diff --git a/app/assets/css/input.css b/app/assets/css/input.css new file mode 100644 index 0000000..9a418db --- /dev/null +++ b/app/assets/css/input.css @@ -0,0 +1,51 @@ +@import "tailwindcss"; + +.table { + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); + display: flex; + flex-direction: column; + width: 40%; + border: 1px solid #e0e0e0; + border-radius: 6px; + margin-top: 30px; + background-color: #fafafa; +} + +.table-header, +.table-row { + display: flex; + padding: 12px; + border-bottom: 1px solid #eaeaea; +} + +.cell { + display: flex; + flex: 1; + padding: 8px 12px; + align-items: center; +} + +.table-header { + background-color: #f5f7fa; + font-weight: 600; + color: #a51010; +} + +.btn { + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); + display: inline-block; + background-color: #b7e1ff; + color: #0f0f0f; + padding: 1px 10px; + margin-right: 8px; + border: none; + border-radius: 6px; + text-decoration: none; + font-size: 14px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.btn:hover { + background-color: #f6fafe; +} \ No newline at end of file diff --git a/app/assets/css/output.css b/app/assets/css/output.css new file mode 100644 index 0000000..18fd34f --- /dev/null +++ b/app/assets/css/output.css @@ -0,0 +1,204 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */ +@layer theme, base, components, utilities; +@layer theme { + :root, :host { + --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; + --default-font-family: var(--font-sans); + --default-mono-font-family: var(--font-mono); + } +} +@layer base { + *, ::after, ::before, ::backdrop, ::file-selector-button { + box-sizing: border-box; + margin: 0; + padding: 0; + border: 0 solid; + } + html, :host { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + tab-size: 4; + font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); + font-feature-settings: var(--default-font-feature-settings, normal); + font-variation-settings: var(--default-font-variation-settings, normal); + -webkit-tap-highlight-color: transparent; + } + hr { + height: 0; + color: inherit; + border-top-width: 1px; + } + abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + h1, h2, h3, h4, h5, h6 { + font-size: inherit; + font-weight: inherit; + } + a { + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + } + b, strong { + font-weight: bolder; + } + code, kbd, samp, pre { + font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); + font-size: 1em; + } + small { + font-size: 80%; + } + sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + sub { + bottom: -0.25em; + } + sup { + top: -0.5em; + } + table { + text-indent: 0; + border-color: inherit; + border-collapse: collapse; + } + :-moz-focusring { + outline: auto; + } + progress { + vertical-align: baseline; + } + summary { + display: list-item; + } + ol, ul, menu { + list-style: none; + } + img, svg, video, canvas, audio, iframe, embed, object { + display: block; + vertical-align: middle; + } + img, video { + max-width: 100%; + height: auto; + } + button, input, select, optgroup, textarea, ::file-selector-button { + font: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + letter-spacing: inherit; + color: inherit; + border-radius: 0; + background-color: transparent; + opacity: 1; + } + :where(select:is([multiple], [size])) optgroup { + font-weight: bolder; + } + :where(select:is([multiple], [size])) optgroup option { + padding-inline-start: 20px; + } + ::file-selector-button { + margin-inline-end: 4px; + } + ::placeholder { + opacity: 1; + } + @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) { + ::placeholder { + color: currentcolor; + @supports (color: color-mix(in lab, red, red)) { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + } + } + textarea { + resize: vertical; + } + ::-webkit-search-decoration { + -webkit-appearance: none; + } + ::-webkit-date-and-time-value { + min-height: 1lh; + text-align: inherit; + } + ::-webkit-datetime-edit { + display: inline-flex; + } + ::-webkit-datetime-edit-fields-wrapper { + padding: 0; + } + ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { + padding-block: 0; + } + ::-webkit-calendar-picker-indicator { + line-height: 1; + } + :-moz-ui-invalid { + box-shadow: none; + } + button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button { + appearance: button; + } + ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { + height: auto; + } + [hidden]:where(:not([hidden="until-found"])) { + display: none !important; + } +} +@layer utilities { + .visible { + visibility: visible; + } + .absolute { + position: absolute; + } + .fixed { + position: fixed; + } + .static { + position: static; + } + .container { + width: 100%; + @media (width >= 40rem) { + max-width: 40rem; + } + @media (width >= 48rem) { + max-width: 48rem; + } + @media (width >= 64rem) { + max-width: 64rem; + } + @media (width >= 80rem) { + max-width: 80rem; + } + @media (width >= 96rem) { + max-width: 96rem; + } + } + .contents { + display: contents; + } + .inline { + display: inline; + } + .table { + display: table; + } + .table-row { + display: table-row; + } +} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 63f340b..e69de29 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,49 +0,0 @@ -.table { - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); - display: flex; - flex-direction: column; - width: 40%; - border: 1px solid #e0e0e0; - border-radius: 6px; - margin-top: 30px; - background-color: #fafafa; -} - -.table-header, -.table-row { - display: flex; - padding: 12px; - border-bottom: 1px solid #eaeaea; -} - -.cell { - display: flex; - flex: 1; - padding: 8px 12px; - align-items: center; -} - -.table-header { - background-color: #f5f7fa; - font-weight: 600; - color: #a51010; -} - -.btn { - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); - display: inline-block; - background-color: #b7e1ff; - color: #0f0f0f; - padding: 1px 10px; - margin-right: 8px; - border: none; - border-radius: 6px; - text-decoration: none; - font-size: 14px; - cursor: pointer; - transition: background-color 0.3s ease; -} - -.btn:hover { - background-color: #f6fafe; -} \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3907795..00a2fb4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,6 +2,7 @@ <%= content_for(:title) || "Bibliotheque" %> + diff --git a/app/views/livres/index.html.erb b/app/views/livres/index.html.erb index 41172e6..f0c1790 100644 --- a/app/views/livres/index.html.erb +++ b/app/views/livres/index.html.erb @@ -7,31 +7,6 @@

<% end %>

Nombre total de livres : <%= @livres.count %>

- - - - - - - - - - - <% @livres.each do |livre| %> - - - - - - - <% end %> - -
TitreAuteurDate de sortieActions
<%= livre.titre %><%= livre.auteur %><%= livre.date_de_sortie %> - <%= button_to "Supprimer", livre_path(livre), method: :delete, data: { confirm: "Supprimer ce livre ?" } %> - <%= link_to "Modifier", edit_livre_path(livre), method: :edit, data: { confirm: "Modifier le livre ?" } %> -
-

<%= link_to "Ajouter un nouveau livre", new_livre_path %>

-
Titre
@@ -51,3 +26,4 @@
<% end %>
+

<%= link_to "Ajouter un nouveau livre", new_livre_path %>

diff --git a/node_modules/.bin/tailwindcss b/node_modules/.bin/tailwindcss new file mode 120000 index 0000000..bad031c --- /dev/null +++ b/node_modules/.bin/tailwindcss @@ -0,0 +1 @@ +../@tailwindcss/cli/dist/index.mjs \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..6b95169 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,391 @@ +{ + "name": "livres", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@parcel/watcher": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", + "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "hasInstallScript": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz", + "integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz", + "integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@parcel/watcher/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@tailwindcss/cli": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.1.18.tgz", + "integrity": "sha512-sMZ+lZbDyxwjD2E0L7oRUjJ01Ffjtme5OtjvvnC+cV4CEDcbqzbp25TCpxHj6kWLU9+DlqJOiNgSOgctC2aZmg==", + "dependencies": { + "@parcel/watcher": "^2.5.1", + "@tailwindcss/node": "4.1.18", + "@tailwindcss/oxide": "4.1.18", + "enhanced-resolve": "^5.18.3", + "mri": "^1.2.0", + "picocolors": "^1.1.1", + "tailwindcss": "4.1.18" + }, + "bin": { + "tailwindcss": "dist/index.mjs" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz", + "integrity": "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.6.1", + "lightningcss": "1.30.2", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.18" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@tailwindcss/node/node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@tailwindcss/node/node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz", + "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.30.2", + "lightningcss-darwin-arm64": "1.30.2", + "lightningcss-darwin-x64": "1.30.2", + "lightningcss-freebsd-x64": "1.30.2", + "lightningcss-linux-arm-gnueabihf": "1.30.2", + "lightningcss-linux-arm64-gnu": "1.30.2", + "lightningcss-linux-arm64-musl": "1.30.2", + "lightningcss-linux-x64-gnu": "1.30.2", + "lightningcss-linux-x64-musl": "1.30.2", + "lightningcss-win32-arm64-msvc": "1.30.2", + "lightningcss-win32-x64-msvc": "1.30.2" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz", + "integrity": "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz", + "integrity": "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@tailwindcss/node/node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.18.tgz", + "integrity": "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-x64": "4.1.18", + "@tailwindcss/oxide-freebsd-x64": "4.1.18", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-x64-musl": "4.1.18", + "@tailwindcss/oxide-wasm32-wasi": "4.1.18", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.18" + } + }, + "node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz", + "integrity": "sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz", + "integrity": "sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.4", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", + "integrity": "sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enhanced-resolve/node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/enhanced-resolve/node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/tailwindcss": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz", + "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==" + } + } +} diff --git a/node_modules/@parcel/watcher-linux-x64-glibc/LICENSE b/node_modules/@parcel/watcher-linux-x64-glibc/LICENSE new file mode 100644 index 0000000..7fb9bc9 --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-glibc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present Devon Govett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@parcel/watcher-linux-x64-glibc/README.md b/node_modules/@parcel/watcher-linux-x64-glibc/README.md new file mode 100644 index 0000000..0214354 --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-glibc/README.md @@ -0,0 +1 @@ +This is the linux-x64-glibc build of @parcel/watcher. See https://github.com/parcel-bundler/watcher for details. \ No newline at end of file diff --git a/node_modules/@parcel/watcher-linux-x64-glibc/package.json b/node_modules/@parcel/watcher-linux-x64-glibc/package.json new file mode 100644 index 0000000..4549903 --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-glibc/package.json @@ -0,0 +1,33 @@ +{ + "name": "@parcel/watcher-linux-x64-glibc", + "version": "2.5.6", + "main": "watcher.node", + "repository": { + "type": "git", + "url": "https://github.com/parcel-bundler/watcher.git" + }, + "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "files": [ + "watcher.node" + ], + "engines": { + "node": ">= 10.0.0" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ] +} diff --git a/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node b/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node new file mode 100644 index 0000000..82fbd00 Binary files /dev/null and b/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node differ diff --git a/node_modules/@parcel/watcher-linux-x64-musl/LICENSE b/node_modules/@parcel/watcher-linux-x64-musl/LICENSE new file mode 100644 index 0000000..7fb9bc9 --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-musl/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present Devon Govett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@parcel/watcher-linux-x64-musl/README.md b/node_modules/@parcel/watcher-linux-x64-musl/README.md new file mode 100644 index 0000000..6c3b0df --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-musl/README.md @@ -0,0 +1 @@ +This is the linux-x64-musl build of @parcel/watcher. See https://github.com/parcel-bundler/watcher for details. \ No newline at end of file diff --git a/node_modules/@parcel/watcher-linux-x64-musl/package.json b/node_modules/@parcel/watcher-linux-x64-musl/package.json new file mode 100644 index 0000000..b707881 --- /dev/null +++ b/node_modules/@parcel/watcher-linux-x64-musl/package.json @@ -0,0 +1,33 @@ +{ + "name": "@parcel/watcher-linux-x64-musl", + "version": "2.5.6", + "main": "watcher.node", + "repository": { + "type": "git", + "url": "https://github.com/parcel-bundler/watcher.git" + }, + "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "files": [ + "watcher.node" + ], + "engines": { + "node": ">= 10.0.0" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ] +} diff --git a/node_modules/@parcel/watcher-linux-x64-musl/watcher.node b/node_modules/@parcel/watcher-linux-x64-musl/watcher.node new file mode 100644 index 0000000..657c28d Binary files /dev/null and b/node_modules/@parcel/watcher-linux-x64-musl/watcher.node differ diff --git a/node_modules/@parcel/watcher/LICENSE b/node_modules/@parcel/watcher/LICENSE new file mode 100644 index 0000000..7fb9bc9 --- /dev/null +++ b/node_modules/@parcel/watcher/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present Devon Govett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@parcel/watcher/README.md b/node_modules/@parcel/watcher/README.md new file mode 100644 index 0000000..28e74f0 --- /dev/null +++ b/node_modules/@parcel/watcher/README.md @@ -0,0 +1,136 @@ +# @parcel/watcher + +A native C++ Node module for querying and subscribing to filesystem events. Used by [Parcel 2](https://github.com/parcel-bundler/parcel). + +## Features + +- **Watch** - subscribe to realtime recursive directory change notifications when files or directories are created, updated, or deleted. +- **Query** - performantly query for historical change events in a directory, even when your program is not running. +- **Native** - implemented in C++ for performance and low-level integration with the operating system. +- **Cross platform** - includes backends for macOS, Linux, Windows, FreeBSD, and Watchman. +- **Performant** - events are throttled in C++ so the JavaScript thread is not overwhelmed during large filesystem changes (e.g. `git checkout` or `npm install`). +- **Scalable** - tens of thousands of files can be watched or queried at once with good performance. + +## Example + +```javascript +const watcher = require('@parcel/watcher'); +const path = require('path'); + +// Subscribe to events +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); + +// later on... +await subscription.unsubscribe(); + +// Get events since some saved snapshot in the past +let snapshotPath = path.join(process.cwd(), 'snapshot.txt'); +let events = await watcher.getEventsSince(process.cwd(), snapshotPath); + +// Save a snapshot for later +await watcher.writeSnapshot(process.cwd(), snapshotPath); +``` + +## Watching + +`@parcel/watcher` supports subscribing to realtime notifications of changes in a directory. It works recursively, so changes in sub-directories will also be emitted. + +Events are throttled and coalesced for performance during large changes like `git checkout` or `npm install`, and a single notification will be emitted with all of the events at the end. + +Only one notification will be emitted per file. For example, if a file was both created and updated since the last event, you'll get only a `create` event. If a file is both created and deleted, you will not be notifed of that file. Renames cause two events: a `delete` for the old name, and a `create` for the new name. + +```javascript +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); +``` + +Events have two properties: + +- `type` - the event type: `create`, `update`, or `delete`. +- `path` - the absolute path to the file or directory. + +To unsubscribe from change notifications, call the `unsubscribe` method on the returned subscription object. + +```javascript +await subscription.unsubscribe(); +``` + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) on Linux +- [ReadDirectoryChangesW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465%28v%3Dvs.85%29.aspx) on Windows +- [kqueue](https://man.freebsd.org/cgi/man.cgi?kqueue) on FreeBSD, or as an alternative to FSEvents on macOS + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Querying + +`@parcel/watcher` also supports querying for historical changes made in a directory, even when your program is not running. This makes it easy to invalidate a cache and re-build only the files that have changed, for example. It can be **significantly** faster than traversing the entire filesystem to determine what files changed, depending on the platform. + +In order to query for historical changes, you first need a previous snapshot to compare to. This can be saved to a file with the `writeSnapshot` function, e.g. just before your program exits. + +```javascript +await watcher.writeSnapshot(dirPath, snapshotPath); +``` + +When your program starts up, you can query for changes that have occurred since that snapshot using the `getEventsSince` function. + +```javascript +let events = await watcher.getEventsSince(dirPath, snapshotPath); +``` + +The events returned are exactly the same as the events that would be passed to the `subscribe` callback (see above). + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [fts](http://man7.org/linux/man-pages/man3/fts.3.html) (brute force) on Linux and FreeBSD +- [FindFirstFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea) (brute force) on Windows + +The FSEvents (macOS) and Watchman backends are significantly more performant than the brute force backends used by default on Linux and Windows, for example returning results in miliseconds instead of seconds for large directory trees. This is because a background daemon monitoring filesystem changes on those platforms allows us to query cached data rather than traversing the filesystem manually (brute force). + +macOS has good performance with FSEvents by default. For the best performance on other platforms, install [Watchman](https://facebook.github.io/watchman/) and it will be used by `@parcel/watcher` automatically. + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Options + +All of the APIs in `@parcel/watcher` support the following options, which are passed as an object as the last function argument. + +- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`picomatch`](https://github.com/micromatch/picomatch) (see [features](https://github.com/micromatch/picomatch#globbing-features)). + - paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children. + - glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths. +- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"kqueue"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead. + +## WASM + +The `@parcel/watcher-wasm` package can be used in place of `@parcel/watcher` on unsupported platforms. It relies on the Node `fs` module, so in non-Node environments such as browsers, an `fs` polyfill will be needed. + +**Note**: the WASM implementation is significantly less efficient than the native implementations because it must crawl the file system to watch each directory individually. Use the native `@parcel/watcher` package wherever possible. + +```js +import {subscribe} from '@parcel/watcher-wasm'; + +// Use the module as documented above. +subscribe(/* ... */); +``` + +## Who is using this? + +- [Parcel 2](https://parceljs.org/) +- [VSCode](https://code.visualstudio.com/updates/v1_62#_file-watching-changes) +- [Tailwind CSS Intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense) +- [Gatsby Cloud](https://twitter.com/chatsidhartha/status/1435647412828196867) +- [Nx](https://nx.dev) +- [Nuxt](https://nuxt.com) +- [Meteor](https://github.com/meteor/meteor) + +## License + +MIT diff --git a/node_modules/@parcel/watcher/binding.gyp b/node_modules/@parcel/watcher/binding.gyp new file mode 100644 index 0000000..3c12d52 --- /dev/null +++ b/node_modules/@parcel/watcher/binding.gyp @@ -0,0 +1,109 @@ +{ + "targets": [ + { + "target_name": "watcher", + "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ], + "sources": [ "src/binding.cc", "src/Watcher.cc", "src/Backend.cc", "src/DirTree.cc", "src/Glob.cc", "src/Debounce.cc" ], + "include_dirs" : [" unknown; + export interface AsyncSubscription { + unsubscribe(): Promise; + } + export interface Event { + path: FilePath; + type: EventType; + } + export function getEventsSince( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise; + export function subscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise; + export function unsubscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise; + export function writeSnapshot( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise; +} + +export = ParcelWatcher; \ No newline at end of file diff --git a/node_modules/@parcel/watcher/index.js b/node_modules/@parcel/watcher/index.js new file mode 100644 index 0000000..31aba4f --- /dev/null +++ b/node_modules/@parcel/watcher/index.js @@ -0,0 +1,42 @@ +const {createWrapper} = require('./wrapper'); + +let name = `@parcel/watcher-${process.platform}-${process.arch}`; +if (process.platform === 'linux') { + const { MUSL, familySync } = require('detect-libc'); + const family = familySync(); + if (family === MUSL) { + name += '-musl'; + } else { + name += '-glibc'; + } +} + +let binding; +try { + binding = require(name); +} catch (err) { + handleError(err); + try { + binding = require('./build/Release/watcher.node'); + } catch (err) { + handleError(err); + try { + binding = require('./build/Debug/watcher.node'); + } catch (err) { + handleError(err); + throw new Error(`No prebuild or local build of @parcel/watcher found. Tried ${name}. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.`); + } + } +} + +function handleError(err) { + if (err?.code !== 'MODULE_NOT_FOUND') { + throw err; + } +} + +const wrapper = createWrapper(binding); +exports.writeSnapshot = wrapper.writeSnapshot; +exports.getEventsSince = wrapper.getEventsSince; +exports.subscribe = wrapper.subscribe; +exports.unsubscribe = wrapper.unsubscribe; diff --git a/node_modules/@parcel/watcher/index.js.flow b/node_modules/@parcel/watcher/index.js.flow new file mode 100644 index 0000000..d75da93 --- /dev/null +++ b/node_modules/@parcel/watcher/index.js.flow @@ -0,0 +1,48 @@ +// @flow +declare type FilePath = string; +declare type GlobPattern = string; + +export type BackendType = + | 'fs-events' + | 'watchman' + | 'inotify' + | 'windows' + | 'brute-force'; +export type EventType = 'create' | 'update' | 'delete'; +export interface Options { + ignore?: Array, + backend?: BackendType +} +export type SubscribeCallback = ( + err: ?Error, + events: Array +) => mixed; +export interface AsyncSubscription { + unsubscribe(): Promise +} +export interface Event { + path: FilePath, + type: EventType +} +declare module.exports: { + getEventsSince( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise>, + subscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise, + unsubscribe( + dir: FilePath, + fn: SubscribeCallback, + opts?: Options + ): Promise, + writeSnapshot( + dir: FilePath, + snapshot: FilePath, + opts?: Options + ): Promise +} \ No newline at end of file diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/LICENSE b/node_modules/@parcel/watcher/node_modules/detect-libc/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/README.md b/node_modules/@parcel/watcher/node_modules/detect-libc/README.md new file mode 100644 index 0000000..23212fd --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/README.md @@ -0,0 +1,163 @@ +# detect-libc + +Node.js module to detect details of the C standard library (libc) +implementation provided by a given Linux system. + +Currently supports detection of GNU glibc and MUSL libc. + +Provides asychronous and synchronous functions for the +family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`). + +The version numbers of libc implementations +are not guaranteed to be semver-compliant. + +For previous v1.x releases, please see the +[v1](https://github.com/lovell/detect-libc/tree/v1) branch. + +## Install + +```sh +npm install detect-libc +``` + +## API + +### GLIBC + +```ts +const GLIBC: string = 'glibc'; +``` + +A String constant containing the value `glibc`. + +### MUSL + +```ts +const MUSL: string = 'musl'; +``` + +A String constant containing the value `musl`. + +### family + +```ts +function family(): Promise; +``` + +Resolves asychronously with: + +* `glibc` or `musl` when the libc family can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { family, GLIBC, MUSL } = require('detect-libc'); + +switch (await family()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### familySync + +```ts +function familySync(): string | null; +``` + +Synchronous version of `family()`. + +```js +const { familySync, GLIBC, MUSL } = require('detect-libc'); + +switch (familySync()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### version + +```ts +function version(): Promise; +``` + +Resolves asychronously with: + +* The version when it can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { version } = require('detect-libc'); + +const v = await version(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### versionSync + +```ts +function versionSync(): string | null; +``` + +Synchronous version of `version()`. + +```js +const { versionSync } = require('detect-libc'); + +const v = versionSync(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### isNonGlibcLinux + +```ts +function isNonGlibcLinux(): Promise; +``` + +Resolves asychronously with: + +* `false` when the libc family is `glibc` +* `true` when the libc family is not `glibc` +* `false` when run on a non-Linux platform + +```js +const { isNonGlibcLinux } = require('detect-libc'); + +if (await isNonGlibcLinux()) { ... } +``` + +### isNonGlibcLinuxSync + +```ts +function isNonGlibcLinuxSync(): boolean; +``` + +Synchronous version of `isNonGlibcLinux()`. + +```js +const { isNonGlibcLinuxSync } = require('detect-libc'); + +if (isNonGlibcLinuxSync()) { ... } +``` + +## Licensing + +Copyright 2017 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/index.d.ts b/node_modules/@parcel/watcher/node_modules/detect-libc/index.d.ts new file mode 100644 index 0000000..4c0fb2b --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/index.d.ts @@ -0,0 +1,14 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +export const GLIBC: 'glibc'; +export const MUSL: 'musl'; + +export function family(): Promise; +export function familySync(): string | null; + +export function isNonGlibcLinux(): Promise; +export function isNonGlibcLinuxSync(): boolean; + +export function version(): Promise; +export function versionSync(): string | null; diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/lib/detect-libc.js b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/detect-libc.js new file mode 100644 index 0000000..01299b4 --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/detect-libc.js @@ -0,0 +1,313 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const childProcess = require('child_process'); +const { isLinux, getReport } = require('./process'); +const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem'); +const { interpreterPath } = require('./elf'); + +let cachedFamilyInterpreter; +let cachedFamilyFilesystem; +let cachedVersionFilesystem; + +const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; +let commandOut = ''; + +const safeCommand = () => { + if (!commandOut) { + return new Promise((resolve) => { + childProcess.exec(command, (err, out) => { + commandOut = err ? ' ' : out; + resolve(commandOut); + }); + }); + } + return commandOut; +}; + +const safeCommandSync = () => { + if (!commandOut) { + try { + commandOut = childProcess.execSync(command, { encoding: 'utf8' }); + } catch (_err) { + commandOut = ' '; + } + } + return commandOut; +}; + +/** + * A String constant containing the value `glibc`. + * @type {string} + * @public + */ +const GLIBC = 'glibc'; + +/** + * A Regexp constant to get the GLIBC Version. + * @type {string} + */ +const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i; + +/** + * A String constant containing the value `musl`. + * @type {string} + * @public + */ +const MUSL = 'musl'; + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); + +const familyFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return GLIBC; + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return MUSL; + } + } + return null; +}; + +const familyFromCommand = (out) => { + const [getconf, ldd1] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return GLIBC; + } + if (ldd1 && ldd1.includes(MUSL)) { + return MUSL; + } + return null; +}; + +const familyFromInterpreterPath = (path) => { + if (path) { + if (path.includes('/ld-musl-')) { + return MUSL; + } else if (path.includes('/ld-linux-')) { + return GLIBC; + } + } + return null; +}; + +const getFamilyFromLddContent = (content) => { + content = content.toString(); + if (content.includes('musl')) { + return MUSL; + } + if (content.includes('GNU C Library')) { + return GLIBC; + } + return null; +}; + +const familyFromFilesystem = async () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromFilesystemSync = () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromInterpreter = async () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = await readFile(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +const familyFromInterpreterSync = () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = readFileSync(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +/** + * Resolves with the libc family when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const family = async () => { + let family = null; + if (isLinux()) { + family = await familyFromInterpreter(); + if (!family) { + family = await familyFromFilesystem(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = await safeCommand(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Returns the libc family when it can be determined, `null` otherwise. + * @returns {?string} + */ +const familySync = () => { + let family = null; + if (isLinux()) { + family = familyFromInterpreterSync(); + if (!family) { + family = familyFromFilesystemSync(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = safeCommandSync(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {Promise} + */ +const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; + +/** + * Returns `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {boolean} + */ +const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; + +const versionFromFilesystem = async () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromFilesystemSync = () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return report.header.glibcVersionRuntime; + } + return null; +}; + +const versionSuffix = (s) => s.trim().split(/\s+/)[1]; + +const versionFromCommand = (out) => { + const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return versionSuffix(getconf); + } + if (ldd1 && ldd2 && ldd1.includes(MUSL)) { + return versionSuffix(ldd2); + } + return null; +}; + +/** + * Resolves with the libc version when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const version = async () => { + let version = null; + if (isLinux()) { + version = await versionFromFilesystem(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = await safeCommand(); + version = versionFromCommand(out); + } + } + return version; +}; + +/** + * Returns the libc version when it can be determined, `null` otherwise. + * @returns {?string} + */ +const versionSync = () => { + let version = null; + if (isLinux()) { + version = versionFromFilesystemSync(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = safeCommandSync(); + version = versionFromCommand(out); + } + } + return version; +}; + +module.exports = { + GLIBC, + MUSL, + family, + familySync, + isNonGlibcLinux, + isNonGlibcLinuxSync, + version, + versionSync +}; diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/lib/elf.js b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/elf.js new file mode 100644 index 0000000..aa166aa --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/elf.js @@ -0,0 +1,39 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const interpreterPath = (elf) => { + if (elf.length < 64) { + return null; + } + if (elf.readUInt32BE(0) !== 0x7F454C46) { + // Unexpected magic bytes + return null; + } + if (elf.readUInt8(4) !== 2) { + // Not a 64-bit ELF + return null; + } + if (elf.readUInt8(5) !== 1) { + // Not little-endian + return null; + } + const offset = elf.readUInt32LE(32); + const size = elf.readUInt16LE(54); + const count = elf.readUInt16LE(56); + for (let i = 0; i < count; i++) { + const headerOffset = offset + (i * size); + const type = elf.readUInt32LE(headerOffset); + if (type === 3) { + const fileOffset = elf.readUInt32LE(headerOffset + 8); + const fileSize = elf.readUInt32LE(headerOffset + 32); + return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, ''); + } + } + return null; +}; + +module.exports = { + interpreterPath +}; diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/lib/filesystem.js b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/filesystem.js new file mode 100644 index 0000000..4c2443c --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/filesystem.js @@ -0,0 +1,51 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const fs = require('fs'); + +const LDD_PATH = '/usr/bin/ldd'; +const SELF_PATH = '/proc/self/exe'; +const MAX_LENGTH = 2048; + +/** + * Read the content of a file synchronous + * + * @param {string} path + * @returns {Buffer} + */ +const readFileSync = (path) => { + const fd = fs.openSync(path, 'r'); + const buffer = Buffer.alloc(MAX_LENGTH); + const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0); + fs.close(fd, () => {}); + return buffer.subarray(0, bytesRead); +}; + +/** + * Read the content of a file + * + * @param {string} path + * @returns {Promise} + */ +const readFile = (path) => new Promise((resolve, reject) => { + fs.open(path, 'r', (err, fd) => { + if (err) { + reject(err); + } else { + const buffer = Buffer.alloc(MAX_LENGTH); + fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => { + resolve(buffer.subarray(0, bytesRead)); + fs.close(fd, () => {}); + }); + } + }); +}); + +module.exports = { + LDD_PATH, + SELF_PATH, + readFileSync, + readFile +}; diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/lib/process.js b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/process.js new file mode 100644 index 0000000..ee78ad2 --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/lib/process.js @@ -0,0 +1,24 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const isLinux = () => process.platform === 'linux'; + +let report = null; +const getReport = () => { + if (!report) { + /* istanbul ignore next */ + if (isLinux() && process.report) { + const orig = process.report.excludeNetwork; + process.report.excludeNetwork = true; + report = process.report.getReport(); + process.report.excludeNetwork = orig; + } else { + report = {}; + } + } + return report; +}; + +module.exports = { isLinux, getReport }; diff --git a/node_modules/@parcel/watcher/node_modules/detect-libc/package.json b/node_modules/@parcel/watcher/node_modules/detect-libc/package.json new file mode 100644 index 0000000..36d0f2b --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/detect-libc/package.json @@ -0,0 +1,44 @@ +{ + "name": "detect-libc", + "version": "2.1.2", + "description": "Node.js module to detect the C standard library (libc) implementation family and version", + "main": "lib/detect-libc.js", + "files": [ + "lib/", + "index.d.ts" + ], + "scripts": { + "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js", + "changelog": "conventional-changelog -i CHANGELOG.md -s", + "bench": "node benchmark/detect-libc", + "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/lovell/detect-libc.git" + }, + "keywords": [ + "libc", + "glibc", + "musl" + ], + "author": "Lovell Fuller ", + "contributors": [ + "Niklas Salmoukas ", + "Vinícius Lourenço " + ], + "license": "Apache-2.0", + "devDependencies": { + "ava": "^2.4.0", + "benchmark": "^2.1.4", + "conventional-changelog-cli": "^5.0.0", + "eslint-config-standard": "^13.0.1", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "semistandard": "^14.2.3" + }, + "engines": { + "node": ">=8" + }, + "types": "index.d.ts" +} diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/LICENSE b/node_modules/@parcel/watcher/node_modules/picomatch/LICENSE new file mode 100644 index 0000000..3608dca --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/README.md b/node_modules/@parcel/watcher/node_modules/picomatch/README.md new file mode 100644 index 0000000..0764496 --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/README.md @@ -0,0 +1,738 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L31) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +**Example without node.js** + +For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection. + +```js +const picomatch = require('picomatch/posix'); +// the same API, defaulting to posix paths +const isMatch = picomatch('a/*'); +console.log(isMatch('a\\b')); //=> false +console.log(isMatch('a/b')); //=> true + +// you can still configure the matcher function to accept windows paths +const isMatch = picomatch('a/*', { options: windows }); +console.log(isMatch('a\\b')); //=> true +console.log(isMatch('a/b')); //=> true +``` + +### [.test](lib/picomatch.js#L116) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L160) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L182) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L198) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L230) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L244) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L285) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L320) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `number` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | +| `windows` | `boolean` | `false` | Also accept backslashes as the path separator. | + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` with the `windows` option) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a+(z)')); // false +console.log(pm.isMatch('az', 'a+(z)')); // true +console.log(pm.isMatch('azzz', 'a+(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +_(Pay special attention to the last three benchmarks. Minimatch freezes on long ranges.)_ + +``` +# .makeRe star (*) + picomatch x 4,449,159 ops/sec ±0.24% (97 runs sampled) + minimatch x 632,772 ops/sec ±0.14% (98 runs sampled) + +# .makeRe star; dot=true (*) + picomatch x 3,500,079 ops/sec ±0.26% (99 runs sampled) + minimatch x 564,916 ops/sec ±0.23% (96 runs sampled) + +# .makeRe globstar (**) + picomatch x 3,261,000 ops/sec ±0.27% (98 runs sampled) + minimatch x 1,664,766 ops/sec ±0.20% (100 runs sampled) + +# .makeRe globstars (**/**/**) + picomatch x 3,284,469 ops/sec ±0.18% (97 runs sampled) + minimatch x 1,435,880 ops/sec ±0.34% (95 runs sampled) + +# .makeRe with leading star (*.txt) + picomatch x 3,100,197 ops/sec ±0.35% (99 runs sampled) + minimatch x 428,347 ops/sec ±0.42% (94 runs sampled) + +# .makeRe - basic braces ({a,b,c}*.txt) + picomatch x 443,578 ops/sec ±1.33% (89 runs sampled) + minimatch x 107,143 ops/sec ±0.35% (94 runs sampled) + +# .makeRe - short ranges ({a..z}*.txt) + picomatch x 415,484 ops/sec ±0.76% (96 runs sampled) + minimatch x 14,299 ops/sec ±0.26% (96 runs sampled) + +# .makeRe - medium ranges ({1..100000}*.txt) + picomatch x 395,020 ops/sec ±0.87% (89 runs sampled) + minimatch x 2 ops/sec ±4.59% (10 runs sampled) + +# .makeRe - long ranges ({1..10000000}*.txt) + picomatch x 400,036 ops/sec ±0.83% (90 runs sampled) + minimatch (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/index.js b/node_modules/@parcel/watcher/node_modules/picomatch/index.js new file mode 100644 index 0000000..a753b1d --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/index.js @@ -0,0 +1,17 @@ +'use strict'; + +const pico = require('./lib/picomatch'); +const utils = require('./lib/utils'); + +function picomatch(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils.isWindows() }; + } + + return pico(glob, options, returnState); +} + +Object.assign(picomatch, pico); +module.exports = picomatch; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/lib/constants.js b/node_modules/@parcel/watcher/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000..3f7ef7e --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/lib/constants.js @@ -0,0 +1,180 @@ +'use strict'; + +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; +const SEP = '/'; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + 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' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + 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, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + __proto__: null, + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + 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, /* \f */ + 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, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + 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, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/lib/parse.js b/node_modules/@parcel/watcher/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000..8fd8ff4 --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1085 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(opts.windows); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/lib/picomatch.js b/node_modules/@parcel/watcher/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000..d0ebd9f --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,341 @@ +'use strict'; + +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(utils.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/lib/scan.js b/node_modules/@parcel/watcher/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000..e59cd7a --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = require('./constants'); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/lib/utils.js b/node_modules/@parcel/watcher/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000..9c97cae --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/lib/utils.js @@ -0,0 +1,72 @@ +/*global navigator*/ +'use strict'; + +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; +}; + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; + +exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; +}; diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/package.json b/node_modules/@parcel/watcher/node_modules/picomatch/package.json new file mode 100644 index 0000000..372e27e --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/package.json @@ -0,0 +1,83 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "posix.js", + "lib" + ], + "sideEffects": false, + "main": "index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^8.57.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^10.4.0", + "nyc": "^15.1.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/node_modules/@parcel/watcher/node_modules/picomatch/posix.js b/node_modules/@parcel/watcher/node_modules/picomatch/posix.js new file mode 100644 index 0000000..d2f2bc5 --- /dev/null +++ b/node_modules/@parcel/watcher/node_modules/picomatch/posix.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/node_modules/@parcel/watcher/package.json b/node_modules/@parcel/watcher/package.json new file mode 100644 index 0000000..995149d --- /dev/null +++ b/node_modules/@parcel/watcher/package.json @@ -0,0 +1,88 @@ +{ + "name": "@parcel/watcher", + "version": "2.5.6", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/parcel-bundler/watcher.git" + }, + "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "files": [ + "index.js", + "index.js.flow", + "index.d.ts", + "wrapper.js", + "package.json", + "README.md", + "LICENSE", + "src", + "scripts/build-from-source.js", + "binding.gyp" + ], + "scripts": { + "prebuild": "prebuildify --napi --strip --tag-libc", + "format": "prettier --write \"./**/*.{js,json,md}\"", + "build": "node-gyp rebuild", + "install": "node scripts/build-from-source.js", + "test": "mocha" + }, + "engines": { + "node": ">= 10.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,json,md}": [ + "prettier --write", + "git add" + ] + }, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "devDependencies": { + "esbuild": "^0.19.8", + "fs-extra": "^10.0.0", + "husky": "^7.0.2", + "lint-staged": "^11.1.2", + "mocha": "^9.1.1", + "napi-wasm": "^1.1.0", + "prebuildify": "^6.0.1", + "prettier": "^2.3.2" + }, + "binary": { + "napi_versions": [ + 3 + ] + }, + "optionalDependencies": { + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6" + } +} diff --git a/node_modules/@parcel/watcher/scripts/build-from-source.js b/node_modules/@parcel/watcher/scripts/build-from-source.js new file mode 100644 index 0000000..4602008 --- /dev/null +++ b/node_modules/@parcel/watcher/scripts/build-from-source.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node + +const {spawn} = require('child_process'); + +if (process.env.npm_config_build_from_source === 'true') { + build(); +} + +function build() { + spawn('node-gyp', ['rebuild'], { stdio: 'inherit', shell: true }).on('exit', function (code) { + process.exit(code); + }); +} diff --git a/node_modules/@parcel/watcher/src/Backend.cc b/node_modules/@parcel/watcher/src/Backend.cc new file mode 100644 index 0000000..09a53d5 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Backend.cc @@ -0,0 +1,186 @@ +#ifdef FS_EVENTS +#include "macos/FSEventsBackend.hh" +#endif +#ifdef WATCHMAN +#include "watchman/WatchmanBackend.hh" +#endif +#ifdef WINDOWS +#include "windows/WindowsBackend.hh" +#endif +#ifdef INOTIFY +#include "linux/InotifyBackend.hh" +#endif +#ifdef KQUEUE +#include "kqueue/KqueueBackend.hh" +#endif +#ifdef __wasm32__ +#include "wasm/WasmBackend.hh" +#endif +#include "shared/BruteForceBackend.hh" + +#include "Backend.hh" +#include + +static std::unordered_map>& getSharedBackends() { + static std::unordered_map>* sharedBackends = + new std::unordered_map>(); + return *sharedBackends; +} + +std::shared_ptr getBackend(std::string backend) { + // Use FSEvents on macOS by default. + // Use watchman by default if available on other platforms. + // Fall back to brute force. + #ifdef FS_EVENTS + if (backend == "fs-events" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef WATCHMAN + if ((backend == "watchman" || backend == "default") && WatchmanBackend::checkAvailable()) { + return std::make_shared(); + } + #endif + #ifdef WINDOWS + if (backend == "windows" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef INOTIFY + if (backend == "inotify" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef KQUEUE + if (backend == "kqueue" || backend == "default") { + return std::make_shared(); + } + #endif + #ifdef __wasm32__ + if (backend == "wasm" || backend == "default") { + return std::make_shared(); + } + #endif + if (backend == "brute-force" || backend == "default") { + return std::make_shared(); + } + + return nullptr; +} + +std::shared_ptr Backend::getShared(std::string backend) { + auto found = getSharedBackends().find(backend); + if (found != getSharedBackends().end()) { + return found->second; + } + + auto result = getBackend(backend); + if (!result) { + return getShared("default"); + } + + result->run(); + getSharedBackends().emplace(backend, result); + return result; +} + +void removeShared(Backend *backend) { + for (auto it = getSharedBackends().begin(); it != getSharedBackends().end(); it++) { + if (it->second.get() == backend) { + getSharedBackends().erase(it); + break; + } + } + + // Free up memory. + if (getSharedBackends().size() == 0) { + getSharedBackends().rehash(0); + } +} + +void Backend::run() { + #ifndef __wasm32__ + mThread = std::thread([this] () { + try { + start(); + } catch (std::exception &err) { + handleError(err); + } + }); + + if (mThread.joinable()) { + mStartedSignal.wait(); + } + #else + try { + start(); + } catch (std::exception &err) { + handleError(err); + } + #endif +} + +void Backend::notifyStarted() { + mStartedSignal.notify(); +} + +void Backend::start() { + notifyStarted(); +} + +Backend::~Backend() { + #ifndef __wasm32__ + // Wait for thread to stop + if (mThread.joinable()) { + // If the backend is being destroyed from the thread itself, detach, otherwise join. + if (mThread.get_id() == std::this_thread::get_id()) { + mThread.detach(); + } else { + mThread.join(); + } + } + #endif +} + +void Backend::watch(WatcherRef watcher) { + std::unique_lock lock(mMutex); + auto res = mSubscriptions.find(watcher); + if (res == mSubscriptions.end()) { + try { + this->subscribe(watcher); + mSubscriptions.insert(watcher); + } catch (std::exception&) { + unref(); + throw; + } + } +} + +void Backend::unwatch(WatcherRef watcher) { + std::unique_lock lock(mMutex); + size_t deleted = mSubscriptions.erase(watcher); + if (deleted > 0) { + this->unsubscribe(watcher); + unref(); + } +} + +void Backend::unref() { + if (mSubscriptions.size() == 0) { + removeShared(this); + } +} + +void Backend::handleWatcherError(WatcherError &err) { + unwatch(err.mWatcher); + err.mWatcher->notifyError(err); +} + +void Backend::handleError(std::exception &err) { + std::unique_lock lock(mMutex); + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end(); it++) { + (*it)->notifyError(err); + } + + removeShared(this); +} diff --git a/node_modules/@parcel/watcher/src/Backend.hh b/node_modules/@parcel/watcher/src/Backend.hh new file mode 100644 index 0000000..d673bd1 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Backend.hh @@ -0,0 +1,37 @@ +#ifndef BACKEND_H +#define BACKEND_H + +#include "Event.hh" +#include "Watcher.hh" +#include "Signal.hh" +#include + +class Backend { +public: + virtual ~Backend(); + void run(); + void notifyStarted(); + + virtual void start(); + virtual void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) = 0; + virtual void getEventsSince(WatcherRef watcher, std::string *snapshotPath) = 0; + virtual void subscribe(WatcherRef watcher) = 0; + virtual void unsubscribe(WatcherRef watcher) = 0; + + static std::shared_ptr getShared(std::string backend); + + void watch(WatcherRef watcher); + void unwatch(WatcherRef watcher); + void unref(); + void handleWatcherError(WatcherError &err); + + std::mutex mMutex; + std::thread mThread; +private: + std::unordered_set mSubscriptions; + Signal mStartedSignal; + + void handleError(std::exception &err); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/Debounce.cc b/node_modules/@parcel/watcher/src/Debounce.cc new file mode 100644 index 0000000..be07e78 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Debounce.cc @@ -0,0 +1,113 @@ +#include "Debounce.hh" + +#ifdef __wasm32__ +extern "C" void on_timeout(void *ctx) { + Debounce *debounce = (Debounce *)ctx; + debounce->notify(); +} +#endif + +std::shared_ptr Debounce::getShared() { + static std::weak_ptr sharedInstance; + std::shared_ptr shared = sharedInstance.lock(); + if (!shared) { + shared = std::make_shared(); + sharedInstance = shared; + } + + return shared; +} + +Debounce::Debounce() { + mRunning = true; + #ifndef __wasm32__ + mThread = std::thread([this] () { + loop(); + }); + #endif +} + +Debounce::~Debounce() { + mRunning = false; + #ifndef __wasm32__ + mWaitSignal.notify(); + mThread.join(); + #endif +} + +void Debounce::add(void *key, std::function cb) { + std::unique_lock lock(mMutex); + mCallbacks.emplace(key, cb); +} + +void Debounce::remove(void *key) { + std::unique_lock lock(mMutex); + mCallbacks.erase(key); +} + +void Debounce::trigger() { + std::unique_lock lock(mMutex); + #ifdef __wasm32__ + notifyIfReady(); + #else + mWaitSignal.notify(); + #endif +} + +#ifndef __wasm32__ +void Debounce::loop() { + while (mRunning) { + mWaitSignal.wait(); + if (!mRunning) { + break; + } + + notifyIfReady(); + } +} +#endif + +void Debounce::notifyIfReady() { + if (!mRunning) { + return; + } + + // If we haven't seen an event in more than the maximum wait time, notify callbacks immediately + // to ensure that we don't wait forever. Otherwise, wait for the minimum wait time and batch + // subsequent fast changes. This also means the first file change in a batch is notified immediately, + // separately from the rest of the batch. This seems like an acceptable tradeoff if the common case + // is that only a single file was updated at a time. + auto time = std::chrono::steady_clock::now(); + if ((time - mLastTime) > std::chrono::milliseconds(MAX_WAIT_TIME)) { + mLastTime = time; + notify(); + } else { + wait(); + } +} + +void Debounce::wait() { + #ifdef __wasm32__ + clear_timeout(mTimeout); + mTimeout = set_timeout(MIN_WAIT_TIME, this); + #else + auto status = mWaitSignal.waitFor(std::chrono::milliseconds(MIN_WAIT_TIME)); + if (mRunning && (status == std::cv_status::timeout)) { + notify(); + } + #endif +} + +void Debounce::notify() { + std::unique_lock lock(mMutex); + + mLastTime = std::chrono::steady_clock::now(); + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + auto cb = it->second; + cb(); + } + + #ifndef __wasm32__ + mWaitSignal.reset(); + #endif +} diff --git a/node_modules/@parcel/watcher/src/Debounce.hh b/node_modules/@parcel/watcher/src/Debounce.hh new file mode 100644 index 0000000..a17fdef --- /dev/null +++ b/node_modules/@parcel/watcher/src/Debounce.hh @@ -0,0 +1,49 @@ +#ifndef DEBOUNCE_H +#define DEBOUNCE_H + +#include +#include +#include +#include "Signal.hh" + +#define MIN_WAIT_TIME 50 +#define MAX_WAIT_TIME 500 + +#ifdef __wasm32__ +extern "C" { + int set_timeout(int ms, void *ctx); + void clear_timeout(int timeout); + void on_timeout(void *ctx); +}; +#endif + +class Debounce { +public: + static std::shared_ptr getShared(); + + Debounce(); + ~Debounce(); + + void add(void *key, std::function cb); + void remove(void *key); + void trigger(); + void notify(); + +private: + bool mRunning; + std::mutex mMutex; + #ifdef __wasm32__ + int mTimeout; + #else + Signal mWaitSignal; + std::thread mThread; + #endif + std::unordered_map> mCallbacks; + std::chrono::time_point mLastTime; + + void loop(); + void notifyIfReady(); + void wait(); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/DirTree.cc b/node_modules/@parcel/watcher/src/DirTree.cc new file mode 100644 index 0000000..b7eddd8 --- /dev/null +++ b/node_modules/@parcel/watcher/src/DirTree.cc @@ -0,0 +1,164 @@ +#include "DirTree.hh" +#include + +// "Meyer's singleton", construction is ordered by use, likewise (reverse) for destruction. +// https://stackoverflow.com/a/17713799 +// https://laristra.github.io/flecsi/src/developer-guide/patterns/meyers_singleton.html +static std::mutex& mDirCacheMutex() { + static std::mutex mutex; + return mutex; +} + +static std::unordered_map>& dirTreeCache() { + static std::unordered_map> cache; + return cache; +} + +struct DirTreeDeleter { + void operator()(DirTree *tree) { + std::lock_guard lock(mDirCacheMutex()); + std::unordered_map> &cache = dirTreeCache(); + cache.erase(tree->root); + delete tree; + + // Free up memory. + if (cache.size() == 0) { + cache.rehash(0); + } + } +}; + +std::shared_ptr DirTree::getCached(std::string root) { + std::lock_guard lock(mDirCacheMutex()); + std::unordered_map> &cache = dirTreeCache(); + + auto found = cache.find(root); + std::shared_ptr tree; + + // Use cached tree, or create an empty one. + if (found != cache.end()) { + tree = found->second.lock(); + } else { + tree = std::shared_ptr(new DirTree(root), DirTreeDeleter()); + cache.emplace(root, tree); + } + + return tree; +} + +DirTree::DirTree(std::string root, FILE *f) : root(root), isComplete(true) { + size_t size; + if (fscanf(f, "%zu", &size)) { + for (size_t i = 0; i < size; i++) { + DirEntry entry(f); + entries.emplace(entry.path, entry); + } + } +} + +// Internal find method that has no lock +DirEntry *DirTree::_find(std::string path) { + auto found = entries.find(path); + if (found == entries.end()) { + return NULL; + } + + return &found->second; +} + +DirEntry *DirTree::add(std::string path, uint64_t mtime, bool isDir) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry entry(path, mtime, isDir); + auto it = entries.emplace(entry.path, entry); + return &it.first->second; +} + +DirEntry *DirTree::find(std::string path) { + std::lock_guard lock(mDirCacheMutex()); + return _find(path); +} + +DirEntry *DirTree::update(std::string path, uint64_t mtime) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry *found = _find(path); + if (found) { + found->mtime = mtime; + } + + return found; +} + +void DirTree::remove(std::string path) { + std::lock_guard lock(mDirCacheMutex()); + + DirEntry *found = _find(path); + + // Remove all sub-entries if this is a directory + if (found && found->isDir) { + std::string pathStart = path + DIR_SEP; + for (auto it = entries.begin(); it != entries.end();) { + if (it->first.rfind(pathStart, 0) == 0) { + it = entries.erase(it); + } else { + it++; + } + } + } + + entries.erase(path); +} + +void DirTree::write(FILE *f) { + std::lock_guard lock(mDirCacheMutex()); + + fprintf(f, "%zu\n", entries.size()); + for (auto it = entries.begin(); it != entries.end(); it++) { + it->second.write(f); + } +} + +void DirTree::getChanges(DirTree *snapshot, EventList &events) { + std::lock_guard lock(mDirCacheMutex()); + std::lock_guard snapshotLock(snapshot->mMutex); + + for (auto it = entries.begin(); it != entries.end(); it++) { + auto found = snapshot->entries.find(it->first); + if (found == snapshot->entries.end()) { + events.create(it->second.path); + } else if (found->second.mtime != it->second.mtime && !found->second.isDir && !it->second.isDir) { + events.update(it->second.path); + } + } + + for (auto it = snapshot->entries.begin(); it != snapshot->entries.end(); it++) { + size_t count = entries.count(it->first); + if (count == 0) { + events.remove(it->second.path); + } + } +} + +DirEntry::DirEntry(std::string p, uint64_t t, bool d) { + path = p; + mtime = t; + isDir = d; + state = NULL; +} + +DirEntry::DirEntry(FILE *f) { + size_t size; + if (fscanf(f, "%zu", &size)) { + path.resize(size); + if (fread(&path[0], sizeof(char), size, f)) { + int d = 0; + fscanf(f, "%" PRIu64 " %d\n", &mtime, &d); + isDir = d == 1; + } + } +} + +void DirEntry::write(FILE *f) const { + fprintf(f, "%zu%s%" PRIu64 " %d\n", path.size(), path.c_str(), mtime, isDir); +} diff --git a/node_modules/@parcel/watcher/src/DirTree.hh b/node_modules/@parcel/watcher/src/DirTree.hh new file mode 100644 index 0000000..328f469 --- /dev/null +++ b/node_modules/@parcel/watcher/src/DirTree.hh @@ -0,0 +1,50 @@ +#ifndef DIR_TREE_H +#define DIR_TREE_H + +#include +#include +#include +#include "Event.hh" + +#ifdef _WIN32 +#define DIR_SEP "\\" +#else +#define DIR_SEP "/" +#endif + +struct DirEntry { + std::string path; + uint64_t mtime; + bool isDir; + mutable void *state; + + DirEntry(std::string p, uint64_t t, bool d); + DirEntry(FILE *f); + void write(FILE *f) const; + bool operator==(const DirEntry &other) const { + return path == other.path; + } +}; + +class DirTree { +public: + static std::shared_ptr getCached(std::string root); + DirTree(std::string root) : root(root), isComplete(false) {} + DirTree(std::string root, FILE *f); + DirEntry *add(std::string path, uint64_t mtime, bool isDir); + DirEntry *find(std::string path); + DirEntry *update(std::string path, uint64_t mtime); + void remove(std::string path); + void write(FILE *f); + void getChanges(DirTree *snapshot, EventList &events); + + std::mutex mMutex; + std::string root; + bool isComplete; + std::unordered_map entries; + +private: + DirEntry *_find(std::string path); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/Event.hh b/node_modules/@parcel/watcher/src/Event.hh new file mode 100644 index 0000000..8d09712 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Event.hh @@ -0,0 +1,109 @@ +#ifndef EVENT_H +#define EVENT_H + +#include +#include +#include "wasm/include.h" +#include +#include +#include +#include + +using namespace Napi; + +struct Event { + std::string path; + bool isCreated; + bool isDeleted; + Event(std::string path) : path(path), isCreated(false), isDeleted(false) {} + + Value toJS(const Env& env) { + EscapableHandleScope scope(env); + Object res = Object::New(env); + std::string type = isCreated ? "create" : isDeleted ? "delete" : "update"; + res.Set(String::New(env, "path"), String::New(env, path.c_str())); + res.Set(String::New(env, "type"), String::New(env, type.c_str())); + return scope.Escape(res); + } +}; + +class EventList { +public: + void create(std::string path) { + std::lock_guard l(mMutex); + Event *event = internalUpdate(path); + if (event->isDeleted) { + // Assume update event when rapidly removed and created + // https://github.com/parcel-bundler/watcher/issues/72 + event->isDeleted = false; + } else { + event->isCreated = true; + } + } + + Event *update(std::string path) { + std::lock_guard l(mMutex); + return internalUpdate(path); + } + + void remove(std::string path) { + std::lock_guard l(mMutex); + Event *event = internalUpdate(path); + event->isDeleted = true; + } + + size_t size() { + std::lock_guard l(mMutex); + return mEvents.size(); + } + + std::vector getEvents() { + std::lock_guard l(mMutex); + std::vector eventsCloneVector; + for(auto it = mEvents.begin(); it != mEvents.end(); ++it) { + if (!(it->second.isCreated && it->second.isDeleted)) { + eventsCloneVector.push_back(it->second); + } + } + return eventsCloneVector; + } + + void clear() { + std::lock_guard l(mMutex); + mEvents.clear(); + mError.reset(); + } + + void error(std::string err) { + std::lock_guard l(mMutex); + if (!mError.has_value()) { + mError.emplace(err); + } + } + + bool hasError() { + std::lock_guard l(mMutex); + return mError.has_value(); + } + + std::string getError() { + std::lock_guard l(mMutex); + return mError.value_or(""); + } + +private: + mutable std::mutex mMutex; + std::map mEvents; + std::optional mError; + Event *internalUpdate(std::string path) { + auto found = mEvents.find(path); + if (found == mEvents.end()) { + auto it = mEvents.emplace(path, Event(path)); + return &it.first->second; + } + + return &found->second; + } +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/Glob.cc b/node_modules/@parcel/watcher/src/Glob.cc new file mode 100644 index 0000000..a4a1722 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Glob.cc @@ -0,0 +1,22 @@ +#include "Glob.hh" + +#ifdef __wasm32__ +extern "C" bool wasm_regex_match(const char *s, const char *regex); +#endif + +Glob::Glob(std::string raw) { + mRaw = raw; + mHash = std::hash()(raw); + #ifndef __wasm32__ + mRegex = std::regex(raw); + #endif +} + +bool Glob::isIgnored(std::string relative_path) const { + // Use native JS regex engine for wasm to reduce binary size. + #ifdef __wasm32__ + return wasm_regex_match(relative_path.c_str(), mRaw.c_str()); + #else + return std::regex_match(relative_path, mRegex); + #endif +} diff --git a/node_modules/@parcel/watcher/src/Glob.hh b/node_modules/@parcel/watcher/src/Glob.hh new file mode 100644 index 0000000..b5fc375 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Glob.hh @@ -0,0 +1,34 @@ +#ifndef GLOB_H +#define GLOB_H + +#include +#include + +struct Glob { + std::size_t mHash; + std::string mRaw; + #ifndef __wasm32__ + std::regex mRegex; + #endif + + Glob(std::string raw); + + bool operator==(const Glob &other) const { + return mHash == other.mHash && mRaw == other.mRaw; + } + + bool isIgnored(std::string relative_path) const; +}; + +namespace std +{ + template <> + struct hash + { + size_t operator()(const Glob& g) const { + return g.mHash; + } + }; +} + +#endif diff --git a/node_modules/@parcel/watcher/src/PromiseRunner.hh b/node_modules/@parcel/watcher/src/PromiseRunner.hh new file mode 100644 index 0000000..4ca3bb6 --- /dev/null +++ b/node_modules/@parcel/watcher/src/PromiseRunner.hh @@ -0,0 +1,101 @@ +#ifndef PROMISE_RUNNER_H +#define PROMISE_RUNNER_H + +#include +#include "wasm/include.h" +#include + +using namespace Napi; + +class PromiseRunner { +public: + const Env env; + Promise::Deferred deferred; + + PromiseRunner(Env env) : env(env), deferred(Promise::Deferred::New(env)) { + napi_status status = napi_create_async_work(env, nullptr, env.Undefined(), + onExecute, onWorkComplete, this, &work); + if (status != napi_ok) { + work = nullptr; + const napi_extended_error_info *error_info = 0; + napi_get_last_error_info(env, &error_info); + if (error_info->error_message) { + Error::New(env, error_info->error_message).ThrowAsJavaScriptException(); + } else { + Error::New(env).ThrowAsJavaScriptException(); + } + } + } + + virtual ~PromiseRunner() {} + + Value queue() { + if (work) { + napi_status status = napi_queue_async_work(env, work); + if (status != napi_ok) { + onError(Error::New(env)); + } + } + + return deferred.Promise(); + } + +private: + napi_async_work work; + std::string error; + + static void onExecute(napi_env env, void *this_pointer) { + PromiseRunner* self = (PromiseRunner*) this_pointer; + try { + self->execute(); + } catch (std::exception &err) { + self->error = err.what(); + } + } + + static void onWorkComplete(napi_env env, napi_status status, void *this_pointer) { + PromiseRunner* self = (PromiseRunner*) this_pointer; + if (status != napi_cancelled) { + HandleScope scope(self->env); + if (status == napi_ok) { + status = napi_delete_async_work(self->env, self->work); + if (status == napi_ok) { + if (self->error.size() == 0) { + self->onOK(); + } else { + self->onError(Error::New(self->env, self->error)); + } + delete self; + return; + } + } + } + + // fallthrough for error handling + const napi_extended_error_info *error_info = 0; + napi_get_last_error_info(env, &error_info); + if (error_info->error_message){ + self->onError(Error::New(env, error_info->error_message)); + } else { + self->onError(Error::New(env)); + } + delete self; + } + + virtual void execute() {} + virtual Value getResult() { + return env.Null(); + } + + void onOK() { + HandleScope scope(env); + Value result = getResult(); + deferred.Resolve(result); + } + + void onError(const Error &e) { + deferred.Reject(e.Value()); + } +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/Signal.hh b/node_modules/@parcel/watcher/src/Signal.hh new file mode 100644 index 0000000..e577319 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Signal.hh @@ -0,0 +1,46 @@ +#ifndef SIGNAL_H +#define SIGNAL_H + +#include +#include + +class Signal { +public: + Signal() : mFlag(false), mWaiting(false) {} + void wait() { + std::unique_lock lock(mMutex); + while (!mFlag) { + mWaiting = true; + mCond.wait(lock); + } + } + + std::cv_status waitFor(std::chrono::milliseconds ms) { + std::unique_lock lock(mMutex); + return mCond.wait_for(lock, ms); + } + + void notify() { + std::unique_lock lock(mMutex); + mFlag = true; + mCond.notify_all(); + } + + void reset() { + std::unique_lock lock(mMutex); + mFlag = false; + mWaiting = false; + } + + bool isWaiting() { + return mWaiting; + } + +private: + bool mFlag; + bool mWaiting; + std::mutex mMutex; + std::condition_variable mCond; +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/Watcher.cc b/node_modules/@parcel/watcher/src/Watcher.cc new file mode 100644 index 0000000..a58ff37 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Watcher.cc @@ -0,0 +1,241 @@ +#include "Watcher.hh" +#include + +using namespace Napi; + +struct WatcherHash { + std::size_t operator() (WatcherRef const &k) const { + return std::hash()(k->mDir); + } +}; + +struct WatcherCompare { + size_t operator() (WatcherRef const &a, WatcherRef const &b) const { + return *a == *b; + } +}; + +static std::unordered_set& getSharedWatchers() { + static std::unordered_set* sharedWatchers = + new std::unordered_set(); + return *sharedWatchers; +} + +WatcherRef Watcher::getShared(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs) { + WatcherRef watcher = std::make_shared(dir, ignorePaths, ignoreGlobs); + auto found = getSharedWatchers().find(watcher); + if (found != getSharedWatchers().end()) { + return *found; + } + + getSharedWatchers().insert(watcher); + return watcher; +} + +void removeShared(Watcher *watcher) { + for (auto it = getSharedWatchers().begin(); it != getSharedWatchers().end(); it++) { + if (it->get() == watcher) { + getSharedWatchers().erase(it); + break; + } + } + + // Free up memory. + if (getSharedWatchers().size() == 0) { + getSharedWatchers().rehash(0); + } +} + +Watcher::Watcher(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs) + : mDir(dir), + mIgnorePaths(ignorePaths), + mIgnoreGlobs(ignoreGlobs) { + mDebounce = Debounce::getShared(); + mDebounce->add(this, [this] () { + triggerCallbacks(); + }); + } + +Watcher::~Watcher() { + mDebounce->remove(this); +} + +void Watcher::wait() { + std::unique_lock lk(mMutex); + mCond.wait(lk); +} + +void Watcher::notify() { + std::unique_lock lk(mMutex); + mCond.notify_all(); + + if (mCallbacks.size() > 0 && mEvents.size() > 0) { + // We must release our lock before calling into the debouncer + // to avoid a deadlock: the debouncer thread itself will require + // our lock from its thread when calling into `triggerCallbacks` + // while holding its own debouncer lock. + lk.unlock(); + mDebounce->trigger(); + } +} + +struct CallbackData { + std::string error; + std::vector events; + CallbackData(std::string error, std::vector events) : error(error), events(events) {} +}; + +Value callbackEventsToJS(const Env &env, std::vector &events) { + EscapableHandleScope scope(env); + Array arr = Array::New(env, events.size()); + uint32_t currentEventIndex = 0; + for (auto eventIterator = events.begin(); eventIterator != events.end(); eventIterator++) { + arr.Set(currentEventIndex++, eventIterator->toJS(env)); + } + return scope.Escape(arr); +} + +void callJSFunction(Napi::Env env, Function jsCallback, CallbackData *data) { + HandleScope scope(env); + auto err = data->error.size() > 0 ? Error::New(env, data->error).Value() : env.Null(); + auto events = callbackEventsToJS(env, data->events); + jsCallback.Call({err, events}); + delete data; + + // Throw errors from the callback as fatal exceptions + // If we don't handle these node segfaults... + if (env.IsExceptionPending()) { + Napi::Error err = env.GetAndClearPendingException(); + napi_fatal_exception(env, err.Value()); + } +} + +void Watcher::notifyError(std::exception &err) { + std::unique_lock lk(mMutex); + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + CallbackData *data = new CallbackData(err.what(), {}); + it->tsfn.BlockingCall(data, callJSFunction); + } + + clearCallbacks(); +} + +// This function is called from the debounce thread. +void Watcher::triggerCallbacks() { + std::unique_lock lk(mMutex); + if (mCallbacks.size() > 0 && (mEvents.size() > 0 || mEvents.hasError())) { + auto error = mEvents.getError(); + auto events = mEvents.getEvents(); + mEvents.clear(); + + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + it->tsfn.BlockingCall(new CallbackData(error, events), callJSFunction); + } + } +} + +// This should be called from the JavaScript thread. +bool Watcher::watch(Function callback) { + std::unique_lock lk(mMutex); + + auto it = findCallback(callback); + if (it != mCallbacks.end()) { + return false; + } + + auto tsfn = ThreadSafeFunction::New( + callback.Env(), + callback, + "Watcher callback", + 0, // Unlimited queue + 1 // Initial thread count + ); + + mCallbacks.push_back(Callback { + tsfn, + Napi::Persistent(callback), + std::this_thread::get_id() + }); + + return true; +} + +// This should be called from the JavaScript thread. +std::vector::iterator Watcher::findCallback(Function callback) { + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + // Only consider callbacks created by the same thread, or V8 will panic. + if (it->threadId == std::this_thread::get_id() && it->ref.Value() == callback) { + return it; + } + } + + return mCallbacks.end(); +} + +// This should be called from the JavaScript thread. +bool Watcher::unwatch(Function callback) { + std::unique_lock lk(mMutex); + + bool removed = false; + auto it = findCallback(callback); + if (it != mCallbacks.end()) { + it->tsfn.Release(); + it->ref.Unref(); + mCallbacks.erase(it); + removed = true; + } + + if (removed && mCallbacks.size() == 0) { + unref(); + return true; + } + + return false; +} + +void Watcher::unref() { + if (mCallbacks.size() == 0) { + removeShared(this); + } +} + +void Watcher::destroy() { + std::unique_lock lk(mMutex); + clearCallbacks(); +} + +// Private because it doesn't lock. +void Watcher::clearCallbacks() { + for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) { + it->tsfn.Release(); + it->ref.Unref(); + } + + mCallbacks.clear(); + unref(); +} + +bool Watcher::isIgnored(std::string path) { + for (auto it = mIgnorePaths.begin(); it != mIgnorePaths.end(); it++) { + auto dir = *it + DIR_SEP; + if (*it == path || path.compare(0, dir.size(), dir) == 0) { + return true; + } + } + + auto basePath = mDir + DIR_SEP; + + if (path.rfind(basePath, 0) != 0) { + return false; + } + + auto relativePath = path.substr(basePath.size()); + + for (auto it = mIgnoreGlobs.begin(); it != mIgnoreGlobs.end(); it++) { + if (it->isIgnored(relativePath)) { + return true; + } + } + + return false; +} diff --git a/node_modules/@parcel/watcher/src/Watcher.hh b/node_modules/@parcel/watcher/src/Watcher.hh new file mode 100644 index 0000000..f89e9f5 --- /dev/null +++ b/node_modules/@parcel/watcher/src/Watcher.hh @@ -0,0 +1,73 @@ +#ifndef WATCHER_H +#define WATCHER_H + +#include +#include +#include +#include +#include "Glob.hh" +#include "Event.hh" +#include "Debounce.hh" +#include "DirTree.hh" +#include "Signal.hh" + +using namespace Napi; + +struct Watcher; +using WatcherRef = std::shared_ptr; + +struct Callback { + Napi::ThreadSafeFunction tsfn; + Napi::FunctionReference ref; + std::thread::id threadId; +}; + +class WatcherState { +public: + virtual ~WatcherState() = default; +}; + +struct Watcher { + std::string mDir; + std::unordered_set mIgnorePaths; + std::unordered_set mIgnoreGlobs; + EventList mEvents; + std::shared_ptr state; + + Watcher(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs); + ~Watcher(); + + bool operator==(const Watcher &other) const { + return mDir == other.mDir && mIgnorePaths == other.mIgnorePaths && mIgnoreGlobs == other.mIgnoreGlobs; + } + + void wait(); + void notify(); + void notifyError(std::exception &err); + bool watch(Function callback); + bool unwatch(Function callback); + void unref(); + bool isIgnored(std::string path); + void destroy(); + + static WatcherRef getShared(std::string dir, std::unordered_set ignorePaths, std::unordered_set ignoreGlobs); + +private: + std::mutex mMutex; + std::condition_variable mCond; + std::vector mCallbacks; + std::shared_ptr mDebounce; + + std::vector::iterator findCallback(Function callback); + void clearCallbacks(); + void triggerCallbacks(); +}; + +class WatcherError : public std::runtime_error { +public: + WatcherRef mWatcher; + WatcherError(std::string msg, WatcherRef watcher) : std::runtime_error(msg), mWatcher(watcher) {} + WatcherError(const char *msg, WatcherRef watcher) : std::runtime_error(msg), mWatcher(watcher) {} +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/binding.cc b/node_modules/@parcel/watcher/src/binding.cc new file mode 100644 index 0000000..057b61b --- /dev/null +++ b/node_modules/@parcel/watcher/src/binding.cc @@ -0,0 +1,268 @@ +#include +#include +#include "wasm/include.h" +#include +#include "Glob.hh" +#include "Event.hh" +#include "Backend.hh" +#include "Watcher.hh" +#include "PromiseRunner.hh" + +using namespace Napi; + +std::unordered_set getIgnorePaths(Env env, Value opts) { + std::unordered_set result; + + if (opts.IsObject()) { + Value v = opts.As().Get(String::New(env, "ignorePaths")); + if (v.IsArray()) { + Array items = v.As(); + for (size_t i = 0; i < items.Length(); i++) { + Value item = items.Get(Number::New(env, static_cast(i))); + if (item.IsString()) { + result.insert(std::string(item.As().Utf8Value().c_str())); + } + } + } + } + + return result; +} + +std::unordered_set getIgnoreGlobs(Env env, Value opts) { + std::unordered_set result; + + if (opts.IsObject()) { + Value v = opts.As().Get(String::New(env, "ignoreGlobs")); + if (v.IsArray()) { + Array items = v.As(); + for (size_t i = 0; i < items.Length(); i++) { + Value item = items.Get(Number::New(env, static_cast(i))); + if (item.IsString()) { + auto key = item.As().Utf8Value(); + try { + result.emplace(key); + } catch (const std::regex_error& e) { + Error::New(env, e.what()).ThrowAsJavaScriptException(); + } + } + } + } + } + + return result; +} + +std::shared_ptr getBackend(Env env, Value opts) { + Value b = opts.As().Get(String::New(env, "backend")); + std::string backendName; + if (b.IsString()) { + backendName = std::string(b.As().Utf8Value().c_str()); + } + + return Backend::getShared(backendName); +} + +class WriteSnapshotRunner : public PromiseRunner { +public: + WriteSnapshotRunner(Env env, Value dir, Value snap, Value opts) + : PromiseRunner(env), + snapshotPath(std::string(snap.As().Utf8Value().c_str())) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + } + + ~WriteSnapshotRunner() { + watcher->unref(); + backend->unref(); + } +private: + std::shared_ptr backend; + WatcherRef watcher; + std::string snapshotPath; + + void execute() override { + backend->writeSnapshot(watcher, &snapshotPath); + } +}; + +class GetEventsSinceRunner : public PromiseRunner { +public: + GetEventsSinceRunner(Env env, Value dir, Value snap, Value opts) + : PromiseRunner(env), + snapshotPath(std::string(snap.As().Utf8Value().c_str())) { + watcher = std::make_shared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + } + + ~GetEventsSinceRunner() { + watcher->unref(); + backend->unref(); + } +private: + std::shared_ptr backend; + WatcherRef watcher; + std::string snapshotPath; + + void execute() override { + backend->getEventsSince(watcher, &snapshotPath); + if (watcher->mEvents.hasError()) { + throw std::runtime_error(watcher->mEvents.getError()); + } + } + + Value getResult() override { + std::vector events = watcher->mEvents.getEvents(); + Array eventsArray = Array::New(env, events.size()); + uint32_t i = 0; + for (auto it = events.begin(); it != events.end(); it++) { + eventsArray.Set(i++, it->toJS(env)); + } + return eventsArray; + } +}; + +template +Value queueSnapshotWork(const CallbackInfo& info) { + Env env = info.Env(); + if (info.Length() < 1 || !info[0].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() < 2 || !info[1].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() >= 3 && !info[2].IsObject()) { + TypeError::New(env, "Expected an object").ThrowAsJavaScriptException(); + return env.Null(); + } + + Runner *runner = new Runner(info.Env(), info[0], info[1], info[2]); + return runner->queue(); +} + +Value writeSnapshot(const CallbackInfo& info) { + return queueSnapshotWork(info); +} + +Value getEventsSince(const CallbackInfo& info) { + return queueSnapshotWork(info); +} + +class SubscribeRunner : public PromiseRunner { +public: + SubscribeRunner(Env env, Value dir, Value fn, Value opts) : PromiseRunner(env) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + watcher->watch(fn.As()); + } + +private: + WatcherRef watcher; + std::shared_ptr backend; + FunctionReference callback; + + void execute() override { + try { + backend->watch(watcher); + } catch (std::exception&) { + watcher->destroy(); + throw; + } + } +}; + +class UnsubscribeRunner : public PromiseRunner { +public: + UnsubscribeRunner(Env env, Value dir, Value fn, Value opts) : PromiseRunner(env) { + watcher = Watcher::getShared( + std::string(dir.As().Utf8Value().c_str()), + getIgnorePaths(env, opts), + getIgnoreGlobs(env, opts) + ); + + backend = getBackend(env, opts); + shouldUnwatch = watcher->unwatch(fn.As()); + } + +private: + WatcherRef watcher; + std::shared_ptr backend; + bool shouldUnwatch; + + void execute() override { + if (shouldUnwatch) { + backend->unwatch(watcher); + } + } +}; + +template +Value queueSubscriptionWork(const CallbackInfo& info) { + Env env = info.Env(); + if (info.Length() < 1 || !info[0].IsString()) { + TypeError::New(env, "Expected a string").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() < 2 || !info[1].IsFunction()) { + TypeError::New(env, "Expected a function").ThrowAsJavaScriptException(); + return env.Null(); + } + + if (info.Length() >= 3 && !info[2].IsObject()) { + TypeError::New(env, "Expected an object").ThrowAsJavaScriptException(); + return env.Null(); + } + + Runner *runner = new Runner(info.Env(), info[0], info[1], info[2]); + return runner->queue(); +} + +Value subscribe(const CallbackInfo& info) { + return queueSubscriptionWork(info); +} + +Value unsubscribe(const CallbackInfo& info) { + return queueSubscriptionWork(info); +} + +Object Init(Env env, Object exports) { + exports.Set( + String::New(env, "writeSnapshot"), + Function::New(env, writeSnapshot) + ); + exports.Set( + String::New(env, "getEventsSince"), + Function::New(env, getEventsSince) + ); + exports.Set( + String::New(env, "subscribe"), + Function::New(env, subscribe) + ); + exports.Set( + String::New(env, "unsubscribe"), + Function::New(env, unsubscribe) + ); + return exports; +} + +NODE_API_MODULE(watcher, Init) diff --git a/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.cc b/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.cc new file mode 100644 index 0000000..2991c32 --- /dev/null +++ b/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.cc @@ -0,0 +1,306 @@ +#include +#include +#include +#include +#include +#include +#include +#include "KqueueBackend.hh" + +#if __APPLE__ +#define st_mtim st_mtimespec +#endif + +#if !defined(O_EVTONLY) +#define O_EVTONLY O_RDONLY +#endif + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void KqueueBackend::start() { + if ((mKqueue = kqueue()) < 0) { + throw std::runtime_error(std::string("Unable to open kqueue: ") + strerror(errno)); + } + + // Create a pipe that we will write to when we want to end the thread. + int err = pipe(mPipe); + if (err == -1) { + throw std::runtime_error(std::string("Unable to open pipe: ") + strerror(errno)); + } + + // Subscribe kqueue to this pipe. + struct kevent ev; + EV_SET( + &ev, + mPipe[0], + EVFILT_READ, + EV_ADD | EV_CLEAR, + 0, + 0, + 0 + ); + + if (kevent(mKqueue, &ev, 1, NULL, 0, 0)) { + close(mPipe[0]); + close(mPipe[1]); + throw std::runtime_error(std::string("Unable to watch pipe: ") + strerror(errno)); + } + + notifyStarted(); + + struct kevent events[128]; + + while (true) { + int event_count = kevent(mKqueue, NULL, 0, events, 128, 0); + if (event_count < 0 || events[0].flags == EV_ERROR) { + throw std::runtime_error(std::string("kevent error: ") + strerror(errno)); + } + + // Track all of the watchers that are touched so we can notify them at the end of the events. + std::unordered_set watchers; + + for (int i = 0; i < event_count; i++) { + int flags = events[i].fflags; + int fd = events[i].ident; + if (fd == mPipe[0]) { + // pipe was written to. break out of the loop. + goto done; + } + + auto it = mFdToEntry.find(fd); + if (it == mFdToEntry.end()) { + // If fd wasn't in our map, we may have already stopped watching it. Ignore the event. + continue; + } + + DirEntry *entry = it->second; + + if (flags & NOTE_WRITE && entry && entry->isDir) { + // If a write occurred on a directory, we have to diff the contents of that + // directory to determine what file was added/deleted. + compareDir(fd, entry->path, watchers); + } else { + std::vector subs = findSubscriptions(entry->path); + for (auto it = subs.begin(); it != subs.end(); it++) { + KqueueSubscription *sub = *it; + watchers.insert(sub->watcher); + if (flags & (NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE)) { + sub->watcher->mEvents.remove(sub->path); + sub->tree->remove(sub->path); + mFdToEntry.erase((int)(size_t)entry->state); + mSubscriptions.erase(sub->path); + } else if (flags & (NOTE_WRITE | NOTE_ATTRIB | NOTE_EXTEND)) { + struct stat st; + lstat(sub->path.c_str(), &st); + if (entry->mtime != CONVERT_TIME(st.st_mtim)) { + entry->mtime = CONVERT_TIME(st.st_mtim); + sub->watcher->mEvents.update(sub->path); + } + } + } + } + } + + for (auto it = watchers.begin(); it != watchers.end(); it++) { + (*it)->notify(); + } + } + +done: + close(mPipe[0]); + close(mPipe[1]); + mEndedSignal.notify(); +} + +KqueueBackend::~KqueueBackend() { + write(mPipe[1], "X", 1); + mEndedSignal.wait(); +} + +void KqueueBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + bool success = watchDir(watcher, it->second.path, tree); + if (!success) { + throw WatcherError(std::string("error watching " + watcher->mDir + ": " + strerror(errno)), watcher); + } + } +} + +bool KqueueBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + if (watcher->isIgnored(path)) { + return false; + } + + DirEntry *entry = tree->find(path); + if (!entry) { + return false; + } + + KqueueSubscription sub = { + .watcher = watcher, + .path = path, + .tree = tree + }; + + if (!entry->state) { + int fd = open(path.c_str(), O_EVTONLY); + if (fd <= 0) { + return false; + } + + struct kevent event; + EV_SET( + &event, + fd, + EVFILT_VNODE, + EV_ADD | EV_CLEAR | EV_ENABLE, + NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | NOTE_RENAME | NOTE_REVOKE, + 0, + 0 + ); + + if (kevent(mKqueue, &event, 1, NULL, 0, 0)) { + close(fd); + return false; + } + + entry->state = (void *)(size_t)fd; + mFdToEntry.emplace(fd, entry); + } + + sub.fd = (int)(size_t)entry->state; + mSubscriptions.emplace(path, sub); + return true; +} + +std::vector KqueueBackend::findSubscriptions(std::string &path) { + // Find the subscriptions affected by this path. + // Copy pointers to them into a vector so that modifying mSubscriptions doesn't invalidate the iterator. + auto range = mSubscriptions.equal_range(path); + std::vector subs; + for (auto it = range.first; it != range.second; it++) { + subs.push_back(&it->second); + } + + return subs; +} + +bool KqueueBackend::compareDir(int fd, std::string &path, std::unordered_set &watchers) { + // macOS doesn't support fdclosedir, so we have to duplicate the file descriptor + // to ensure the closedir doesn't also stop watching. + #if __APPLE__ + fd = dup(fd); + #endif + + DIR *dir = fdopendir(fd); + if (dir == NULL) { + return false; + } + + // fdopendir doesn't rewind to the beginning. + rewinddir(dir); + + std::vector subs = findSubscriptions(path); + std::string dirStart = path + DIR_SEP; + + std::unordered_set> trees; + for (auto it = subs.begin(); it != subs.end(); it++) { + trees.emplace((*it)->tree); + } + + std::unordered_set entries; + struct dirent *entry; + while ((entry = readdir(dir))) { + if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { + continue; + } + + std::string fullpath = dirStart + entry->d_name; + entries.emplace(fullpath); + + for (auto it = trees.begin(); it != trees.end(); it++) { + std::shared_ptr tree = *it; + if (!tree->find(fullpath)) { + struct stat st; + fstatat(fd, entry->d_name, &st, AT_SYMLINK_NOFOLLOW); + tree->add(fullpath, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + + // Notify all watchers with the same tree. + for (auto i = subs.begin(); i != subs.end(); i++) { + KqueueSubscription *sub = *i; + if (sub->tree == tree) { + if (sub->watcher->isIgnored(fullpath)) { + continue; + } + + sub->watcher->mEvents.create(fullpath); + watchers.emplace(sub->watcher); + + bool success = watchDir(sub->watcher, fullpath, sub->tree); + if (!success) { + sub->tree->remove(fullpath); + return false; + } + } + } + } + } + } + + for (auto it = trees.begin(); it != trees.end(); it++) { + std::shared_ptr tree = *it; + for (auto entry = tree->entries.begin(); entry != tree->entries.end();) { + + if ( + entry->first.rfind(dirStart, 0) == 0 && + entry->first.find(DIR_SEP, dirStart.length()) == std::string::npos && + entries.count(entry->first) == 0 + ) { + // Notify all watchers with the same tree. + for (auto i = subs.begin(); i != subs.end(); i++) { + if ((*i)->tree == tree) { + KqueueSubscription *sub = *i; + if (!sub->watcher->isIgnored(entry->first)) { + sub->watcher->mEvents.remove(entry->first); + watchers.emplace(sub->watcher); + } + } + } + + mFdToEntry.erase((int)(size_t)entry->second.state); + mSubscriptions.erase(entry->first); + entry = tree->entries.erase(entry); + } else { + entry++; + } + } + } + + #if __APPLE__ + closedir(dir); + #else + fdclosedir(dir); + #endif + + return true; +} + +void KqueueBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second.watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + // Closing the file descriptor automatically unwatches it in the kqueue. + close(it->second.fd); + mFdToEntry.erase(it->second.fd); + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.hh b/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.hh new file mode 100644 index 0000000..3c6a9cd --- /dev/null +++ b/node_modules/@parcel/watcher/src/kqueue/KqueueBackend.hh @@ -0,0 +1,35 @@ +#ifndef KQUEUE_H +#define KQUEUE_H + +#include +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" +#include "../Signal.hh" + +struct KqueueSubscription { + WatcherRef watcher; + std::string path; + std::shared_ptr tree; + int fd; +}; + +class KqueueBackend : public BruteForceBackend { +public: + void start() override; + ~KqueueBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + int mKqueue; + int mPipe[2]; + std::unordered_multimap mSubscriptions; + std::unordered_map mFdToEntry; + Signal mEndedSignal; + + bool watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + bool compareDir(int fd, std::string &dir, std::unordered_set &watchers); + std::vector findSubscriptions(std::string &path); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/linux/InotifyBackend.cc b/node_modules/@parcel/watcher/src/linux/InotifyBackend.cc new file mode 100644 index 0000000..949f498 --- /dev/null +++ b/node_modules/@parcel/watcher/src/linux/InotifyBackend.cc @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include "InotifyBackend.hh" + +#define INOTIFY_MASK \ + IN_ATTRIB | IN_CREATE | IN_DELETE | \ + IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM | \ + IN_MOVED_TO | IN_DONT_FOLLOW | IN_ONLYDIR | IN_EXCL_UNLINK +#define BUFFER_SIZE 8192 +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void InotifyBackend::start() { + // Create a pipe that we will write to when we want to end the thread. + int err = pipe2(mPipe, O_CLOEXEC | O_NONBLOCK); + if (err == -1) { + throw std::runtime_error(std::string("Unable to open pipe: ") + strerror(errno)); + } + + // Init inotify file descriptor. + mInotify = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); + if (mInotify == -1) { + throw std::runtime_error(std::string("Unable to initialize inotify: ") + strerror(errno)); + } + + pollfd pollfds[2]; + pollfds[0].fd = mPipe[0]; + pollfds[0].events = POLLIN; + pollfds[0].revents = 0; + pollfds[1].fd = mInotify; + pollfds[1].events = POLLIN; + pollfds[1].revents = 0; + + notifyStarted(); + + // Loop until we get an event from the pipe. + while (true) { + int result = poll(pollfds, 2, 500); + if (result < 0) { + throw std::runtime_error(std::string("Unable to poll: ") + strerror(errno)); + } + + if (pollfds[0].revents) { + break; + } + + if (pollfds[1].revents) { + handleEvents(); + } + } + + close(mPipe[0]); + close(mPipe[1]); + close(mInotify); + + mEndedSignal.notify(); +} + +InotifyBackend::~InotifyBackend() { + write(mPipe[1], "X", 1); + mEndedSignal.wait(); +} + +// This function is called by Backend::watch which takes a lock on mMutex +void InotifyBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + if (it->second.isDir) { + bool success = watchDir(watcher, it->second.path, tree); + if (!success) { + throw WatcherError(std::string("inotify_add_watch on '") + it->second.path + std::string("' failed: ") + strerror(errno), watcher); + } + } + } +} + +bool InotifyBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + int wd = inotify_add_watch(mInotify, path.c_str(), INOTIFY_MASK); + if (wd == -1) { + return false; + } + + std::shared_ptr sub = std::make_shared(); + sub->tree = tree; + sub->path = path; + sub->watcher = watcher; + mSubscriptions.emplace(wd, sub); + + return true; +} + +void InotifyBackend::handleEvents() { + char buf[BUFFER_SIZE] __attribute__ ((aligned(__alignof__(struct inotify_event))));; + struct inotify_event *event; + + // Track all of the watchers that are touched so we can notify them at the end of the events. + std::unordered_set watchers; + + while (true) { + int n = read(mInotify, &buf, BUFFER_SIZE); + if (n < 0) { + if (errno == EAGAIN || errno == EWOULDBLOCK) { + break; + } + + throw std::runtime_error(std::string("Error reading from inotify: ") + strerror(errno)); + } + + if (n == 0) { + break; + } + + for (char *ptr = buf; ptr < buf + n; ptr += sizeof(*event) + event->len) { + event = (struct inotify_event *)ptr; + + if ((event->mask & IN_Q_OVERFLOW) == IN_Q_OVERFLOW) { + // overflow + continue; + } + + handleEvent(event, watchers); + } + } + + for (auto it = watchers.begin(); it != watchers.end(); it++) { + (*it)->notify(); + } +} + +void InotifyBackend::handleEvent(struct inotify_event *event, std::unordered_set &watchers) { + std::unique_lock lock(mMutex); + + // Find the subscriptions for this watch descriptor + auto range = mSubscriptions.equal_range(event->wd); + std::unordered_set> set; + for (auto it = range.first; it != range.second; it++) { + set.insert(it->second); + } + + for (auto it = set.begin(); it != set.end(); it++) { + if (handleSubscription(event, *it)) { + watchers.insert((*it)->watcher); + } + } +} + +bool InotifyBackend::handleSubscription(struct inotify_event *event, std::shared_ptr sub) { + // Build full path and check if its in our ignore list. + std::shared_ptr watcher = sub->watcher; + std::string path = std::string(sub->path); + bool isDir = event->mask & IN_ISDIR; + + if (event->len > 0) { + path += "/" + std::string(event->name); + } + + if (watcher->isIgnored(path)) { + return false; + } + + // If this is a create, check if it's a directory and start watching if it is. + // In any case, keep the directory tree up to date. + if (event->mask & (IN_CREATE | IN_MOVED_TO)) { + watcher->mEvents.create(path); + + struct stat st; + // Use lstat to avoid resolving symbolic links that we cannot watch anyway + // https://github.com/parcel-bundler/watcher/issues/76 + if (lstat(path.c_str(), &st) != 0) { + return false; + } + DirEntry *entry = sub->tree->add(path, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + + if (entry->isDir) { + bool success = watchDir(watcher, path, sub->tree); + if (!success) { + sub->tree->remove(path); + return false; + } + } + } else if (event->mask & (IN_MODIFY | IN_ATTRIB)) { + watcher->mEvents.update(path); + + struct stat st; + if (stat(path.c_str(), &st) != 0) { + return false; + } + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + } else if (event->mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVED_FROM | IN_MOVE_SELF)) { + bool isSelfEvent = (event->mask & (IN_DELETE_SELF | IN_MOVE_SELF)); + // Ignore delete/move self events unless this is the recursive watch root + if (isSelfEvent && path != watcher->mDir) { + return false; + } + + // If the entry being deleted/moved is a directory, remove it from the list of subscriptions + // XXX: self events don't have the IN_ISDIR mask + if (isSelfEvent || isDir) { + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->path == path) { + it = mSubscriptions.erase(it); + } else { + ++it; + } + } + } + + watcher->mEvents.remove(path); + sub->tree->remove(path); + } + + return true; +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void InotifyBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + int err = inotify_rm_watch(mInotify, it->first); + if (err == -1) { + throw WatcherError(std::string("Unable to remove watcher: ") + strerror(errno), watcher); + } + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/node_modules/@parcel/watcher/src/linux/InotifyBackend.hh b/node_modules/@parcel/watcher/src/linux/InotifyBackend.hh new file mode 100644 index 0000000..f34cd1f --- /dev/null +++ b/node_modules/@parcel/watcher/src/linux/InotifyBackend.hh @@ -0,0 +1,34 @@ +#ifndef INOTIFY_H +#define INOTIFY_H + +#include +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" +#include "../Signal.hh" + +struct InotifySubscription { + std::shared_ptr tree; + std::string path; + WatcherRef watcher; +}; + +class InotifyBackend : public BruteForceBackend { +public: + void start() override; + ~InotifyBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + int mPipe[2]; + int mInotify; + std::unordered_multimap> mSubscriptions; + Signal mEndedSignal; + + bool watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + void handleEvents(); + void handleEvent(struct inotify_event *event, std::unordered_set &watchers); + bool handleSubscription(struct inotify_event *event, std::shared_ptr sub); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/macos/FSEventsBackend.cc b/node_modules/@parcel/watcher/src/macos/FSEventsBackend.cc new file mode 100644 index 0000000..cfda962 --- /dev/null +++ b/node_modules/@parcel/watcher/src/macos/FSEventsBackend.cc @@ -0,0 +1,338 @@ +#include +#include +#include +#include +#include +#include "../Event.hh" +#include "../Backend.hh" +#include "./FSEventsBackend.hh" +#include "../Watcher.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#define IGNORED_FLAGS (kFSEventStreamEventFlagItemIsHardlink | kFSEventStreamEventFlagItemIsLastHardlink | kFSEventStreamEventFlagItemIsSymlink | kFSEventStreamEventFlagItemIsDir | kFSEventStreamEventFlagItemIsFile) + +void stopStream(FSEventStreamRef stream, CFRunLoopRef runLoop) { + FSEventStreamStop(stream); + FSEventStreamUnscheduleFromRunLoop(stream, runLoop, kCFRunLoopDefaultMode); + FSEventStreamInvalidate(stream); + FSEventStreamRelease(stream); +} + +// macOS has a case insensitive file system by default. In order to detect +// file renames that only affect case, we need to get the canonical path +// and compare it with the input path to determine if a file was created or deleted. +bool pathExists(char *path) { + int fd = open(path, O_RDONLY | O_SYMLINK); + if (fd == -1) { + return false; + } + + char buf[PATH_MAX]; + if (fcntl(fd, F_GETPATH, buf) == -1) { + close(fd); + return false; + } + + bool res = strncmp(path, buf, PATH_MAX) == 0; + close(fd); + return res; +} + +class State: public WatcherState { +public: + FSEventStreamRef stream; + std::shared_ptr tree; + uint64_t since; +}; + +void FSEventsCallback( + ConstFSEventStreamRef streamRef, + void *clientCallBackInfo, + size_t numEvents, + void *eventPaths, + const FSEventStreamEventFlags eventFlags[], + const FSEventStreamEventId eventIds[] +) { + char **paths = (char **)eventPaths; + std::shared_ptr& watcher = *static_cast *>(clientCallBackInfo); + + EventList& list = watcher->mEvents; + if (watcher->state == nullptr) { + return; + } + + auto stateGuard = watcher->state; + auto* state = static_cast(stateGuard.get()); + uint64_t since = state->since; + bool deletedRoot = false; + + for (size_t i = 0; i < numEvents; ++i) { + bool isCreated = (eventFlags[i] & kFSEventStreamEventFlagItemCreated) == kFSEventStreamEventFlagItemCreated; + bool isRemoved = (eventFlags[i] & kFSEventStreamEventFlagItemRemoved) == kFSEventStreamEventFlagItemRemoved; + bool isModified = (eventFlags[i] & kFSEventStreamEventFlagItemModified) == kFSEventStreamEventFlagItemModified || + (eventFlags[i] & kFSEventStreamEventFlagItemInodeMetaMod) == kFSEventStreamEventFlagItemInodeMetaMod || + (eventFlags[i] & kFSEventStreamEventFlagItemFinderInfoMod) == kFSEventStreamEventFlagItemFinderInfoMod || + (eventFlags[i] & kFSEventStreamEventFlagItemChangeOwner) == kFSEventStreamEventFlagItemChangeOwner || + (eventFlags[i] & kFSEventStreamEventFlagItemXattrMod) == kFSEventStreamEventFlagItemXattrMod; + bool isRenamed = (eventFlags[i] & kFSEventStreamEventFlagItemRenamed) == kFSEventStreamEventFlagItemRenamed; + bool isDone = (eventFlags[i] & kFSEventStreamEventFlagHistoryDone) == kFSEventStreamEventFlagHistoryDone; + bool isDir = (eventFlags[i] & kFSEventStreamEventFlagItemIsDir) == kFSEventStreamEventFlagItemIsDir; + + + if (eventFlags[i] & kFSEventStreamEventFlagMustScanSubDirs) { + if (eventFlags[i] & kFSEventStreamEventFlagUserDropped) { + list.error("Events were dropped by the FSEvents client. File system must be re-scanned."); + } else if (eventFlags[i] & kFSEventStreamEventFlagKernelDropped) { + list.error("Events were dropped by the kernel. File system must be re-scanned."); + } else { + list.error("Too many events. File system must be re-scanned."); + } + } + + if (isDone) { + watcher->notify(); + break; + } + + auto ignoredFlags = IGNORED_FLAGS; + if (__builtin_available(macOS 10.13, *)) { + ignoredFlags |= kFSEventStreamEventFlagItemCloned; + } + + // If we don't care about any of the flags that are set, ignore this event. + if ((eventFlags[i] & ~ignoredFlags) == 0) { + continue; + } + + // FSEvents exclusion paths only apply to files, not directories. + if (watcher->isIgnored(paths[i])) { + continue; + } + + // Handle unambiguous events first + if (isCreated && !(isRemoved || isModified || isRenamed)) { + state->tree->add(paths[i], 0, isDir); + list.create(paths[i]); + } else if (isRemoved && !(isCreated || isModified || isRenamed)) { + state->tree->remove(paths[i]); + list.remove(paths[i]); + if (paths[i] == watcher->mDir) { + deletedRoot = true; + } + } else if (isModified && !(isCreated || isRemoved || isRenamed)) { + struct stat file; + if (stat(paths[i], &file)) { + continue; + } + + // Ignore if mtime is the same as the last event. + // This prevents duplicate events from being emitted. + // If tv_nsec is zero, the file system probably only has second-level + // granularity so allow the even through in that case. + uint64_t mtime = CONVERT_TIME(file.st_mtimespec); + DirEntry *entry = state->tree->find(paths[i]); + if (entry && mtime == entry->mtime && file.st_mtimespec.tv_nsec != 0) { + continue; + } + + if (entry) { + // Update mtime. + entry->mtime = mtime; + } else { + // Add to tree if this path has not been discovered yet. + state->tree->add(paths[i], mtime, S_ISDIR(file.st_mode)); + } + + list.update(paths[i]); + } else { + // If multiple flags were set, then we need to call `stat` to determine if the file really exists. + // This helps disambiguate creates, updates, and deletes. + struct stat file; + if (stat(paths[i], &file) || !pathExists(paths[i])) { + // File does not exist, so we have to assume it was removed. This is not exact since the + // flags set by fsevents get coalesced together (e.g. created & deleted), so there is no way to + // know whether the create and delete both happened since our snapshot (in which case + // we'd rather ignore this event completely). This will result in some extra delete events + // being emitted for files we don't know about, but that is the best we can do. + state->tree->remove(paths[i]); + list.remove(paths[i]); + if (paths[i] == watcher->mDir) { + deletedRoot = true; + } + continue; + } + + // If the file was modified, and existed before, then this is an update, otherwise a create. + uint64_t ctime = CONVERT_TIME(file.st_birthtimespec); + uint64_t mtime = CONVERT_TIME(file.st_mtimespec); + DirEntry *entry = !since ? state->tree->find(paths[i]) : NULL; + if (entry && entry->mtime == mtime && file.st_mtimespec.tv_nsec != 0) { + continue; + } + + // Some mounted file systems report a creation time of 0/unix epoch which we special case. + if (isModified && (entry || (ctime <= since && ctime != 0))) { + state->tree->update(paths[i], mtime); + list.update(paths[i]); + } else { + state->tree->add(paths[i], mtime, S_ISDIR(file.st_mode)); + list.create(paths[i]); + } + } + } + + if (!since) { + watcher->notify(); + } + + // Stop watching if the root directory was deleted. + if (deletedRoot) { + stopStream((FSEventStreamRef)streamRef, CFRunLoopGetCurrent()); + watcher->state = nullptr; + } +} + +void checkWatcher(WatcherRef watcher) { + struct stat file; + if (stat(watcher->mDir.c_str(), &file)) { + throw WatcherError(strerror(errno), watcher); + } + + if (!S_ISDIR(file.st_mode)) { + throw WatcherError(strerror(ENOTDIR), watcher); + } +} + +void FSEventsBackend::startStream(WatcherRef watcher, FSEventStreamEventId id) { + checkWatcher(watcher); + + CFAbsoluteTime latency = 0.001; + CFStringRef fileWatchPath = CFStringCreateWithCString( + NULL, + watcher->mDir.c_str(), + kCFStringEncodingUTF8 + ); + + CFArrayRef pathsToWatch = CFArrayCreate( + NULL, + (const void **)&fileWatchPath, + 1, + NULL + ); + + // Make a watcher reference we can pass into the callback. This ensures bumped ref-count. + std::shared_ptr* callbackWatcher = new std::shared_ptr (watcher); + FSEventStreamContext callbackInfo {0, static_cast (callbackWatcher), nullptr, nullptr, nullptr}; + FSEventStreamRef stream = FSEventStreamCreate( + NULL, + &FSEventsCallback, + &callbackInfo, + pathsToWatch, + id, + latency, + kFSEventStreamCreateFlagFileEvents + ); + + CFMutableArrayRef exclusions = CFArrayCreateMutable(NULL, watcher->mIgnorePaths.size(), NULL); + for (auto it = watcher->mIgnorePaths.begin(); it != watcher->mIgnorePaths.end(); it++) { + CFStringRef path = CFStringCreateWithCString( + NULL, + it->c_str(), + kCFStringEncodingUTF8 + ); + + CFArrayAppendValue(exclusions, (const void *)path); + } + + FSEventStreamSetExclusionPaths(stream, exclusions); + + FSEventStreamScheduleWithRunLoop(stream, mRunLoop, kCFRunLoopDefaultMode); + bool started = FSEventStreamStart(stream); + + CFRelease(pathsToWatch); + CFRelease(fileWatchPath); + + if (!started) { + FSEventStreamRelease(stream); + throw WatcherError("Error starting FSEvents stream", watcher); + } + + auto stateGuard = watcher->state; + State* s = static_cast(stateGuard.get()); + s->tree = std::make_shared(watcher->mDir); + s->stream = stream; +} + +void FSEventsBackend::start() { + mRunLoop = CFRunLoopGetCurrent(); + CFRetain(mRunLoop); + + // Unlock once run loop has started. + CFRunLoopPerformBlock(mRunLoop, kCFRunLoopDefaultMode, ^ { + notifyStarted(); + }); + + CFRunLoopWakeUp(mRunLoop); + CFRunLoopRun(); +} + +FSEventsBackend::~FSEventsBackend() { + std::unique_lock lock(mMutex); + CFRunLoopStop(mRunLoop); + CFRelease(mRunLoop); +} + +void FSEventsBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + checkWatcher(watcher); + + FSEventStreamEventId id = FSEventsGetCurrentEventId(); + std::ofstream ofs(*snapshotPath); + ofs << id; + ofs << "\n"; + + struct timespec now; + clock_gettime(CLOCK_REALTIME, &now); + ofs << CONVERT_TIME(now); +} + +void FSEventsBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + std::ifstream ifs(*snapshotPath); + if (ifs.fail()) { + return; + } + + FSEventStreamEventId id; + uint64_t since; + ifs >> id; + ifs >> since; + + auto s = std::make_shared(); + s->since = since; + watcher->state = s; + + startStream(watcher, id); + watcher->wait(); + stopStream(s->stream, mRunLoop); + + watcher->state = nullptr; +} + +// This function is called by Backend::watch which takes a lock on mMutex +void FSEventsBackend::subscribe(WatcherRef watcher) { + auto s = std::make_shared(); + s->since = 0; + watcher->state = s; + startStream(watcher, kFSEventStreamEventIdSinceNow); +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void FSEventsBackend::unsubscribe(WatcherRef watcher) { + auto stateGuard = watcher->state; + State* s = static_cast(stateGuard.get()); + if (s != nullptr) { + stopStream(s->stream, mRunLoop); + watcher->state = nullptr; + } +} diff --git a/node_modules/@parcel/watcher/src/macos/FSEventsBackend.hh b/node_modules/@parcel/watcher/src/macos/FSEventsBackend.hh new file mode 100644 index 0000000..57ded66 --- /dev/null +++ b/node_modules/@parcel/watcher/src/macos/FSEventsBackend.hh @@ -0,0 +1,20 @@ +#ifndef FS_EVENTS_H +#define FS_EVENTS_H + +#include +#include "../Backend.hh" + +class FSEventsBackend : public Backend { +public: + void start() override; + ~FSEventsBackend(); + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + void startStream(WatcherRef watcher, FSEventStreamEventId id); + CFRunLoopRef mRunLoop; +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/shared/BruteForceBackend.cc b/node_modules/@parcel/watcher/src/shared/BruteForceBackend.cc new file mode 100644 index 0000000..0e9b84f --- /dev/null +++ b/node_modules/@parcel/watcher/src/shared/BruteForceBackend.cc @@ -0,0 +1,41 @@ +#include +#include "../DirTree.hh" +#include "../Event.hh" +#include "./BruteForceBackend.hh" + +std::shared_ptr BruteForceBackend::getTree(WatcherRef watcher, bool shouldRead) { + auto tree = DirTree::getCached(watcher->mDir); + + // If the tree is not complete, read it if needed. + if (!tree->isComplete && shouldRead) { + readTree(watcher, tree); + tree->isComplete = true; + } + + return tree; +} + +void BruteForceBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + auto tree = getTree(watcher); + FILE *f = fopen(snapshotPath->c_str(), "w"); + if (!f) { + throw std::runtime_error(std::string("Unable to open snapshot file: ") + strerror(errno)); + } + + tree->write(f); + fclose(f); +} + +void BruteForceBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + FILE *f = fopen(snapshotPath->c_str(), "r"); + if (!f) { + throw std::runtime_error(std::string("Unable to open snapshot file: ") + strerror(errno)); + } + + DirTree snapshot{watcher->mDir, f}; + auto now = getTree(watcher); + now->getChanges(&snapshot, watcher->mEvents); + fclose(f); +} diff --git a/node_modules/@parcel/watcher/src/shared/BruteForceBackend.hh b/node_modules/@parcel/watcher/src/shared/BruteForceBackend.hh new file mode 100644 index 0000000..de7a73d --- /dev/null +++ b/node_modules/@parcel/watcher/src/shared/BruteForceBackend.hh @@ -0,0 +1,25 @@ +#ifndef BRUTE_FORCE_H +#define BRUTE_FORCE_H + +#include "../Backend.hh" +#include "../DirTree.hh" +#include "../Watcher.hh" + +class BruteForceBackend : public Backend { +public: + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override { + throw "Brute force backend doesn't support subscriptions."; + } + + void unsubscribe(WatcherRef watcher) override { + throw "Brute force backend doesn't support subscriptions."; + } + + std::shared_ptr getTree(WatcherRef watcher, bool shouldRead = true); +private: + void readTree(WatcherRef watcher, std::shared_ptr tree); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/unix/fts.cc b/node_modules/@parcel/watcher/src/unix/fts.cc new file mode 100644 index 0000000..d50c3e4 --- /dev/null +++ b/node_modules/@parcel/watcher/src/unix/fts.cc @@ -0,0 +1,50 @@ +#include + +// weird error on linux +#ifdef __THROW +#undef __THROW +#endif +#define __THROW + +#include +#include +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#if __APPLE__ +#define st_mtim st_mtimespec +#endif + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + char *paths[2] {(char *)watcher->mDir.c_str(), NULL}; + FTS *fts = fts_open(paths, FTS_NOCHDIR | FTS_PHYSICAL, NULL); + if (!fts) { + throw WatcherError(strerror(errno), watcher); + } + + FTSENT *node; + bool isRoot = true; + + while ((node = fts_read(fts)) != NULL) { + if (node->fts_errno) { + fts_close(fts); + throw WatcherError(strerror(node->fts_errno), watcher); + } + + if (isRoot && !(node->fts_info & FTS_D)) { + fts_close(fts); + throw WatcherError(strerror(ENOTDIR), watcher); + } + + if (watcher->isIgnored(std::string(node->fts_path))) { + fts_set(fts, node, FTS_SKIP); + continue; + } + + tree->add(node->fts_path, CONVERT_TIME(node->fts_statp->st_mtim), (node->fts_info & FTS_D) == FTS_D); + isRoot = false; + } + + fts_close(fts); +} diff --git a/node_modules/@parcel/watcher/src/unix/legacy.cc b/node_modules/@parcel/watcher/src/unix/legacy.cc new file mode 100644 index 0000000..60490c6 --- /dev/null +++ b/node_modules/@parcel/watcher/src/unix/legacy.cc @@ -0,0 +1,77 @@ +#include + +// weird error on linux +#ifdef __THROW +#undef __THROW +#endif +#define __THROW + +#ifdef _LIBC +# include +#else +# include +#endif +#include +#include +#include + +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) +#if __APPLE__ +#define st_mtim st_mtimespec +#endif +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) + +void iterateDir(WatcherRef watcher, const std::shared_ptr tree, const char *relative, int parent_fd, const std::string &dirname) { + int open_flags = (O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); + int new_fd = openat(parent_fd, relative, open_flags); + if (new_fd == -1) { + if (errno == EACCES) { + return; // ignore insufficient permissions + } + + throw WatcherError(strerror(errno), watcher); + } + + struct stat rootAttributes; + fstatat(new_fd, ".", &rootAttributes, AT_SYMLINK_NOFOLLOW); + tree->add(dirname, CONVERT_TIME(rootAttributes.st_mtim), true); + + if (DIR *dir = fdopendir(new_fd)) { + while (struct dirent *ent = (errno = 0, readdir(dir))) { + if (ISDOT(ent->d_name)) continue; + + std::string fullPath = dirname + "/" + ent->d_name; + + if (!watcher->isIgnored(fullPath)) { + struct stat attrib; + fstatat(new_fd, ent->d_name, &attrib, AT_SYMLINK_NOFOLLOW); + bool isDir = ent->d_type == DT_DIR; + + if (isDir) { + iterateDir(watcher, tree, ent->d_name, new_fd, fullPath); + } else { + tree->add(fullPath, CONVERT_TIME(attrib.st_mtim), isDir); + } + } + } + + closedir(dir); + } else { + close(new_fd); + } + + if (errno) { + throw WatcherError(strerror(errno), watcher); + } +} + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + int fd = open(watcher->mDir.c_str(), O_RDONLY); + if (fd) { + iterateDir(watcher, tree, ".", fd, watcher->mDir); + close(fd); + } +} diff --git a/node_modules/@parcel/watcher/src/wasm/WasmBackend.cc b/node_modules/@parcel/watcher/src/wasm/WasmBackend.cc new file mode 100644 index 0000000..9514109 --- /dev/null +++ b/node_modules/@parcel/watcher/src/wasm/WasmBackend.cc @@ -0,0 +1,132 @@ +#include +#include "WasmBackend.hh" + +#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec) + +void WasmBackend::start() { + notifyStarted(); +} + +void WasmBackend::subscribe(WatcherRef watcher) { + // Build a full directory tree recursively, and watch each directory. + std::shared_ptr tree = getTree(watcher); + + for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) { + if (it->second.isDir) { + watchDir(watcher, it->second.path, tree); + } + } +} + +void WasmBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree) { + int wd = wasm_backend_add_watch(path.c_str(), (void *)this); + std::shared_ptr sub = std::make_shared(); + sub->tree = tree; + sub->path = path; + sub->watcher = watcher; + mSubscriptions.emplace(wd, sub); +} + +extern "C" void wasm_backend_event_handler(void *backend, int wd, int type, char *filename) { + WasmBackend *b = (WasmBackend *)(backend); + b->handleEvent(wd, type, filename); +} + +void WasmBackend::handleEvent(int wd, int type, char *filename) { + // Find the subscriptions for this watch descriptor + auto range = mSubscriptions.equal_range(wd); + std::unordered_set> set; + for (auto it = range.first; it != range.second; it++) { + set.insert(it->second); + } + + for (auto it = set.begin(); it != set.end(); it++) { + if (handleSubscription(type, filename, *it)) { + (*it)->watcher->notify(); + } + } +} + +bool WasmBackend::handleSubscription(int type, char *filename, std::shared_ptr sub) { + // Build full path and check if its in our ignore list. + WatcherRef watcher = sub->watcher; + std::string path = std::string(sub->path); + + if (filename[0] != '\0') { + path += "/" + std::string(filename); + } + + if (watcher->isIgnored(path)) { + return false; + } + + if (type == 1) { + struct stat st; + stat(path.c_str(), &st); + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + watcher->mEvents.update(path); + } else if (type == 2) { + // Determine if this is a create or delete depending on if the file exists or not. + struct stat st; + if (lstat(path.c_str(), &st)) { + // If the entry being deleted/moved is a directory, remove it from the list of subscriptions + DirEntry *entry = sub->tree->find(path); + if (!entry) { + return false; + } + + if (entry->isDir) { + std::string pathStart = path + DIR_SEP; + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->path == path || it->second->path.rfind(pathStart, 0) == 0) { + wasm_backend_remove_watch(it->first); + it = mSubscriptions.erase(it); + } else { + ++it; + } + } + + // Remove all sub-entries + for (auto it = sub->tree->entries.begin(); it != sub->tree->entries.end();) { + if (it->first.rfind(pathStart, 0) == 0) { + watcher->mEvents.remove(it->first); + it = sub->tree->entries.erase(it); + } else { + it++; + } + } + } + + watcher->mEvents.remove(path); + sub->tree->remove(path); + } else if (sub->tree->find(path)) { + sub->tree->update(path, CONVERT_TIME(st.st_mtim)); + watcher->mEvents.update(path); + } else { + watcher->mEvents.create(path); + + // If this is a create, check if it's a directory and start watching if it is. + DirEntry *entry = sub->tree->add(path, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode)); + if (entry->isDir) { + watchDir(watcher, path, sub->tree); + } + } + } + + return true; +} + +void WasmBackend::unsubscribe(WatcherRef watcher) { + // Find any subscriptions pointing to this watcher, and remove them. + for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) { + if (it->second->watcher.get() == watcher.get()) { + if (mSubscriptions.count(it->first) == 1) { + wasm_backend_remove_watch(it->first); + } + + it = mSubscriptions.erase(it); + } else { + it++; + } + } +} diff --git a/node_modules/@parcel/watcher/src/wasm/WasmBackend.hh b/node_modules/@parcel/watcher/src/wasm/WasmBackend.hh new file mode 100644 index 0000000..9facac8 --- /dev/null +++ b/node_modules/@parcel/watcher/src/wasm/WasmBackend.hh @@ -0,0 +1,34 @@ +#ifndef WASM_H +#define WASM_H + +#include +#include "../shared/BruteForceBackend.hh" +#include "../DirTree.hh" + +extern "C" { + int wasm_backend_add_watch(const char *filename, void *backend); + void wasm_backend_remove_watch(int wd); + void wasm_backend_event_handler(void *backend, int wd, int type, char *filename); +}; + +struct WasmSubscription { + std::shared_ptr tree; + std::string path; + WatcherRef watcher; +}; + +class WasmBackend : public BruteForceBackend { +public: + void start() override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; + void handleEvent(int wd, int type, char *filename); +private: + int mWasm; + std::unordered_multimap> mSubscriptions; + + void watchDir(WatcherRef watcher, std::string path, std::shared_ptr tree); + bool handleSubscription(int type, char *filename, std::shared_ptr sub); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/wasm/include.h b/node_modules/@parcel/watcher/src/wasm/include.h new file mode 100644 index 0000000..60e4d65 --- /dev/null +++ b/node_modules/@parcel/watcher/src/wasm/include.h @@ -0,0 +1,74 @@ +/* +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +*/ + +// Node does not include the headers for these functions when compiling for WASM, so add them here. +#ifdef __wasm32__ +extern "C" { +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_threadsafe_function(napi_env env, + napi_value func, + napi_value async_resource, + napi_value async_resource_name, + size_t max_queue_size, + size_t initial_thread_count, + void* thread_finalize_data, + napi_finalize thread_finalize_cb, + void* context, + napi_threadsafe_function_call_js call_js_cb, + napi_threadsafe_function* result); + +NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context( + napi_threadsafe_function func, void** result); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_call_threadsafe_function(napi_threadsafe_function func, + void* data, + napi_threadsafe_function_call_mode is_blocking); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_acquire_threadsafe_function(napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function( + napi_threadsafe_function func, napi_threadsafe_function_release_mode mode); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func); + +NAPI_EXTERN napi_status NAPI_CDECL +napi_create_async_work(napi_env env, + napi_value async_resource, + napi_value async_resource_name, + napi_async_execute_callback execute, + napi_async_complete_callback complete, + void* data, + napi_async_work* result); +NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env, + napi_async_work work); +NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env, + napi_async_work work); +} +#endif diff --git a/node_modules/@parcel/watcher/src/watchman/BSER.cc b/node_modules/@parcel/watcher/src/watchman/BSER.cc new file mode 100644 index 0000000..82390dd --- /dev/null +++ b/node_modules/@parcel/watcher/src/watchman/BSER.cc @@ -0,0 +1,302 @@ +#include +#include "./BSER.hh" + +BSERType decodeType(std::istream &iss) { + int8_t type; + iss.read(reinterpret_cast(&type), sizeof(type)); + return (BSERType) type; +} + +void expectType(std::istream &iss, BSERType expected) { + BSERType got = decodeType(iss); + if (got != expected) { + throw std::runtime_error("Unexpected BSER type"); + } +} + +void encodeType(std::ostream &oss, BSERType type) { + int8_t t = (int8_t)type; + oss.write(reinterpret_cast(&t), sizeof(t)); +} + +template +class Value : public BSERValue { +public: + T value; + Value(T val) { + value = val; + } + + Value() {} +}; + +class BSERInteger : public Value { +public: + BSERInteger(int64_t value) : Value(value) {} + BSERInteger(std::istream &iss) { + int8_t int8; + int16_t int16; + int32_t int32; + int64_t int64; + + BSERType type = decodeType(iss); + + switch (type) { + case BSER_INT8: + iss.read(reinterpret_cast(&int8), sizeof(int8)); + value = int8; + break; + case BSER_INT16: + iss.read(reinterpret_cast(&int16), sizeof(int16)); + value = int16; + break; + case BSER_INT32: + iss.read(reinterpret_cast(&int32), sizeof(int32)); + value = int32; + break; + case BSER_INT64: + iss.read(reinterpret_cast(&int64), sizeof(int64)); + value = int64; + break; + default: + throw std::runtime_error("Invalid BSER int type"); + } + } + + int64_t intValue() override { + return value; + } + + void encode(std::ostream &oss) override { + if (value <= INT8_MAX) { + encodeType(oss, BSER_INT8); + int8_t v = (int8_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else if (value <= INT16_MAX) { + encodeType(oss, BSER_INT16); + int16_t v = (int16_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else if (value <= INT32_MAX) { + encodeType(oss, BSER_INT32); + int32_t v = (int32_t)value; + oss.write(reinterpret_cast(&v), sizeof(v)); + } else { + encodeType(oss, BSER_INT64); + oss.write(reinterpret_cast(&value), sizeof(value)); + } + } +}; + +class BSERArray : public Value { +public: + BSERArray() : Value() {} + BSERArray(BSER::Array value) : Value(value) {} + BSERArray(std::istream &iss) { + expectType(iss, BSER_ARRAY); + int64_t len = BSERInteger(iss).intValue(); + for (int64_t i = 0; i < len; i++) { + value.push_back(BSER(iss)); + } + } + + BSER::Array arrayValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_ARRAY); + BSERInteger(value.size()).encode(oss); + for (auto it = value.begin(); it != value.end(); it++) { + it->encode(oss); + } + } +}; + +class BSERString : public Value { +public: + BSERString(std::string value) : Value(value) {} + BSERString(std::istream &iss) { + expectType(iss, BSER_STRING); + int64_t len = BSERInteger(iss).intValue(); + value.resize(len); + iss.read(&value[0], len); + } + + std::string stringValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_STRING); + BSERInteger(value.size()).encode(oss); + oss << value; + } +}; + +class BSERObject : public Value { +public: + BSERObject() : Value() {} + BSERObject(BSER::Object value) : Value(value) {} + BSERObject(std::istream &iss) { + expectType(iss, BSER_OBJECT); + int64_t len = BSERInteger(iss).intValue(); + for (int64_t i = 0; i < len; i++) { + auto key = BSERString(iss).stringValue(); + auto val = BSER(iss); + value.emplace(key, val); + } + } + + BSER::Object objectValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_OBJECT); + BSERInteger(value.size()).encode(oss); + for (auto it = value.begin(); it != value.end(); it++) { + BSERString(it->first).encode(oss); + it->second.encode(oss); + } + } +}; + +class BSERDouble : public Value { +public: + BSERDouble(double value) : Value(value) {} + BSERDouble(std::istream &iss) { + expectType(iss, BSER_REAL); + iss.read(reinterpret_cast(&value), sizeof(value)); + } + + double doubleValue() override { + return value; + } + + void encode(std::ostream &oss) override { + encodeType(oss, BSER_REAL); + oss.write(reinterpret_cast(&value), sizeof(value)); + } +}; + +class BSERBoolean : public Value { +public: + BSERBoolean(bool value) : Value(value) {} + bool boolValue() override { return value; } + void encode(std::ostream &oss) override { + int8_t t = value == true ? static_cast(BSER_BOOL_TRUE) : static_cast(BSER_BOOL_FALSE); + oss.write(reinterpret_cast(&t), sizeof(t)); + } +}; + +class BSERNull : public Value { +public: + BSERNull() : Value(false) {} + void encode(std::ostream &oss) override { + encodeType(oss, BSER_NULL); + } +}; + +std::shared_ptr decodeTemplate(std::istream &iss) { + expectType(iss, BSER_TEMPLATE); + auto keys = BSERArray(iss).arrayValue(); + auto len = BSERInteger(iss).intValue(); + std::shared_ptr arr = std::make_shared(); + for (int64_t i = 0; i < len; i++) { + BSER::Object obj; + for (auto it = keys.begin(); it != keys.end(); it++) { + if (iss.peek() == 0x0c) { + iss.ignore(1); + continue; + } + + auto val = BSER(iss); + obj.emplace(it->stringValue(), val); + } + arr->value.push_back(obj); + } + return arr; +} + +BSER::BSER(std::istream &iss) { + BSERType type = decodeType(iss); + iss.unget(); + + switch (type) { + case BSER_ARRAY: + m_ptr = std::make_shared(iss); + break; + case BSER_OBJECT: + m_ptr = std::make_shared(iss); + break; + case BSER_STRING: + m_ptr = std::make_shared(iss); + break; + case BSER_INT8: + case BSER_INT16: + case BSER_INT32: + case BSER_INT64: + m_ptr = std::make_shared(iss); + break; + case BSER_REAL: + m_ptr = std::make_shared(iss); + break; + case BSER_BOOL_TRUE: + iss.ignore(1); + m_ptr = std::make_shared(true); + break; + case BSER_BOOL_FALSE: + iss.ignore(1); + m_ptr = std::make_shared(false); + break; + case BSER_NULL: + iss.ignore(1); + m_ptr = std::make_shared(); + break; + case BSER_TEMPLATE: + m_ptr = decodeTemplate(iss); + break; + default: + throw std::runtime_error("unknown BSER type"); + } +} + +BSER::BSER() : m_ptr(std::make_shared()) {} +BSER::BSER(BSER::Array value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(BSER::Object value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(const char *value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(std::string value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(int64_t value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(double value) : m_ptr(std::make_shared(value)) {} +BSER::BSER(bool value) : m_ptr(std::make_shared(value)) {} + +BSER::Array BSER::arrayValue() { return m_ptr->arrayValue(); } +BSER::Object BSER::objectValue() { return m_ptr->objectValue(); } +std::string BSER::stringValue() { return m_ptr->stringValue(); } +int64_t BSER::intValue() { return m_ptr->intValue(); } +double BSER::doubleValue() { return m_ptr->doubleValue(); } +bool BSER::boolValue() { return m_ptr->boolValue(); } +void BSER::encode(std::ostream &oss) { + m_ptr->encode(oss); +} + +int64_t BSER::decodeLength(std::istream &iss) { + char pdu[2]; + if (!iss.read(pdu, 2) || pdu[0] != 0 || pdu[1] != 1) { + throw std::runtime_error("Invalid BSER"); + } + + return BSERInteger(iss).intValue(); +} + +std::string BSER::encode() { + std::ostringstream oss(std::ios_base::binary); + encode(oss); + + std::ostringstream res(std::ios_base::binary); + res.write("\x00\x01", 2); + + BSERInteger(oss.str().size()).encode(res); + res << oss.str(); + return res.str(); +} diff --git a/node_modules/@parcel/watcher/src/watchman/BSER.hh b/node_modules/@parcel/watcher/src/watchman/BSER.hh new file mode 100644 index 0000000..6bd2025 --- /dev/null +++ b/node_modules/@parcel/watcher/src/watchman/BSER.hh @@ -0,0 +1,69 @@ +#ifndef BSER_H +#define BSER_H + +#include +#include +#include +#include +#include + +enum BSERType { + BSER_ARRAY = 0x00, + BSER_OBJECT = 0x01, + BSER_STRING = 0x02, + BSER_INT8 = 0x03, + BSER_INT16 = 0x04, + BSER_INT32 = 0x05, + BSER_INT64 = 0x06, + BSER_REAL = 0x07, + BSER_BOOL_TRUE = 0x08, + BSER_BOOL_FALSE = 0x09, + BSER_NULL = 0x0a, + BSER_TEMPLATE = 0x0b +}; + +class BSERValue; + +class BSER { +public: + typedef std::vector Array; + typedef std::unordered_map Object; + + BSER(); + BSER(BSER::Array value); + BSER(BSER::Object value); + BSER(std::string value); + BSER(const char *value); + BSER(int64_t value); + BSER(double value); + BSER(bool value); + BSER(std::istream &iss); + + BSER::Array arrayValue(); + BSER::Object objectValue(); + std::string stringValue(); + int64_t intValue(); + double doubleValue(); + bool boolValue(); + void encode(std::ostream &oss); + + static int64_t decodeLength(std::istream &iss); + std::string encode(); +private: + std::shared_ptr m_ptr; +}; + +class BSERValue { +protected: + friend class BSER; + virtual BSER::Array arrayValue() { return BSER::Array(); } + virtual BSER::Object objectValue() { return BSER::Object(); } + virtual std::string stringValue() { return std::string(); } + virtual int64_t intValue() { return 0; } + virtual double doubleValue() { return 0; } + virtual bool boolValue() { return false; } + virtual void encode(std::ostream &oss) {} + virtual ~BSERValue() {} +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/watchman/IPC.hh b/node_modules/@parcel/watcher/src/watchman/IPC.hh new file mode 100644 index 0000000..94aa62f --- /dev/null +++ b/node_modules/@parcel/watcher/src/watchman/IPC.hh @@ -0,0 +1,175 @@ +#ifndef IPC_H +#define IPC_H + +#include +#include + +#ifdef _WIN32 +#include +#include +#else +#include +#include +#include +#endif + +class IPC { +public: + IPC(std::string path) { + mStopped = false; + #ifdef _WIN32 + while (true) { + mPipe = CreateFile( + path.data(), // pipe name + GENERIC_READ | GENERIC_WRITE, // read and write access + 0, // no sharing + NULL, // default security attributes + OPEN_EXISTING, // opens existing pipe + FILE_FLAG_OVERLAPPED, // attributes + NULL // no template file + ); + + if (mPipe != INVALID_HANDLE_VALUE) { + break; + } + + if (GetLastError() != ERROR_PIPE_BUSY) { + throw std::runtime_error("Could not open pipe"); + } + + // Wait for pipe to become available if it is busy + if (!WaitNamedPipe(path.data(), 30000)) { + throw std::runtime_error("Error waiting for pipe"); + } + } + + mReader = CreateEvent(NULL, true, false, NULL); + mWriter = CreateEvent(NULL, true, false, NULL); + #else + struct sockaddr_un addr; + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path) - 1); + + mSock = socket(AF_UNIX, SOCK_STREAM, 0); + if (connect(mSock, (struct sockaddr *) &addr, sizeof(struct sockaddr_un))) { + throw std::runtime_error("Error connecting to socket"); + } + #endif + } + + ~IPC() { + mStopped = true; + #ifdef _WIN32 + CancelIo(mPipe); + CloseHandle(mPipe); + CloseHandle(mReader); + CloseHandle(mWriter); + #else + shutdown(mSock, SHUT_RDWR); + #endif + } + + void write(std::string buf) { + #ifdef _WIN32 + OVERLAPPED overlapped; + overlapped.hEvent = mWriter; + bool success = WriteFile( + mPipe, // pipe handle + buf.data(), // message + static_cast(buf.size()), // message length + NULL, // bytes written + &overlapped // overlapped + ); + + if (mStopped) { + return; + } + + if (!success) { + if (GetLastError() != ERROR_IO_PENDING) { + throw std::runtime_error("Write error"); + } + } + + DWORD written; + success = GetOverlappedResult(mPipe, &overlapped, &written, true); + if (!success) { + throw std::runtime_error("GetOverlappedResult failed"); + } + + if (written != buf.size()) { + throw std::runtime_error("Wrong number of bytes written"); + } + #else + int r = 0; + for (unsigned int i = 0; i != buf.size(); i += r) { + r = ::write(mSock, &buf[i], buf.size() - i); + if (r == -1) { + if (errno == EAGAIN) { + r = 0; + } else if (mStopped) { + return; + } else { + throw std::runtime_error("Write error"); + } + } + } + #endif + } + + int read(char *buf, size_t len) { + #ifdef _WIN32 + OVERLAPPED overlapped; + overlapped.hEvent = mReader; + bool success = ReadFile( + mPipe, // pipe handle + buf, // buffer to receive reply + static_cast(len), // size of buffer + NULL, // number of bytes read + &overlapped // overlapped + ); + + if (!success && !mStopped) { + if (GetLastError() != ERROR_IO_PENDING) { + throw std::runtime_error("Read error"); + } + } + + DWORD read = 0; + success = GetOverlappedResult(mPipe, &overlapped, &read, true); + if (!success && !mStopped) { + throw std::runtime_error("GetOverlappedResult failed"); + } + + return read; + #else + int r = ::read(mSock, buf, len); + if (r == 0 && !mStopped) { + throw std::runtime_error("Socket ended unexpectedly"); + } + + if (r < 0) { + if (mStopped) { + return 0; + } + + throw std::runtime_error(strerror(errno)); + } + + return r; + #endif + } + +private: + bool mStopped; + #ifdef _WIN32 + HANDLE mPipe; + HANDLE mReader; + HANDLE mWriter; + #else + int mSock; + #endif +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.cc b/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.cc new file mode 100644 index 0000000..a442f16 --- /dev/null +++ b/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.cc @@ -0,0 +1,342 @@ +#include +#include +#include +#include +#include "../DirTree.hh" +#include "../Event.hh" +#include "./BSER.hh" +#include "./WatchmanBackend.hh" + +#ifdef _WIN32 +#include "../windows/win_utils.hh" +#define S_ISDIR(mode) ((mode & _S_IFDIR) == _S_IFDIR) +#define popen _popen +#define pclose _pclose +#else +#include +#define normalizePath(dir) dir +#endif + +template +BSER readBSER(T &&do_read) { + std::stringstream oss; + char buffer[256]; + size_t r; + int64_t len = -1; + do { + // Start by reading a minimal amount of data in order to decode the length. + // After that, attempt to read the remaining length, up to the buffer size. + r = do_read(buffer, len == -1 ? 20 : (len < 256 ? len : 256)); + oss << std::string(buffer, r); + + if (len == -1) { + uint64_t l = BSER::decodeLength(oss); + len = l + oss.tellg(); + } + + len -= r; + } while (len > 0); + + return BSER(oss); +} + +std::string getSockPath() { + auto var = getenv("WATCHMAN_SOCK"); + if (var && *var) { + return std::string(var); + } + +#ifdef _WIN32 + FILE *fp = popen("watchman --output-encoding=bser get-sockname", "r"); +#else + FILE *fp = popen("watchman --output-encoding=bser get-sockname 2>/dev/null", "r"); +#endif + if (fp == NULL || errno == ECHILD) { + throw std::runtime_error("Failed to execute watchman"); + } + + BSER b = readBSER([fp] (char *buf, size_t len) { + return fread(buf, sizeof(char), len, fp); + }); + + pclose(fp); + + auto objValue = b.objectValue(); + auto foundSockname = objValue.find("sockname"); + if (foundSockname == objValue.end()) { + throw std::runtime_error("sockname not found"); + } + return foundSockname->second.stringValue(); +} + +std::unique_ptr watchmanConnect() { + std::string path = getSockPath(); + return std::unique_ptr(new IPC(path)); +} + +BSER watchmanRead(IPC *ipc) { + return readBSER([ipc] (char *buf, size_t len) { + return ipc->read(buf, len); + }); +} + +BSER::Object WatchmanBackend::watchmanRequest(BSER b) { + std::string cmd = b.encode(); + mIPC->write(cmd); + mRequestSignal.notify(); + + mResponseSignal.wait(); + mResponseSignal.reset(); + + if (!mError.empty()) { + std::runtime_error err = std::runtime_error(mError); + mError = std::string(); + throw err; + } + + return mResponse; +} + +void WatchmanBackend::watchmanWatch(std::string dir) { + std::vector cmd; + cmd.push_back("watch"); + cmd.push_back(normalizePath(dir)); + watchmanRequest(cmd); +} + +bool WatchmanBackend::checkAvailable() { + try { + watchmanConnect(); + return true; + } catch (std::exception&) { + return false; + } +} + +void handleFiles(WatcherRef watcher, BSER::Object obj) { + auto found = obj.find("files"); + if (found == obj.end()) { + throw WatcherError("Error reading changes from watchman", watcher); + } + + auto files = found->second.arrayValue(); + for (auto it = files.begin(); it != files.end(); it++) { + auto file = it->objectValue(); + auto name = file.find("name")->second.stringValue(); + #ifdef _WIN32 + std::replace(name.begin(), name.end(), '/', '\\'); + #endif + auto mode = file.find("mode")->second.intValue(); + auto isNew = file.find("new")->second.boolValue(); + auto exists = file.find("exists")->second.boolValue(); + auto path = watcher->mDir + DIR_SEP + name; + if (watcher->isIgnored(path)) { + continue; + } + + if (isNew && exists) { + watcher->mEvents.create(path); + } else if (exists && !S_ISDIR(mode)) { + watcher->mEvents.update(path); + } else if (!isNew && !exists) { + watcher->mEvents.remove(path); + } + } +} + +void WatchmanBackend::handleSubscription(BSER::Object obj) { + std::unique_lock lock(mMutex); + auto subscription = obj.find("subscription")->second.stringValue(); + auto it = mSubscriptions.find(subscription); + if (it == mSubscriptions.end()) { + return; + } + + auto watcher = it->second; + try { + handleFiles(watcher, obj); + watcher->notify(); + } catch (WatcherError &err) { + handleWatcherError(err); + } +} + +void WatchmanBackend::start() { + mIPC = watchmanConnect(); + notifyStarted(); + + while (true) { + // If there are no subscriptions we are reading, wait for a request. + if (mSubscriptions.size() == 0) { + mRequestSignal.wait(); + mRequestSignal.reset(); + } + + // Break out of loop if we are stopped. + if (mStopped) { + break; + } + + // Attempt to read from the socket. + // If there is an error and we are stopped, break. + BSER b; + try { + b = watchmanRead(&*mIPC); + } catch (std::exception &err) { + if (mStopped) { + break; + } else if (mResponseSignal.isWaiting()) { + mError = err.what(); + mResponseSignal.notify(); + } else { + // Throwing causes the backend to be destroyed, but we never reach the code below to notify the signal + mEndedSignal.notify(); + throw; + } + } + + auto obj = b.objectValue(); + auto error = obj.find("error"); + if (error != obj.end()) { + mError = error->second.stringValue(); + mResponseSignal.notify(); + continue; + } + + // If this message is for a subscription, handle it, otherwise notify the request. + auto subscription = obj.find("subscription"); + if (subscription != obj.end()) { + handleSubscription(obj); + } else { + mResponse = obj; + mResponseSignal.notify(); + } + } + + mEndedSignal.notify(); +} + +WatchmanBackend::~WatchmanBackend() { + // Mark the watcher as stopped, close the socket, and trigger the lock. + // This will cause the read loop to be broken and the thread to exit. + mStopped = true; + mIPC.reset(); + mRequestSignal.notify(); + + // If not ended yet, wait. + mEndedSignal.wait(); +} + +std::string WatchmanBackend::clock(WatcherRef watcher) { + BSER::Array cmd; + cmd.push_back("clock"); + cmd.push_back(normalizePath(watcher->mDir)); + + BSER::Object obj = watchmanRequest(cmd); + auto found = obj.find("clock"); + if (found == obj.end()) { + throw WatcherError("Error reading clock from watchman", watcher); + } + + return found->second.stringValue(); +} + +void WatchmanBackend::writeSnapshot(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + watchmanWatch(watcher->mDir); + + std::ofstream ofs(*snapshotPath); + ofs << clock(watcher); +} + +void WatchmanBackend::getEventsSince(WatcherRef watcher, std::string *snapshotPath) { + std::unique_lock lock(mMutex); + std::ifstream ifs(*snapshotPath); + if (ifs.fail()) { + return; + } + + watchmanWatch(watcher->mDir); + + std::string clock; + ifs >> clock; + + BSER::Array cmd; + cmd.push_back("since"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(clock); + + BSER::Object obj = watchmanRequest(cmd); + handleFiles(watcher, obj); +} + +std::string getId(WatcherRef watcher) { + std::ostringstream id; + id << "parcel-"; + id << static_cast(watcher.get()); + return id.str(); +} + +// This function is called by Backend::watch which takes a lock on mMutex +void WatchmanBackend::subscribe(WatcherRef watcher) { + watchmanWatch(watcher->mDir); + + std::string id = getId(watcher); + BSER::Array cmd; + cmd.push_back("subscribe"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(id); + + BSER::Array fields; + fields.push_back("name"); + fields.push_back("mode"); + fields.push_back("exists"); + fields.push_back("new"); + + BSER::Object opts; + opts.emplace("fields", fields); + opts.emplace("since", clock(watcher)); + + if (watcher->mIgnorePaths.size() > 0) { + BSER::Array ignore; + BSER::Array anyOf; + anyOf.push_back("anyof"); + + for (auto it = watcher->mIgnorePaths.begin(); it != watcher->mIgnorePaths.end(); it++) { + std::string pathStart = watcher->mDir + DIR_SEP; + if (it->rfind(pathStart, 0) == 0) { + auto relative = it->substr(pathStart.size()); + BSER::Array dirname; + dirname.push_back("dirname"); + dirname.push_back(relative); + anyOf.push_back(dirname); + } + } + + ignore.push_back("not"); + ignore.push_back(anyOf); + + opts.emplace("expression", ignore); + } + + cmd.push_back(opts); + watchmanRequest(cmd); + + mSubscriptions.emplace(id, watcher); + mRequestSignal.notify(); +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void WatchmanBackend::unsubscribe(WatcherRef watcher) { + std::string id = getId(watcher); + auto erased = mSubscriptions.erase(id); + + if (erased) { + BSER::Array cmd; + cmd.push_back("unsubscribe"); + cmd.push_back(normalizePath(watcher->mDir)); + cmd.push_back(id); + + watchmanRequest(cmd); + } +} diff --git a/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.hh b/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.hh new file mode 100644 index 0000000..699cded --- /dev/null +++ b/node_modules/@parcel/watcher/src/watchman/WatchmanBackend.hh @@ -0,0 +1,35 @@ +#ifndef WATCHMAN_H +#define WATCHMAN_H + +#include "../Backend.hh" +#include "./BSER.hh" +#include "../Signal.hh" +#include "./IPC.hh" + +class WatchmanBackend : public Backend { +public: + static bool checkAvailable(); + void start() override; + WatchmanBackend() : mStopped(false) {}; + ~WatchmanBackend(); + void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) override; + void getEventsSince(WatcherRef watcher, std::string *snapshotPath) override; + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + std::unique_ptr mIPC; + Signal mRequestSignal; + Signal mResponseSignal; + BSER::Object mResponse; + std::string mError; + std::unordered_map mSubscriptions; + bool mStopped; + Signal mEndedSignal; + + std::string clock(WatcherRef watcher); + void watchmanWatch(std::string dir); + BSER::Object watchmanRequest(BSER cmd); + void handleSubscription(BSER::Object obj); +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/windows/WindowsBackend.cc b/node_modules/@parcel/watcher/src/windows/WindowsBackend.cc new file mode 100644 index 0000000..eabce1e --- /dev/null +++ b/node_modules/@parcel/watcher/src/windows/WindowsBackend.cc @@ -0,0 +1,282 @@ +#include +#include +#include "../DirTree.hh" +#include "../shared/BruteForceBackend.hh" +#include "./WindowsBackend.hh" +#include "./win_utils.hh" + +#define DEFAULT_BUF_SIZE 1024 * 1024 +#define NETWORK_BUF_SIZE 64 * 1024 +#define CONVERT_TIME(ft) ULARGE_INTEGER{ft.dwLowDateTime, ft.dwHighDateTime}.QuadPart + +void BruteForceBackend::readTree(WatcherRef watcher, std::shared_ptr tree) { + std::stack directories; + + directories.push(watcher->mDir); + + while (!directories.empty()) { + HANDLE hFind = INVALID_HANDLE_VALUE; + + std::string path = directories.top(); + std::string spec = path + "\\*"; + directories.pop(); + + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(spec.c_str(), &ffd); + + if (hFind == INVALID_HANDLE_VALUE) { + if (path == watcher->mDir) { + FindClose(hFind); + throw WatcherError("Error opening directory", watcher); + } + + tree->remove(path); + continue; + } + + do { + if (strcmp(ffd.cFileName, ".") != 0 && strcmp(ffd.cFileName, "..") != 0) { + std::string fullPath = path + "\\" + ffd.cFileName; + if (watcher->isIgnored(fullPath)) { + continue; + } + + tree->add(fullPath, CONVERT_TIME(ffd.ftLastWriteTime), ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + directories.push(fullPath); + } + } + } while (FindNextFile(hFind, &ffd) != 0); + + FindClose(hFind); + } +} + +void WindowsBackend::start() { + mRunning = true; + notifyStarted(); + + while (mRunning) { + SleepEx(INFINITE, true); + } +} + +WindowsBackend::~WindowsBackend() { + // Mark as stopped, and queue a noop function in the thread to break the loop + mRunning = false; + QueueUserAPC([](__in ULONG_PTR) {}, mThread.native_handle(), (ULONG_PTR)this); +} + +class Subscription: public WatcherState { +public: + Subscription(WindowsBackend *backend, WatcherRef watcher, std::shared_ptr tree) { + mRunning = true; + mBackend = backend; + mWatcher = watcher; + mTree = tree; + ZeroMemory(&mOverlapped, sizeof(OVERLAPPED)); + mOverlapped.hEvent = this; + mReadBuffer.resize(DEFAULT_BUF_SIZE); + mWriteBuffer.resize(DEFAULT_BUF_SIZE); + + mDirectoryHandle = CreateFileW( + utf8ToUtf16(watcher->mDir).data(), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL + ); + + if (mDirectoryHandle == INVALID_HANDLE_VALUE) { + throw WatcherError("Invalid handle", mWatcher); + } + + // Ensure that the path is a directory + BY_HANDLE_FILE_INFORMATION info; + bool success = GetFileInformationByHandle( + mDirectoryHandle, + &info + ); + + if (!success) { + throw WatcherError("Could not get file information", mWatcher); + } + + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + throw WatcherError("Not a directory", mWatcher); + } + } + + virtual ~Subscription() { + stop(); + } + + void run() { + try { + poll(); + } catch (WatcherError &err) { + mBackend->handleWatcherError(err); + } + } + + void stop() { + if (mRunning) { + mRunning = false; + CancelIo(mDirectoryHandle); + CloseHandle(mDirectoryHandle); + } + } + + void poll() { + if (!mRunning) { + return; + } + + // Asynchronously wait for changes. + int success = ReadDirectoryChangesW( + mDirectoryHandle, + mWriteBuffer.data(), + static_cast(mWriteBuffer.size()), + TRUE, // recursive + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES + | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_LAST_WRITE, + NULL, + &mOverlapped, + [](DWORD errorCode, DWORD numBytes, LPOVERLAPPED overlapped) { + auto subscription = reinterpret_cast(overlapped->hEvent); + try { + subscription->processEvents(errorCode); + } catch (WatcherError &err) { + subscription->mBackend->handleWatcherError(err); + } + } + ); + + if (!success) { + throw WatcherError("Failed to read changes", mWatcher); + } + } + + void processEvents(DWORD errorCode) { + if (!mRunning) { + return; + } + + switch (errorCode) { + case ERROR_OPERATION_ABORTED: + return; + case ERROR_INVALID_PARAMETER: + // resize buffers to network size (64kb), and try again + mReadBuffer.resize(NETWORK_BUF_SIZE); + mWriteBuffer.resize(NETWORK_BUF_SIZE); + poll(); + return; + case ERROR_NOTIFY_ENUM_DIR: + throw WatcherError("Buffer overflow. Some events may have been lost.", mWatcher); + case ERROR_ACCESS_DENIED: { + // This can happen if the watched directory is deleted. Check if that is the case, + // and if so emit a delete event. Otherwise, fall through to default error case. + DWORD attrs = GetFileAttributesW(utf8ToUtf16(mWatcher->mDir).data()); + bool isDir = attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY); + if (!isDir) { + mWatcher->mEvents.remove(mWatcher->mDir); + mTree->remove(mWatcher->mDir); + mWatcher->notify(); + stop(); + return; + } + } + default: + if (errorCode != ERROR_SUCCESS) { + throw WatcherError("Unknown error", mWatcher); + } + } + + // Swap read and write buffers, and poll again + std::swap(mWriteBuffer, mReadBuffer); + poll(); + + // Read change events + BYTE *base = mReadBuffer.data(); + while (true) { + PFILE_NOTIFY_INFORMATION info = (PFILE_NOTIFY_INFORMATION)base; + processEvent(info); + + if (info->NextEntryOffset == 0) { + break; + } + + base += info->NextEntryOffset; + } + + mWatcher->notify(); + } + + void processEvent(PFILE_NOTIFY_INFORMATION info) { + std::string path = mWatcher->mDir + "\\" + utf16ToUtf8(info->FileName, info->FileNameLength / sizeof(WCHAR)); + if (mWatcher->isIgnored(path)) { + return; + } + + switch (info->Action) { + case FILE_ACTION_ADDED: + case FILE_ACTION_RENAMED_NEW_NAME: { + WIN32_FILE_ATTRIBUTE_DATA data; + if (GetFileAttributesExW(utf8ToUtf16(path).data(), GetFileExInfoStandard, &data)) { + mWatcher->mEvents.create(path); + mTree->add(path, CONVERT_TIME(data.ftLastWriteTime), data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + } + break; + } + case FILE_ACTION_MODIFIED: { + WIN32_FILE_ATTRIBUTE_DATA data; + if (GetFileAttributesExW(utf8ToUtf16(path).data(), GetFileExInfoStandard, &data)) { + mTree->update(path, CONVERT_TIME(data.ftLastWriteTime)); + if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + mWatcher->mEvents.update(path); + } + } + break; + } + case FILE_ACTION_REMOVED: + case FILE_ACTION_RENAMED_OLD_NAME: + mWatcher->mEvents.remove(path); + mTree->remove(path); + break; + } + } + +private: + WindowsBackend *mBackend; + std::shared_ptr mWatcher; + std::shared_ptr mTree; + bool mRunning; + HANDLE mDirectoryHandle; + std::vector mReadBuffer; + std::vector mWriteBuffer; + OVERLAPPED mOverlapped; +}; + +// This function is called by Backend::watch which takes a lock on mMutex +void WindowsBackend::subscribe(WatcherRef watcher) { + // Create a subscription for this watcher + auto sub = std::make_shared(this, watcher, getTree(watcher, false)); + watcher->state = sub; + + // Queue polling for this subscription in the correct thread. + bool success = QueueUserAPC([](__in ULONG_PTR ptr) { + Subscription *sub = (Subscription *)ptr; + sub->run(); + }, mThread.native_handle(), (ULONG_PTR)sub.get()); + + if (!success) { + throw std::runtime_error("Unable to queue APC"); + } +} + +// This function is called by Backend::unwatch which takes a lock on mMutex +void WindowsBackend::unsubscribe(WatcherRef watcher) { + watcher->state = nullptr; +} diff --git a/node_modules/@parcel/watcher/src/windows/WindowsBackend.hh b/node_modules/@parcel/watcher/src/windows/WindowsBackend.hh new file mode 100644 index 0000000..d679782 --- /dev/null +++ b/node_modules/@parcel/watcher/src/windows/WindowsBackend.hh @@ -0,0 +1,18 @@ +#ifndef WINDOWS_H +#define WINDOWS_H + +#include +#include +#include "../shared/BruteForceBackend.hh" + +class WindowsBackend : public BruteForceBackend { +public: + void start() override; + ~WindowsBackend(); + void subscribe(WatcherRef watcher) override; + void unsubscribe(WatcherRef watcher) override; +private: + bool mRunning; +}; + +#endif diff --git a/node_modules/@parcel/watcher/src/windows/win_utils.cc b/node_modules/@parcel/watcher/src/windows/win_utils.cc new file mode 100644 index 0000000..62a1e59 --- /dev/null +++ b/node_modules/@parcel/watcher/src/windows/win_utils.cc @@ -0,0 +1,44 @@ +#include "./win_utils.hh" + +std::wstring utf8ToUtf16(std::string input) { + unsigned int len = MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, NULL, 0); + WCHAR *output = new WCHAR[len]; + MultiByteToWideChar(CP_UTF8, 0, input.c_str(), -1, output, len); + std::wstring res(output); + delete[] output; + return res; +} + +std::string utf16ToUtf8(const WCHAR *input, DWORD length) { + unsigned int len = WideCharToMultiByte(CP_UTF8, 0, input, length, NULL, 0, NULL, NULL); + char *output = new char[len + 1]; + WideCharToMultiByte(CP_UTF8, 0, input, length, output, len, NULL, NULL); + output[len] = '\0'; + std::string res(output); + delete[] output; + return res; +} + +std::string normalizePath(std::string path) { + // Prevent truncation to MAX_PATH characters by adding the \\?\ prefix + std::wstring p = utf8ToUtf16("\\\\?\\" + path); + + // Get the required length for the output + DWORD len = GetLongPathNameW(p.data(), NULL, 0); + if (!len) { + return path; + } + + // Allocate output array and get long path + WCHAR *output = new WCHAR[len]; + len = GetLongPathNameW(p.data(), output, len); + if (!len) { + delete[] output; + return path; + } + + // Convert back to utf8 + std::string res = utf16ToUtf8(output + 4, len - 4); + delete[] output; + return res; +} diff --git a/node_modules/@parcel/watcher/src/windows/win_utils.hh b/node_modules/@parcel/watcher/src/windows/win_utils.hh new file mode 100644 index 0000000..9178d1b --- /dev/null +++ b/node_modules/@parcel/watcher/src/windows/win_utils.hh @@ -0,0 +1,11 @@ +#ifndef WIN_UTILS_H +#define WIN_UTILS_H + +#include +#include + +std::wstring utf8ToUtf16(std::string input); +std::string utf16ToUtf8(const WCHAR *input, DWORD length); +std::string normalizePath(std::string path); + +#endif diff --git a/node_modules/@parcel/watcher/wrapper.js b/node_modules/@parcel/watcher/wrapper.js new file mode 100644 index 0000000..3b47518 --- /dev/null +++ b/node_modules/@parcel/watcher/wrapper.js @@ -0,0 +1,74 @@ +const path = require('path'); +const picomatch = require('picomatch'); +const isGlob = require('is-glob'); + +function normalizeOptions(dir, opts = {}) { + const { ignore, ...rest } = opts; + + if (Array.isArray(ignore)) { + opts = { ...rest }; + + for (const value of ignore) { + if (isGlob(value)) { + if (!opts.ignoreGlobs) { + opts.ignoreGlobs = []; + } + + const regex = picomatch.makeRe(value, { + // We set `dot: true` to workaround an issue with the + // regular expression on Linux where the resulting + // negative lookahead `(?!(\\/|^)` was never matching + // in some cases. See also https://bit.ly/3UZlQDm + dot: true, + windows: process.platform === 'win32', + }); + opts.ignoreGlobs.push(regex.source); + } else { + if (!opts.ignorePaths) { + opts.ignorePaths = []; + } + + opts.ignorePaths.push(path.resolve(dir, value)); + } + } + } + + return opts; +} + +exports.createWrapper = (binding) => { + return { + writeSnapshot(dir, snapshot, opts) { + return binding.writeSnapshot( + path.resolve(dir), + path.resolve(snapshot), + normalizeOptions(dir, opts), + ); + }, + getEventsSince(dir, snapshot, opts) { + return binding.getEventsSince( + path.resolve(dir), + path.resolve(snapshot), + normalizeOptions(dir, opts), + ); + }, + async subscribe(dir, fn, opts) { + dir = path.resolve(dir); + opts = normalizeOptions(dir, opts); + await binding.subscribe(dir, fn, opts); + + return { + unsubscribe() { + return binding.unsubscribe(dir, fn, opts); + }, + }; + }, + unsubscribe(dir, fn, opts) { + return binding.unsubscribe( + path.resolve(dir), + fn, + normalizeOptions(dir, opts), + ); + } + }; +}; diff --git a/node_modules/@tailwindcss/cli/LICENSE b/node_modules/@tailwindcss/cli/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/@tailwindcss/cli/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/cli/README.md b/node_modules/@tailwindcss/cli/README.md new file mode 100644 index 0000000..7d21bd8 --- /dev/null +++ b/node_modules/@tailwindcss/cli/README.md @@ -0,0 +1,36 @@ +

+ + + + + Tailwind CSS + + +

+ +

+ A utility-first CSS framework for rapidly building custom user interfaces. +

+ +

+ Build Status + Total Downloads + Latest Release + License +

+ +--- + +## Documentation + +For full documentation, visit [tailwindcss.com](https://tailwindcss.com). + +## Community + +For help, discussion about best practices, or feature ideas: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +## Contributing + +If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**. diff --git a/node_modules/@tailwindcss/cli/dist/index.mjs b/node_modules/@tailwindcss/cli/dist/index.mjs new file mode 100755 index 0000000..b7c84d2 --- /dev/null +++ b/node_modules/@tailwindcss/cli/dist/index.mjs @@ -0,0 +1,9 @@ +#!/usr/bin/env node +var le=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ae=e=>{throw TypeError(e)};var G=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&ae("Object expected");var r,o;i&&(r=t[le("asyncDispose")]),r===void 0&&(r=t[le("dispose")],i&&(o=r)),typeof r!="function"&&ae("Object not disposable"),o&&(r=function(){try{o.call(this)}catch(n){return Promise.reject(n)}}),e.push([i,r,t])}else i&&e.push([i]);return t},J=(e,t,i)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(u,s,l,p){return p=Error(l),p.name="SuppressedError",p.error=u,p.suppressed=s,p},o=u=>t=i?new r(u,t,"An error was suppressed during disposal"):(i=!0,u),n=u=>{for(;u=e.pop();)try{var s=u[1]&&u[1].call(u[2]);if(u[0])return Promise.resolve(s).then(n,l=>(o(l),n()))}catch(l){o(l)}if(i)throw t};return n()};import ke from"mri";function pe(e,t=process.argv.slice(2)){for(let[o,n]of t.entries())n==="-"&&(t[o]="__IO_DEFAULT_VALUE__");let i=ke(t);for(let o in i){let n=i[o];o!=="_"&&Array.isArray(n)&&(n=n[n.length-1]),n==="__IO_DEFAULT_VALUE__"&&(n="-"),i[o]=n}let r={_:i._};for(let[o,{type:n,alias:u,default:s=n==="boolean"?!1:null}]of Object.entries(e)){if(r[o]=s,u){let l=u.slice(1);i[l]!==void 0&&(r[o]=ue(i[l],n))}{let l=o.slice(2);i[l]!==void 0&&(r[o]=ue(i[l],n))}}return r}function ue(e,t){switch(t){case"string":return D(e);case"boolean":return O(e);case"number":return R(e);case"boolean | string":return O(e)??D(e);case"number | string":return R(e)??D(e);case"boolean | number":return O(e)??R(e);case"boolean | number | string":return O(e)??R(e)??D(e);default:throw new Error(`Unhandled type: ${t}`)}}function O(e){if(e===!0||e===!1)return e;if(e==="true")return!0;if(e==="false")return!1}function R(e){if(typeof e=="number")return e;{let t=Number(e);if(!Number.isNaN(t))return t}}function D(e){return`${e}`}import We from"@parcel/watcher";import{compile as Ee,env as Ue,Instrumentation as he,optimize as Pe,toSourceMap as P}from"@tailwindcss/node";import{clearRequireCache as Ie}from"@tailwindcss/node/require-cache";import{Scanner as Le}from"@tailwindcss/oxide";import{existsSync as je}from"fs";import Z from"fs/promises";import C from"path";var A=class{#e=new Set([]);queueMacrotask(t){let i=setTimeout(t,0);return this.add(()=>{clearTimeout(i)})}add(t){return this.#e.add(t),()=>{this.#e.delete(t),t()}}async dispose(){for(let t of this.#e)await t();this.#e.clear()}};import Re from"fs";import me from"path";import{stripVTControlCharacters as De}from"util";import w from"picocolors";import ce from"enhanced-resolve";import Me from"fs";import{createRequire as Be}from"module";var Oe=Be(import.meta.url).resolve;function fe(e){if(typeof globalThis.__tw_resolve=="function"){let t=globalThis.__tw_resolve(e);if(t)return t}return Oe(e)}var Xe=ce.ResolverFactory.createResolver({fileSystem:new ce.CachedInputFileSystem(Me,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function de(e){let t=typeof e=="number"?BigInt(e):e;return t<1000n?`${t}ns`:(t/=1000n,t<1000n?`${t}\xB5s`:(t/=1000n,t<1000n?`${t}ms`:(t/=1000n,t<60n?`${t}s`:(t/=60n,t<60n?`${t}m`:(t/=60n,t<24n?`${t}h`:(t/=24n,`${t}d`))))))}var z={indent:2};function N(){return`${w.italic(w.bold(w.blue("\u2248")))} tailwindcss ${w.blue(`v${ze()}`)}`}function F(e){return`${w.dim(w.blue("`"))}${w.blue(e)}${w.dim(w.blue("`"))}`}function W(e,t=process.cwd(),{preferAbsoluteIfShorter:i=!0}={}){let r=me.relative(t,e);return r.startsWith("..")||(r=`.${me.sep}${r}`),i&&r.length>e.length?e:r}function Q(e,t){let i=e.split(" "),r=[],o="",n=0;for(let u of i){let s=De(u).length;n+s+1>t&&(r.push(o),o="",n=0),o+=(n?" ":"")+u,n+=s+(n?1:0)}return n&&r.push(o),r}function E(e){let t=de(e);return e<=50*1e6?w.green(t):e<=300*1e6?w.blue(t):e<=1e3*1e6?w.yellow(t):w.red(t)}function k(e,t=0){return`${" ".repeat(t+z.indent)}${e}`}function x(e=""){process.stderr.write(`${e} +`)}function h(e=""){process.stdout.write(`${e} +`)}function ze(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:e}=JSON.parse(Re.readFileSync(fe("tailwindcss/package.json"),"utf-8"));return e}import U from"fs/promises";import Ne from"path";function Y(){return new Promise((e,t)=>{let i="";process.stdin.on("data",r=>{i+=r}),process.stdin.on("end",()=>e(i)),process.stdin.on("error",r=>t(r))})}async function H(e,t){if(!await U.stat(e).then(r=>r.isCharacterDevice()||r.isFIFO()).catch(()=>!1))try{if(await U.readFile(e,"utf8")===t)return}catch{}await U.mkdir(Ne.dirname(e),{recursive:!0}),await U.writeFile(e,t,"utf8")}var ye=String.raw,a=Ue.DEBUG;function I(){return{"--input":{type:"string",description:"Input file",alias:"-i"},"--output":{type:"string",description:"Output file",alias:"-o",default:"-"},"--watch":{type:"boolean | string",description:"Watch for changes and rebuild as needed, and use `always` to keep watching when stdin is closed",alias:"-w",values:["always"]},"--minify":{type:"boolean",description:"Optimize and minify the output",alias:"-m"},"--optimize":{type:"boolean",description:"Optimize the output without minifying"},"--cwd":{type:"string",description:"The current working directory",default:"."},"--map":{type:"boolean | string",description:"Generate a source map",default:!1}}}async function X(e){try{return await e()}catch(t){t instanceof Error&&x(t.toString()),process.exit(1)}}async function ge(e){var ie=[];try{x(N());x();let t=G(ie,new he);a&&t.start("[@tailwindcss/cli] (initial build)");let i=C.resolve(e["--cwd"]);e["--output"]&&e["--output"]!=="-"&&(e["--output"]=C.resolve(i,e["--output"]));e["--input"]&&e["--input"]!=="-"&&(e["--input"]=C.resolve(i,e["--input"]),je(e["--input"])||(x(`Specified input file ${F(W(e["--input"]))} does not exist.`),process.exit(1)));e["--input"]===e["--output"]&&e["--input"]!=="-"&&(x(`Specified input file ${F(W(e["--input"]))} and output file ${F(W(e["--output"]))} are identical.`),process.exit(1));e["--map"]==="-"&&(x("Use --map without a value to inline the source map"),process.exit(1));e["--map"]&&e["--map"]!==!0&&(e["--map"]=C.resolve(i,e["--map"]));let r=process.hrtime.bigint();let o=e["--input"]?e["--input"]==="-"?await Y():await Z.readFile(e["--input"],"utf-8"):ye` + @import 'tailwindcss'; + `;let n={css:"",optimizedCss:""};async function u(g,b,f,S){let $=g;if(f["--minify"]||f["--optimize"])if(g!==n.css){a&&S.start("Optimize CSS");let T=Pe(g,{file:f["--input"]??"input.css",minify:f["--minify"]??!1,map:b?.raw??void 0});a&&S.end("Optimize CSS"),n.css=g,n.optimizedCss=T.code,T.map&&(b=P(T.map)),$=T.code}else $=n.optimizedCss;b&&(f["--map"]===!0?($+=` +`,$+=b.inline):typeof f["--map"]=="string"&&(a&&S.start("Write source map"),await H(f["--map"],b.raw),a&&S.end("Write source map"))),a&&S.start("Write output"),f["--output"]&&f["--output"]!=="-"?await H(f["--output"],$):h($),a&&S.end("Write output")}let s=e["--input"]&&e["--input"]!=="-"?C.resolve(e["--input"]):null;let l=s?C.dirname(s):process.cwd();let p=s?[s]:[];async function m(g,b){a&&b.start("Setup compiler");let f=await Ee(g,{from:e["--output"]?s??"stdin.css":void 0,base:l,onDependency(T){p.push(T)}}),S=(f.root==="none"?[]:f.root===null?[{base:i,pattern:"**/*",negated:!1}]:[{...f.root,negated:!1}]).concat(f.sources),$=new Le({sources:S});return a&&b.end("Setup compiler"),[f,$]}let[d,y]=await X(()=>m(o,t));if(e["--watch"]){let g=[];g.push(await we(be(y),async function b(f){try{var S=[];try{if(f.length===1&&f[0]===e["--output"])return;let c=G(S,new he);a&&c.start("[@tailwindcss/cli] (watcher)");let re=process.hrtime.bigint();let oe=[];let j="incremental";let se=p;for(let _ of f){if(se.includes(_)){j="full";break}oe.push({file:_,extension:C.extname(_).slice(1)})}let V="";let q=null;if(j==="full"){let _=e["--input"]?e["--input"]==="-"?await Y():await Z.readFile(e["--input"],"utf-8"):ye` + @import 'tailwindcss'; + `;Ie(se),p=s?[s]:[],[d,y]=await m(_,c),a&&c.start("Scan for candidates");let K=y.scan();a&&c.end("Scan for candidates"),a&&c.start("Setup new watchers");let Fe=await we(be(y),b);a&&c.end("Setup new watchers"),a&&c.start("Cleanup old watchers"),await Promise.all(g.splice(0).map(Ae=>Ae())),a&&c.end("Cleanup old watchers"),g.push(Fe),a&&c.start("Build CSS"),V=d.build(K),a&&c.end("Build CSS"),e["--map"]&&(a&&c.start("Build Source Map"),q=P(d.buildSourceMap()),a&&c.end("Build Source Map"))}else if(j==="incremental"){a&&c.start("Scan for candidates");let _=y.scanFiles(oe);if(a&&c.end("Scan for candidates"),_.length<=0){let K=process.hrtime.bigint();x(`Done in ${E(K-re)}`);return}a&&c.start("Build CSS"),V=d.build(_),a&&c.end("Build CSS"),e["--map"]&&(a&&c.start("Build Source Map"),q=P(d.buildSourceMap()),a&&c.end("Build Source Map"))}await u(V,q,e,c);let Ce=process.hrtime.bigint();x(`Done in ${E(Ce-re)}`)}catch($){var T=$,ve=!0}finally{J(S,T,ve)}}catch(c){c instanceof Error&&x(c.toString())}})),e["--watch"]!=="always"&&process.stdin.on("end",()=>{Promise.all(g.map(b=>b())).then(()=>process.exit(0),()=>process.exit(1))}),process.stdin.resume()}a&&t.start("Scan for candidates");let L=y.scan();a&&t.end("Scan for candidates");a&&t.start("Build CSS");let M=await X(()=>d.build(L));a&&t.end("Build CSS");let B=null;e["--map"]&&(a&&t.start("Build Source Map"),B=await X(()=>P(d.buildSourceMap())),a&&t.end("Build Source Map"));await u(M,B,e,t);let xe=process.hrtime.bigint();x(`Done in ${E(xe-r)}`)}catch($e){var Te=$e,_e=!0}finally{J(ie,Te,_e)}}async function we(e,t){e=e.sort((s,l)=>s.length-l.length);let i=[];for(let s=0;s!i.includes(s));let r=new A,o=new Set,n=new A;async function u(){await n.dispose(),n.queueMacrotask(()=>{t(Array.from(o)),o.clear()})}for(let s of e){let{unsubscribe:l}=await We.subscribe(s,async(p,m)=>{if(p){console.error(p);return}await Promise.all(m.map(async d=>{if(d.type==="delete")return;let y=null;try{y=await Z.lstat(d.path)}catch{}!y?.isFile()&&!y?.isSymbolicLink()||o.add(d.path)})),await u()});r.add(l)}return async()=>{await r.dispose(),await n.dispose()}}function be(e){return[...new Set(e.normalizedSources.flatMap(t=>t.base))]}import v from"picocolors";function ee({invalid:e,usage:t,options:i}){let r=process.stdout.columns;if(h(N()),e&&(h(),h(`${v.dim("Invalid command:")} ${e}`)),t&&t.length>0){h(),h(v.dim("Usage:"));for(let[o,n]of t.entries()){let u=n.slice(0,n.indexOf("[")),s=n.slice(n.indexOf("["));s=s.replace(/\[.*?\]/g,m=>v.dim(m));let p=Q(s,r-z.indent-u.length-1);p.length>1&&o!==0&&h(),h(k(`${u}${p.shift()}`));for(let m of p)h(k(m,u.length))}}if(i){let o=0;for(let{alias:l}of Object.values(i))l&&(o=Math.max(o,l.length));let n=[],u=0;for(let[l,{alias:p,values:m}]of Object.entries(i)){m?.length&&(l+=`[=${m.join(", ")}]`);let d=[p&&`${p.padStart(o)}`,p?l:" ".repeat(o+2)+l].filter(Boolean).join(", ");n.push(d),u=Math.max(u,d.length)}h(),h(v.dim("Options:"));let s=8;for(let{description:l,default:p=null}of Object.values(i)){let m=n.shift(),d=s+(u-m.length),y=2,L=r-m.length-d-y-z.indent,M=Q(p!==null?`${l} ${v.dim(`[default:\u202F${F(`${p}`)}]`)}`:l,L);h(k(`${v.blue(m)} ${v.dim(v.gray("\xB7")).repeat(d)} ${M.shift()}`));for(let B of M)h(k(`${" ".repeat(m.length+d+y)}${B}`))}}}var te={"--help":{type:"boolean",description:"Display usage information",alias:"-h"}},ne=pe({...I(),...te}),Se=ne._[0];Se&&(ee({invalid:Se,usage:["tailwindcss [options]"],options:{...I(),...te}}),process.exit(1));(process.stdout.isTTY&&process.argv[2]===void 0||ne["--help"])&&(ee({usage:["tailwindcss [--input input.css] [--output output.css] [--watch] [options\u2026]"],options:{...I(),...te}}),process.exit(0));ge(ne); diff --git a/node_modules/@tailwindcss/cli/package.json b/node_modules/@tailwindcss/cli/package.json new file mode 100644 index 0000000..5d4b9b2 --- /dev/null +++ b/node_modules/@tailwindcss/cli/package.json @@ -0,0 +1,40 @@ +{ + "name": "@tailwindcss/cli", + "version": "4.1.18", + "description": "A utility-first CSS framework for rapidly building custom user interfaces.", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tailwindlabs/tailwindcss.git", + "directory": "packages/@tailwindcss-cli" + }, + "bugs": "https://github.com/tailwindlabs/tailwindcss/issues", + "homepage": "https://tailwindcss.com", + "bin": { + "tailwindcss": "./dist/index.mjs" + }, + "exports": { + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "dependencies": { + "@parcel/watcher": "^2.5.1", + "enhanced-resolve": "^5.18.3", + "mri": "^1.2.0", + "picocolors": "^1.1.1", + "@tailwindcss/node": "4.1.18", + "tailwindcss": "4.1.18", + "@tailwindcss/oxide": "4.1.18" + }, + "scripts": { + "lint": "tsc --noEmit", + "build": "tsup-node", + "dev": "pnpm run build -- --watch" + } +} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/LICENSE b/node_modules/@tailwindcss/node/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/@tailwindcss/node/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/README.md b/node_modules/@tailwindcss/node/README.md new file mode 100644 index 0000000..7d21bd8 --- /dev/null +++ b/node_modules/@tailwindcss/node/README.md @@ -0,0 +1,36 @@ +

+ + + + + Tailwind CSS + + +

+ +

+ A utility-first CSS framework for rapidly building custom user interfaces. +

+ +

+ Build Status + Total Downloads + Latest Release + License +

+ +--- + +## Documentation + +For full documentation, visit [tailwindcss.com](https://tailwindcss.com). + +## Community + +For help, discussion about best practices, or feature ideas: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +## Contributing + +If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**. diff --git a/node_modules/@tailwindcss/node/dist/esm-cache.loader.d.mts b/node_modules/@tailwindcss/node/dist/esm-cache.loader.d.mts new file mode 100644 index 0000000..55f2bad --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/esm-cache.loader.d.mts @@ -0,0 +1,5 @@ +import { ResolveHook } from 'node:module'; + +declare let resolve: ResolveHook; + +export { resolve }; diff --git a/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs b/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs new file mode 100644 index 0000000..f9ae108 --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs @@ -0,0 +1 @@ +import{isBuiltin as i}from"module";var o=async(a,e,u)=>{let r=await u(a,e);if(r.url===import.meta.url||i(r.url)||!e.parentURL)return r;let t=new URL(e.parentURL).searchParams.get("id");if(t===null)return r;let l=new URL(r.url);return l.searchParams.set("id",t),{...r,url:`${l}`}};export{o as resolve}; diff --git a/node_modules/@tailwindcss/node/dist/index.d.mts b/node_modules/@tailwindcss/node/dist/index.d.mts new file mode 100644 index 0000000..2e20c57 --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/index.d.mts @@ -0,0 +1,255 @@ +import { AstNode as AstNode$1 } from './ast'; +import { Candidate, Variant } from './candidate'; +import { compileAstNodes } from './compile'; +import { ClassEntry, VariantEntry, CanonicalizeOptions } from './intellisense'; +import { Theme } from './theme'; +import { Utilities } from './utilities'; +import { Variants } from './variants'; +import * as tailwindcss from 'tailwindcss'; +import { Polyfills, Features } from 'tailwindcss'; +export { Features, Polyfills } from 'tailwindcss'; + +declare const DEBUG: boolean; + +declare const env_DEBUG: typeof DEBUG; +declare namespace env { + export { env_DEBUG as DEBUG }; +} + +declare const enum CompileAstFlags { + None = 0, + RespectImportant = 1 +} +type DesignSystem = { + theme: Theme; + utilities: Utilities; + variants: Variants; + invalidCandidates: Set; + important: boolean; + getClassOrder(classes: string[]): [string, bigint | null][]; + getClassList(): ClassEntry[]; + getVariants(): VariantEntry[]; + parseCandidate(candidate: string): Readonly[]; + parseVariant(variant: string): Readonly | null; + compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[]; + candidatesToCss(classes: string[]): (string | null)[]; + candidatesToAst(classes: string[]): AstNode$1[][]; + storage: Record; +}; + +/** + * The source code for one or more nodes in the AST + * + * This generally corresponds to a stylesheet + */ +interface Source { + /** + * The path to the file that contains the referenced source code + * + * If this references the *output* source code, this is `null`. + */ + file: string | null; + /** + * The referenced source code + */ + code: string; +} +/** + * The file and offsets within it that this node covers + * + * This can represent either: + * - A location in the original CSS which caused this node to be created + * - A location in the output CSS where this node resides + */ +type SourceLocation = [source: Source, start: number, end: number]; + +/** + * Line offset tables are the key to generating our source maps. They allow us + * to store indexes with our AST nodes and later convert them into positions as + * when given the source that the indexes refer to. + */ +/** + * A position in source code + * + * https://tc39.es/ecma426/#sec-position-record-type + */ +interface Position { + /** The line number, one-based */ + line: number; + /** The column/character number, one-based */ + column: number; +} + +interface OriginalPosition extends Position { + source: DecodedSource; +} +/** + * A "decoded" sourcemap + * + * @see https://tc39.es/ecma426/#decoded-source-map-record + */ +interface DecodedSourceMap { + file: string | null; + sources: DecodedSource[]; + mappings: DecodedMapping[]; +} +/** + * A "decoded" source + * + * @see https://tc39.es/ecma426/#decoded-source-record + */ +interface DecodedSource { + url: string | null; + content: string | null; + ignore: boolean; +} +/** + * A "decoded" mapping + * + * @see https://tc39.es/ecma426/#decoded-mapping-record + */ +interface DecodedMapping { + originalPosition: OriginalPosition | null; + generatedPosition: Position; + name: string | null; +} + +type StyleRule = { + kind: 'rule'; + selector: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type AtRule = { + kind: 'at-rule'; + name: string; + params: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Declaration = { + kind: 'declaration'; + property: string; + value: string | undefined; + important: boolean; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Comment = { + kind: 'comment'; + value: string; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Context = { + kind: 'context'; + context: Record; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type AtRoot = { + kind: 'at-root'; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot; + +type Resolver = (id: string, base: string) => Promise; +interface CompileOptions { + base: string; + from?: string; + onDependency: (path: string) => void; + shouldRewriteUrls?: boolean; + polyfills?: Polyfills; + customCssResolver?: Resolver; + customJsResolver?: Resolver; +} +declare function compileAst(ast: AstNode[], options: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: "none" | { + base: string; + pattern: string; + } | null; + features: Features; + build(candidates: string[]): AstNode[]; +}>; +declare function compile(css: string, options: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: "none" | { + base: string; + pattern: string; + } | null; + features: Features; + build(candidates: string[]): string; + buildSourceMap(): tailwindcss.DecodedSourceMap; +}>; +declare function __unstable__loadDesignSystem(css: string, { base }: { + base: string; +}): Promise; +declare function loadModule(id: string, base: string, onDependency: (path: string) => void, customJsResolver?: Resolver): Promise<{ + path: string; + base: string; + module: any; +}>; + +declare class Instrumentation implements Disposable { + #private; + private defaultFlush; + constructor(defaultFlush?: (message: string) => undefined); + hit(label: string): void; + start(label: string): void; + end(label: string): void; + reset(): void; + report(flush?: (message: string) => undefined): void; + [Symbol.dispose](): void; +} + +declare function normalizePath(originalPath: string): string; + +interface OptimizeOptions { + /** + * The file being transformed + */ + file?: string; + /** + * Enabled minified output + */ + minify?: boolean; + /** + * The output source map before optimization + * + * If omitted a resulting source map will not be available + */ + map?: string; +} +interface TransformResult { + code: string; + map: string | undefined; +} +declare function optimize(input: string, { file, minify, map }?: OptimizeOptions): TransformResult; + +interface SourceMap { + readonly raw: string; + readonly inline: string; +} +declare function toSourceMap(map: DecodedSourceMap | string): SourceMap; + +export { type CompileOptions, type DecodedSource, type DecodedSourceMap, Instrumentation, type OptimizeOptions, type Resolver, type SourceMap, type TransformResult, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize, toSourceMap }; diff --git a/node_modules/@tailwindcss/node/dist/index.d.ts b/node_modules/@tailwindcss/node/dist/index.d.ts new file mode 100644 index 0000000..2e20c57 --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/index.d.ts @@ -0,0 +1,255 @@ +import { AstNode as AstNode$1 } from './ast'; +import { Candidate, Variant } from './candidate'; +import { compileAstNodes } from './compile'; +import { ClassEntry, VariantEntry, CanonicalizeOptions } from './intellisense'; +import { Theme } from './theme'; +import { Utilities } from './utilities'; +import { Variants } from './variants'; +import * as tailwindcss from 'tailwindcss'; +import { Polyfills, Features } from 'tailwindcss'; +export { Features, Polyfills } from 'tailwindcss'; + +declare const DEBUG: boolean; + +declare const env_DEBUG: typeof DEBUG; +declare namespace env { + export { env_DEBUG as DEBUG }; +} + +declare const enum CompileAstFlags { + None = 0, + RespectImportant = 1 +} +type DesignSystem = { + theme: Theme; + utilities: Utilities; + variants: Variants; + invalidCandidates: Set; + important: boolean; + getClassOrder(classes: string[]): [string, bigint | null][]; + getClassList(): ClassEntry[]; + getVariants(): VariantEntry[]; + parseCandidate(candidate: string): Readonly[]; + parseVariant(variant: string): Readonly | null; + compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[]; + candidatesToCss(classes: string[]): (string | null)[]; + candidatesToAst(classes: string[]): AstNode$1[][]; + storage: Record; +}; + +/** + * The source code for one or more nodes in the AST + * + * This generally corresponds to a stylesheet + */ +interface Source { + /** + * The path to the file that contains the referenced source code + * + * If this references the *output* source code, this is `null`. + */ + file: string | null; + /** + * The referenced source code + */ + code: string; +} +/** + * The file and offsets within it that this node covers + * + * This can represent either: + * - A location in the original CSS which caused this node to be created + * - A location in the output CSS where this node resides + */ +type SourceLocation = [source: Source, start: number, end: number]; + +/** + * Line offset tables are the key to generating our source maps. They allow us + * to store indexes with our AST nodes and later convert them into positions as + * when given the source that the indexes refer to. + */ +/** + * A position in source code + * + * https://tc39.es/ecma426/#sec-position-record-type + */ +interface Position { + /** The line number, one-based */ + line: number; + /** The column/character number, one-based */ + column: number; +} + +interface OriginalPosition extends Position { + source: DecodedSource; +} +/** + * A "decoded" sourcemap + * + * @see https://tc39.es/ecma426/#decoded-source-map-record + */ +interface DecodedSourceMap { + file: string | null; + sources: DecodedSource[]; + mappings: DecodedMapping[]; +} +/** + * A "decoded" source + * + * @see https://tc39.es/ecma426/#decoded-source-record + */ +interface DecodedSource { + url: string | null; + content: string | null; + ignore: boolean; +} +/** + * A "decoded" mapping + * + * @see https://tc39.es/ecma426/#decoded-mapping-record + */ +interface DecodedMapping { + originalPosition: OriginalPosition | null; + generatedPosition: Position; + name: string | null; +} + +type StyleRule = { + kind: 'rule'; + selector: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type AtRule = { + kind: 'at-rule'; + name: string; + params: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Declaration = { + kind: 'declaration'; + property: string; + value: string | undefined; + important: boolean; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Comment = { + kind: 'comment'; + value: string; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Context = { + kind: 'context'; + context: Record; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type AtRoot = { + kind: 'at-root'; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot; + +type Resolver = (id: string, base: string) => Promise; +interface CompileOptions { + base: string; + from?: string; + onDependency: (path: string) => void; + shouldRewriteUrls?: boolean; + polyfills?: Polyfills; + customCssResolver?: Resolver; + customJsResolver?: Resolver; +} +declare function compileAst(ast: AstNode[], options: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: "none" | { + base: string; + pattern: string; + } | null; + features: Features; + build(candidates: string[]): AstNode[]; +}>; +declare function compile(css: string, options: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: "none" | { + base: string; + pattern: string; + } | null; + features: Features; + build(candidates: string[]): string; + buildSourceMap(): tailwindcss.DecodedSourceMap; +}>; +declare function __unstable__loadDesignSystem(css: string, { base }: { + base: string; +}): Promise; +declare function loadModule(id: string, base: string, onDependency: (path: string) => void, customJsResolver?: Resolver): Promise<{ + path: string; + base: string; + module: any; +}>; + +declare class Instrumentation implements Disposable { + #private; + private defaultFlush; + constructor(defaultFlush?: (message: string) => undefined); + hit(label: string): void; + start(label: string): void; + end(label: string): void; + reset(): void; + report(flush?: (message: string) => undefined): void; + [Symbol.dispose](): void; +} + +declare function normalizePath(originalPath: string): string; + +interface OptimizeOptions { + /** + * The file being transformed + */ + file?: string; + /** + * Enabled minified output + */ + minify?: boolean; + /** + * The output source map before optimization + * + * If omitted a resulting source map will not be available + */ + map?: string; +} +interface TransformResult { + code: string; + map: string | undefined; +} +declare function optimize(input: string, { file, minify, map }?: OptimizeOptions): TransformResult; + +interface SourceMap { + readonly raw: string; + readonly inline: string; +} +declare function toSourceMap(map: DecodedSourceMap | string): SourceMap; + +export { type CompileOptions, type DecodedSource, type DecodedSourceMap, Instrumentation, type OptimizeOptions, type Resolver, type SourceMap, type TransformResult, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize, toSourceMap }; diff --git a/node_modules/@tailwindcss/node/dist/index.js b/node_modules/@tailwindcss/node/dist/index.js new file mode 100644 index 0000000..f60005b --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/index.js @@ -0,0 +1,18 @@ +"use strict";var It=Object.create;var ne=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty;var Le=(e,r)=>{for(var t in r)ne(e,t,{get:r[t],enumerable:!0})},Ke=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ut(r))!Kt.call(e,o)&&o!==t&&ne(e,o,{get:()=>r[o],enumerable:!(i=Dt(r,o))||i.enumerable});return e};var T=(e,r,t)=>(t=e!=null?It(Lt(e)):{},Ke(r||!e||!e.__esModule?ne(t,"default",{value:e,enumerable:!0}):t,e)),zt=e=>Ke(ne({},"__esModule",{value:!0}),e);var ci={};Le(ci,{Features:()=>O.Features,Instrumentation:()=>Ue,Polyfills:()=>O.Polyfills,__unstable__loadDesignSystem:()=>ti,compile:()=>ei,compileAst:()=>Xr,env:()=>oe,loadModule:()=>Ie,normalizePath:()=>me,optimize:()=>li,toSourceMap:()=>fi});module.exports=zt(ci);var Pt=T(require("module")),_t=require("url");var oe={};Le(oe,{DEBUG:()=>ve});var ve=Mt(process.env.DEBUG);function Mt(e){if(typeof e=="boolean")return e;if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let r=e.split(",").map(t=>t.split(":")[0]);return r.includes("-tailwindcss")?!1:!!r.includes("tailwindcss")}var j=T(require("enhanced-resolve")),St=require("jiti"),ge=T(require("fs")),_e=T(require("fs/promises")),re=T(require("path")),Oe=require("url"),O=require("tailwindcss");var ae=T(require("fs/promises")),B=T(require("path")),Ft=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],jt=[".js",".cjs",".mjs"],Wt=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Bt=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Yt(e,r){for(let t of r){let i=`${e}${t}`;if((await ae.default.stat(i).catch(()=>null))?.isFile())return i}for(let t of r){let i=`${e}/index${t}`;if(await ae.default.access(i).then(()=>!0,()=>!1))return i}return null}async function ze(e,r,t,i){let o=jt.includes(i)?Wt:Bt,a=await Yt(B.default.resolve(t,r),o);if(a===null||e.has(a))return;e.add(a),t=B.default.dirname(a),i=B.default.extname(a);let n=await ae.default.readFile(a,"utf-8"),s=[];for(let l of Ft)for(let u of n.matchAll(l))u[1].startsWith(".")&&s.push(ze(e,u[1],t,i));await Promise.all(s)}async function Me(e){let r=new Set;return await ze(r,e,B.default.dirname(e),B.default.extname(e)),Array.from(r)}var Ve=T(require("path"));function Y(e){return{kind:"word",value:e}}function Gt(e,r){return{kind:"function",value:e,nodes:r}}function Ht(e){return{kind:"separator",value:e}}function S(e){let r="";for(let t of e)switch(t.kind){case"word":case"separator":{r+=t.value;break}case"function":r+=t.value+"("+S(t.nodes)+")"}return r}var Fe=92,qt=41,je=58,We=44,Zt=34,Be=61,Ye=62,Ge=60,He=10,Qt=40,Jt=39,Xt=47,qe=32,Ze=9;function A(e){e=e.replaceAll(`\r +`,` +`);let r=[],t=[],i=null,o="",a;for(let n=0;n0){let u=Y(o);i?i.nodes.push(u):r.push(u),o=""}let l=Y(e[n]);i?i.nodes.push(l):r.push(l);break}case je:case We:case Be:case Ye:case Ge:case He:case qe:case Ze:{if(o.length>0){let c=Y(o);i?i.nodes.push(c):r.push(c),o=""}let l=n,u=n+1;for(;u0){let u=Y(o);l?.nodes.push(u),o=""}t.length>0?i=t[t.length-1]:i=null;break}default:o+=String.fromCharCode(s)}}return o.length>0&&r.push(Y(o)),r}var g=class extends Map{constructor(t){super();this.factory=t}get(t){let i=super.get(t);return i===void 0&&(i=this.factory(t,this),this.set(t,i)),i}};var yi=new Uint8Array(256);var le=new Uint8Array(256);function y(e,r){let t=0,i=[],o=0,a=e.length,n=r.charCodeAt(0);for(let s=0;s0&&l===le[t-1]&&t--;break}}return i.push(e.slice(o)),i}var we=(n=>(n[n.Continue=0]="Continue",n[n.Skip=1]="Skip",n[n.Stop=2]="Stop",n[n.Replace=3]="Replace",n[n.ReplaceSkip=4]="ReplaceSkip",n[n.ReplaceStop=5]="ReplaceStop",n))(we||{}),w={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function v(e,r){typeof r=="function"?Qe(e,r):Qe(e,r.enter,r.exit)}function Qe(e,r=()=>w.Continue,t=()=>w.Continue){let i=[[e,0,null]],o={parent:null,depth:0,path(){let a=[];for(let n=1;n0;){let a=i.length-1,n=i[a],s=n[0],l=n[1],u=n[2];if(l>=s.length){i.pop();continue}if(o.parent=u,o.depth=a,l>=0){let m=s[l],d=r(m,o)??w.Continue;switch(d.kind){case 0:{m.nodes&&m.nodes.length>0&&i.push([m.nodes,0,m]),n[1]=~l;continue}case 2:return;case 1:{n[1]=~l;continue}case 3:{s.splice(l,1,...d.nodes);continue}case 5:{s.splice(l,1,...d.nodes);return}case 4:{s.splice(l,1,...d.nodes),n[1]+=d.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${we[d.kind]??`Unknown(${d.kind})`}\` in enter.`)}}let p=~l,c=s[p],f=t(c,o)??w.Continue;switch(f.kind){case 0:n[1]=p+1;continue;case 2:return;case 3:{s.splice(p,1,...f.nodes),n[1]=p+f.nodes.length;continue}case 5:{s.splice(p,1,...f.nodes);return}case 4:{s.splice(p,1,...f.nodes),n[1]=p+f.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${we[f.kind]??`Unknown(${f.kind})`}\` in exit.`)}}}var Vi=new g(e=>{let r=A(e),t=new Set;return v(r,(i,o)=>{let a=o.parent===null?r:o.parent.nodes??[];if(i.kind==="word"&&(i.value==="+"||i.value==="-"||i.value==="*"||i.value==="/")){let n=a.indexOf(i)??-1;if(n===-1)return;let s=a[n-1];if(s?.kind!=="separator"||s.value!==" ")return;let l=a[n+1];if(l?.kind!=="separator"||l.value!==" ")return;t.add(s),t.add(l)}else i.kind==="separator"&&i.value.length>0&&i.value.trim()===""?(a[0]===i||a[a.length-1]===i)&&t.add(i):i.kind==="separator"&&i.value.trim()===","&&(i.value=",")}),t.size>0&&v(r,i=>{if(t.has(i))return t.delete(i),w.ReplaceSkip([])}),ye(r),S(r)});var Ri=new g(e=>{let r=A(e);return r.length===3&&r[0].kind==="word"&&r[0].value==="&"&&r[1].kind==="separator"&&r[1].value===":"&&r[2].kind==="function"&&r[2].value==="is"?S(r[2].nodes):e});function ye(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=G(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=G(r.value);for(let t=0;t{let r=A(e);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function er(e){throw new Error(`Unexpected value: ${e}`)}function G(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var tr=process.env.FEATURES_ENV!=="stable";var _=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,Fi=new RegExp(`^${_.source}$`);var ji=new RegExp(`^${_.source}%$`);var Wi=new RegExp(`^${_.source}s*/s*${_.source}$`);var rr=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],Bi=new RegExp(`^${_.source}(${rr.join("|")})$`);var ir=["deg","rad","grad","turn"],Yi=new RegExp(`^${_.source}(${ir.join("|")})$`);var Gi=new RegExp(`^${_.source} +${_.source} +${_.source}$`);function C(e){let r=Number(e);return Number.isInteger(r)&&r>=0&&String(r)===String(e)}function H(e,r){if(r===null)return e;let t=Number(r);return Number.isNaN(t)||(r=`${t*100}%`),r==="100%"?e:`color-mix(in oklab, ${e} ${r}, transparent)`}var ar={"--alpha":lr,"--spacing":sr,"--theme":ur,theme:fr};function lr(e,r,t,...i){let[o,a]=y(t,"/").map(n=>n.trim());if(!o||!a)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${o||"var(--my-color)"} / ${a||"50%"})\``);if(i.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${o||"var(--my-color)"} / ${a||"50%"})\``);return H(o,a)}function sr(e,r,t,...i){if(!t)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(i.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${i.length+1}.`);let o=e.theme.resolve(null,["--spacing"]);if(!o)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${o} * ${t})`}function ur(e,r,t,...i){if(!t.startsWith("--"))throw new Error("The --theme(\u2026) function can only be used with CSS variables from your theme.");let o=!1;t.endsWith(" inline")&&(o=!0,t=t.slice(0,-7)),r.kind==="at-rule"&&(o=!0);let a=e.resolveThemeValue(t,o);if(!a){if(i.length>0)return i.join(", ");throw new Error(`Could not resolve value for theme function: \`theme(${t})\`. Consider checking if the variable name is correct or provide a fallback value to silence this error.`)}if(i.length===0)return a;let n=i.join(", ");if(n==="initial")return a;if(a==="initial")return n;if(a.startsWith("var(")||a.startsWith("theme(")||a.startsWith("--theme(")){let s=A(a);return pr(s,n),S(s)}return a}function fr(e,r,t,...i){t=cr(t);let o=e.resolveThemeValue(t);if(!o&&i.length>0)return i.join(", ");if(!o)throw new Error(`Could not resolve value for theme function: \`theme(${t})\`. Consider checking if the path is correct or provide a fallback value to silence this error.`);return o}var gn=new RegExp(Object.keys(ar).map(e=>`${e}\\(`).join("|"));function cr(e){if(e[0]!=="'"&&e[0]!=='"')return e;let r="",t=e[0];for(let i=1;i{if(t.kind==="function"&&!(t.value!=="var"&&t.value!=="theme"&&t.value!=="--theme"))if(t.nodes.length===1)t.nodes.push({kind:"word",value:`, ${r}`});else{let i=t.nodes[t.nodes.length-1];i.kind==="word"&&i.value==="initial"&&(i.value=r)}})}var mr=/^(?[-+]?(?:\d*\.)?\d+)(?[a-z]+|%)?$/i,tt=new g(e=>{let r=mr.exec(e);if(!r)return null;let t=r.groups?.value;if(t===void 0)return null;let i=Number(t);if(Number.isNaN(i))return null;let o=r.groups?.unit;return o===void 0?[i,null]:[i,o]});function rt(e,r="top",t="right",i="bottom",o="left"){return it(`${e}-${r}`,`${e}-${t}`,`${e}-${i}`,`${e}-${o}`)}function it(e="top",r="right",t="bottom",i="left"){return{1:[[e,0],[r,0],[t,0],[i,0]],2:[[e,0],[r,1],[t,0],[i,1]],3:[[e,0],[r,1],[t,2],[i,1]],4:[[e,0],[r,1],[t,2],[i,3]]}}function z(e,r){return{1:[[e,0],[r,0]],2:[[e,0],[r,1]]}}var _n={inset:it(),margin:rt("margin"),padding:rt("padding"),gap:z("row-gap","column-gap")},In={"inset-block":z("top","bottom"),"inset-inline":z("left","right"),"margin-block":z("margin-top","margin-bottom"),"margin-inline":z("margin-left","margin-right"),"padding-block":z("padding-top","padding-bottom"),"padding-inline":z("padding-left","padding-right")};var fo=Symbol();var co=Symbol();var po=Symbol();var mo=Symbol();var go=Symbol();var ho=Symbol();var vo=Symbol();var wo=Symbol();var yo=Symbol();var ko=Symbol();var bo=Symbol();var xo=Symbol();var Ao=Symbol();function xe(e){let r=[0];for(let o=0;o0;){let l=(n|0)>>1,u=a+l;r[u]<=o?(a=u+1,n=n-l-1):n=l}a-=1;let s=o-r[a];return{line:a+1,column:s}}function i({line:o,column:a}){o-=1,o=Math.min(Math.max(o,0),r.length-1);let n=r[o],s=r[o+1]??n;return Math.min(Math.max(n+a,0),s)}return{find:t,findOffset:i}}var Q=92,ue=47,fe=42,st=34,ut=39,$r=58,ce=59,E=10,pe=13,J=32,X=9,ft=123,Ae=125,$e=40,ct=41,Tr=91,Er=93,pt=45,Ce=64,Nr=33,N=class e extends Error{loc;constructor(r,t){if(t){let i=t[0],o=xe(i.code).find(t[1]);r=`${i.file}:${o.line}:${o.column+1}: ${r}`}super(r),this.name="CssSyntaxError",this.loc=t,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function te(e,r){let t=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let i=[],o=[],a=[],n=null,s=null,l="",u="",p=0,c;for(let f=0;f0&&e[k]===d[d.length-1]&&(d=d.slice(0,-1));let L=Se(l,h);if(!L)throw new N("Invalid custom property, expected a value",t?[t,x,f]:null);t&&(L.src=[t,x,f],L.dst=[t,x,f]),n?n.nodes.push(L):i.push(L),l=""}else if(m===ce&&l.charCodeAt(0)===Ce)s=ee(l),t&&(s.src=[t,p,f],s.dst=[t,p,f]),n?n.nodes.push(s):i.push(s),l="",s=null;else if(m===ce&&u[u.length-1]!==")"){let d=Se(l);if(!d){if(l.length===0)continue;throw new N(`Invalid declaration: \`${l.trim()}\``,t?[t,p,f]:null)}t&&(d.src=[t,p,f],d.dst=[t,p,f]),n?n.nodes.push(d):i.push(d),l=""}else if(m===ft&&u[u.length-1]!==")")u+="}",s=I(l.trim()),t&&(s.src=[t,p,f],s.dst=[t,p,f]),n&&n.nodes.push(s),a.push(n),n=s,l="",s=null;else if(m===Ae&&u[u.length-1]!==")"){if(u==="")throw new N("Missing opening {",t?[t,f,f]:null);if(u=u.slice(0,-1),l.length>0)if(l.charCodeAt(0)===Ce)s=ee(l),t&&(s.src=[t,p,f],s.dst=[t,p,f]),n?n.nodes.push(s):i.push(s),l="",s=null;else{let x=l.indexOf(":");if(n){let h=Se(l,x);if(!h)throw new N(`Invalid declaration: \`${l.trim()}\``,t?[t,p,f]:null);t&&(h.src=[t,p,f],h.dst=[t,p,f]),n.nodes.push(h)}}let d=a.pop()??null;d===null&&n&&i.push(n),n=d,l="",s=null}else if(m===$e)u+=")",l+="(";else if(m===ct){if(u[u.length-1]!==")")throw new N("Missing opening (",t?[t,f,f]:null);u=u.slice(0,-1),l+=")"}else{if(l.length===0&&(m===J||m===E||m===X))continue;l===""&&(p=f),l+=String.fromCharCode(m)}}}if(l.charCodeAt(0)===Ce){let f=ee(l);t&&(f.src=[t,p,e.length],f.dst=[t,p,e.length]),i.push(f)}if(u.length>0&&n){if(n.kind==="rule")throw new N(`Missing closing } at ${n.selector}`,n.src?[n.src[0],n.src[1],n.src[1]]:null);if(n.kind==="at-rule")throw new N(`Missing closing } at ${n.name} ${n.params}`,n.src?[n.src[0],n.src[1],n.src[1]]:null)}return o.length>0?o.concat(i):i}function ee(e,r=[]){let t=e,i="";for(let o=5;o{if(C(e.value))return e.value}),b=F(e=>{if(C(e.value))return`${e.value}%`}),D=F(e=>{if(C(e.value))return`${e.value}px`}),gt=F(e=>{if(C(e.value))return`${e.value}ms`}),de=F(e=>{if(C(e.value))return`${e.value}deg`}),_r=F(e=>{if(e.fraction===null)return;let[r,t]=y(e.fraction,"/");if(!(!C(r)||!C(t)))return e.fraction}),ht=F(e=>{if(C(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),Ir={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",..._r},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...b}),backdropContrast:({theme:e})=>({...e("contrast"),...b}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...b}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...de}),backdropInvert:({theme:e})=>({...e("invert"),...b}),backdropOpacity:({theme:e})=>({...e("opacity"),...b}),backdropSaturate:({theme:e})=>({...e("saturate"),...b}),backdropSepia:({theme:e})=>({...e("sepia"),...b}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...D},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...b},caretColor:({theme:e})=>e("colors"),colors:()=>({...Ne}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...V},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...b},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),...D}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...V},flexShrink:{0:"0",DEFAULT:"1",...V},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...b},grayscale:{0:"0",DEFAULT:"100%",...b},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...V},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...V},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...V},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...V},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...ht},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...ht},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...de},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...b},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...V},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...b},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...V},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...de},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...b},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...b},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...b},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...de},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...V},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...D},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...gt},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...gt},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...V}};var Ur=64;function K(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function $(e,r="",t=[]){return{kind:"at-rule",name:e,params:r,nodes:t}}function I(e,r=[]){return e.charCodeAt(0)===Ur?ee(e,r):K(e,r)}function R(e,r,t=!1){return{kind:"declaration",property:e,value:r,important:t}}function Ee(e){return{kind:"comment",value:e}}function M(e,r){let t=0,i={file:null,code:""};function o(n,s=0){let l="",u=" ".repeat(s);if(n.kind==="declaration"){if(l+=`${u}${n.property}: ${n.value}${n.important?" !important":""}; +`,r){t+=u.length;let p=t;t+=n.property.length,t+=2,t+=n.value?.length??0,n.important&&(t+=11);let c=t;t+=2,n.dst=[i,p,c]}}else if(n.kind==="rule"){if(l+=`${u}${n.selector} { +`,r){t+=u.length;let p=t;t+=n.selector.length,t+=1;let c=t;n.dst=[i,p,c],t+=2}for(let p of n.nodes)l+=o(p,s+1);l+=`${u}} +`,r&&(t+=u.length,t+=2)}else if(n.kind==="at-rule"){if(n.nodes.length===0){let p=`${u}${n.name} ${n.params}; +`;if(r){t+=u.length;let c=t;t+=n.name.length,t+=1,t+=n.params.length;let f=t;t+=2,n.dst=[i,c,f]}return p}if(l+=`${u}${n.name}${n.params?` ${n.params} `:" "}{ +`,r){t+=u.length;let p=t;t+=n.name.length,n.params&&(t+=1,t+=n.params.length),t+=1;let c=t;n.dst=[i,p,c],t+=2}for(let p of n.nodes)l+=o(p,s+1);l+=`${u}} +`,r&&(t+=u.length,t+=2)}else if(n.kind==="comment"){if(l+=`${u}/*${n.value}*/ +`,r){t+=u.length;let p=t;t+=2+n.value.length+2;let c=t;n.dst=[i,p,c],t+=1}}else if(n.kind==="context"||n.kind==="at-root")return"";return l}let a="";for(let n of e)a+=o(n,0);return i.code=a,a}function Lr(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var i="";if(t>4&&e[3]==="\\"){var o=e[2];(o==="?"||o===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//")}var a=e.split(/[/\\]+/);return r!==!1&&a[a.length-1]===""&&a.pop(),i+a.join("/")}function me(e){let r=Lr(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var Re=/(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g,Wr=/(?zr.test(e),Gr=e=>Mr.test(e);async function wt({css:e,base:r,root:t}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let i=te(e),o=[];function a(n){if(n[0]==="/")return n;let s=Ve.posix.join(me(r),n),l=Ve.posix.relative(me(t),s);return l.startsWith(".")||(l="./"+l),l}return v(i,n=>{if(n.kind!=="declaration"||!n.value)return;let s=Re.test(n.value),l=vt.test(n.value);if(s||l){let u=l?Hr:yt;o.push(u(n.value,a).then(p=>{n.value=p}))}}),o.length&&await Promise.all(o),M(i)}function yt(e,r){return bt(e,Re,async t=>{let[i,o]=t;return await kt(o.trim(),i,r)})}async function Hr(e,r){return await bt(e,vt,async t=>{let[,i]=t;return await Zr(i,async({url:a})=>Re.test(a)?await yt(a,r):Kr.test(a)?a:await kt(a,a,r))})}async function kt(e,r,t,i="url"){let o="",a=e[0];if((a==='"'||a==="'")&&(o=a,e=e.slice(1,-1)),qr(e))return r;let n=await t(e);return o===""&&n!==encodeURI(n)&&(o='"'),o==="'"&&n.includes("'")&&(o='"'),o==='"'&&n.includes('"')&&(n=n.replace(Wr,'\\"')),`${i}(${o}${n}${o})`}function qr(e,r){return Gr(e)||Yr(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||Fr.test(e)}function Zr(e,r){return Promise.all(Qr(e).map(async({url:t,descriptor:i})=>({url:await r({url:t,descriptor:i}),descriptor:i}))).then(Jr)}function Qr(e){let r=e.trim().replace(Br," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(jr);return Array.from(r,({groups:t})=>({url:t?.url?.trim()??"",descriptor:t?.descriptor?.trim()??""})).filter(({url:t})=>!!t)}function Jr(e){return e.map(({url:r,descriptor:t})=>r+(t?` ${t}`:"")).join(", ")}async function bt(e,r,t){let i,o=e,a="";for(;i=r.exec(o);)a+=o.slice(0,i.index),a+=await t(i),o=o.slice(i.index+i[0].length);return a+=o,a}var ai={};function $t({base:e,from:r,polyfills:t,onDependency:i,shouldRewriteUrls:o,customCssResolver:a,customJsResolver:n}){return{base:e,polyfills:t,from:r,async loadModule(s,l){return Ie(s,l,i,n)},async loadStylesheet(s,l){let u=await Et(s,l,i,a);return o&&(u.content=await wt({css:u.content,root:e,base:u.base})),u}}}async function Tt(e){if(e.root&&e.root!=="none"){let r=/[*{]/,t=[];for(let o of e.root.pattern.split("/")){if(r.test(o))break;t.push(o)}if(!await _e.default.stat(re.default.resolve(e.root.base,t.join("/"))).then(o=>o.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist or is not a directory.`)}}async function Xr(e,r){let t=await(0,O.compileAst)(e,$t(r));return await Tt(t),t}async function ei(e,r){let t=await(0,O.compile)(e,$t(r));return await Tt(t),t}async function ti(e,{base:r}){return(0,O.__unstable__loadDesignSystem)(e,{base:r,async loadModule(t,i){return Ie(t,i,()=>{})},async loadStylesheet(t,i){return Et(t,i,()=>{})}})}async function Ie(e,r,t,i){if(e[0]!=="."){let s=await Ct(e,r,i);if(!s)throw new Error(`Could not resolve '${e}' from '${r}'`);let l=await At((0,Oe.pathToFileURL)(s).href);return{path:s,base:re.default.dirname(s),module:l.default??l}}let o=await Ct(e,r,i);if(!o)throw new Error(`Could not resolve '${e}' from '${r}'`);let[a,n]=await Promise.all([At((0,Oe.pathToFileURL)(o).href+"?id="+Date.now()),Me(o)]);for(let s of n)t(s);return{path:o,base:re.default.dirname(o),module:a.default??a}}async function Et(e,r,t,i){let o=await ii(e,r,i);if(!o)throw new Error(`Could not resolve '${e}' from '${r}'`);t(o);let a=await _e.default.readFile(o,"utf-8");return{path:o,base:re.default.dirname(o),content:a}}var xt=null;async function At(e){if(typeof globalThis.__tw_load=="function"){let r=await globalThis.__tw_load(e);if(r)return r}try{return await import(e)}catch{return xt??=(0,St.createJiti)(ai.url,{moduleCache:!1,fsCache:!1}),await xt.import(e)}}var De=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],ri=j.default.ResolverFactory.createResolver({fileSystem:new j.default.CachedInputFileSystem(ge.default,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:De});async function ii(e,r,t){if(typeof globalThis.__tw_resolve=="function"){let i=globalThis.__tw_resolve(e,r);if(i)return Promise.resolve(i)}if(t){let i=await t(e,r);if(i)return i}return Pe(ri,e,r)}var ni=j.default.ResolverFactory.createResolver({fileSystem:new j.default.CachedInputFileSystem(ge.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:De}),oi=j.default.ResolverFactory.createResolver({fileSystem:new j.default.CachedInputFileSystem(ge.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:De});async function Ct(e,r,t){if(typeof globalThis.__tw_resolve=="function"){let i=globalThis.__tw_resolve(e,r);if(i)return Promise.resolve(i)}if(t){let i=await t(e,r);if(i)return i}return Pe(ni,e,r).catch(()=>Pe(oi,e,r))}function Pe(e,r,t){return new Promise((i,o)=>e.resolve({},t,r,{},(a,n)=>{if(a)return o(a);i(n)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Ue=class{constructor(r=t=>void process.stderr.write(`${t} +`)){this.defaultFlush=r}#r=new g(()=>({value:0}));#t=new g(()=>({value:0n}));#e=[];hit(r){this.#r.get(r).value++}start(r){let t=this.#e.map(o=>o.label).join("//"),i=`${t}${t.length===0?"":"//"}${r}`;this.#r.get(i).value++,this.#t.get(i),this.#e.push({id:i,label:r,namespace:t,value:process.hrtime.bigint()})}end(r){let t=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==r)throw new Error(`Mismatched timer label: \`${r}\`, expected \`${this.#e[this.#e.length-1].label}\``);let i=this.#e.pop(),o=t-i.value;this.#t.get(i.id).value+=o}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(r=this.defaultFlush){let t=[],i=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:s}]of this.#r.entries()){if(this.#t.has(n))continue;t.length===0&&(i=!0,t.push("Hits:"));let l=n.split("//").length;t.push(`${" ".repeat(l)}${n} ${he(Nt(`\xD7 ${s}`))}`)}this.#t.size>0&&i&&t.push(` +Timers:`);let o=-1/0,a=new Map;for(let[n,{value:s}]of this.#t){let l=`${(Number(s)/1e6).toFixed(2)}ms`;a.set(n,l),o=Math.max(o,l.length)}for(let n of this.#t.keys()){let s=n.split("//").length;t.push(`${he(`[${a.get(n).padStart(o," ")}]`)}${" ".repeat(s-1)}${s===1?" ":he(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":he(Nt(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}r(` +${t.join(` +`)} +`),this.reset()}[Symbol.dispose](){ve&&this.report()}};function he(e){return`\x1B[2m${e}\x1B[22m`}function Nt(e){return`\x1B[34m${e}\x1B[39m`}var Vt=T(require("@jridgewell/remapping")),U=require("lightningcss"),Rt=T(require("magic-string"));function li(e,{file:r="input.css",minify:t=!1,map:i}={}){function o(l,u){return(0,U.transform)({filename:r,code:l,minify:t,sourceMap:typeof u<"u",inputSourceMap:u,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:U.Features.Nesting|U.Features.MediaQueries,exclude:U.Features.LogicalProperties|U.Features.DirSelector|U.Features.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0})}let a=o(Buffer.from(e),i);if(i=a.map?.toString(),a.warnings=a.warnings.filter(l=>!/'(deep|slotted|global)' is not recognized as a valid pseudo-/.test(l.message)),a.warnings.length>0){let l=e.split(` +`),u=[`Found ${a.warnings.length} ${a.warnings.length===1?"warning":"warnings"} while optimizing generated CSS:`];for(let[p,c]of a.warnings.entries()){u.push(""),a.warnings.length>1&&u.push(`Issue #${p+1}:`);let f=2,m=Math.max(0,c.loc.line-f-1),d=Math.min(l.length,c.loc.line+f),x=l.slice(m,d).map((h,L)=>m+L+1===c.loc.line?`${ie("\u2502")} ${h}`:ie(`\u2502 ${h}`));x.splice(c.loc.line-m,0,`${ie("\u2506")}${" ".repeat(c.loc.column-1)} ${si(`${ie("^--")} ${c.message}`)}`,`${ie("\u2506")}`),u.push(...x)}u.push(""),console.warn(u.join(` +`))}a=o(a.code,i),i=a.map?.toString();let n=a.code.toString(),s=new Rt.default(n);if(s.replaceAll("@media not (","@media not all and ("),i!==void 0&&s.hasChanged()){let l=s.generateMap({source:"original",hires:"boundary"}).toString();i=(0,Vt.default)([l,i],()=>null).toString()}return n=s.toString(),{code:n,map:i}}function ie(e){return`\x1B[2m${e}\x1B[22m`}function si(e){return`\x1B[33m${e}\x1B[39m`}var Ot=require("source-map-js");function ui(e){let r=new Ot.SourceMapGenerator,t=1,i=new g(o=>({url:o?.url??``,content:o?.content??""}));for(let o of e.mappings){let a=i.get(o.originalPosition?.source??null);r.addMapping({generated:o.generatedPosition,original:o.originalPosition,source:a.url,name:o.name}),r.setSourceContent(a.url,a.content)}return r.toString()}function fi(e){let r=typeof e=="string"?e:ui(e);return{raw:r,get inline(){let t="";return t+="/*# sourceMappingURL=data:application/json;base64,",t+=Buffer.from(r,"utf-8").toString("base64"),t+=` */ +`,t}}}process.versions.bun||Pt.register?.((0,_t.pathToFileURL)(require.resolve("@tailwindcss/node/esm-cache-loader")));0&&(module.exports={Features,Instrumentation,Polyfills,__unstable__loadDesignSystem,compile,compileAst,env,loadModule,normalizePath,optimize,toSourceMap}); diff --git a/node_modules/@tailwindcss/node/dist/index.mjs b/node_modules/@tailwindcss/node/dist/index.mjs new file mode 100644 index 0000000..3a4d2dc --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/index.mjs @@ -0,0 +1,18 @@ +var St=Object.defineProperty;var $t=(e,r)=>{for(var t in r)St(e,t,{get:r[t],enumerable:!0})};import*as ce from"module";import{pathToFileURL as Xr}from"url";var pe={};$t(pe,{DEBUG:()=>fe});var fe=Tt(process.env.DEBUG);function Tt(e){if(typeof e=="boolean")return e;if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let r=e.split(",").map(t=>t.split(":")[0]);return r.includes("-tailwindcss")?!1:!!r.includes("tailwindcss")}import F from"enhanced-resolve";import{createJiti as Kr}from"jiti";import Ve from"fs";import wt from"fs/promises";import se from"path";import{pathToFileURL as mt}from"url";import{__unstable__loadDesignSystem as zr,compile as Mr,compileAst as Fr,Features as ru,Polyfills as iu}from"tailwindcss";import de from"fs/promises";import j from"path";var Et=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],Nt=[".js",".cjs",".mjs"],Vt=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Rt=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Ot(e,r){for(let t of r){let i=`${e}${t}`;if((await de.stat(i).catch(()=>null))?.isFile())return i}for(let t of r){let i=`${e}/index${t}`;if(await de.access(i).then(()=>!0,()=>!1))return i}return null}async function Oe(e,r,t,i){let o=Nt.includes(i)?Vt:Rt,a=await Ot(j.resolve(t,r),o);if(a===null||e.has(a))return;e.add(a),t=j.dirname(a),i=j.extname(a);let n=await de.readFile(a,"utf-8"),s=[];for(let l of Et)for(let u of n.matchAll(l))u[1].startsWith(".")&&s.push(Oe(e,u[1],t,i));await Promise.all(s)}async function Pe(e){let r=new Set;return await Oe(r,e,j.dirname(e),j.extname(e)),Array.from(r)}import*as Te from"path";function M(e){return{kind:"word",value:e}}function Pt(e,r){return{kind:"function",value:e,nodes:r}}function _t(e){return{kind:"separator",value:e}}function S(e){let r="";for(let t of e)switch(t.kind){case"word":case"separator":{r+=t.value;break}case"function":r+=t.value+"("+S(t.nodes)+")"}return r}var _e=92,It=41,Ie=58,De=44,Dt=34,Ue=61,Le=62,Ke=60,ze=10,Ut=40,Lt=39,Kt=47,Me=32,Fe=9;function A(e){e=e.replaceAll(`\r +`,` +`);let r=[],t=[],i=null,o="",a;for(let n=0;n0){let u=M(o);i?i.nodes.push(u):r.push(u),o=""}let l=M(e[n]);i?i.nodes.push(l):r.push(l);break}case Ie:case De:case Ue:case Le:case Ke:case ze:case Me:case Fe:{if(o.length>0){let f=M(o);i?i.nodes.push(f):r.push(f),o=""}let l=n,u=n+1;for(;u0){let u=M(o);l?.nodes.push(u),o=""}t.length>0?i=t[t.length-1]:i=null;break}default:o+=String.fromCharCode(s)}}return o.length>0&&r.push(M(o)),r}var g=class extends Map{constructor(t){super();this.factory=t}get(t){let i=super.get(t);return i===void 0&&(i=this.factory(t,this),this.set(t,i)),i}};var ui=new Uint8Array(256);var te=new Uint8Array(256);function y(e,r){let t=0,i=[],o=0,a=e.length,n=r.charCodeAt(0);for(let s=0;s0&&l===te[t-1]&&t--;break}}return i.push(e.slice(o)),i}var me=(n=>(n[n.Continue=0]="Continue",n[n.Skip=1]="Skip",n[n.Stop=2]="Stop",n[n.Replace=3]="Replace",n[n.ReplaceSkip=4]="ReplaceSkip",n[n.ReplaceStop=5]="ReplaceStop",n))(me||{}),w={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function v(e,r){typeof r=="function"?je(e,r):je(e,r.enter,r.exit)}function je(e,r=()=>w.Continue,t=()=>w.Continue){let i=[[e,0,null]],o={parent:null,depth:0,path(){let a=[];for(let n=1;n0;){let a=i.length-1,n=i[a],s=n[0],l=n[1],u=n[2];if(l>=s.length){i.pop();continue}if(o.parent=u,o.depth=a,l>=0){let m=s[l],d=r(m,o)??w.Continue;switch(d.kind){case 0:{m.nodes&&m.nodes.length>0&&i.push([m.nodes,0,m]),n[1]=~l;continue}case 2:return;case 1:{n[1]=~l;continue}case 3:{s.splice(l,1,...d.nodes);continue}case 5:{s.splice(l,1,...d.nodes);return}case 4:{s.splice(l,1,...d.nodes),n[1]+=d.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${me[d.kind]??`Unknown(${d.kind})`}\` in enter.`)}}let p=~l,f=s[p],c=t(f,o)??w.Continue;switch(c.kind){case 0:n[1]=p+1;continue;case 2:return;case 3:{s.splice(p,1,...c.nodes),n[1]=p+c.nodes.length;continue}case 5:{s.splice(p,1,...c.nodes);return}case 4:{s.splice(p,1,...c.nodes),n[1]=p+c.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${me[c.kind]??`Unknown(${c.kind})`}\` in exit.`)}}}var ki=new g(e=>{let r=A(e),t=new Set;return v(r,(i,o)=>{let a=o.parent===null?r:o.parent.nodes??[];if(i.kind==="word"&&(i.value==="+"||i.value==="-"||i.value==="*"||i.value==="/")){let n=a.indexOf(i)??-1;if(n===-1)return;let s=a[n-1];if(s?.kind!=="separator"||s.value!==" ")return;let l=a[n+1];if(l?.kind!=="separator"||l.value!==" ")return;t.add(s),t.add(l)}else i.kind==="separator"&&i.value.length>0&&i.value.trim()===""?(a[0]===i||a[a.length-1]===i)&&t.add(i):i.kind==="separator"&&i.value.trim()===","&&(i.value=",")}),t.size>0&&v(r,i=>{if(t.has(i))return t.delete(i),w.ReplaceSkip([])}),ge(r),S(r)});var bi=new g(e=>{let r=A(e);return r.length===3&&r[0].kind==="word"&&r[0].value==="&"&&r[1].kind==="separator"&&r[1].value===":"&&r[2].kind==="function"&&r[2].value==="is"?S(r[2].nodes):e});function ge(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=W(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=W(r.value);for(let t=0;t{let r=A(e);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function zt(e){throw new Error(`Unexpected value: ${e}`)}function W(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var Mt=process.env.FEATURES_ENV!=="stable";var O=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,Oi=new RegExp(`^${O.source}$`);var Pi=new RegExp(`^${O.source}%$`);var _i=new RegExp(`^${O.source}s*/s*${O.source}$`);var Ft=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],Ii=new RegExp(`^${O.source}(${Ft.join("|")})$`);var jt=["deg","rad","grad","turn"],Di=new RegExp(`^${O.source}(${jt.join("|")})$`);var Ui=new RegExp(`^${O.source} +${O.source} +${O.source}$`);function C(e){let r=Number(e);return Number.isInteger(r)&&r>=0&&String(r)===String(e)}function B(e,r){if(r===null)return e;let t=Number(r);return Number.isNaN(t)||(r=`${t*100}%`),r==="100%"?e:`color-mix(in oklab, ${e} ${r}, transparent)`}var Yt={"--alpha":Gt,"--spacing":Ht,"--theme":qt,theme:Zt};function Gt(e,r,t,...i){let[o,a]=y(t,"/").map(n=>n.trim());if(!o||!a)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${o||"var(--my-color)"} / ${a||"50%"})\``);if(i.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${o||"var(--my-color)"} / ${a||"50%"})\``);return B(o,a)}function Ht(e,r,t,...i){if(!t)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(i.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${i.length+1}.`);let o=e.theme.resolve(null,["--spacing"]);if(!o)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${o} * ${t})`}function qt(e,r,t,...i){if(!t.startsWith("--"))throw new Error("The --theme(\u2026) function can only be used with CSS variables from your theme.");let o=!1;t.endsWith(" inline")&&(o=!0,t=t.slice(0,-7)),r.kind==="at-rule"&&(o=!0);let a=e.resolveThemeValue(t,o);if(!a){if(i.length>0)return i.join(", ");throw new Error(`Could not resolve value for theme function: \`theme(${t})\`. Consider checking if the variable name is correct or provide a fallback value to silence this error.`)}if(i.length===0)return a;let n=i.join(", ");if(n==="initial")return a;if(a==="initial")return n;if(a.startsWith("var(")||a.startsWith("theme(")||a.startsWith("--theme(")){let s=A(a);return Jt(s,n),S(s)}return a}function Zt(e,r,t,...i){t=Qt(t);let o=e.resolveThemeValue(t);if(!o&&i.length>0)return i.join(", ");if(!o)throw new Error(`Could not resolve value for theme function: \`theme(${t})\`. Consider checking if the path is correct or provide a fallback value to silence this error.`);return o}var on=new RegExp(Object.keys(Yt).map(e=>`${e}\\(`).join("|"));function Qt(e){if(e[0]!=="'"&&e[0]!=='"')return e;let r="",t=e[0];for(let i=1;i{if(t.kind==="function"&&!(t.value!=="var"&&t.value!=="theme"&&t.value!=="--theme"))if(t.nodes.length===1)t.nodes.push({kind:"word",value:`, ${r}`});else{let i=t.nodes[t.nodes.length-1];i.kind==="word"&&i.value==="initial"&&(i.value=r)}})}var er=/^(?[-+]?(?:\d*\.)?\d+)(?[a-z]+|%)?$/i,Ge=new g(e=>{let r=er.exec(e);if(!r)return null;let t=r.groups?.value;if(t===void 0)return null;let i=Number(t);if(Number.isNaN(i))return null;let o=r.groups?.unit;return o===void 0?[i,null]:[i,o]});function He(e,r="top",t="right",i="bottom",o="left"){return qe(`${e}-${r}`,`${e}-${t}`,`${e}-${i}`,`${e}-${o}`)}function qe(e="top",r="right",t="bottom",i="left"){return{1:[[e,0],[r,0],[t,0],[i,0]],2:[[e,0],[r,1],[t,0],[i,1]],3:[[e,0],[r,1],[t,2],[i,1]],4:[[e,0],[r,1],[t,2],[i,3]]}}function U(e,r){return{1:[[e,0],[r,0]],2:[[e,0],[r,1]]}}var Cn={inset:qe(),margin:He("margin"),padding:He("padding"),gap:U("row-gap","column-gap")},Sn={"inset-block":U("top","bottom"),"inset-inline":U("left","right"),"margin-block":U("margin-top","margin-bottom"),"margin-inline":U("margin-left","margin-right"),"padding-block":U("padding-top","padding-bottom"),"padding-inline":U("padding-left","padding-right")};var eo=Symbol();var to=Symbol();var ro=Symbol();var io=Symbol();var no=Symbol();var oo=Symbol();var ao=Symbol();var lo=Symbol();var so=Symbol();var uo=Symbol();var co=Symbol();var fo=Symbol();var po=Symbol();function we(e){let r=[0];for(let o=0;o0;){let l=(n|0)>>1,u=a+l;r[u]<=o?(a=u+1,n=n-l-1):n=l}a-=1;let s=o-r[a];return{line:a+1,column:s}}function i({line:o,column:a}){o-=1,o=Math.min(Math.max(o,0),r.length-1);let n=r[o],s=r[o+1]??n;return Math.min(Math.max(n+a,0),s)}return{find:t,findOffset:i}}var H=92,ie=47,ne=42,et=34,tt=39,pr=58,oe=59,T=10,ae=13,q=32,Z=9,rt=123,ye=125,xe=40,it=41,dr=91,mr=93,nt=45,ke=64,gr=33,E=class e extends Error{loc;constructor(r,t){if(t){let i=t[0],o=we(i.code).find(t[1]);r=`${i.file}:${o.line}:${o.column+1}: ${r}`}super(r),this.name="CssSyntaxError",this.loc=t,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function J(e,r){let t=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let i=[],o=[],a=[],n=null,s=null,l="",u="",p=0,f;for(let c=0;c0&&e[k]===d[d.length-1]&&(d=d.slice(0,-1));let I=be(l,h);if(!I)throw new E("Invalid custom property, expected a value",t?[t,x,c]:null);t&&(I.src=[t,x,c],I.dst=[t,x,c]),n?n.nodes.push(I):i.push(I),l=""}else if(m===oe&&l.charCodeAt(0)===ke)s=Q(l),t&&(s.src=[t,p,c],s.dst=[t,p,c]),n?n.nodes.push(s):i.push(s),l="",s=null;else if(m===oe&&u[u.length-1]!==")"){let d=be(l);if(!d){if(l.length===0)continue;throw new E(`Invalid declaration: \`${l.trim()}\``,t?[t,p,c]:null)}t&&(d.src=[t,p,c],d.dst=[t,p,c]),n?n.nodes.push(d):i.push(d),l=""}else if(m===rt&&u[u.length-1]!==")")u+="}",s=P(l.trim()),t&&(s.src=[t,p,c],s.dst=[t,p,c]),n&&n.nodes.push(s),a.push(n),n=s,l="",s=null;else if(m===ye&&u[u.length-1]!==")"){if(u==="")throw new E("Missing opening {",t?[t,c,c]:null);if(u=u.slice(0,-1),l.length>0)if(l.charCodeAt(0)===ke)s=Q(l),t&&(s.src=[t,p,c],s.dst=[t,p,c]),n?n.nodes.push(s):i.push(s),l="",s=null;else{let x=l.indexOf(":");if(n){let h=be(l,x);if(!h)throw new E(`Invalid declaration: \`${l.trim()}\``,t?[t,p,c]:null);t&&(h.src=[t,p,c],h.dst=[t,p,c]),n.nodes.push(h)}}let d=a.pop()??null;d===null&&n&&i.push(n),n=d,l="",s=null}else if(m===xe)u+=")",l+="(";else if(m===it){if(u[u.length-1]!==")")throw new E("Missing opening (",t?[t,c,c]:null);u=u.slice(0,-1),l+=")"}else{if(l.length===0&&(m===q||m===T||m===Z))continue;l===""&&(p=c),l+=String.fromCharCode(m)}}}if(l.charCodeAt(0)===ke){let c=Q(l);t&&(c.src=[t,p,e.length],c.dst=[t,p,e.length]),i.push(c)}if(u.length>0&&n){if(n.kind==="rule")throw new E(`Missing closing } at ${n.selector}`,n.src?[n.src[0],n.src[1],n.src[1]]:null);if(n.kind==="at-rule")throw new E(`Missing closing } at ${n.name} ${n.params}`,n.src?[n.src[0],n.src[1],n.src[1]]:null)}return o.length>0?o.concat(i):i}function Q(e,r=[]){let t=e,i="";for(let o=5;o{if(C(e.value))return e.value}),b=K(e=>{if(C(e.value))return`${e.value}%`}),_=K(e=>{if(C(e.value))return`${e.value}px`}),lt=K(e=>{if(C(e.value))return`${e.value}ms`}),le=K(e=>{if(C(e.value))return`${e.value}deg`}),kr=K(e=>{if(e.fraction===null)return;let[r,t]=y(e.fraction,"/");if(!(!C(r)||!C(t)))return e.fraction}),st=K(e=>{if(C(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),br={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",...kr},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...b}),backdropContrast:({theme:e})=>({...e("contrast"),...b}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...b}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...le}),backdropInvert:({theme:e})=>({...e("invert"),...b}),backdropOpacity:({theme:e})=>({...e("opacity"),...b}),backdropSaturate:({theme:e})=>({...e("saturate"),...b}),backdropSepia:({theme:e})=>({...e("sepia"),...b}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",..._},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...b},caretColor:({theme:e})=>e("colors"),colors:()=>({...Se}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...N},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...b},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),..._}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...N},flexShrink:{0:"0",DEFAULT:"1",...N},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...b},grayscale:{0:"0",DEFAULT:"100%",...b},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...N},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...N},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...N},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...N},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...st},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...st},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...le},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...b},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...N},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...b},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...N},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...le},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...b},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...b},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...b},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...le},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...N},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",..._},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...lt},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...lt},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...N}};var Ar=64;function D(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function $(e,r="",t=[]){return{kind:"at-rule",name:e,params:r,nodes:t}}function P(e,r=[]){return e.charCodeAt(0)===Ar?Q(e,r):D(e,r)}function V(e,r,t=!1){return{kind:"declaration",property:e,value:r,important:t}}function Ce(e){return{kind:"comment",value:e}}function L(e,r){let t=0,i={file:null,code:""};function o(n,s=0){let l="",u=" ".repeat(s);if(n.kind==="declaration"){if(l+=`${u}${n.property}: ${n.value}${n.important?" !important":""}; +`,r){t+=u.length;let p=t;t+=n.property.length,t+=2,t+=n.value?.length??0,n.important&&(t+=11);let f=t;t+=2,n.dst=[i,p,f]}}else if(n.kind==="rule"){if(l+=`${u}${n.selector} { +`,r){t+=u.length;let p=t;t+=n.selector.length,t+=1;let f=t;n.dst=[i,p,f],t+=2}for(let p of n.nodes)l+=o(p,s+1);l+=`${u}} +`,r&&(t+=u.length,t+=2)}else if(n.kind==="at-rule"){if(n.nodes.length===0){let p=`${u}${n.name} ${n.params}; +`;if(r){t+=u.length;let f=t;t+=n.name.length,t+=1,t+=n.params.length;let c=t;t+=2,n.dst=[i,f,c]}return p}if(l+=`${u}${n.name}${n.params?` ${n.params} `:" "}{ +`,r){t+=u.length;let p=t;t+=n.name.length,n.params&&(t+=1,t+=n.params.length),t+=1;let f=t;n.dst=[i,p,f],t+=2}for(let p of n.nodes)l+=o(p,s+1);l+=`${u}} +`,r&&(t+=u.length,t+=2)}else if(n.kind==="comment"){if(l+=`${u}/*${n.value}*/ +`,r){t+=u.length;let p=t;t+=2+n.value.length+2;let f=t;n.dst=[i,p,f],t+=1}}else if(n.kind==="context"||n.kind==="at-root")return"";return l}let a="";for(let n of e)a+=o(n,0);return i.code=a,a}function Cr(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var i="";if(t>4&&e[3]==="\\"){var o=e[2];(o==="?"||o===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//")}var a=e.split(/[/\\]+/);return r!==!1&&a[a.length-1]===""&&a.pop(),i+a.join("/")}function $e(e){let r=Cr(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var Ee=/(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g,Vr=/(?$r.test(e),Pr=e=>Tr.test(e);async function ct({css:e,base:r,root:t}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let i=J(e),o=[];function a(n){if(n[0]==="/")return n;let s=Te.posix.join($e(r),n),l=Te.posix.relative($e(t),s);return l.startsWith(".")||(l="./"+l),l}return v(i,n=>{if(n.kind!=="declaration"||!n.value)return;let s=Ee.test(n.value),l=ut.test(n.value);if(s||l){let u=l?_r:ft;o.push(u(n.value,a).then(p=>{n.value=p}))}}),o.length&&await Promise.all(o),L(i)}function ft(e,r){return dt(e,Ee,async t=>{let[i,o]=t;return await pt(o.trim(),i,r)})}async function _r(e,r){return await dt(e,ut,async t=>{let[,i]=t;return await Dr(i,async({url:a})=>Ee.test(a)?await ft(a,r):Sr.test(a)?a:await pt(a,a,r))})}async function pt(e,r,t,i="url"){let o="",a=e[0];if((a==='"'||a==="'")&&(o=a,e=e.slice(1,-1)),Ir(e))return r;let n=await t(e);return o===""&&n!==encodeURI(n)&&(o='"'),o==="'"&&n.includes("'")&&(o='"'),o==='"'&&n.includes('"')&&(n=n.replace(Vr,'\\"')),`${i}(${o}${n}${o})`}function Ir(e,r){return Pr(e)||Or(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||Er.test(e)}function Dr(e,r){return Promise.all(Ur(e).map(async({url:t,descriptor:i})=>({url:await r({url:t,descriptor:i}),descriptor:i}))).then(Lr)}function Ur(e){let r=e.trim().replace(Rr," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(Nr);return Array.from(r,({groups:t})=>({url:t?.url?.trim()??"",descriptor:t?.descriptor?.trim()??""})).filter(({url:t})=>!!t)}function Lr(e){return e.map(({url:r,descriptor:t})=>r+(t?` ${t}`:"")).join(", ")}async function dt(e,r,t){let i,o=e,a="";for(;i=r.exec(o);)a+=o.slice(0,i.index),a+=await t(i),o=o.slice(i.index+i[0].length);return a+=o,a}function yt({base:e,from:r,polyfills:t,onDependency:i,shouldRewriteUrls:o,customCssResolver:a,customJsResolver:n}){return{base:e,polyfills:t,from:r,async loadModule(s,l){return bt(s,l,i,n)},async loadStylesheet(s,l){let u=await xt(s,l,i,a);return o&&(u.content=await ct({css:u.content,root:e,base:u.base})),u}}}async function kt(e){if(e.root&&e.root!=="none"){let r=/[*{]/,t=[];for(let o of e.root.pattern.split("/")){if(r.test(o))break;t.push(o)}if(!await wt.stat(se.resolve(e.root.base,t.join("/"))).then(o=>o.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist or is not a directory.`)}}async function au(e,r){let t=await Fr(e,yt(r));return await kt(t),t}async function lu(e,r){let t=await Mr(e,yt(r));return await kt(t),t}async function su(e,{base:r}){return zr(e,{base:r,async loadModule(t,i){return bt(t,i,()=>{})},async loadStylesheet(t,i){return xt(t,i,()=>{})}})}async function bt(e,r,t,i){if(e[0]!=="."){let s=await vt(e,r,i);if(!s)throw new Error(`Could not resolve '${e}' from '${r}'`);let l=await ht(mt(s).href);return{path:s,base:se.dirname(s),module:l.default??l}}let o=await vt(e,r,i);if(!o)throw new Error(`Could not resolve '${e}' from '${r}'`);let[a,n]=await Promise.all([ht(mt(o).href+"?id="+Date.now()),Pe(o)]);for(let s of n)t(s);return{path:o,base:se.dirname(o),module:a.default??a}}async function xt(e,r,t,i){let o=await Wr(e,r,i);if(!o)throw new Error(`Could not resolve '${e}' from '${r}'`);t(o);let a=await wt.readFile(o,"utf-8");return{path:o,base:se.dirname(o),content:a}}var gt=null;async function ht(e){if(typeof globalThis.__tw_load=="function"){let r=await globalThis.__tw_load(e);if(r)return r}try{return await import(e)}catch{return gt??=Kr(import.meta.url,{moduleCache:!1,fsCache:!1}),await gt.import(e)}}var Re=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],jr=F.ResolverFactory.createResolver({fileSystem:new F.CachedInputFileSystem(Ve,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:Re});async function Wr(e,r,t){if(typeof globalThis.__tw_resolve=="function"){let i=globalThis.__tw_resolve(e,r);if(i)return Promise.resolve(i)}if(t){let i=await t(e,r);if(i)return i}return Ne(jr,e,r)}var Br=F.ResolverFactory.createResolver({fileSystem:new F.CachedInputFileSystem(Ve,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:Re}),Yr=F.ResolverFactory.createResolver({fileSystem:new F.CachedInputFileSystem(Ve,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:Re});async function vt(e,r,t){if(typeof globalThis.__tw_resolve=="function"){let i=globalThis.__tw_resolve(e,r);if(i)return Promise.resolve(i)}if(t){let i=await t(e,r);if(i)return i}return Ne(Br,e,r).catch(()=>Ne(Yr,e,r))}function Ne(e,r,t){return new Promise((i,o)=>e.resolve({},t,r,{},(a,n)=>{if(a)return o(a);i(n)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var At=class{constructor(r=t=>void process.stderr.write(`${t} +`)){this.defaultFlush=r}#r=new g(()=>({value:0}));#t=new g(()=>({value:0n}));#e=[];hit(r){this.#r.get(r).value++}start(r){let t=this.#e.map(o=>o.label).join("//"),i=`${t}${t.length===0?"":"//"}${r}`;this.#r.get(i).value++,this.#t.get(i),this.#e.push({id:i,label:r,namespace:t,value:process.hrtime.bigint()})}end(r){let t=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==r)throw new Error(`Mismatched timer label: \`${r}\`, expected \`${this.#e[this.#e.length-1].label}\``);let i=this.#e.pop(),o=t-i.value;this.#t.get(i.id).value+=o}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(r=this.defaultFlush){let t=[],i=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:s}]of this.#r.entries()){if(this.#t.has(n))continue;t.length===0&&(i=!0,t.push("Hits:"));let l=n.split("//").length;t.push(`${" ".repeat(l)}${n} ${ue(Ct(`\xD7 ${s}`))}`)}this.#t.size>0&&i&&t.push(` +Timers:`);let o=-1/0,a=new Map;for(let[n,{value:s}]of this.#t){let l=`${(Number(s)/1e6).toFixed(2)}ms`;a.set(n,l),o=Math.max(o,l.length)}for(let n of this.#t.keys()){let s=n.split("//").length;t.push(`${ue(`[${a.get(n).padStart(o," ")}]`)}${" ".repeat(s-1)}${s===1?" ":ue(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":ue(Ct(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}r(` +${t.join(` +`)} +`),this.reset()}[Symbol.dispose](){fe&&this.report()}};function ue(e){return`\x1B[2m${e}\x1B[22m`}function Ct(e){return`\x1B[34m${e}\x1B[39m`}import Gr from"@jridgewell/remapping";import{Features as X,transform as Hr}from"lightningcss";import qr from"magic-string";function gu(e,{file:r="input.css",minify:t=!1,map:i}={}){function o(l,u){return Hr({filename:r,code:l,minify:t,sourceMap:typeof u<"u",inputSourceMap:u,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:X.Nesting|X.MediaQueries,exclude:X.LogicalProperties|X.DirSelector|X.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0})}let a=o(Buffer.from(e),i);if(i=a.map?.toString(),a.warnings=a.warnings.filter(l=>!/'(deep|slotted|global)' is not recognized as a valid pseudo-/.test(l.message)),a.warnings.length>0){let l=e.split(` +`),u=[`Found ${a.warnings.length} ${a.warnings.length===1?"warning":"warnings"} while optimizing generated CSS:`];for(let[p,f]of a.warnings.entries()){u.push(""),a.warnings.length>1&&u.push(`Issue #${p+1}:`);let c=2,m=Math.max(0,f.loc.line-c-1),d=Math.min(l.length,f.loc.line+c),x=l.slice(m,d).map((h,I)=>m+I+1===f.loc.line?`${ee("\u2502")} ${h}`:ee(`\u2502 ${h}`));x.splice(f.loc.line-m,0,`${ee("\u2506")}${" ".repeat(f.loc.column-1)} ${Zr(`${ee("^--")} ${f.message}`)}`,`${ee("\u2506")}`),u.push(...x)}u.push(""),console.warn(u.join(` +`))}a=o(a.code,i),i=a.map?.toString();let n=a.code.toString(),s=new qr(n);if(s.replaceAll("@media not (","@media not all and ("),i!==void 0&&s.hasChanged()){let l=s.generateMap({source:"original",hires:"boundary"}).toString();i=Gr([l,i],()=>null).toString()}return n=s.toString(),{code:n,map:i}}function ee(e){return`\x1B[2m${e}\x1B[22m`}function Zr(e){return`\x1B[33m${e}\x1B[39m`}import{SourceMapGenerator as Qr}from"source-map-js";function Jr(e){let r=new Qr,t=1,i=new g(o=>({url:o?.url??``,content:o?.content??""}));for(let o of e.mappings){let a=i.get(o.originalPosition?.source??null);r.addMapping({generated:o.generatedPosition,original:o.originalPosition,source:a.url,name:o.name}),r.setSourceContent(a.url,a.content)}return r.toString()}function yu(e){let r=typeof e=="string"?e:Jr(e);return{raw:r,get inline(){let t="";return t+="/*# sourceMappingURL=data:application/json;base64,",t+=Buffer.from(r,"utf-8").toString("base64"),t+=` */ +`,t}}}if(!process.versions.bun){let e=ce.createRequire(import.meta.url);ce.register?.(Xr(e.resolve("@tailwindcss/node/esm-cache-loader")))}export{ru as Features,At as Instrumentation,iu as Polyfills,su as __unstable__loadDesignSystem,lu as compile,au as compileAst,pe as env,bt as loadModule,$e as normalizePath,gu as optimize,yu as toSourceMap}; diff --git a/node_modules/@tailwindcss/node/dist/require-cache.d.ts b/node_modules/@tailwindcss/node/dist/require-cache.d.ts new file mode 100644 index 0000000..de970b9 --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/require-cache.d.ts @@ -0,0 +1,3 @@ +declare function clearRequireCache(files: string[]): void; + +export { clearRequireCache }; diff --git a/node_modules/@tailwindcss/node/dist/require-cache.js b/node_modules/@tailwindcss/node/dist/require-cache.js new file mode 100644 index 0000000..398995f --- /dev/null +++ b/node_modules/@tailwindcss/node/dist/require-cache.js @@ -0,0 +1 @@ +"use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},u=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of f(e))!l.call(r,c)&&c!==t&&i(r,c,{get:()=>e[c],enumerable:!(o=a(e,c))||o.enumerable});return r};var h=r=>u(i({},"__esModule",{value:!0}),r);var d={};n(d,{clearRequireCache:()=>q});module.exports=h(d);function q(r){for(let e of r)delete require.cache[e]}0&&(module.exports={clearRequireCache}); diff --git a/node_modules/@tailwindcss/node/node_modules/.bin/jiti b/node_modules/@tailwindcss/node/node_modules/.bin/jiti new file mode 120000 index 0000000..18f28cf --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/.bin/jiti @@ -0,0 +1 @@ +../jiti/lib/jiti-cli.mjs \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/LICENSE b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/README.md b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/README.md new file mode 100644 index 0000000..93692b1 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/README.md @@ -0,0 +1,227 @@ +# @jridgewell/gen-mapping + +> Generate source maps + +`gen-mapping` allows you to generate a source map during transpilation or minification. +With a source map, you're able to trace the original location in the source file, either in Chrome's +DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This +provides the same `addMapping` and `setSourceContent` API. + +## Installation + +```sh +npm install @jridgewell/gen-mapping +``` + +## Usage + +```typescript +import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; + +const map = new GenMapping({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); + +setSourceContent(map, 'input.js', `function foo() {}`); + +addMapping(map, { + // Lines start at line 1, columns at column 0. + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +addMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 9 }, + name: 'foo', +}); + +assert.deepEqual(toDecodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: [ + [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] + ], +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: 'AAAA,SAASA', +}); +``` + +### Smaller Sourcemaps + +Not everything needs to be added to a sourcemap, and needless markings can cause signficantly +larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will +intelligently determine if this marking adds useful information. If not, the marking will be +skipped. + +```typescript +import { maybeAddMapping } from '@jridgewell/gen-mapping'; + +const map = new GenMapping(); + +// Adding a sourceless marking at the beginning of a line isn't useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, +}); + +// Adding a new source marking is useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +// But adding another marking pointing to the exact same original location isn't, even if the +// generated column changed. +maybeAddMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + names: [], + sources: ['input.js'], + sourcesContent: [null], + mappings: 'AAAA', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map +Memory Usage: +gen-mapping: addSegment 5852872 bytes +gen-mapping: addMapping 7716042 bytes +source-map-js 6143250 bytes +source-map-0.6.1 6124102 bytes +source-map-0.8.0 6121173 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) +gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) +source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) +source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) +source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) +gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) +source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) +source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) +source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +babel.min.js.map +Memory Usage: +gen-mapping: addSegment 37578063 bytes +gen-mapping: addMapping 37212897 bytes +source-map-js 47638527 bytes +source-map-0.6.1 47690503 bytes +source-map-0.8.0 47470188 bytes +Smallest memory usage is gen-mapping: addMapping + +Adding speed: +gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) +gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) +source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) +source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) +source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) +gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) +source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) +source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) +source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +preact.js.map +Memory Usage: +gen-mapping: addSegment 416247 bytes +gen-mapping: addMapping 419824 bytes +source-map-js 1024619 bytes +source-map-0.6.1 1146004 bytes +source-map-0.8.0 1113250 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) +gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) +source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) +source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) +source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) +gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) +source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) +source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) +source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +react.js.map +Memory Usage: +gen-mapping: addSegment 975096 bytes +gen-mapping: addMapping 1102981 bytes +source-map-js 2918836 bytes +source-map-0.6.1 2885435 bytes +source-map-0.8.0 2874336 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) +gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) +source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) +source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) +source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) +gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) +source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) +source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) +source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) +Fastest is gen-mapping: decoded output +``` + +[source-map]: https://www.npmjs.com/package/source-map +[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs new file mode 100644 index 0000000..bbb0cac --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs @@ -0,0 +1,292 @@ +// src/set-array.ts +var SetArray = class { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +}; +function cast(set) { + return set; +} +function get(setarr, key) { + return cast(setarr)._indexes[key]; +} +function put(setarr, key) { + const index = get(setarr, key); + if (index !== void 0) return index; + const { array, _indexes: indexes } = cast(setarr); + const length = array.push(key); + return indexes[key] = length - 1; +} +function remove(setarr, key) { + const index = get(setarr, key); + if (index === void 0) return; + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]--; + } + indexes[key] = void 0; + array.pop(); +} + +// src/gen-mapping.ts +import { + encode +} from "@jridgewell/sourcemap-codec"; +import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping"; + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; + +// src/gen-mapping.ts +var NO_NAME = -1; +var GenMapping = class { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +}; +function cast2(map) { + return map; +} +function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +} +function addMapping(map, mapping) { + return addMappingInternal(false, map, mapping); +} +var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +}; +var maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); +}; +function setSourceContent(map, source, content) { + const { + _sources: sources, + _sourcesContent: sourcesContent + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map, source, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} +function toDecodedMap(map) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast2(map); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map.file || void 0, + names: names.array, + sourceRoot: map.sourceRoot || void 0, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array + }; +} +function toEncodedMap(map) { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: encode(decoded.mappings) + }); +} +function fromMap(input) { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(cast2(gen)._names, map.names); + putAll(cast2(gen)._sources, map.sources); + cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast2(gen)._mappings = decodedMappings(map); + if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); + return gen; +} +function allMappings(map) { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = void 0; + let original = void 0; + let name = void 0; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; +} +function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names + // _originalScopes: originalScopes, + } = cast2(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + assert(sourceLine); + assert(sourceColumn); + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert( + line, + index, + name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] + ); +} +function assert(_val) { +} +function getIndex(arr, index) { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} +function putAll(setarr, array) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} +function skipSourceless(line, index) { + if (index === 0) return true; + const prev = line[index - 1]; + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + if (index === 0) return false; + const prev = line[index - 1]; + if (prev.length === 1) return false; + return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source, + original.line - 1, + original.column, + name, + content + ); +} +export { + GenMapping, + addMapping, + addSegment, + allMappings, + fromMap, + maybeAddMapping, + maybeAddSegment, + setIgnore, + setSourceContent, + toDecodedMap, + toEncodedMap +}; +//# sourceMappingURL=gen-mapping.mjs.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map new file mode 100644 index 0000000..4e37e45 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/set-array.ts", "../src/gen-mapping.ts", "../src/sourcemap-segment.ts"], + "mappings": ";AAUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;AChFA;AAAA,EACE;AAAA,OAGK;AACP,SAAS,UAAU,uBAAuB;;;ACKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;ADsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASA,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,UAAU,OAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,SAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,YAAY,gBAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", + "names": ["cast"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js new file mode 100644 index 0000000..cb84af5 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js @@ -0,0 +1,358 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.sourcemapCodec, global.traceMapping); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.genMapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_sourcemapCodec, require_traceMapping) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/sourcemap-codec +var require_sourcemap_codec = __commonJS({ + "umd:@jridgewell/sourcemap-codec"(exports, module2) { + module2.exports = require_sourcemapCodec; + } +}); + +// umd:@jridgewell/trace-mapping +var require_trace_mapping = __commonJS({ + "umd:@jridgewell/trace-mapping"(exports, module2) { + module2.exports = require_traceMapping; + } +}); + +// src/gen-mapping.ts +var gen_mapping_exports = {}; +__export(gen_mapping_exports, { + GenMapping: () => GenMapping, + addMapping: () => addMapping, + addSegment: () => addSegment, + allMappings: () => allMappings, + fromMap: () => fromMap, + maybeAddMapping: () => maybeAddMapping, + maybeAddSegment: () => maybeAddSegment, + setIgnore: () => setIgnore, + setSourceContent: () => setSourceContent, + toDecodedMap: () => toDecodedMap, + toEncodedMap: () => toEncodedMap +}); +module.exports = __toCommonJS(gen_mapping_exports); + +// src/set-array.ts +var SetArray = class { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +}; +function cast(set) { + return set; +} +function get(setarr, key) { + return cast(setarr)._indexes[key]; +} +function put(setarr, key) { + const index = get(setarr, key); + if (index !== void 0) return index; + const { array, _indexes: indexes } = cast(setarr); + const length = array.push(key); + return indexes[key] = length - 1; +} +function remove(setarr, key) { + const index = get(setarr, key); + if (index === void 0) return; + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]--; + } + indexes[key] = void 0; + array.pop(); +} + +// src/gen-mapping.ts +var import_sourcemap_codec = __toESM(require_sourcemap_codec()); +var import_trace_mapping = __toESM(require_trace_mapping()); + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; + +// src/gen-mapping.ts +var NO_NAME = -1; +var GenMapping = class { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +}; +function cast2(map) { + return map; +} +function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +} +function addMapping(map, mapping) { + return addMappingInternal(false, map, mapping); +} +var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +}; +var maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); +}; +function setSourceContent(map, source, content) { + const { + _sources: sources, + _sourcesContent: sourcesContent + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map, source, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} +function toDecodedMap(map) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast2(map); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map.file || void 0, + names: names.array, + sourceRoot: map.sourceRoot || void 0, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array + }; +} +function toEncodedMap(map) { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: (0, import_sourcemap_codec.encode)(decoded.mappings) + }); +} +function fromMap(input) { + const map = new import_trace_mapping.TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(cast2(gen)._names, map.names); + putAll(cast2(gen)._sources, map.sources); + cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map); + if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); + return gen; +} +function allMappings(map) { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = void 0; + let original = void 0; + let name = void 0; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; +} +function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names + // _originalScopes: originalScopes, + } = cast2(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + assert(sourceLine); + assert(sourceColumn); + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert( + line, + index, + name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] + ); +} +function assert(_val) { +} +function getIndex(arr, index) { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} +function putAll(setarr, array) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} +function skipSourceless(line, index) { + if (index === 0) return true; + const prev = line[index - 1]; + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + if (index === 0) return false; + const prev = line[index - 1]; + if (prev.length === 1) return false; + return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source, + original.line - 1, + original.column, + name, + content + ); +} +})); +//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map new file mode 100644 index 0000000..b13750b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/trace-mapping", "../src/gen-mapping.ts", "../src/set-array.ts", "../src/sourcemap-segment.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,2CAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;ADhFA,6BAIO;AACP,2BAA0C;;;AEKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;AFsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASC,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,cAAU,+BAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,8BAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,gBAAY,sCAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", + "names": ["module", "module", "cast"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts new file mode 100644 index 0000000..9ba936e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts @@ -0,0 +1,88 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts new file mode 100644 index 0000000..6ed4354 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts @@ -0,0 +1,32 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..aa19fb5 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,12 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..8eb90fb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts @@ -0,0 +1,43 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/package.json b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/package.json new file mode 100644 index 0000000..036f9b7 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/package.json @@ -0,0 +1,67 @@ +{ + "name": "@jridgewell/gen-mapping", + "version": "0.3.13", + "description": "Generate source maps", + "keywords": [ + "source", + "map" + ], + "main": "dist/gen-mapping.umd.js", + "module": "dist/gen-mapping.mjs", + "types": "types/gen-mapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/gen-mapping.d.mts", + "default": "./dist/gen-mapping.mjs" + }, + "default": { + "types": "./types/gen-mapping.d.cts", + "default": "./dist/gen-mapping.umd.js" + } + }, + "./dist/gen-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs gen-mapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/gen-mapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts new file mode 100644 index 0000000..ecc878c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts @@ -0,0 +1,614 @@ +import { SetArray, put, remove } from './set-array'; +import { + encode, + // encodeGeneratedRanges, + // encodeOriginalScopes +} from '@jridgewell/sourcemap-codec'; +import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; + +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, +} from './sourcemap-segment'; + +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec'; +import type { SourceMapSegment } from './sourcemap-segment'; +import type { + DecodedSourceMap, + EncodedSourceMap, + Pos, + Mapping, + // BindingExpressionRange, + // OriginalPos, + // OriginalScopeInfo, + // GeneratedRangeInfo, +} from './types'; + +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; + +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; + +const NO_NAME = -1; + +/** + * Provides the state to generate a sourcemap. + */ +export class GenMapping { + declare private _names: SetArray; + declare private _sources: SetArray; + declare private _sourcesContent: (string | null)[]; + declare private _mappings: SourceMapSegment[][]; + // private declare _originalScopes: OriginalScope[][]; + // private declare _generatedRanges: GeneratedRange[]; + declare private _ignoreList: SetArray; + declare file: string | null | undefined; + declare sourceRoot: string | null | undefined; + + constructor({ file, sourceRoot }: Options = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + // this._originalScopes = []; + // this._generatedRanges = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +} + +interface PublicMap { + _names: GenMapping['_names']; + _sources: GenMapping['_sources']; + _sourcesContent: GenMapping['_sourcesContent']; + _mappings: GenMapping['_mappings']; + // _originalScopes: GenMapping['_originalScopes']; + // _generatedRanges: GenMapping['_generatedRanges']; + _ignoreList: GenMapping['_ignoreList']; +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast(map: unknown): PublicMap { + return map as any; +} + +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source?: null, + sourceLine?: null, + sourceColumn?: null, + name?: null, + content?: null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source: string, + sourceLine: number, + sourceColumn: number, + name?: null, + content?: string | null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source: string, + sourceLine: number, + sourceColumn: number, + name: string, + content?: string | null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source?: string | null, + sourceLine?: number | null, + sourceColumn?: number | null, + name?: string | null, + content?: string | null, +): void { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, + ); +} + +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source?: string | null; + original?: Pos | null; + name?: string | null; + content?: string | null; + }, +): void { + return addMappingInternal(false, map, mapping as Parameters[2]); +} + +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export const maybeAddSegment: typeof addSegment = ( + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, +) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, + ); +}; + +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export const maybeAddMapping: typeof addMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping as Parameters[2]); +}; + +/** + * Adds/removes the content of the source file to the source map. + */ +export function setSourceContent(map: GenMapping, source: string, content: string | null): void { + const { + _sources: sources, + _sourcesContent: sourcesContent, + // _originalScopes: originalScopes, + } = cast(map); + const index = put(sources, source); + sourcesContent[index] = content; + // if (index === originalScopes.length) originalScopes[index] = []; +} + +export function setIgnore(map: GenMapping, source: string, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList, + // _originalScopes: originalScopes, + } = cast(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + // if (index === originalScopes.length) originalScopes[index] = []; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} + +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function toDecodedMap(map: GenMapping): DecodedSourceMap { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList, + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast(map); + removeEmptyFinalLines(mappings); + + return { + version: 3, + file: map.file || undefined, + names: names.array, + sourceRoot: map.sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array, + }; +} + +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function toEncodedMap(map: GenMapping): EncodedSourceMap { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: encode(decoded.mappings as SourceMapSegment[][]), + }); +} + +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export function fromMap(input: SourceMapInput): GenMapping { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + + putAll(cast(gen)._names, map.names); + putAll(cast(gen)._sources, map.sources as string[]); + cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings']; + // TODO: implement originalScopes/generatedRanges + if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList); + + return gen; +} + +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export function allMappings(map: GenMapping): Mapping[] { + const out: Mapping[] = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast(map); + + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + + const generated = { line: i + 1, column: seg[COLUMN] }; + let source: string | undefined = undefined; + let original: Pos | undefined = undefined; + let name: string | undefined = undefined; + + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + + out.push({ generated, source, original, name } as Mapping); + } + } + + return out; +} + +// This split declaration is only so that terser can elminiate the static initialization block. +function addSegmentInternal( + skipable: boolean, + map: GenMapping, + genLine: number, + genColumn: number, + source: S, + sourceLine: S extends string ? number : null | undefined, + sourceColumn: S extends string ? number : null | undefined, + name: S extends string ? string | null | undefined : null | undefined, + content: S extends string ? string | null | undefined : null | undefined, +): void { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + // _originalScopes: originalScopes, + } = cast(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + + // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source + // isn't nullish. + assert(sourceLine); + assert(sourceColumn); + + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null; + // if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = []; + + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + + return insert( + line, + index, + name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn], + ); +} + +function assert(_val: unknown): asserts _val is T { + // noop. +} + +function getIndex(arr: T[][], index: number): T[] { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} + +function getColumnIndex(line: SourceMapSegment[], genColumn: number): number { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} + +function insert(array: T[], index: number, value: T) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} + +function removeEmptyFinalLines(mappings: SourceMapSegment[][]) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} + +function putAll(setarr: SetArray, array: T[]) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} + +function skipSourceless(line: SourceMapSegment[], index: number): boolean { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) return true; + + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} + +function skipSource( + line: SourceMapSegment[], + index: number, + sourcesIndex: number, + sourceLine: number, + sourceColumn: number, + namesIndex: number, +): boolean { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) return false; + + const prev = line[index - 1]; + + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) return false; + + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return ( + sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME) + ); +} + +function addMappingInternal( + skipable: boolean, + map: GenMapping, + mapping: { + generated: Pos; + source: S; + original: S extends string ? Pos : null | undefined; + name: S extends string ? string | null | undefined : null | undefined; + content: S extends string ? string | null | undefined : null | undefined; + }, +) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null, + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source as string, + original.line - 1, + original.column, + name, + content, + ); +} + +/* +export function addOriginalScope( + map: GenMapping, + data: { + start: Pos; + end: Pos; + source: string; + kind: string; + name?: string; + variables?: string[]; + }, +): OriginalScopeInfo { + const { start, end, source, kind, name, variables } = data; + const { + _sources: sources, + _sourcesContent: sourcesContent, + _originalScopes: originalScopes, + _names: names, + } = cast(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (index === originalScopes.length) originalScopes[index] = []; + + const kindIndex = put(names, kind); + const scope: OriginalScope = name + ? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)] + : [start.line - 1, start.column, end.line - 1, end.column, kindIndex]; + if (variables) { + scope.vars = variables.map((v) => put(names, v)); + } + const len = originalScopes[index].push(scope); + return [index, len - 1, variables]; +} +*/ + +// Generated Ranges +/* +export function addGeneratedRange( + map: GenMapping, + data: { + start: Pos; + isScope: boolean; + originalScope?: OriginalScopeInfo; + callsite?: OriginalPos; + }, +): GeneratedRangeInfo { + const { start, isScope, originalScope, callsite } = data; + const { + _originalScopes: originalScopes, + _sources: sources, + _sourcesContent: sourcesContent, + _generatedRanges: generatedRanges, + } = cast(map); + + const range: GeneratedRange = [ + start.line - 1, + start.column, + 0, + 0, + originalScope ? originalScope[0] : -1, + originalScope ? originalScope[1] : -1, + ]; + if (originalScope?.[2]) { + range.bindings = originalScope[2].map(() => [[-1]]); + } + if (callsite) { + const index = put(sources, callsite.source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (index === originalScopes.length) originalScopes[index] = []; + range.callsite = [index, callsite.line - 1, callsite.column]; + } + if (isScope) range.isScope = true; + generatedRanges.push(range); + + return [range, originalScope?.[2]]; +} + +export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) { + range[0][2] = pos.line - 1; + range[0][3] = pos.column; +} + +export function addBinding( + map: GenMapping, + range: GeneratedRangeInfo, + variable: string, + expression: string | BindingExpressionRange, +) { + const { _names: names } = cast(map); + const bindings = (range[0].bindings ||= []); + const vars = range[1]; + + const index = vars!.indexOf(variable); + const binding = getIndex(bindings, index); + + if (typeof expression === 'string') binding[0] = [put(names, expression)]; + else { + const { start } = expression; + binding.push([put(names, expression.expression), start.line - 1, start.column]); + } +} +*/ diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/set-array.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/set-array.ts new file mode 100644 index 0000000..a2a73a5 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/set-array.ts @@ -0,0 +1,82 @@ +type Key = string | number | symbol; + +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export class SetArray { + declare private _indexes: Record; + declare array: readonly T[]; + + constructor() { + this._indexes = { __proto__: null } as any; + this.array = []; + } +} + +interface PublicSet { + array: T[]; + _indexes: SetArray['_indexes']; +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the set into a type + * with public access modifiers. + */ +function cast(set: SetArray): PublicSet { + return set as any; +} + +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export function get(setarr: SetArray, key: T): number | undefined { + return cast(setarr)._indexes[key]; +} + +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export function put(setarr: SetArray, key: T): number { + // The key may or may not be present. If it is present, it's a number. + const index = get(setarr, key); + if (index !== undefined) return index; + + const { array, _indexes: indexes } = cast(setarr); + + const length = array.push(key); + return (indexes[key] = length - 1); +} + +/** + * Pops the last added item out of the SetArray. + */ +export function pop(setarr: SetArray): void { + const { array, _indexes: indexes } = cast(setarr); + if (array.length === 0) return; + + const last = array.pop()!; + indexes[last] = undefined; +} + +/** + * Removes the key, if it exists in the set. + */ +export function remove(setarr: SetArray, key: T): void { + const index = get(setarr, key); + if (index === undefined) return; + + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]!--; + } + indexes[key] = undefined; + array.pop(); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts new file mode 100644 index 0000000..fb296dd --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts @@ -0,0 +1,16 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; + +export type SourceMapSegment = + | [GeneratedColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; + +export const COLUMN = 0; +export const SOURCES_INDEX = 1; +export const SOURCE_LINE = 2; +export const SOURCE_COLUMN = 3; +export const NAMES_INDEX = 4; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/types.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/types.ts new file mode 100644 index 0000000..b087f70 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/src/types.ts @@ -0,0 +1,61 @@ +// import type { GeneratedRange, OriginalScope } from '@jridgewell/sourcemap-codec'; +import type { SourceMapSegment } from './sourcemap-segment'; + +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} + +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; + // originalScopes: string[]; + // generatedRanges: string; +} + +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; + // originalScopes: readonly OriginalScope[][]; + // generatedRanges: readonly GeneratedRange[]; +} + +export interface Pos { + line: number; // 1-based + column: number; // 0-based +} + +export interface OriginalPos extends Pos { + source: string; +} + +export interface BindingExpressionRange { + start: Pos; + expression: string; +} + +// export type OriginalScopeInfo = [number, number, string[] | undefined]; +// export type GeneratedRangeInfo = [GeneratedRange, string[] | undefined]; + +export type Mapping = + | { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; + } + | { + generated: Pos; + source: string; + original: Pos; + name: string; + } + | { + generated: Pos; + source: string; + original: Pos; + name: undefined; + }; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts new file mode 100644 index 0000000..7618d85 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts @@ -0,0 +1,89 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.cts'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; +//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map new file mode 100644 index 0000000..8a2b183 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts new file mode 100644 index 0000000..bbc0d89 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts @@ -0,0 +1,89 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.mts'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; +//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map new file mode 100644 index 0000000..8a2b183 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts new file mode 100644 index 0000000..5d8cda3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts @@ -0,0 +1,33 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; +//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map new file mode 100644 index 0000000..c52b8bc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts new file mode 100644 index 0000000..5d8cda3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts @@ -0,0 +1,33 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; +//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map new file mode 100644 index 0000000..c52b8bc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts new file mode 100644 index 0000000..6886295 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts @@ -0,0 +1,13 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map new file mode 100644 index 0000000..23cdc45 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts new file mode 100644 index 0000000..6886295 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts @@ -0,0 +1,13 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map new file mode 100644 index 0000000..23cdc45 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts new file mode 100644 index 0000000..58da00a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts @@ -0,0 +1,44 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map new file mode 100644 index 0000000..159e734 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts new file mode 100644 index 0000000..e9837eb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts @@ -0,0 +1,44 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map new file mode 100644 index 0000000..159e734 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/LICENSE b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/README.md b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/README.md new file mode 100644 index 0000000..6d092d7 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/README.md @@ -0,0 +1,218 @@ +# @jridgewell/remapping + +> Remap sequential sourcemaps through transformations to point at the original source code + +Remapping allows you to take the sourcemaps generated through transforming your code and "remap" +them to the original source locations. Think "my minified code, transformed with babel and bundled +with webpack", all pointing to the correct location in your original source code. + +With remapping, none of your source code transformations need to be aware of the input's sourcemap, +they only need to generate an output sourcemap. This greatly simplifies building custom +transformations (think a find-and-replace). + +## Installation + +```sh +npm install @jridgewell/remapping +``` + +## Usage + +```typescript +function remapping( + map: SourceMap | SourceMap[], + loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), + options?: { excludeContent: boolean, decodedMappings: boolean } +): SourceMap; + +// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the +// "source" location (where child sources are resolved relative to, or the location of original +// source), and the ability to override the "content" of an original source for inclusion in the +// output sourcemap. +type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +} +``` + +`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer +in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents +a transformed file (it has a sourcmap associated with it), then the `loader` should return that +sourcemap. If not, the path will be treated as an original, untransformed source code. + +```js +// Babel transformed "helloworld.js" into "transformed.js" +const transformedMap = JSON.stringify({ + file: 'transformed.js', + // 1st column of 2nd line of output file translates into the 1st source + // file, line 3, column 2 + mappings: ';CAEE', + sources: ['helloworld.js'], + version: 3, +}); + +// Uglify minified "transformed.js" into "transformed.min.js" +const minifiedTransformedMap = JSON.stringify({ + file: 'transformed.min.js', + // 0th column of 1st line of output file translates into the 1st source + // file, line 2, column 1. + mappings: 'AACC', + names: [], + sources: ['transformed.js'], + version: 3, +}); + +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + // The "transformed.js" file is an transformed file. + if (file === 'transformed.js') { + // The root importer is empty. + console.assert(ctx.importer === ''); + // The depth in the sourcemap tree we're currently loading. + // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. + console.assert(ctx.depth === 1); + + return transformedMap; + } + + // Loader will be called to load transformedMap's source file pointers as well. + console.assert(file === 'helloworld.js'); + // `transformed.js`'s sourcemap points into `helloworld.js`. + console.assert(ctx.importer === 'transformed.js'); + // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. + console.assert(ctx.depth === 2); + return null; + } +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +In this example, `loader` will be called twice: + +1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the + associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can + be traced through it into the source files it represents. +2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so + we return `null`. + +The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If +you were to read the `mappings`, it says "0th column of the first line output line points to the 1st +column of the 2nd line of the file `helloworld.js`". + +### Multiple transformations of a file + +As a convenience, if you have multiple single-source transformations of a file, you may pass an +array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this +changes the `importer` and `depth` of each call to our loader. So our above example could have been +written as: + +```js +const remapped = remapping( + [minifiedTransformedMap, transformedMap], + () => null +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +### Advanced control of the loading graph + +#### `source` + +The `source` property can overridden to any value to change the location of the current load. Eg, +for an original source file, it allows us to change the location to the original source regardless +of what the sourcemap source entry says. And for transformed files, it allows us to change the +relative resolving location for child sources of the loaded sourcemap. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested + // source files are loaded, they will now be relative to `src/`. + ctx.source = 'src/transformed.js'; + return transformedMap; + } + + console.assert(file === 'src/helloworld.js'); + // We could futher change the source of this original file, eg, to be inside a nested directory + // itself. This will be reflected in the remapped sourcemap. + ctx.source = 'src/nested/transformed.js'; + return null; + } +); + +console.log(remapped); +// { +// …, +// sources: ['src/nested/helloworld.js'], +// }; +``` + + +#### `content` + +The `content` property can be overridden when we encounter an original source file. Eg, this allows +you to manually provide the source content of the original file regardless of whether the +`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove +the source content. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap + // would not include any `sourcesContent` values. + return transformedMap; + } + + console.assert(file === 'helloworld.js'); + // We can read the file to provide the source content. + ctx.content = fs.readFileSync(file, 'utf8'); + return null; + } +); + +console.log(remapped); +// { +// …, +// sourcesContent: [ +// 'console.log("Hello world!")', +// ], +// }; +``` + +### Options + +#### excludeContent + +By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the +`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce +the size out the sourcemap. + +#### decodedMappings + +By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the +`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of +encoding into a VLQ string. diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs new file mode 100644 index 0000000..8b7009c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs @@ -0,0 +1,144 @@ +// src/build-source-map-tree.ts +import { TraceMap } from "@jridgewell/trace-mapping"; + +// src/source-map-tree.ts +import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from "@jridgewell/gen-mapping"; +import { traceSegment, decodedMappings } from "@jridgewell/trace-mapping"; +var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); +var EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore + }; +} +function MapSource(map, sources) { + return Source(map, sources, "", null, false); +} +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +function traceMappings(tree) { + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + if (segment.length !== 1) { + const source2 = rootSources[segment[1]]; + traced = originalPositionFor( + source2, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : "" + ); + if (traced == null) continue; + } + const { column, line, name, content, source, ignore } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) setSourceContent(gen, source, content); + if (ignore) setIgnore(gen, source, true); + } + } + return gen; +} +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = traceSegment(source.map, line, column); + if (segment == null) return null; + if (segment.length === 1) return SOURCELESS_MAPPING; + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name + ); +} + +// src/build-source-map-tree.ts +function asArray(value) { + if (Array.isArray(value)) return value; + return [value]; +} +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, "")); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file. +Did you specify these with the most recent transformation maps first?` + ); + } + } + let tree = build(map, loader, "", 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + const ctx = { + importer, + depth, + source: sourceFile || "", + content: void 0, + ignore: void 0 + }; + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); + const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +// src/source-map.ts +import { toDecodedMap, toEncodedMap } from "@jridgewell/gen-mapping"; +var SourceMap = class { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +}; + +// src/remapping.ts +function remapping(input, loader, options) { + const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} +export { + remapping as default +}; +//# sourceMappingURL=remapping.mjs.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs.map new file mode 100644 index 0000000..66801e6 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts", "../src/remapping.ts"], + "mappings": ";AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,YAAY,iBAAiB,WAAW,wBAAwB;AACzE,SAAS,cAAc,uBAAuB;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,SAAS,MAAM;AAC5D;AAMO,SAAS,cAAc,MAA6B;AAGzD,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,KAAK,IAAI,KAAK,CAAC;AAClD,QAAM,EAAE,SAAS,aAAa,IAAI,IAAI;AACtC,QAAM,YAAY,IAAI;AACtB,QAAM,eAAe,gBAAgB,GAAG;AAExC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC5C,UAAM,WAAW,aAAa,CAAC;AAE/B,aAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,YAAM,UAAU,SAAS,CAAC;AAC1B,YAAM,SAAS,QAAQ,CAAC;AACxB,UAAI,SAAwC;AAI5C,UAAI,QAAQ,WAAW,GAAG;AACxB,cAAMA,UAAS,YAAY,QAAQ,CAAC,CAAC;AACrC,iBAAS;AAAA,UACPA;AAAA,UACA,QAAQ,CAAC;AAAA,UACT,QAAQ,CAAC;AAAA,UACT,QAAQ,WAAW,IAAI,UAAU,QAAQ,CAAC,CAAC,IAAI;AAAA,QACjD;AAIA,YAAI,UAAU,KAAM;AAAA,MACtB;AAEA,YAAM,EAAE,QAAQ,MAAM,MAAM,SAAS,QAAQ,OAAO,IAAI;AAExD,sBAAgB,KAAK,GAAG,QAAQ,QAAQ,MAAM,QAAQ,IAAI;AAC1D,UAAI,UAAU,WAAW,KAAM,kBAAiB,KAAK,QAAQ,OAAO;AACpE,UAAI,OAAQ,WAAU,KAAK,QAAQ,IAAI;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAMO,SAAS,oBACd,QACA,MACA,QACA,MAC+B;AAC/B,MAAI,CAAC,OAAO,KAAK;AACf,WAAO,cAAc,OAAO,QAAQ,MAAM,QAAQ,MAAM,OAAO,SAAS,OAAO,MAAM;AAAA,EACvF;AAEA,QAAM,UAAU,aAAa,OAAO,KAAK,MAAM,MAAM;AAGrD,MAAI,WAAW,KAAM,QAAO;AAG5B,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzB,QAAQ,CAAC;AAAA,IACT,QAAQ,CAAC;AAAA,IACT,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM,QAAQ,CAAC,CAAC,IAAI;AAAA,EACxD;AACF;;;ADpKA,SAAS,QAAW,OAAqB;AACvC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,CAAC,KAAK;AACf;AAae,SAAR,mBACL,OACA,QACe;AACf,QAAM,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS,GAAG,EAAE,CAAC;AAC1D,QAAM,MAAM,KAAK,IAAI;AAErB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,QAAQ,SAAS,GAAG;AAC9B,YAAM,IAAI;AAAA,QACR,sBAAsB,CAAC;AAAA;AAAA,MAEzB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC;AACnC,WAAS,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;AACzC,WAAO,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAAA,EAClC;AACA,SAAO;AACT;AAEA,SAAS,MACP,KACA,QACA,UACA,eACe;AACf,QAAM,EAAE,iBAAiB,gBAAgB,WAAW,IAAI;AAExD,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,WAAW,gBAAgB,IAAI,CAAC,YAA2B,MAAuB;AAKtF,UAAM,MAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,QAAQ,cAAc;AAAA,MACtB,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAIA,UAAM,YAAY,OAAO,IAAI,QAAQ,GAAG;AAExC,UAAM,EAAE,QAAQ,SAAS,OAAO,IAAI;AAGpC,QAAI,UAAW,QAAO,MAAM,IAAI,SAAS,WAAW,MAAM,GAAG,QAAQ,QAAQ,KAAK;AAMlF,UAAM,gBACJ,YAAY,SAAY,UAAU,iBAAiB,eAAe,CAAC,IAAI;AACzE,UAAM,UAAU,WAAW,SAAY,SAAS,aAAa,WAAW,SAAS,CAAC,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,SAAS,cAAc,oBAAoB;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,kBAAkB,aAAa,GAAG,IAAI,aAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;ACLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", + "names": ["source"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js new file mode 100644 index 0000000..077eb4d --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js @@ -0,0 +1,212 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/gen-mapping'), require('@jridgewell/trace-mapping')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/gen-mapping', '@jridgewell/trace-mapping'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.genMapping, global.traceMapping); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.remapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_genMapping, require_traceMapping) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/trace-mapping +var require_trace_mapping = __commonJS({ + "umd:@jridgewell/trace-mapping"(exports, module2) { + module2.exports = require_traceMapping; + } +}); + +// umd:@jridgewell/gen-mapping +var require_gen_mapping = __commonJS({ + "umd:@jridgewell/gen-mapping"(exports, module2) { + module2.exports = require_genMapping; + } +}); + +// src/remapping.ts +var remapping_exports = {}; +__export(remapping_exports, { + default: () => remapping +}); +module.exports = __toCommonJS(remapping_exports); + +// src/build-source-map-tree.ts +var import_trace_mapping2 = __toESM(require_trace_mapping()); + +// src/source-map-tree.ts +var import_gen_mapping = __toESM(require_gen_mapping()); +var import_trace_mapping = __toESM(require_trace_mapping()); +var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); +var EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore + }; +} +function MapSource(map, sources) { + return Source(map, sources, "", null, false); +} +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +function traceMappings(tree) { + const gen = new import_gen_mapping.GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = (0, import_trace_mapping.decodedMappings)(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + if (segment.length !== 1) { + const source2 = rootSources[segment[1]]; + traced = originalPositionFor( + source2, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : "" + ); + if (traced == null) continue; + } + const { column, line, name, content, source, ignore } = traced; + (0, import_gen_mapping.maybeAddSegment)(gen, i, genCol, source, line, column, name); + if (source && content != null) (0, import_gen_mapping.setSourceContent)(gen, source, content); + if (ignore) (0, import_gen_mapping.setIgnore)(gen, source, true); + } + } + return gen; +} +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = (0, import_trace_mapping.traceSegment)(source.map, line, column); + if (segment == null) return null; + if (segment.length === 1) return SOURCELESS_MAPPING; + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name + ); +} + +// src/build-source-map-tree.ts +function asArray(value) { + if (Array.isArray(value)) return value; + return [value]; +} +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new import_trace_mapping2.TraceMap(m, "")); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file. +Did you specify these with the most recent transformation maps first?` + ); + } + } + let tree = build(map, loader, "", 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + const ctx = { + importer, + depth, + source: sourceFile || "", + content: void 0, + ignore: void 0 + }; + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + if (sourceMap) return build(new import_trace_mapping2.TraceMap(sourceMap, source), loader, source, depth); + const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +// src/source-map.ts +var import_gen_mapping2 = __toESM(require_gen_mapping()); +var SourceMap = class { + constructor(map, options) { + const out = options.decodedMappings ? (0, import_gen_mapping2.toDecodedMap)(map) : (0, import_gen_mapping2.toEncodedMap)(map); + this.version = out.version; + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +}; + +// src/remapping.ts +function remapping(input, loader, options) { + const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} +})); +//# sourceMappingURL=remapping.umd.js.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map new file mode 100644 index 0000000..d5e0786 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/trace-mapping", "umd:@jridgewell/gen-mapping", "../src/remapping.ts", "../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,2CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,wBAAyB;;;ACAzB,yBAAyE;AACzE,2BAA8C;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,SAAS,MAAM;AAC5D;AAMO,SAAS,cAAc,MAA6B;AAGzD,QAAM,MAAM,IAAI,8BAAW,EAAE,MAAM,KAAK,IAAI,KAAK,CAAC;AAClD,QAAM,EAAE,SAAS,aAAa,IAAI,IAAI;AACtC,QAAM,YAAY,IAAI;AACtB,QAAM,mBAAe,sCAAgB,GAAG;AAExC,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC5C,UAAM,WAAW,aAAa,CAAC;AAE/B,aAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,YAAM,UAAU,SAAS,CAAC;AAC1B,YAAM,SAAS,QAAQ,CAAC;AACxB,UAAI,SAAwC;AAI5C,UAAI,QAAQ,WAAW,GAAG;AACxB,cAAMC,UAAS,YAAY,QAAQ,CAAC,CAAC;AACrC,iBAAS;AAAA,UACPA;AAAA,UACA,QAAQ,CAAC;AAAA,UACT,QAAQ,CAAC;AAAA,UACT,QAAQ,WAAW,IAAI,UAAU,QAAQ,CAAC,CAAC,IAAI;AAAA,QACjD;AAIA,YAAI,UAAU,KAAM;AAAA,MACtB;AAEA,YAAM,EAAE,QAAQ,MAAM,MAAM,SAAS,QAAQ,OAAO,IAAI;AAExD,8CAAgB,KAAK,GAAG,QAAQ,QAAQ,MAAM,QAAQ,IAAI;AAC1D,UAAI,UAAU,WAAW,KAAM,0CAAiB,KAAK,QAAQ,OAAO;AACpE,UAAI,OAAQ,mCAAU,KAAK,QAAQ,IAAI;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAMO,SAAS,oBACd,QACA,MACA,QACA,MAC+B;AAC/B,MAAI,CAAC,OAAO,KAAK;AACf,WAAO,cAAc,OAAO,QAAQ,MAAM,QAAQ,MAAM,OAAO,SAAS,OAAO,MAAM;AAAA,EACvF;AAEA,QAAM,cAAU,mCAAa,OAAO,KAAK,MAAM,MAAM;AAGrD,MAAI,WAAW,KAAM,QAAO;AAG5B,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzB,QAAQ,CAAC;AAAA,IACT,QAAQ,CAAC;AAAA,IACT,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM,QAAQ,CAAC,CAAC,IAAI;AAAA,EACxD;AACF;;;ADpKA,SAAS,QAAW,OAAqB;AACvC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,CAAC,KAAK;AACf;AAae,SAAR,mBACL,OACA,QACe;AACf,QAAM,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,+BAAS,GAAG,EAAE,CAAC;AAC1D,QAAM,MAAM,KAAK,IAAI;AAErB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,QAAQ,SAAS,GAAG;AAC9B,YAAM,IAAI;AAAA,QACR,sBAAsB,CAAC;AAAA;AAAA,MAEzB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC;AACnC,WAAS,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;AACzC,WAAO,UAAU,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAAA,EAClC;AACA,SAAO;AACT;AAEA,SAAS,MACP,KACA,QACA,UACA,eACe;AACf,QAAM,EAAE,iBAAiB,gBAAgB,WAAW,IAAI;AAExD,QAAM,QAAQ,gBAAgB;AAC9B,QAAM,WAAW,gBAAgB,IAAI,CAAC,YAA2B,MAAuB;AAKtF,UAAM,MAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,QAAQ,cAAc;AAAA,MACtB,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAIA,UAAM,YAAY,OAAO,IAAI,QAAQ,GAAG;AAExC,UAAM,EAAE,QAAQ,SAAS,OAAO,IAAI;AAGpC,QAAI,UAAW,QAAO,MAAM,IAAI,+BAAS,WAAW,MAAM,GAAG,QAAQ,QAAQ,KAAK;AAMlF,UAAM,gBACJ,YAAY,SAAY,UAAU,iBAAiB,eAAe,CAAC,IAAI;AACzE,UAAM,UAAU,WAAW,SAAY,SAAS,aAAa,WAAW,SAAS,CAAC,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,IAAAC,sBAA2C;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,sBAAkB,kCAAa,GAAG,QAAI,kCAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;AHLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", + "names": ["module", "module", "import_trace_mapping", "source", "import_gen_mapping"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/package.json b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/package.json new file mode 100644 index 0000000..ed00441 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/package.json @@ -0,0 +1,71 @@ +{ + "name": "@jridgewell/remapping", + "version": "2.3.5", + "description": "Remap sequential sourcemaps through transformations to point at the original source code", + "keywords": [ + "source", + "map", + "remap" + ], + "main": "dist/remapping.umd.js", + "module": "dist/remapping.mjs", + "types": "types/remapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/remapping.d.mts", + "default": "./dist/remapping.mjs" + }, + "default": { + "types": "./types/remapping.d.cts", + "default": "./dist/remapping.umd.js" + } + }, + "./dist/remapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs remapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/remapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/remapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "devDependencies": { + "source-map": "0.6.1" + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts new file mode 100644 index 0000000..3e0262b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts @@ -0,0 +1,89 @@ +import { TraceMap } from '@jridgewell/trace-mapping'; + +import { OriginalSource, MapSource } from './source-map-tree'; + +import type { Sources, MapSource as MapSourceType } from './source-map-tree'; +import type { SourceMapInput, SourceMapLoader, LoaderContext } from './types'; + +function asArray(value: T | T[]): T[] { + if (Array.isArray(value)) return value; + return [value]; +} + +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree( + input: SourceMapInput | SourceMapInput[], + loader: SourceMapLoader, +): MapSourceType { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop()!; + + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?', + ); + } + } + + let tree = build(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} + +function build( + map: TraceMap, + loader: SourceMapLoader, + importer: string, + importerDepth: number, +): MapSourceType { + const { resolvedSources, sourcesContent, ignoreList } = map; + + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx: LoaderContext = { + importer, + depth, + source: sourceFile || '', + content: undefined, + ignore: undefined, + }; + + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + + const { source, content, ignore } = ctx; + + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); + + // Else, it's an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = + content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + + return MapSource(map, children); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/remapping.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/remapping.ts new file mode 100644 index 0000000..c0f8b0d --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/remapping.ts @@ -0,0 +1,42 @@ +import buildSourceMapTree from './build-source-map-tree'; +import { traceMappings } from './source-map-tree'; +import SourceMap from './source-map'; + +import type { SourceMapInput, SourceMapLoader, Options } from './types'; +export type { + SourceMapSegment, + EncodedSourceMap, + EncodedSourceMap as RawSourceMap, + DecodedSourceMap, + SourceMapInput, + SourceMapLoader, + LoaderContext, + Options, +} from './types'; +export type { SourceMap }; + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping( + input: SourceMapInput | SourceMapInput[], + loader: SourceMapLoader, + options?: boolean | Options, +): SourceMap { + const opts = + typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map-tree.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map-tree.ts new file mode 100644 index 0000000..935240f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map-tree.ts @@ -0,0 +1,172 @@ +import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping'; +import { traceSegment, decodedMappings } from '@jridgewell/trace-mapping'; + +import type { TraceMap } from '@jridgewell/trace-mapping'; + +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; + +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; + +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; + +export type Sources = OriginalSource | MapSource; + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); +const EMPTY_SOURCES: Sources[] = []; + +function SegmentObject( + source: string, + line: number, + column: number, + name: string, + content: string | null, + ignore: boolean, +): SourceMapSegmentObject { + return { source, line, column, name, content, ignore }; +} + +function Source( + map: TraceMap, + sources: Sources[], + source: '', + content: null, + ignore: false, +): MapSource; +function Source( + map: null, + sources: Sources[], + source: string, + content: string | null, + ignore: boolean, +): OriginalSource; +function Source( + map: TraceMap | null, + sources: Sources[], + source: string | '', + content: string | null, + ignore: boolean, +): Sources { + return { + map, + sources, + source, + content, + ignore, + } as any; +} + +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export function MapSource(map: TraceMap, sources: Sources[]): MapSource { + return Source(map, sources, '', null, false); +} + +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export function OriginalSource( + source: string, + content: string | null, + ignore: boolean, +): OriginalSource { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} + +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export function traceMappings(tree: MapSource): GenMapping { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING; + + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor( + source, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : '', + ); + + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) continue; + } + + const { column, line, name, content, source, ignore } = traced; + + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) setSourceContent(gen, source, content); + if (ignore) setIgnore(gen, source, true); + } + } + + return gen; +} + +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export function originalPositionFor( + source: Sources, + line: number, + column: number, + name: string, +): SourceMapSegmentObject | null { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + + const segment = traceSegment(source.map, line, column); + + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) return SOURCELESS_MAPPING; + + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name, + ); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map.ts new file mode 100644 index 0000000..5156086 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/source-map.ts @@ -0,0 +1,38 @@ +import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping'; + +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types'; + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + declare file?: string | null; + declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + declare sourceRoot?: string; + declare names: string[]; + declare sources: (string | null)[]; + declare sourcesContent?: (string | null)[]; + declare version: 3; + declare ignoreList: number[] | undefined; + + constructor(map: GenMapping, options: Options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings as SourceMap['mappings']; + this.names = out.names as SourceMap['names']; + this.ignoreList = out.ignoreList as SourceMap['ignoreList']; + this.sourceRoot = out.sourceRoot; + + this.sources = out.sources as SourceMap['sources']; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent']; + } + } + + toString(): string { + return JSON.stringify(this); + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/types.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/types.ts new file mode 100644 index 0000000..384961d --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/src/types.ts @@ -0,0 +1,27 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; + +export type { + SourceMapSegment, + DecodedSourceMap, + EncodedSourceMap, +} from '@jridgewell/trace-mapping'; + +export type { SourceMapInput }; + +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; + +export type SourceMapLoader = ( + file: string, + ctx: LoaderContext, +) => SourceMapInput | null | undefined | void; + +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts new file mode 100644 index 0000000..e089aea --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts @@ -0,0 +1,15 @@ +import type { MapSource as MapSourceType } from './source-map-tree.cts'; +import type { SourceMapInput, SourceMapLoader } from './types.cts'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export = function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; +//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map new file mode 100644 index 0000000..38e4290 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts new file mode 100644 index 0000000..746ac5f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts @@ -0,0 +1,15 @@ +import type { MapSource as MapSourceType } from './source-map-tree.mts'; +import type { SourceMapInput, SourceMapLoader } from './types.mts'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; +//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map new file mode 100644 index 0000000..38e4290 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts new file mode 100644 index 0000000..2022784 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts @@ -0,0 +1,21 @@ +import SourceMap from './source-map.cts'; +import type { SourceMapInput, SourceMapLoader, Options } from './types.cts'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.cts'; +export type { SourceMap }; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export = function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; +//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts.map new file mode 100644 index 0000000..9f2fd0e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts new file mode 100644 index 0000000..95c4066 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts @@ -0,0 +1,21 @@ +import SourceMap from './source-map.mts'; +import type { SourceMapInput, SourceMapLoader, Options } from './types.mts'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.mts'; +export type { SourceMap }; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; +//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts.map new file mode 100644 index 0000000..9f2fd0e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/remapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts new file mode 100644 index 0000000..440f65b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts @@ -0,0 +1,46 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; +export type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; +//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map new file mode 100644 index 0000000..e7cbfb9 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts new file mode 100644 index 0000000..440f65b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts @@ -0,0 +1,46 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; +export type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; +//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map new file mode 100644 index 0000000..e7cbfb9 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts new file mode 100644 index 0000000..fdb7eed --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts @@ -0,0 +1,19 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.cts'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export = class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList: number[] | undefined; + constructor(map: GenMapping, options: Options); + toString(): string; +} +//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts.map new file mode 100644 index 0000000..593daf8 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts new file mode 100644 index 0000000..52ebba2 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts @@ -0,0 +1,19 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.mts'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList: number[] | undefined; + constructor(map: GenMapping, options: Options); + toString(): string; +} +//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts.map new file mode 100644 index 0000000..593daf8 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/source-map.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts new file mode 100644 index 0000000..eeb320f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts @@ -0,0 +1,16 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; +export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts.map new file mode 100644 index 0000000..4f8647e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts new file mode 100644 index 0000000..eeb320f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts @@ -0,0 +1,16 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; +export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts.map new file mode 100644 index 0000000..4f8647e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping/types/types.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/LICENSE b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/LICENSE new file mode 100644 index 0000000..0a81b2a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/LICENSE @@ -0,0 +1,19 @@ +Copyright 2019 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/README.md b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/README.md new file mode 100644 index 0000000..2fe70df --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/README.md @@ -0,0 +1,40 @@ +# @jridgewell/resolve-uri + +> Resolve a URI relative to an optional base URI + +Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. + +## Installation + +```sh +npm install @jridgewell/resolve-uri +``` + +## Usage + +```typescript +function resolve(input: string, base?: string): string; +``` + +```js +import resolve from '@jridgewell/resolve-uri'; + +resolve('foo', 'https://example.com'); // => 'https://example.com/foo' +``` + +| Input | Base | Resolution | Explanation | +|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| +| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | +| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | +| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | +| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | +| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | +| `/example` | _rest_ | `/example` | Input is normalized only | +| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | +| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | +| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | +| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | +| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | +| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | +| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | +| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs new file mode 100644 index 0000000..e958e88 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs @@ -0,0 +1,232 @@ +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: 7 /* Absolute */, + }; +} +function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = 6 /* SchemeRelative */; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = 5 /* AbsolutePath */; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? 3 /* Query */ + : input.startsWith('#') + ? 2 /* Hash */ + : 4 /* RelativePath */ + : 1 /* Empty */; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath(url, type) { + const rel = type <= 4 /* RelativePath */; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== 7 /* Absolute */) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1 /* Empty */: + url.hash = baseUrl.hash; + // fall through + case 2 /* Hash */: + url.query = baseUrl.query; + // fall through + case 3 /* Query */: + case 4 /* RelativePath */: + mergePaths(url, baseUrl); + // fall through + case 5 /* AbsolutePath */: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case 6 /* SchemeRelative */: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case 2 /* Hash */: + case 3 /* Query */: + return queryHash; + case 4 /* RelativePath */: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case 5 /* AbsolutePath */: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +export { resolve as default }; +//# sourceMappingURL=resolve-uri.mjs.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map new file mode 100644 index 0000000..1de97d0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAuBpF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;IAEZ,OAAO;QACL,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;QAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,0BAA0B;QAClC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,wBAAwB;QAChC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;IACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IACd,GAAG,CAAC,IAAI,GAAG,KAAK;UACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;cAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;wBAGT;IAClB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;;;IAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;IACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;IAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;QACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;KACtB;SAAM;;QAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;KACpD;AACH,CAAC;AAED;;;;AAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;IAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;IAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;IAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;IAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;QAGxB,IAAI,CAAC,KAAK,EAAE;YACV,gBAAgB,GAAG,IAAI,CAAC;YACxB,SAAS;SACV;;QAGD,gBAAgB,GAAG,KAAK,CAAC;;QAGzB,IAAI,KAAK,KAAK,GAAG;YAAE,SAAS;;;QAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,QAAQ,EAAE;gBACZ,gBAAgB,GAAG,IAAI,CAAC;gBACxB,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,CAAC;aACX;iBAAM,IAAI,GAAG,EAAE;;;gBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;aAC3B;YACD,SAAS;SACV;;;QAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;QAC1B,QAAQ,EAAE,CAAC;KACZ;IAED,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;KACzB;IACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QACxD,IAAI,IAAI,GAAG,CAAC;KACb;IACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;AAClB,CAAC;AAED;;;SAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;IACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;IAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;QAE9B,QAAQ,SAAS;YACf;gBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;gBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;YAG5B,mBAAmB;YACnB;gBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;YAG3B;;gBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;;gBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;SAC/B;QACD,IAAI,QAAQ,GAAG,SAAS;YAAE,SAAS,GAAG,QAAQ,CAAC;KAChD;IAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;IACvC,QAAQ,SAAS;;;QAIf,kBAAkB;QAClB;YACE,OAAO,SAAS,CAAC;QAEnB,2BAA2B;;YAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;YAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;gBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;aAChC;YAED,OAAO,IAAI,GAAG,SAAS,CAAC;SACzB;QAED;YACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;QAE9B;YACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;KACpF;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js new file mode 100644 index 0000000..a783049 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js @@ -0,0 +1,240 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); +})(this, (function () { 'use strict'; + + // Matches the scheme of a URL, eg "http://" + const schemeRegex = /^[\w+.-]+:\/\//; + /** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + /** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); + } + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function isRelative(input) { + return /^[.?#]/.test(input); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); + } + function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: 7 /* Absolute */, + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = 6 /* SchemeRelative */; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = 5 /* AbsolutePath */; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? 3 /* Query */ + : input.startsWith('#') + ? 2 /* Hash */ + : 4 /* RelativePath */ + : 1 /* Empty */; + return url; + } + function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + } + /** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ + function normalizePath(url, type) { + const rel = type <= 4 /* RelativePath */; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; + } + /** + * Attempts to resolve `input` URL/path relative to `base`. + */ + function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== 7 /* Absolute */) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1 /* Empty */: + url.hash = baseUrl.hash; + // fall through + case 2 /* Hash */: + url.query = baseUrl.query; + // fall through + case 3 /* Query */: + case 4 /* RelativePath */: + mergePaths(url, baseUrl); + // fall through + case 5 /* AbsolutePath */: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case 6 /* SchemeRelative */: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case 2 /* Hash */: + case 3 /* Query */: + return queryHash; + case 4 /* RelativePath */: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case 5 /* AbsolutePath */: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } + } + + return resolve; + +})); +//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map new file mode 100644 index 0000000..70a37f2 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAErC;;;;;;;;;;IAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;IAE5F;;;;;;;;;IASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;IAuBpF,SAAS,aAAa,CAAC,KAAa;QAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,mBAAmB,CAAC,KAAa;QACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,SAAS,cAAc,CAAC,KAAa;QACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,SAAS,CAAC,KAAa;QAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,SAAS,UAAU,CAAC,KAAa;QAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,gBAAgB,CAAC,KAAa;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,YAAY,CAAC,KAAa;QACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;QAEZ,OAAO;YACL,MAAM;YACN,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;IAED,SAAS,QAAQ,CAAC,KAAa;QAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;YAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,0BAA0B;YAClC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;YACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;YACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,wBAAwB;YAChC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;QACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,GAAG,KAAK;cACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;kBAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;4BAGT;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,SAAS,iBAAiB,CAAC,IAAY;;;QAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;QACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;QAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;YACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACtB;aAAM;;YAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;SACpD;IACH,CAAC;IAED;;;;IAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;QAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;QACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;QAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;QAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;QAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;YAGxB,IAAI,CAAC,KAAK,EAAE;gBACV,gBAAgB,GAAG,IAAI,CAAC;gBACxB,SAAS;aACV;;YAGD,gBAAgB,GAAG,KAAK,CAAC;;YAGzB,IAAI,KAAK,KAAK,GAAG;gBAAE,SAAS;;;YAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,IAAI,QAAQ,EAAE;oBACZ,gBAAgB,GAAG,IAAI,CAAC;oBACxB,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,CAAC;iBACX;qBAAM,IAAI,GAAG,EAAE;;;oBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;iBAC3B;gBACD,SAAS;aACV;;;YAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;YAC1B,QAAQ,EAAE,CAAC;SACZ;QAED,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;YACxD,IAAI,IAAI,GAAG,CAAC;SACb;QACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;aAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;QACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;QAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;YAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;YAE9B,QAAQ,SAAS;gBACf;oBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;oBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;gBAG5B,mBAAmB;gBACnB;oBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;gBAG3B;;oBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;;oBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;aAC/B;YACD,IAAI,QAAQ,GAAG,SAAS;gBAAE,SAAS,GAAG,QAAQ,CAAC;SAChD;QAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;QACvC,QAAQ,SAAS;;;YAIf,kBAAkB;YAClB;gBACE,OAAO,SAAS,CAAC;YAEnB,2BAA2B;;gBAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAE/B,IAAI,CAAC,IAAI;oBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;gBAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;oBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;iBAChC;gBAED,OAAO,IAAI,GAAG,SAAS,CAAC;aACzB;YAED;gBACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;YAE9B;gBACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts new file mode 100644 index 0000000..b7f0b3b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts @@ -0,0 +1,4 @@ +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/package.json b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/package.json new file mode 100644 index 0000000..02a4c51 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri/package.json @@ -0,0 +1,69 @@ +{ + "name": "@jridgewell/resolve-uri", + "version": "3.1.2", + "description": "Resolve a URI relative to an optional base URI", + "keywords": [ + "resolve", + "uri", + "url", + "path" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/resolve-uri", + "main": "dist/resolve-uri.umd.js", + "module": "dist/resolve-uri.mjs", + "types": "dist/types/resolve-uri.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/resolve-uri.d.ts", + "browser": "./dist/resolve-uri.umd.js", + "require": "./dist/resolve-uri.umd.js", + "import": "./dist/resolve-uri.mjs" + }, + "./dist/resolve-uri.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", + "@rollup/plugin-typescript": "8.3.0", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/LICENSE b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/README.md b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/README.md new file mode 100644 index 0000000..b3e0708 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/README.md @@ -0,0 +1,264 @@ +# @jridgewell/sourcemap-codec + +Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). + + +## Why? + +Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. + +This package makes the process slightly easier. + + +## Installation + +```bash +npm install @jridgewell/sourcemap-codec +``` + + +## Usage + +```js +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); + +assert.deepEqual( decoded, [ + // the first line (of the generated code) has no mappings, + // as shown by the starting semi-colon (which separates lines) + [], + + // the second line contains four (comma-separated) segments + [ + // segments are encoded as you'd expect: + // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] + + // i.e. the first segment begins at column 2, and maps back to the second column + // of the second line (both zero-based) of the 0th source, and uses the 0th + // name in the `map.names` array + [ 2, 0, 2, 2, 0 ], + + // the remaining segments are 4-length rather than 5-length, + // because they don't map a name + [ 4, 0, 2, 4 ], + [ 6, 0, 2, 5 ], + [ 7, 0, 2, 7 ] + ], + + // the final line contains two segments + [ + [ 2, 1, 10, 19 ], + [ 12, 1, 11, 20 ] + ] +]); + +var encoded = encode( decoded ); +assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Decode Memory Usage: +local code 5815135 bytes +@jridgewell/sourcemap-codec 1.4.15 5868160 bytes +sourcemap-codec 5492584 bytes +source-map-0.6.1 13569984 bytes +source-map-0.8.0 6390584 bytes +chrome dev tools 8011136 bytes +Smallest memory usage is sourcemap-codec + +Decode speed: +decode: local code x 492 ops/sec ±1.22% (90 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled) +decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled) +decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled) +decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled) +chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 444248 bytes +@jridgewell/sourcemap-codec 1.4.15 623024 bytes +sourcemap-codec 8696280 bytes +source-map-0.6.1 8745176 bytes +source-map-0.8.0 8736624 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 796 ops/sec ±0.11% (97 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled) +encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled) +encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled) +encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled) +Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +babel.min.js.map - 347793 segments + +Decode Memory Usage: +local code 35424960 bytes +@jridgewell/sourcemap-codec 1.4.15 35424696 bytes +sourcemap-codec 36033464 bytes +source-map-0.6.1 62253704 bytes +source-map-0.8.0 43843920 bytes +chrome dev tools 45111400 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Decode speed: +decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled) +decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled) +decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled) +decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled) +chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 2606016 bytes +@jridgewell/sourcemap-codec 1.4.15 2626440 bytes +sourcemap-codec 21152576 bytes +source-map-0.6.1 25023928 bytes +source-map-0.8.0 25256448 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 127 ops/sec ±0.18% (83 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled) +encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled) +encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled) +encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +preact.js.map - 1992 segments + +Decode Memory Usage: +local code 261696 bytes +@jridgewell/sourcemap-codec 1.4.15 244296 bytes +sourcemap-codec 302816 bytes +source-map-0.6.1 939176 bytes +source-map-0.8.0 336 bytes +chrome dev tools 587368 bytes +Smallest memory usage is source-map-0.8.0 + +Decode speed: +decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled) +decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled) +decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled) +decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled) +chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 262944 bytes +@jridgewell/sourcemap-codec 1.4.15 25544 bytes +sourcemap-codec 323048 bytes +source-map-0.6.1 507808 bytes +source-map-0.8.0 507480 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Encode speed: +encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled) +encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled) +encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code + + +*** + + +react.js.map - 5726 segments + +Decode Memory Usage: +local code 678816 bytes +@jridgewell/sourcemap-codec 1.4.15 678816 bytes +sourcemap-codec 816400 bytes +source-map-0.6.1 2288864 bytes +source-map-0.8.0 721360 bytes +chrome dev tools 1012512 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled) +decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled) +decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled) +decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled) +chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 140960 bytes +@jridgewell/sourcemap-codec 1.4.15 159808 bytes +sourcemap-codec 969304 bytes +source-map-0.6.1 930520 bytes +source-map-0.8.0 930248 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled) +encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled) +encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled) +Fastest is encode: local code + + +*** + + +vscode.map - 2141001 segments + +Decode Memory Usage: +local code 198955264 bytes +@jridgewell/sourcemap-codec 1.4.15 199175352 bytes +sourcemap-codec 199102688 bytes +source-map-0.6.1 386323432 bytes +source-map-0.8.0 244116432 bytes +chrome dev tools 293734280 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled) +decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled) +decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled) +decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled) +chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 13509880 bytes +@jridgewell/sourcemap-codec 1.4.15 13537648 bytes +sourcemap-codec 32540104 bytes +source-map-0.6.1 127531040 bytes +source-map-0.8.0 127535312 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled) +encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled) +encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled) +encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 +``` + +# License + +MIT diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs new file mode 100644 index 0000000..532bab3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs @@ -0,0 +1,423 @@ +// src/vlq.ts +var comma = ",".charCodeAt(0); +var semicolon = ";".charCodeAt(0); +var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var intToChar = new Uint8Array(64); +var charToInt = new Uint8Array(128); +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -2147483648 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} + +// src/strings.ts +var bufLength = 1024 * 16; +var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ""; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +}; +var StringReader = class { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +}; + +// src/scopes.ts +var EMPTY = []; +function decodeOriginalScopes(input) { + const { length } = input; + const reader = new StringReader(input); + const scopes = []; + const stack = []; + let line = 0; + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + if (!hasMoreVlq(reader, length)) { + const last = stack.pop(); + last[2] = line; + last[3] = column; + continue; + } + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 1; + const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; + let vars = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + scopes.push(scope); + stack.push(scope); + } + return scopes; +} +function encodeOriginalScopes(scopes) { + const writer = new StringWriter(); + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + return writer.flush(); +} +function _encodeOriginalScopes(scopes, index, writer, state) { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + if (index > 0) writer.write(comma); + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + const fields = scope.length === 6 ? 1 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + for (const v of vars) { + encodeInteger(writer, v, 0); + } + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + return index; +} +function decodeGeneratedRanges(input) { + const { length } = input; + const reader = new StringReader(input); + const ranges = []; + const stack = []; + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + do { + const semi = reader.indexOf(";"); + let genColumn = 0; + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop(); + last[2] = genLine; + last[3] = genColumn; + continue; + } + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 1; + const hasCallsite = fields & 2; + const hasScope = fields & 4; + let callsite = null; + let bindings = EMPTY; + let range; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 + ); + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; + } else { + range = [genLine, genColumn, 0, 0]; + } + range.isScope = !!hasScope; + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0 + ); + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + ranges.push(range); + stack.push(range); + } + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + return ranges; +} +function encodeGeneratedRanges(ranges) { + if (ranges.length === 0) return ""; + const writer = new StringWriter(); + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + return writer.flush(); +} +function _encodeGeneratedRanges(ranges, index, writer, state) { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings + } = range; + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + state[1] = encodeInteger(writer, range[1], state[1]); + const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); + encodeInteger(writer, fields, 0); + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); + encodeInteger(writer, expRange[0], 0); + } + } + } + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + return index; +} +function catchupLine(writer, lastLine, line) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} + +// src/sourcemap-codec.ts +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(";"); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} +export { + decode, + decodeGeneratedRanges, + decodeOriginalScopes, + encode, + encodeGeneratedRanges, + encodeOriginalScopes +}; +//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map new file mode 100644 index 0000000..c276844 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts", "../src/sourcemap-codec.ts"], + "mappings": ";AAEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;ACtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", + "names": [] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js new file mode 100644 index 0000000..2d8e459 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js @@ -0,0 +1,464 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.sourcemapCodec = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module) { +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/sourcemap-codec.ts +var sourcemap_codec_exports = {}; +__export(sourcemap_codec_exports, { + decode: () => decode, + decodeGeneratedRanges: () => decodeGeneratedRanges, + decodeOriginalScopes: () => decodeOriginalScopes, + encode: () => encode, + encodeGeneratedRanges: () => encodeGeneratedRanges, + encodeOriginalScopes: () => encodeOriginalScopes +}); +module.exports = __toCommonJS(sourcemap_codec_exports); + +// src/vlq.ts +var comma = ",".charCodeAt(0); +var semicolon = ";".charCodeAt(0); +var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var intToChar = new Uint8Array(64); +var charToInt = new Uint8Array(128); +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -2147483648 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} + +// src/strings.ts +var bufLength = 1024 * 16; +var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ""; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +}; +var StringReader = class { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +}; + +// src/scopes.ts +var EMPTY = []; +function decodeOriginalScopes(input) { + const { length } = input; + const reader = new StringReader(input); + const scopes = []; + const stack = []; + let line = 0; + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + if (!hasMoreVlq(reader, length)) { + const last = stack.pop(); + last[2] = line; + last[3] = column; + continue; + } + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 1; + const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; + let vars = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + scopes.push(scope); + stack.push(scope); + } + return scopes; +} +function encodeOriginalScopes(scopes) { + const writer = new StringWriter(); + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + return writer.flush(); +} +function _encodeOriginalScopes(scopes, index, writer, state) { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + if (index > 0) writer.write(comma); + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + const fields = scope.length === 6 ? 1 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + for (const v of vars) { + encodeInteger(writer, v, 0); + } + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + return index; +} +function decodeGeneratedRanges(input) { + const { length } = input; + const reader = new StringReader(input); + const ranges = []; + const stack = []; + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + do { + const semi = reader.indexOf(";"); + let genColumn = 0; + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop(); + last[2] = genLine; + last[3] = genColumn; + continue; + } + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 1; + const hasCallsite = fields & 2; + const hasScope = fields & 4; + let callsite = null; + let bindings = EMPTY; + let range; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 + ); + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; + } else { + range = [genLine, genColumn, 0, 0]; + } + range.isScope = !!hasScope; + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0 + ); + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + ranges.push(range); + stack.push(range); + } + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + return ranges; +} +function encodeGeneratedRanges(ranges) { + if (ranges.length === 0) return ""; + const writer = new StringWriter(); + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + return writer.flush(); +} +function _encodeGeneratedRanges(ranges, index, writer, state) { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings + } = range; + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + state[1] = encodeInteger(writer, range[1], state[1]); + const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); + encodeInteger(writer, fields, 0); + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); + encodeInteger(writer, expRange[0], 0); + } + } + } + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + return index; +} +function catchupLine(writer, lastLine, line) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} + +// src/sourcemap-codec.ts +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(";"); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} +})); +//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map new file mode 100644 index 0000000..abc18d2 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/sourcemap-codec.ts", "../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;AHtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", + "names": [] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/package.json new file mode 100644 index 0000000..da55137 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/package.json @@ -0,0 +1,63 @@ +{ + "name": "@jridgewell/sourcemap-codec", + "version": "1.5.5", + "description": "Encode/decode sourcemap mappings", + "keywords": [ + "sourcemap", + "vlq" + ], + "main": "dist/sourcemap-codec.umd.js", + "module": "dist/sourcemap-codec.mjs", + "types": "types/sourcemap-codec.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/sourcemap-codec.d.mts", + "default": "./dist/sourcemap-codec.mjs" + }, + "default": { + "types": "./types/sourcemap-codec.d.cts", + "default": "./dist/sourcemap-codec.umd.js" + } + }, + "./dist/sourcemap-codec.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs sourcemap-codec.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/sourcemap-codec" + }, + "author": "Justin Ridgewell ", + "license": "MIT" +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts new file mode 100644 index 0000000..d194c2f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts @@ -0,0 +1,345 @@ +import { StringReader, StringWriter } from './strings'; +import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; + +const EMPTY: any[] = []; + +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; + +type Mix = (A & O) | (B & O); + +export type OriginalScope = Mix< + [Line, Column, Line, Column, Kind], + [Line, Column, Line, Column, Kind, Name], + { vars: Var[] } +>; + +export type GeneratedRange = Mix< + [Line, Column, Line, Column], + [Line, Column, Line, Column, SourcesIndex, ScopesIndex], + { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; + } +>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; + +export function decodeOriginalScopes(input: string): OriginalScope[] { + const { length } = input; + const reader = new StringReader(input); + const scopes: OriginalScope[] = []; + const stack: OriginalScope[] = []; + let line = 0; + + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + + if (!hasMoreVlq(reader, length)) { + const last = stack.pop()!; + last[2] = line; + last[3] = column; + continue; + } + + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 0b0001; + + const scope: OriginalScope = ( + hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind] + ) as OriginalScope; + + let vars: Var[] = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + + scopes.push(scope); + stack.push(scope); + } + + return scopes; +} + +export function encodeOriginalScopes(scopes: OriginalScope[]): string { + const writer = new StringWriter(); + + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + + return writer.flush(); +} + +function _encodeOriginalScopes( + scopes: OriginalScope[], + index: number, + writer: StringWriter, + state: [ + number, // GenColumn + ], +): number { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + + if (index > 0) writer.write(comma); + + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + + const fields = scope.length === 6 ? 0b0001 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + + for (const v of vars) { + encodeInteger(writer, v, 0); + } + + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || (l === endLine && c >= endColumn)) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + + return index; +} + +export function decodeGeneratedRanges(input: string): GeneratedRange[] { + const { length } = input; + const reader = new StringReader(input); + const ranges: GeneratedRange[] = []; + const stack: GeneratedRange[] = []; + + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + + do { + const semi = reader.indexOf(';'); + let genColumn = 0; + + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop()!; + last[2] = genLine; + last[3] = genColumn; + continue; + } + + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 0b0001; + const hasCallsite = fields & 0b0010; + const hasScope = fields & 0b0100; + + let callsite: CallSite | null = null; + let bindings: Binding[] = EMPTY; + let range: GeneratedRange; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0, + ); + + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex] as GeneratedRange; + } else { + range = [genLine, genColumn, 0, 0] as GeneratedRange; + } + + range.isScope = !!hasScope; + + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0, + ); + + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges: BindingExpressionRange[]; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + + ranges.push(range); + stack.push(range); + } + + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + + return ranges; +} + +export function encodeGeneratedRanges(ranges: GeneratedRange[]): string { + if (ranges.length === 0) return ''; + + const writer = new StringWriter(); + + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + + return writer.flush(); +} + +function _encodeGeneratedRanges( + ranges: GeneratedRange[], + index: number, + writer: StringWriter, + state: [ + number, // GenLine + number, // GenColumn + number, // DefSourcesIndex + number, // DefScopesIndex + number, // CallSourcesIndex + number, // CallLine + number, // CallColumn + ], +): number { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings, + } = range; + + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + + state[1] = encodeInteger(writer, range[1], state[1]); + + const fields = + (range.length === 6 ? 0b0001 : 0) | (callsite ? 0b0010 : 0) | (isScope ? 0b0100 : 0); + encodeInteger(writer, fields, 0); + + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite!; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1]!, bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2]!, bindingStartColumn); + encodeInteger(writer, expRange[0]!, 0); + } + } + } + + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || (l === endLine && c >= endColumn)) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + + return index; +} + +function catchupLine(writer: StringWriter, lastLine: number, line: number) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts new file mode 100644 index 0000000..a81f894 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts @@ -0,0 +1,111 @@ +import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; +import { StringWriter, StringReader } from './strings'; + +export { + decodeOriginalScopes, + encodeOriginalScopes, + decodeGeneratedRanges, + encodeGeneratedRanges, +} from './scopes'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes'; + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; + +export function decode(mappings: string): SourceMapMappings { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded: SourceMapMappings = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + + do { + const semi = reader.indexOf(';'); + const line: SourceMapLine = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + + while (reader.pos < semi) { + let seg: SourceMapSegment; + + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + + line.push(seg); + reader.pos++; + } + + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + + return decoded; +} + +function sort(line: SourceMapSegment[]) { + line.sort(sortComparator); +} + +function sortComparator(a: SourceMapSegment, b: SourceMapSegment): number { + return a[0] - b[0]; +} + +export function encode(decoded: SourceMapMappings): string; +export function encode(decoded: Readonly): string; +export function encode(decoded: Readonly): string { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + + let genColumn = 0; + + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + + genColumn = encodeInteger(writer, segment[0], genColumn); + + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + + return writer.flush(); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/strings.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/strings.ts new file mode 100644 index 0000000..d161965 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/strings.ts @@ -0,0 +1,65 @@ +const bufLength = 1024 * 16; + +// Provide a fallback for older environments. +const td = + typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf: Uint8Array): string { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf: Uint8Array): string { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + +export class StringWriter { + pos = 0; + private out = ''; + private buffer = new Uint8Array(bufLength); + + write(v: number): void { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + + flush(): string { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} + +export class StringReader { + pos = 0; + declare private buffer: string; + + constructor(buffer: string) { + this.buffer = buffer; + } + + next(): number { + return this.buffer.charCodeAt(this.pos++); + } + + peek(): number { + return this.buffer.charCodeAt(this.pos); + } + + indexOf(char: string): number { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts new file mode 100644 index 0000000..a42c681 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts @@ -0,0 +1,55 @@ +import type { StringReader, StringWriter } from './strings'; + +export const comma = ','.charCodeAt(0); +export const semicolon = ';'.charCodeAt(0); + +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII + +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} + +export function decodeInteger(reader: StringReader, relative: number): number { + let value = 0; + let shift = 0; + let integer = 0; + + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + + const shouldNegate = value & 1; + value >>>= 1; + + if (shouldNegate) { + value = -0x80000000 | -value; + } + + return relative + value; +} + +export function encodeInteger(builder: StringWriter, num: number, relative: number): number { + let delta = num - relative; + + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + + return num; +} + +export function hasMoreVlq(reader: StringReader, max: number) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts new file mode 100644 index 0000000..c583c75 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts @@ -0,0 +1,50 @@ +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; +type Mix = (A & O) | (B & O); +export type OriginalScope = Mix<[ + Line, + Column, + Line, + Column, + Kind +], [ + Line, + Column, + Line, + Column, + Kind, + Name +], { + vars: Var[]; +}>; +export type GeneratedRange = Mix<[ + Line, + Column, + Line, + Column +], [ + Line, + Column, + Line, + Column, + SourcesIndex, + ScopesIndex +], { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; +}>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; +export declare function decodeOriginalScopes(input: string): OriginalScope[]; +export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; +export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; +export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; +export {}; +//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map new file mode 100644 index 0000000..630e647 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts new file mode 100644 index 0000000..c583c75 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts @@ -0,0 +1,50 @@ +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; +type Mix = (A & O) | (B & O); +export type OriginalScope = Mix<[ + Line, + Column, + Line, + Column, + Kind +], [ + Line, + Column, + Line, + Column, + Kind, + Name +], { + vars: Var[]; +}>; +export type GeneratedRange = Mix<[ + Line, + Column, + Line, + Column +], [ + Line, + Column, + Line, + Column, + SourcesIndex, + ScopesIndex +], { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; +}>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; +export declare function decodeOriginalScopes(input: string): OriginalScope[]; +export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; +export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; +export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; +export {}; +//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map new file mode 100644 index 0000000..630e647 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts new file mode 100644 index 0000000..5f35e22 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts @@ -0,0 +1,9 @@ +export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.cts'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.cts'; +export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; +//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map new file mode 100644 index 0000000..7123d52 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts new file mode 100644 index 0000000..199fb9f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts @@ -0,0 +1,9 @@ +export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.mts'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.mts'; +export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; +//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map new file mode 100644 index 0000000..7123d52 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts new file mode 100644 index 0000000..62faceb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts @@ -0,0 +1,16 @@ +export declare class StringWriter { + pos: number; + private out; + private buffer; + write(v: number): void; + flush(): string; +} +export declare class StringReader { + pos: number; + private buffer; + constructor(buffer: string); + next(): number; + peek(): number; + indexOf(char: string): number; +} +//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map new file mode 100644 index 0000000..d3602da --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts new file mode 100644 index 0000000..62faceb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts @@ -0,0 +1,16 @@ +export declare class StringWriter { + pos: number; + private out; + private buffer; + write(v: number): void; + flush(): string; +} +export declare class StringReader { + pos: number; + private buffer; + constructor(buffer: string); + next(): number; + peek(): number; + indexOf(char: string): number; +} +//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map new file mode 100644 index 0000000..d3602da --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts new file mode 100644 index 0000000..dbd6602 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts @@ -0,0 +1,7 @@ +import type { StringReader, StringWriter } from './strings.cts'; +export declare const comma: number; +export declare const semicolon: number; +export declare function decodeInteger(reader: StringReader, relative: number): number; +export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; +export declare function hasMoreVlq(reader: StringReader, max: number): boolean; +//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map new file mode 100644 index 0000000..6fdc356 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts new file mode 100644 index 0000000..2c739bc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts @@ -0,0 +1,7 @@ +import type { StringReader, StringWriter } from './strings.mts'; +export declare const comma: number; +export declare const semicolon: number; +export declare function decodeInteger(reader: StringReader, relative: number): number; +export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; +export declare function hasMoreVlq(reader: StringReader, max: number): boolean; +//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map new file mode 100644 index 0000000..6fdc356 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/README.md b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/README.md new file mode 100644 index 0000000..9fc0ed0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/README.md @@ -0,0 +1,348 @@ +# @jridgewell/trace-mapping + +> Trace the original position through a source map + +`trace-mapping` allows you to take the line and column of an output file and trace it to the +original location in the source file through a source map. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This +provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. + +## Installation + +```sh +npm install @jridgewell/trace-mapping +``` + +## Usage + +```typescript +import { + TraceMap, + originalPositionFor, + generatedPositionFor, + sourceContentFor, + isIgnored, +} from '@jridgewell/trace-mapping'; + +const tracer = new TraceMap({ + version: 3, + sources: ['input.js'], + sourcesContent: ['content of input.js'], + names: ['foo'], + mappings: 'KAyCIA', + ignoreList: [], +}); + +// Lines start at line 1, columns at column 0. +const traced = originalPositionFor(tracer, { line: 1, column: 5 }); +assert.deepEqual(traced, { + source: 'input.js', + line: 42, + column: 4, + name: 'foo', +}); + +const content = sourceContentFor(tracer, traced.source); +assert.strictEqual(content, 'content for input.js'); + +const generated = generatedPositionFor(tracer, { + source: 'input.js', + line: 42, + column: 4, +}); +assert.deepEqual(generated, { + line: 1, + column: 5, +}); + +const ignored = isIgnored(tracer, 'input.js'); +assert.equal(ignored, false); +``` + +We also provide a lower level API to get the actual segment that matches our line and column. Unlike +`originalPositionFor`, `traceSegment` uses a 0-base for `line`: + +```typescript +import { traceSegment } from '@jridgewell/trace-mapping'; + +// line is 0-base. +const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); + +// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] +// Again, line is 0-base and so is sourceLine +assert.deepEqual(traced, [5, 0, 41, 4, 0]); +``` + +### SectionedSourceMaps + +The sourcemap spec defines a special `sections` field that's designed to handle concatenation of +output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool +produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` +helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a +`TraceMap` instance: + +```typescript +import { AnyMap } from '@jridgewell/trace-mapping'; +const fooOutput = 'foo'; +const barOutput = 'bar'; +const output = [fooOutput, barOutput].join('\n'); + +const sectioned = new AnyMap({ + version: 3, + sections: [ + { + // 0-base line and column + offset: { line: 0, column: 0 }, + // fooOutput's sourcemap + map: { + version: 3, + sources: ['foo.js'], + names: ['foo'], + mappings: 'AAAAA', + }, + }, + { + // barOutput's sourcemap will not affect the first line, only the second + offset: { line: 1, column: 0 }, + map: { + version: 3, + sources: ['bar.js'], + names: ['bar'], + mappings: 'AAAAA', + }, + }, + ], +}); + +const traced = originalPositionFor(sectioned, { + line: 2, + column: 0, +}); + +assert.deepEqual(traced, { + source: 'bar.js', + line: 1, + column: 0, + name: 'bar', +}); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Memory Usage: +trace-mapping decoded 414164 bytes +trace-mapping encoded 6274352 bytes +source-map-js 10968904 bytes +source-map-0.6.1 17587160 bytes +source-map-0.8.0 8812155 bytes +Chrome dev tools 8672912 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 205 ops/sec ±0.19% (88 runs sampled) +trace-mapping: encoded JSON input x 405 ops/sec ±1.47% (88 runs sampled) +trace-mapping: decoded Object input x 4,645 ops/sec ±0.15% (98 runs sampled) +trace-mapping: encoded Object input x 458 ops/sec ±1.63% (91 runs sampled) +source-map-js: encoded Object input x 75.48 ops/sec ±1.64% (67 runs sampled) +source-map-0.6.1: encoded Object input x 39.37 ops/sec ±1.44% (53 runs sampled) +Chrome dev tools: encoded Object input x 150 ops/sec ±1.76% (79 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 44,946 ops/sec ±0.16% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 37,995 ops/sec ±1.81% (89 runs sampled) +source-map-js: encoded originalPositionFor x 9,230 ops/sec ±1.36% (93 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 8,057 ops/sec ±0.84% (96 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 28,198 ops/sec ±1.12% (91 runs sampled) +Chrome dev tools: encoded originalPositionFor x 46,276 ops/sec ±1.35% (95 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 204,406 ops/sec ±0.19% (97 runs sampled) +trace-mapping: encoded originalPositionFor x 196,695 ops/sec ±0.24% (99 runs sampled) +source-map-js: encoded originalPositionFor x 11,948 ops/sec ±0.94% (99 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 10,730 ops/sec ±0.36% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 51,427 ops/sec ±0.21% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 162,615 ops/sec ±0.18% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +babel.min.js.map - 347793 segments + +Memory Usage: +trace-mapping decoded 18504 bytes +trace-mapping encoded 35428008 bytes +source-map-js 51676808 bytes +source-map-0.6.1 63367136 bytes +source-map-0.8.0 43158400 bytes +Chrome dev tools 50721552 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 17.82 ops/sec ±6.35% (35 runs sampled) +trace-mapping: encoded JSON input x 31.57 ops/sec ±7.50% (43 runs sampled) +trace-mapping: decoded Object input x 867 ops/sec ±0.74% (94 runs sampled) +trace-mapping: encoded Object input x 33.83 ops/sec ±7.66% (46 runs sampled) +source-map-js: encoded Object input x 6.58 ops/sec ±3.31% (20 runs sampled) +source-map-0.6.1: encoded Object input x 4.23 ops/sec ±3.43% (15 runs sampled) +Chrome dev tools: encoded Object input x 22.14 ops/sec ±3.79% (41 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 78,234 ops/sec ±1.48% (29 runs sampled) +trace-mapping: encoded originalPositionFor x 60,761 ops/sec ±1.35% (21 runs sampled) +source-map-js: encoded originalPositionFor x 51,448 ops/sec ±2.17% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 47,221 ops/sec ±1.99% (15 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 84,002 ops/sec ±1.45% (27 runs sampled) +Chrome dev tools: encoded originalPositionFor x 106,457 ops/sec ±1.38% (37 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 930,943 ops/sec ±0.25% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 843,545 ops/sec ±0.34% (97 runs sampled) +source-map-js: encoded originalPositionFor x 114,510 ops/sec ±1.37% (36 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 87,412 ops/sec ±0.72% (92 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 197,709 ops/sec ±0.89% (59 runs sampled) +Chrome dev tools: encoded originalPositionFor x 688,983 ops/sec ±0.33% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +preact.js.map - 1992 segments + +Memory Usage: +trace-mapping decoded 33136 bytes +trace-mapping encoded 254240 bytes +source-map-js 837488 bytes +source-map-0.6.1 961928 bytes +source-map-0.8.0 54384 bytes +Chrome dev tools 709680 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 3,709 ops/sec ±0.13% (99 runs sampled) +trace-mapping: encoded JSON input x 6,447 ops/sec ±0.22% (101 runs sampled) +trace-mapping: decoded Object input x 83,062 ops/sec ±0.23% (100 runs sampled) +trace-mapping: encoded Object input x 14,980 ops/sec ±0.28% (100 runs sampled) +source-map-js: encoded Object input x 2,544 ops/sec ±0.16% (99 runs sampled) +source-map-0.6.1: encoded Object input x 1,221 ops/sec ±0.37% (97 runs sampled) +Chrome dev tools: encoded Object input x 4,241 ops/sec ±0.39% (93 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 91,028 ops/sec ±0.14% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 84,348 ops/sec ±0.26% (98 runs sampled) +source-map-js: encoded originalPositionFor x 26,998 ops/sec ±0.23% (98 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 18,049 ops/sec ±0.26% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 41,916 ops/sec ±0.28% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 88,616 ops/sec ±0.14% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 319,960 ops/sec ±0.16% (100 runs sampled) +trace-mapping: encoded originalPositionFor x 302,153 ops/sec ±0.18% (100 runs sampled) +source-map-js: encoded originalPositionFor x 35,574 ops/sec ±0.19% (100 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 19,943 ops/sec ±0.12% (101 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 54,648 ops/sec ±0.20% (99 runs sampled) +Chrome dev tools: encoded originalPositionFor x 278,319 ops/sec ±0.17% (102 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +react.js.map - 5726 segments + +Memory Usage: +trace-mapping decoded 10872 bytes +trace-mapping encoded 681512 bytes +source-map-js 2563944 bytes +source-map-0.6.1 2150864 bytes +source-map-0.8.0 88680 bytes +Chrome dev tools 1149576 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1,887 ops/sec ±0.28% (99 runs sampled) +trace-mapping: encoded JSON input x 4,749 ops/sec ±0.48% (97 runs sampled) +trace-mapping: decoded Object input x 74,236 ops/sec ±0.11% (99 runs sampled) +trace-mapping: encoded Object input x 5,752 ops/sec ±0.38% (100 runs sampled) +source-map-js: encoded Object input x 806 ops/sec ±0.19% (97 runs sampled) +source-map-0.6.1: encoded Object input x 418 ops/sec ±0.33% (94 runs sampled) +Chrome dev tools: encoded Object input x 1,524 ops/sec ±0.57% (92 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 620,201 ops/sec ±0.33% (96 runs sampled) +trace-mapping: encoded originalPositionFor x 579,548 ops/sec ±0.35% (97 runs sampled) +source-map-js: encoded originalPositionFor x 230,983 ops/sec ±0.62% (54 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 158,145 ops/sec ±0.80% (46 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 343,801 ops/sec ±0.55% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 659,649 ops/sec ±0.49% (98 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 2,368,079 ops/sec ±0.32% (98 runs sampled) +trace-mapping: encoded originalPositionFor x 2,134,039 ops/sec ±2.72% (87 runs sampled) +source-map-js: encoded originalPositionFor x 290,120 ops/sec ±2.49% (82 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 187,613 ops/sec ±0.86% (49 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 479,569 ops/sec ±0.65% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 2,048,414 ops/sec ±0.24% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +vscode.map - 2141001 segments + +Memory Usage: +trace-mapping decoded 5206584 bytes +trace-mapping encoded 208370336 bytes +source-map-js 278493008 bytes +source-map-0.6.1 391564048 bytes +source-map-0.8.0 257508787 bytes +Chrome dev tools 291053000 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1.63 ops/sec ±33.88% (9 runs sampled) +trace-mapping: encoded JSON input x 3.29 ops/sec ±36.13% (13 runs sampled) +trace-mapping: decoded Object input x 103 ops/sec ±0.93% (77 runs sampled) +trace-mapping: encoded Object input x 5.42 ops/sec ±28.54% (19 runs sampled) +source-map-js: encoded Object input x 1.07 ops/sec ±13.84% (7 runs sampled) +source-map-0.6.1: encoded Object input x 0.60 ops/sec ±2.43% (6 runs sampled) +Chrome dev tools: encoded Object input x 2.61 ops/sec ±22.00% (11 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 257,019 ops/sec ±0.97% (93 runs sampled) +trace-mapping: encoded originalPositionFor x 179,163 ops/sec ±0.83% (92 runs sampled) +source-map-js: encoded originalPositionFor x 73,337 ops/sec ±1.35% (87 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 38,797 ops/sec ±1.66% (88 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 107,758 ops/sec ±1.94% (45 runs sampled) +Chrome dev tools: encoded originalPositionFor x 188,550 ops/sec ±1.85% (79 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 447,621 ops/sec ±3.64% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 323,698 ops/sec ±5.20% (88 runs sampled) +source-map-js: encoded originalPositionFor x 78,387 ops/sec ±1.69% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 41,016 ops/sec ±3.01% (25 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 124,204 ops/sec ±0.90% (92 runs sampled) +Chrome dev tools: encoded originalPositionFor x 230,087 ops/sec ±2.61% (93 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor +``` + +[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs new file mode 100644 index 0000000..73a95c7 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs @@ -0,0 +1,493 @@ +// src/trace-mapping.ts +import { encode, decode } from "@jridgewell/sourcemap-codec"; + +// src/resolve.ts +import resolveUri from "@jridgewell/resolve-uri"; + +// src/strip-filename.ts +function stripFilename(path) { + if (!path) return ""; + const index = path.lastIndexOf("/"); + return path.slice(0, index + 1); +} + +// src/resolve.ts +function resolver(mapUrl, sourceRoot) { + const from = stripFilename(mapUrl); + const prefix = sourceRoot ? sourceRoot + "/" : ""; + return (source) => resolveUri(prefix + (source || ""), from); +} + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; +var REV_GENERATED_LINE = 1; +var REV_GENERATED_COLUMN = 2; + +// src/sort.ts +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + if (!owned) mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +// src/by-source.ts +function buildBySources(decoded, memos) { + const sources = memos.map(() => []); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + const sourceIndex2 = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const source = sources[sourceIndex2]; + const segs = source[sourceLine] || (source[sourceLine] = []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + return sources; +} + +// src/binary-search.ts +var found = false; +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; +} +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); +} + +// src/types.ts +function parse(map) { + return typeof map === "string" ? JSON.parse(map) : map; +} + +// src/flatten-map.ts +var FlattenMap = function(map, mapUrl) { + const parsed = parse(map); + if (!("sections" in parsed)) { + return new TraceMap(parsed, mapUrl); + } + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const ignoreList = []; + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity + ); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc + ); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const parsed = parse(input); + if ("sections" in parsed) return recurse(...arguments); + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + if (lineI > stopLine) return; + const out = getLine(mappings, lineI); + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + if (lineI === stopLine && column >= stopColumn) return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] + ); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} + +// src/trace-mapping.ts +var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; +var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; +var LEAST_UPPER_BOUND = -1; +var GREATEST_LOWER_BOUND = 1; +var TraceMap = class { + constructor(map, mapUrl) { + const isString = typeof map === "string"; + if (!isString && map._decodedMemo) return map; + const parsed = parse(map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else if (Array.isArray(mappings)) { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString); + } else if (parsed.sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + } +}; +function cast(map) { + return map; +} +function encodedMappings(map) { + var _a, _b; + return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded); +} +function decodedMappings(map) { + var _a; + return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded)); +} +function traceSegment(map, line, column) { + const decoded = decodedMappings(map); + if (line >= decoded.length) return null; + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND + ); + return index === -1 ? null : segments[index]; +} +function originalPositionFor(map, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + if (line >= decoded.length) return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND + ); + if (index === -1) return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null + ); +} +function generatedPositionFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} +function allGeneratedPositionsFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} +function eachMapping(map, cb) { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name + }); + } + } +} +function sourceIndex(map, source) { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} +function sourceContentFor(map, source) { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} +function isIgnored(map, source) { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} +function presortedDecodedMap(map, mapUrl) { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} +function decodedMap(map) { + return clone(map, decodedMappings(map)); +} +function encodedMap(map) { + return clone(map, encodedMappings(map)); +} +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || map.x_google_ignoreList + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + if (index === -1 || index === segments.length) return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + if (!found && bias === LEAST_UPPER_BOUND) min++; + if (min === -1 || min === segments.length) return []; + const matchedColumn = found ? column : segments[min][COLUMN]; + if (!found) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} +function generatedPosition(map, source, line, column, bias, all) { + var _a, _b; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex2 = sources.indexOf(source); + if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); + if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); + const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); + const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); + const segments = generated[sourceIndex2][line]; + if (segments == null) return all ? [] : GMapping(null, null); + const memo = bySourceMemos[sourceIndex2]; + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} +export { + FlattenMap as AnyMap, + FlattenMap, + GREATEST_LOWER_BOUND, + LEAST_UPPER_BOUND, + TraceMap, + allGeneratedPositionsFor, + decodedMap, + decodedMappings, + eachMapping, + encodedMap, + encodedMappings, + generatedPositionFor, + isIgnored, + originalPositionFor, + presortedDecodedMap, + sourceContentFor, + traceSegment +}; +//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map new file mode 100644 index 0000000..a789581 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], + "mappings": ";AAAA,SAAS,QAAQ,cAAc;;;ACA/B,OAAO,gBAAgB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,WAAW,WAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMA,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", + "names": ["sourceIndex", "sourceIndex"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js new file mode 100644 index 0000000..0387ae3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js @@ -0,0 +1,559 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/resolve-uri'), require('@jridgewell/sourcemap-codec')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/resolve-uri', '@jridgewell/sourcemap-codec'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.resolveURI, global.sourcemapCodec); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.traceMapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_resolveURI, require_sourcemapCodec) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/sourcemap-codec +var require_sourcemap_codec = __commonJS({ + "umd:@jridgewell/sourcemap-codec"(exports, module2) { + module2.exports = require_sourcemapCodec; + } +}); + +// umd:@jridgewell/resolve-uri +var require_resolve_uri = __commonJS({ + "umd:@jridgewell/resolve-uri"(exports, module2) { + module2.exports = require_resolveURI; + } +}); + +// src/trace-mapping.ts +var trace_mapping_exports = {}; +__export(trace_mapping_exports, { + AnyMap: () => FlattenMap, + FlattenMap: () => FlattenMap, + GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND, + LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND, + TraceMap: () => TraceMap, + allGeneratedPositionsFor: () => allGeneratedPositionsFor, + decodedMap: () => decodedMap, + decodedMappings: () => decodedMappings, + eachMapping: () => eachMapping, + encodedMap: () => encodedMap, + encodedMappings: () => encodedMappings, + generatedPositionFor: () => generatedPositionFor, + isIgnored: () => isIgnored, + originalPositionFor: () => originalPositionFor, + presortedDecodedMap: () => presortedDecodedMap, + sourceContentFor: () => sourceContentFor, + traceSegment: () => traceSegment +}); +module.exports = __toCommonJS(trace_mapping_exports); +var import_sourcemap_codec = __toESM(require_sourcemap_codec()); + +// src/resolve.ts +var import_resolve_uri = __toESM(require_resolve_uri()); + +// src/strip-filename.ts +function stripFilename(path) { + if (!path) return ""; + const index = path.lastIndexOf("/"); + return path.slice(0, index + 1); +} + +// src/resolve.ts +function resolver(mapUrl, sourceRoot) { + const from = stripFilename(mapUrl); + const prefix = sourceRoot ? sourceRoot + "/" : ""; + return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from); +} + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; +var REV_GENERATED_LINE = 1; +var REV_GENERATED_COLUMN = 2; + +// src/sort.ts +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + if (!owned) mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +// src/by-source.ts +function buildBySources(decoded, memos) { + const sources = memos.map(() => []); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + const sourceIndex2 = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const source = sources[sourceIndex2]; + const segs = source[sourceLine] || (source[sourceLine] = []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + return sources; +} + +// src/binary-search.ts +var found = false; +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; +} +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); +} + +// src/types.ts +function parse(map) { + return typeof map === "string" ? JSON.parse(map) : map; +} + +// src/flatten-map.ts +var FlattenMap = function(map, mapUrl) { + const parsed = parse(map); + if (!("sections" in parsed)) { + return new TraceMap(parsed, mapUrl); + } + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const ignoreList = []; + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity + ); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc + ); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const parsed = parse(input); + if ("sections" in parsed) return recurse(...arguments); + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + if (lineI > stopLine) return; + const out = getLine(mappings, lineI); + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + if (lineI === stopLine && column >= stopColumn) return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] + ); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} + +// src/trace-mapping.ts +var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; +var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; +var LEAST_UPPER_BOUND = -1; +var GREATEST_LOWER_BOUND = 1; +var TraceMap = class { + constructor(map, mapUrl) { + const isString = typeof map === "string"; + if (!isString && map._decodedMemo) return map; + const parsed = parse(map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else if (Array.isArray(mappings)) { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString); + } else if (parsed.sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + } +}; +function cast(map) { + return map; +} +function encodedMappings(map) { + var _a, _b; + return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded); +} +function decodedMappings(map) { + var _a; + return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded)); +} +function traceSegment(map, line, column) { + const decoded = decodedMappings(map); + if (line >= decoded.length) return null; + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND + ); + return index === -1 ? null : segments[index]; +} +function originalPositionFor(map, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + if (line >= decoded.length) return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND + ); + if (index === -1) return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null + ); +} +function generatedPositionFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} +function allGeneratedPositionsFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} +function eachMapping(map, cb) { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name + }); + } + } +} +function sourceIndex(map, source) { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} +function sourceContentFor(map, source) { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} +function isIgnored(map, source) { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} +function presortedDecodedMap(map, mapUrl) { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} +function decodedMap(map) { + return clone(map, decodedMappings(map)); +} +function encodedMap(map) { + return clone(map, encodedMappings(map)); +} +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || map.x_google_ignoreList + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + if (index === -1 || index === segments.length) return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + if (!found && bias === LEAST_UPPER_BOUND) min++; + if (min === -1 || min === segments.length) return []; + const matchedColumn = found ? column : segments[min][COLUMN]; + if (!found) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} +function generatedPosition(map, source, line, column, bias, all) { + var _a, _b; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex2 = sources.indexOf(source); + if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); + if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); + const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); + const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); + const segments = generated[sourceIndex2][line]; + if (segments == null) return all ? [] : GMapping(null, null); + const memo = bySourceMemos[sourceIndex2]; + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} +})); +//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map new file mode 100644 index 0000000..68b0c77 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/resolve-uri", "../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA+B;;;ACA/B,yBAAuB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,eAAW,mBAAAC,SAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMC,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", + "names": ["module", "module", "resolveUri", "sourceIndex", "sourceIndex"] +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/package.json new file mode 100644 index 0000000..9d3a1c0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/package.json @@ -0,0 +1,67 @@ +{ + "name": "@jridgewell/trace-mapping", + "version": "0.3.31", + "description": "Trace the original position through a source map", + "keywords": [ + "source", + "map" + ], + "main": "dist/trace-mapping.umd.js", + "module": "dist/trace-mapping.mjs", + "types": "types/trace-mapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/trace-mapping.d.mts", + "default": "./dist/trace-mapping.mjs" + }, + "default": { + "types": "./types/trace-mapping.d.cts", + "default": "./dist/trace-mapping.umd.js" + } + }, + "./dist/trace-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.mjs", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs trace-mapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/trace-mapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/binary-search.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/binary-search.ts new file mode 100644 index 0000000..c1144ad --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/binary-search.ts @@ -0,0 +1,115 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +import { COLUMN } from './sourcemap-segment'; + +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; + +export let found = false; + +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export function binarySearch( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + low: number, + high: number, +): number { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + + if (cmp === 0) { + found = true; + return mid; + } + + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + + found = false; + return low - 1; +} + +export function upperBound( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + index: number, +): number { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} + +export function lowerBound( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + index: number, +): number { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} + +export function memoizedState(): MemoState { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} + +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export function memoizedBinarySearch( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + state: MemoState, + key: number, +): number { + const { lastKey, lastNeedle, lastIndex } = state; + + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/by-source.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/by-source.ts new file mode 100644 index 0000000..1da6af0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/by-source.ts @@ -0,0 +1,41 @@ +import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment'; +import { sortComparator } from './sort'; + +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; + +export type Source = ReverseSegment[][]; + +// Rebuilds the original source files, with mappings that are ordered by source line/column instead +// of generated line/column. +export default function buildBySources( + decoded: readonly SourceMapSegment[][], + memos: unknown[], +): Source[] { + const sources: Source[] = memos.map(() => []); + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + + const source = sources[sourceIndex]; + const segs = (source[sourceLine] ||= []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + + return sources; +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts new file mode 100644 index 0000000..61ac40c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts @@ -0,0 +1,192 @@ +import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping'; +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, +} from './sourcemap-segment'; +import { parse } from './types'; + +import type { + DecodedSourceMap, + DecodedSourceMapXInput, + EncodedSourceMapXInput, + SectionedSourceMapXInput, + SectionedSourceMapInput, + SectionXInput, + Ro, +} from './types'; +import type { SourceMapSegment } from './sourcemap-segment'; + +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; + +export const FlattenMap: FlattenMap = function (map, mapUrl) { + const parsed = parse(map as SectionedSourceMapInput); + + if (!('sections' in parsed)) { + return new TraceMap(parsed as DecodedSourceMapXInput | EncodedSourceMapXInput, mapUrl); + } + + const mappings: SourceMapSegment[][] = []; + const sources: string[] = []; + const sourcesContent: (string | null)[] = []; + const names: string[] = []; + const ignoreList: number[] = []; + + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity, + ); + + const joined: DecodedSourceMap = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList, + }; + + return presortedDecodedMap(joined); +} as FlattenMap; + +function recurse( + input: SectionedSourceMapXInput, + mapUrl: string | null | undefined, + mappings: SourceMapSegment[][], + sources: string[], + sourcesContent: (string | null)[], + names: string[], + ignoreList: number[], + lineOffset: number, + columnOffset: number, + stopLine: number, + stopColumn: number, +) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc, + ); + } +} + +function addSection( + input: SectionXInput['map'], + mapUrl: string | null | undefined, + mappings: SourceMapSegment[][], + sources: string[], + sourcesContent: (string | null)[], + names: string[], + ignoreList: number[], + lineOffset: number, + columnOffset: number, + stopLine: number, + stopColumn: number, +) { + const parsed = parse(input); + if ('sections' in parsed) return recurse(...(arguments as unknown as Parameters)); + + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + + append(sources, resolvedSources); + append(names, map.names); + + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) return; + + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) return; + + if (seg.length === 1) { + out.push([column]); + continue; + } + + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]], + ); + } + } +} + +function append(arr: T[], other: T[]) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} + +function getLine(arr: T[][], index: number): T[] { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/resolve.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/resolve.ts new file mode 100644 index 0000000..30bfa3b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/resolve.ts @@ -0,0 +1,16 @@ +import resolveUri from '@jridgewell/resolve-uri'; +import stripFilename from './strip-filename'; + +type Resolve = (source: string | null) => string; +export default function resolver( + mapUrl: string | null | undefined, + sourceRoot: string | undefined, +): Resolve { + const from = stripFilename(mapUrl); + // The sourceRoot is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + const prefix = sourceRoot ? sourceRoot + '/' : ''; + + return (source) => resolveUri(prefix + (source || ''), from); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sort.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sort.ts new file mode 100644 index 0000000..5d016cb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sort.ts @@ -0,0 +1,45 @@ +import { COLUMN } from './sourcemap-segment'; + +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; + +export default function maybeSort( + mappings: SourceMapSegment[][], + owned: boolean, +): SourceMapSegment[][] { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) mappings = mappings.slice(); + + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} + +function nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} + +function isSorted(line: SourceMapSegment[]): boolean { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} + +function sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} + +export function sortComparator(a: T, b: T): number { + return a[COLUMN] - b[COLUMN]; +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts new file mode 100644 index 0000000..94f1b6a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts @@ -0,0 +1,23 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; + +type GeneratedLine = number; + +export type SourceMapSegment = + | [GeneratedColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; + +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; + +export const COLUMN = 0; +export const SOURCES_INDEX = 1; +export const SOURCE_LINE = 2; +export const SOURCE_COLUMN = 3; +export const NAMES_INDEX = 4; + +export const REV_GENERATED_LINE = 1; +export const REV_GENERATED_COLUMN = 2; diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts new file mode 100644 index 0000000..2c88980 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts @@ -0,0 +1,8 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string { + if (!path) return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts new file mode 100644 index 0000000..0b793d5 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts @@ -0,0 +1,502 @@ +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +import resolver from './resolve'; +import maybeSort from './sort'; +import buildBySources from './by-source'; +import { + memoizedState, + memoizedBinarySearch, + upperBound, + lowerBound, + found as bsFound, +} from './binary-search'; +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, + REV_GENERATED_LINE, + REV_GENERATED_COLUMN, +} from './sourcemap-segment'; +import { parse } from './types'; + +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +import type { + SourceMapV3, + DecodedSourceMap, + EncodedSourceMap, + InvalidOriginalMapping, + OriginalMapping, + InvalidGeneratedMapping, + GeneratedMapping, + SourceMapInput, + Needle, + SourceNeedle, + SourceMap, + EachMapping, + Bias, + XInput, + SectionedSourceMap, + Ro, +} from './types'; +import type { Source } from './by-source'; +import type { MemoState } from './binary-search'; + +export type { SourceMapSegment } from './sourcemap-segment'; +export type { + SourceMap, + DecodedSourceMap, + EncodedSourceMap, + Section, + SectionedSourceMap, + SourceMapV3, + Bias, + EachMapping, + GeneratedMapping, + InvalidGeneratedMapping, + InvalidOriginalMapping, + Needle, + OriginalMapping, + OriginalMapping as Mapping, + SectionedSourceMapInput, + SourceMapInput, + SourceNeedle, + XInput, + EncodedSourceMapXInput, + DecodedSourceMapXInput, + SectionedSourceMapXInput, + SectionXInput, +} from './types'; + +interface PublicMap { + _encoded: TraceMap['_encoded']; + _decoded: TraceMap['_decoded']; + _decodedMemo: TraceMap['_decodedMemo']; + _bySources: TraceMap['_bySources']; + _bySourceMemos: TraceMap['_bySourceMemos']; +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; + +export const LEAST_UPPER_BOUND = -1; +export const GREATEST_LOWER_BOUND = 1; + +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map'; + +export class TraceMap implements SourceMap { + declare version: SourceMapV3['version']; + declare file: SourceMapV3['file']; + declare names: SourceMapV3['names']; + declare sourceRoot: SourceMapV3['sourceRoot']; + declare sources: SourceMapV3['sources']; + declare sourcesContent: SourceMapV3['sourcesContent']; + declare ignoreList: SourceMapV3['ignoreList']; + + declare resolvedSources: string[]; + declare private _encoded: string | undefined; + + declare private _decoded: SourceMapSegment[][] | undefined; + declare private _decodedMemo: MemoState; + + declare private _bySources: Source[] | undefined; + declare private _bySourceMemos: MemoState[] | undefined; + + constructor(map: Ro, mapUrl?: string | null) { + const isString = typeof map === 'string'; + if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap; + + const parsed = parse(map as Exclude); + + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined; + + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } else if (Array.isArray(mappings)) { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } else if ((parsed as unknown as SectionedSourceMap).sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast(map: unknown): PublicMap { + return map as any; +} + +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] { + return (cast(map)._encoded ??= encode(cast(map)._decoded!)); +} + +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export function decodedMappings(map: TraceMap): Readonly { + return (cast(map)._decoded ||= decode(cast(map)._encoded!)); +} + +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export function traceSegment( + map: TraceMap, + line: number, + column: number, +): Readonly | null { + const decoded = decodedMappings(map); + + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) return null; + + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND, + ); + + return index === -1 ? null : segments[index]; +} + +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export function originalPositionFor( + map: TraceMap, + needle: Needle, +): OriginalMapping | InvalidOriginalMapping { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + + const decoded = decodedMappings(map); + + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) return OMapping(null, null, null, null); + + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND, + ); + + if (index === -1) return OMapping(null, null, null, null); + + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null, + ); +} + +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export function generatedPositionFor( + map: TraceMap, + needle: SourceNeedle, +): GeneratedMapping | InvalidGeneratedMapping { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} + +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] { + const { source, line, column, bias } = needle; + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} + +/** + * Iterates each mapping in generated position order. + */ +export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + } as EachMapping); + } + } +} + +function sourceIndex(map: TraceMap, source: string): number { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} + +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export function sourceContentFor(map: TraceMap, source: string): string | null { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} + +/** + * Determines if the source is marked to ignore by the source map. + */ +export function isIgnored(map: TraceMap, source: string): boolean { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} + +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} + +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function decodedMap( + map: TraceMap, +): Omit & { mappings: readonly SourceMapSegment[][] } { + return clone(map, decodedMappings(map)); +} + +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function encodedMap(map: TraceMap): EncodedSourceMap { + return clone(map, encodedMappings(map)); +} + +function clone( + map: TraceMap | DecodedSourceMap, + mappings: T, +): T extends string ? EncodedSourceMap : DecodedSourceMap { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList, + } as any; +} + +function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping; +function OMapping( + source: string, + line: number, + column: number, + name: string | null, +): OriginalMapping; +function OMapping( + source: string | null, + line: number | null, + column: number | null, + name: string | null, +): OriginalMapping | InvalidOriginalMapping { + return { source, line, column, name } as any; +} + +function GMapping(line: null, column: null): InvalidGeneratedMapping; +function GMapping(line: number, column: number): GeneratedMapping; +function GMapping( + line: number | null, + column: number | null, +): GeneratedMapping | InvalidGeneratedMapping { + return { line, column } as any; +} + +function traceSegmentInternal( + segments: SourceMapSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number; +function traceSegmentInternal( + segments: ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number; +function traceSegmentInternal( + segments: SourceMapSegment[] | ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number { + let index = memoizedBinarySearch(segments, column, memo, line); + if (bsFound) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + + if (index === -1 || index === segments.length) return -1; + return index; +} + +function sliceGeneratedPositions( + segments: ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): GeneratedMapping[] { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!bsFound && bias === LEAST_UPPER_BOUND) min++; + + if (min === -1 || min === segments.length) return []; + + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = bsFound ? column : segments[min][COLUMN]; + + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!bsFound) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} + +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: false, +): GeneratedMapping | InvalidGeneratedMapping; +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: true, +): GeneratedMapping[]; +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: boolean, +): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] { + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) return all ? [] : GMapping(null, null); + + const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState)); + const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos)); + + const segments = generated[sourceIndex][line]; + if (segments == null) return all ? [] : GMapping(null, null); + + const memo = bySourceMemos[sourceIndex]; + + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/types.ts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/types.ts new file mode 100644 index 0000000..730a61f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/src/types.ts @@ -0,0 +1,114 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; + +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} + +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} + +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} + +export interface Section { + offset: { line: number; column: number }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} + +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} + +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; + +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; + +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; + +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; + +export type XInput = { x_google_ignoreList?: SourceMapV3['ignoreList'] }; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; + +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; + +export type Needle = { line: number; column: number; bias?: Bias }; +export type SourceNeedle = { source: string; line: number; column: number; bias?: Bias }; + +export type EachMapping = + | { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; + } + | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; + }; + +export abstract class SourceMap { + declare version: SourceMapV3['version']; + declare file: SourceMapV3['file']; + declare names: SourceMapV3['names']; + declare sourceRoot: SourceMapV3['sourceRoot']; + declare sources: SourceMapV3['sources']; + declare sourcesContent: SourceMapV3['sourcesContent']; + declare resolvedSources: SourceMapV3['sources']; + declare ignoreList: SourceMapV3['ignoreList']; +} + +export type Ro = + T extends Array + ? V[] | Readonly | RoArray | Readonly> + : T extends object + ? T | Readonly | RoObject | Readonly> + : T; +type RoArray = Ro[]; +type RoObject = { [K in keyof T]: T[K] | Ro }; + +export function parse(map: T): Exclude { + return typeof map === 'string' ? JSON.parse(map) : (map as Exclude); +} diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts new file mode 100644 index 0000000..b7bb85c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts @@ -0,0 +1,33 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts'; +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; +//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map new file mode 100644 index 0000000..648e84c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts new file mode 100644 index 0000000..19e1e6b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts @@ -0,0 +1,33 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.mts'; +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; +//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map new file mode 100644 index 0000000..648e84c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts new file mode 100644 index 0000000..da49693 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; +export type Source = ReverseSegment[][]; +export = function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; +//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map new file mode 100644 index 0000000..32d2a7a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts new file mode 100644 index 0000000..f361049 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; +export type Source = ReverseSegment[][]; +export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; +//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map new file mode 100644 index 0000000..32d2a7a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts new file mode 100644 index 0000000..433d849 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts @@ -0,0 +1,9 @@ +import { TraceMap } from './trace-mapping.cts'; +import type { SectionedSourceMapInput, Ro } from './types.cts'; +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; +export declare const FlattenMap: FlattenMap; +export {}; +//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map new file mode 100644 index 0000000..994b208 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts new file mode 100644 index 0000000..444a1be --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts @@ -0,0 +1,9 @@ +import { TraceMap } from './trace-mapping.mts'; +import type { SectionedSourceMapInput, Ro } from './types.mts'; +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; +export declare const FlattenMap: FlattenMap; +export {}; +//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map new file mode 100644 index 0000000..994b208 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts new file mode 100644 index 0000000..62aeedb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts @@ -0,0 +1,4 @@ +type Resolve = (source: string | null) => string; +export = function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; +export {}; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map new file mode 100644 index 0000000..9f155ac --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts new file mode 100644 index 0000000..e2798a1 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts @@ -0,0 +1,4 @@ +type Resolve = (source: string | null) => string; +export default function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; +export {}; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map new file mode 100644 index 0000000..9f155ac --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts new file mode 100644 index 0000000..aa14c12 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; +export = function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; +export declare function sortComparator(a: T, b: T): number; +//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map new file mode 100644 index 0000000..48b8e67 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts new file mode 100644 index 0000000..c5b94e6 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; +export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; +export declare function sortComparator(a: T, b: T): number; +//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map new file mode 100644 index 0000000..48b8e67 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts new file mode 100644 index 0000000..8d3cabc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts @@ -0,0 +1,17 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +type GeneratedLine = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map new file mode 100644 index 0000000..0c94a46 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts new file mode 100644 index 0000000..8d3cabc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts @@ -0,0 +1,17 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +type GeneratedLine = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map new file mode 100644 index 0000000..0c94a46 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts new file mode 100644 index 0000000..8b3c0e9 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts @@ -0,0 +1,5 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export = function stripFilename(path: string | undefined | null): string; +//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map new file mode 100644 index 0000000..17a25da --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts new file mode 100644 index 0000000..cbbaee0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts @@ -0,0 +1,5 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string; +//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map new file mode 100644 index 0000000..17a25da --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts new file mode 100644 index 0000000..a40f305 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts @@ -0,0 +1,80 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.cts'; +export type { SourceMapSegment } from './sourcemap-segment.cts'; +export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.cts'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.cts'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + ignoreList: SourceMapV3['ignoreList']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: Ro, mapUrl?: string | null); +} +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare function decodedMappings(map: TraceMap): Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare function sourceContentFor(map: TraceMap, source: string): string | null; +/** + * Determines if the source is marked to ignore by the source map. + */ +export declare function isIgnored(map: TraceMap, source: string): boolean; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function decodedMap(map: TraceMap): Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function encodedMap(map: TraceMap): EncodedSourceMap; +//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map new file mode 100644 index 0000000..b5a874c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts new file mode 100644 index 0000000..bc2ff0f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts @@ -0,0 +1,80 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.mts'; +export type { SourceMapSegment } from './sourcemap-segment.mts'; +export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.mts'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.mts'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + ignoreList: SourceMapV3['ignoreList']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: Ro, mapUrl?: string | null); +} +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare function decodedMappings(map: TraceMap): Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare function sourceContentFor(map: TraceMap, source: string): string | null; +/** + * Determines if the source is marked to ignore by the source map. + */ +export declare function isIgnored(map: TraceMap, source: string): boolean; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function decodedMap(map: TraceMap): Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function encodedMap(map: TraceMap): EncodedSourceMap; +//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map new file mode 100644 index 0000000..b5a874c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts new file mode 100644 index 0000000..729c2c3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts @@ -0,0 +1,107 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.cts'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export type XInput = { + x_google_ignoreList?: SourceMapV3['ignoreList']; +}; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; +export type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; + ignoreList: SourceMapV3['ignoreList']; +} +export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +type RoArray = Ro[]; +type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export declare function parse(map: T): Exclude; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map new file mode 100644 index 0000000..9224783 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts new file mode 100644 index 0000000..a26d186 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts @@ -0,0 +1,107 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.mts'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export type XInput = { + x_google_ignoreList?: SourceMapV3['ignoreList']; +}; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; +export type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; + ignoreList: SourceMapV3['ignoreList']; +} +export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +type RoArray = Ro[]; +type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export declare function parse(map: T): Exclude; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map new file mode 100644 index 0000000..9224783 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/LICENSE b/node_modules/@tailwindcss/node/node_modules/detect-libc/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/README.md b/node_modules/@tailwindcss/node/node_modules/detect-libc/README.md new file mode 100644 index 0000000..23212fd --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/README.md @@ -0,0 +1,163 @@ +# detect-libc + +Node.js module to detect details of the C standard library (libc) +implementation provided by a given Linux system. + +Currently supports detection of GNU glibc and MUSL libc. + +Provides asychronous and synchronous functions for the +family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`). + +The version numbers of libc implementations +are not guaranteed to be semver-compliant. + +For previous v1.x releases, please see the +[v1](https://github.com/lovell/detect-libc/tree/v1) branch. + +## Install + +```sh +npm install detect-libc +``` + +## API + +### GLIBC + +```ts +const GLIBC: string = 'glibc'; +``` + +A String constant containing the value `glibc`. + +### MUSL + +```ts +const MUSL: string = 'musl'; +``` + +A String constant containing the value `musl`. + +### family + +```ts +function family(): Promise; +``` + +Resolves asychronously with: + +* `glibc` or `musl` when the libc family can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { family, GLIBC, MUSL } = require('detect-libc'); + +switch (await family()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### familySync + +```ts +function familySync(): string | null; +``` + +Synchronous version of `family()`. + +```js +const { familySync, GLIBC, MUSL } = require('detect-libc'); + +switch (familySync()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### version + +```ts +function version(): Promise; +``` + +Resolves asychronously with: + +* The version when it can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { version } = require('detect-libc'); + +const v = await version(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### versionSync + +```ts +function versionSync(): string | null; +``` + +Synchronous version of `version()`. + +```js +const { versionSync } = require('detect-libc'); + +const v = versionSync(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### isNonGlibcLinux + +```ts +function isNonGlibcLinux(): Promise; +``` + +Resolves asychronously with: + +* `false` when the libc family is `glibc` +* `true` when the libc family is not `glibc` +* `false` when run on a non-Linux platform + +```js +const { isNonGlibcLinux } = require('detect-libc'); + +if (await isNonGlibcLinux()) { ... } +``` + +### isNonGlibcLinuxSync + +```ts +function isNonGlibcLinuxSync(): boolean; +``` + +Synchronous version of `isNonGlibcLinux()`. + +```js +const { isNonGlibcLinuxSync } = require('detect-libc'); + +if (isNonGlibcLinuxSync()) { ... } +``` + +## Licensing + +Copyright 2017 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/index.d.ts b/node_modules/@tailwindcss/node/node_modules/detect-libc/index.d.ts new file mode 100644 index 0000000..4c0fb2b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/index.d.ts @@ -0,0 +1,14 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +export const GLIBC: 'glibc'; +export const MUSL: 'musl'; + +export function family(): Promise; +export function familySync(): string | null; + +export function isNonGlibcLinux(): Promise; +export function isNonGlibcLinuxSync(): boolean; + +export function version(): Promise; +export function versionSync(): string | null; diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/detect-libc.js b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/detect-libc.js new file mode 100644 index 0000000..01299b4 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/detect-libc.js @@ -0,0 +1,313 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const childProcess = require('child_process'); +const { isLinux, getReport } = require('./process'); +const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem'); +const { interpreterPath } = require('./elf'); + +let cachedFamilyInterpreter; +let cachedFamilyFilesystem; +let cachedVersionFilesystem; + +const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; +let commandOut = ''; + +const safeCommand = () => { + if (!commandOut) { + return new Promise((resolve) => { + childProcess.exec(command, (err, out) => { + commandOut = err ? ' ' : out; + resolve(commandOut); + }); + }); + } + return commandOut; +}; + +const safeCommandSync = () => { + if (!commandOut) { + try { + commandOut = childProcess.execSync(command, { encoding: 'utf8' }); + } catch (_err) { + commandOut = ' '; + } + } + return commandOut; +}; + +/** + * A String constant containing the value `glibc`. + * @type {string} + * @public + */ +const GLIBC = 'glibc'; + +/** + * A Regexp constant to get the GLIBC Version. + * @type {string} + */ +const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i; + +/** + * A String constant containing the value `musl`. + * @type {string} + * @public + */ +const MUSL = 'musl'; + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); + +const familyFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return GLIBC; + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return MUSL; + } + } + return null; +}; + +const familyFromCommand = (out) => { + const [getconf, ldd1] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return GLIBC; + } + if (ldd1 && ldd1.includes(MUSL)) { + return MUSL; + } + return null; +}; + +const familyFromInterpreterPath = (path) => { + if (path) { + if (path.includes('/ld-musl-')) { + return MUSL; + } else if (path.includes('/ld-linux-')) { + return GLIBC; + } + } + return null; +}; + +const getFamilyFromLddContent = (content) => { + content = content.toString(); + if (content.includes('musl')) { + return MUSL; + } + if (content.includes('GNU C Library')) { + return GLIBC; + } + return null; +}; + +const familyFromFilesystem = async () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromFilesystemSync = () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromInterpreter = async () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = await readFile(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +const familyFromInterpreterSync = () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = readFileSync(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +/** + * Resolves with the libc family when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const family = async () => { + let family = null; + if (isLinux()) { + family = await familyFromInterpreter(); + if (!family) { + family = await familyFromFilesystem(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = await safeCommand(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Returns the libc family when it can be determined, `null` otherwise. + * @returns {?string} + */ +const familySync = () => { + let family = null; + if (isLinux()) { + family = familyFromInterpreterSync(); + if (!family) { + family = familyFromFilesystemSync(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = safeCommandSync(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {Promise} + */ +const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; + +/** + * Returns `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {boolean} + */ +const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; + +const versionFromFilesystem = async () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromFilesystemSync = () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return report.header.glibcVersionRuntime; + } + return null; +}; + +const versionSuffix = (s) => s.trim().split(/\s+/)[1]; + +const versionFromCommand = (out) => { + const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return versionSuffix(getconf); + } + if (ldd1 && ldd2 && ldd1.includes(MUSL)) { + return versionSuffix(ldd2); + } + return null; +}; + +/** + * Resolves with the libc version when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const version = async () => { + let version = null; + if (isLinux()) { + version = await versionFromFilesystem(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = await safeCommand(); + version = versionFromCommand(out); + } + } + return version; +}; + +/** + * Returns the libc version when it can be determined, `null` otherwise. + * @returns {?string} + */ +const versionSync = () => { + let version = null; + if (isLinux()) { + version = versionFromFilesystemSync(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = safeCommandSync(); + version = versionFromCommand(out); + } + } + return version; +}; + +module.exports = { + GLIBC, + MUSL, + family, + familySync, + isNonGlibcLinux, + isNonGlibcLinuxSync, + version, + versionSync +}; diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/elf.js b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/elf.js new file mode 100644 index 0000000..aa166aa --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/elf.js @@ -0,0 +1,39 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const interpreterPath = (elf) => { + if (elf.length < 64) { + return null; + } + if (elf.readUInt32BE(0) !== 0x7F454C46) { + // Unexpected magic bytes + return null; + } + if (elf.readUInt8(4) !== 2) { + // Not a 64-bit ELF + return null; + } + if (elf.readUInt8(5) !== 1) { + // Not little-endian + return null; + } + const offset = elf.readUInt32LE(32); + const size = elf.readUInt16LE(54); + const count = elf.readUInt16LE(56); + for (let i = 0; i < count; i++) { + const headerOffset = offset + (i * size); + const type = elf.readUInt32LE(headerOffset); + if (type === 3) { + const fileOffset = elf.readUInt32LE(headerOffset + 8); + const fileSize = elf.readUInt32LE(headerOffset + 32); + return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, ''); + } + } + return null; +}; + +module.exports = { + interpreterPath +}; diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/filesystem.js b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/filesystem.js new file mode 100644 index 0000000..4c2443c --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/filesystem.js @@ -0,0 +1,51 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const fs = require('fs'); + +const LDD_PATH = '/usr/bin/ldd'; +const SELF_PATH = '/proc/self/exe'; +const MAX_LENGTH = 2048; + +/** + * Read the content of a file synchronous + * + * @param {string} path + * @returns {Buffer} + */ +const readFileSync = (path) => { + const fd = fs.openSync(path, 'r'); + const buffer = Buffer.alloc(MAX_LENGTH); + const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0); + fs.close(fd, () => {}); + return buffer.subarray(0, bytesRead); +}; + +/** + * Read the content of a file + * + * @param {string} path + * @returns {Promise} + */ +const readFile = (path) => new Promise((resolve, reject) => { + fs.open(path, 'r', (err, fd) => { + if (err) { + reject(err); + } else { + const buffer = Buffer.alloc(MAX_LENGTH); + fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => { + resolve(buffer.subarray(0, bytesRead)); + fs.close(fd, () => {}); + }); + } + }); +}); + +module.exports = { + LDD_PATH, + SELF_PATH, + readFileSync, + readFile +}; diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/process.js b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/process.js new file mode 100644 index 0000000..ee78ad2 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/lib/process.js @@ -0,0 +1,24 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const isLinux = () => process.platform === 'linux'; + +let report = null; +const getReport = () => { + if (!report) { + /* istanbul ignore next */ + if (isLinux() && process.report) { + const orig = process.report.excludeNetwork; + process.report.excludeNetwork = true; + report = process.report.getReport(); + process.report.excludeNetwork = orig; + } else { + report = {}; + } + } + return report; +}; + +module.exports = { isLinux, getReport }; diff --git a/node_modules/@tailwindcss/node/node_modules/detect-libc/package.json b/node_modules/@tailwindcss/node/node_modules/detect-libc/package.json new file mode 100644 index 0000000..36d0f2b --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/detect-libc/package.json @@ -0,0 +1,44 @@ +{ + "name": "detect-libc", + "version": "2.1.2", + "description": "Node.js module to detect the C standard library (libc) implementation family and version", + "main": "lib/detect-libc.js", + "files": [ + "lib/", + "index.d.ts" + ], + "scripts": { + "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js", + "changelog": "conventional-changelog -i CHANGELOG.md -s", + "bench": "node benchmark/detect-libc", + "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/lovell/detect-libc.git" + }, + "keywords": [ + "libc", + "glibc", + "musl" + ], + "author": "Lovell Fuller ", + "contributors": [ + "Niklas Salmoukas ", + "Vinícius Lourenço " + ], + "license": "Apache-2.0", + "devDependencies": { + "ava": "^2.4.0", + "benchmark": "^2.1.4", + "conventional-changelog-cli": "^5.0.0", + "eslint-config-standard": "^13.0.1", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "semistandard": "^14.2.3" + }, + "engines": { + "node": ">=8" + }, + "types": "index.d.ts" +} diff --git a/node_modules/@tailwindcss/node/node_modules/jiti/LICENSE b/node_modules/@tailwindcss/node/node_modules/jiti/LICENSE new file mode 100644 index 0000000..e739abc --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/jiti/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pooya Parsa + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/node/node_modules/jiti/README.md b/node_modules/@tailwindcss/node/node_modules/jiti/README.md new file mode 100644 index 0000000..2c957a9 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/jiti/README.md @@ -0,0 +1,243 @@ +# jiti + + + +[![npm version](https://img.shields.io/npm/v/jiti?color=F0DB4F)](https://npmjs.com/package/jiti) +[![npm downloads](https://img.shields.io/npm/dm/jiti?color=F0DB4F)](https://npmjs.com/package/jiti) +[![bundle size](https://img.shields.io/bundlephobia/minzip/jiti?color=F0DB4F)](https://bundlephobia.com/package/jiti) + + + +> This is the active development branch. Check out [jiti/v1](https://github.com/unjs/jiti/tree/v1) for legacy v1 docs and code. + +## 🌟 Used in + +[Docusaurus](https://docusaurus.io/), [ESLint](https://github.com/eslint/eslint), [FormKit](https://formkit.com/), [Histoire](https://histoire.dev/), [Knip](https://knip.dev/), [Nitro](https://nitro.unjs.io/), [Nuxt](https://nuxt.com/), [PostCSS loader](https://github.com/webpack-contrib/postcss-loader), [Rsbuild](https://rsbuild.dev/), [Size Limit](https://github.com/ai/size-limit), [Slidev](https://sli.dev/), [Tailwindcss](https://tailwindcss.com/), [Tokenami](https://github.com/tokenami/tokenami), [UnoCSS](https://unocss.dev/), [WXT](https://wxt.dev/), [Winglang](https://www.winglang.io/), [Graphql code generator](https://the-guild.dev/graphql/codegen), [Lingui](https://lingui.dev/), [Scaffdog](https://scaff.dog/), [Storybook](https://storybook.js.org), [...UnJS ecosystem](https://unjs.io/), [...60M+ npm monthly downloads](https://npm.chart.dev/jiti), [...6M+ public repositories](https://github.com/unjs/jiti/network/dependents). + +## ✅ Features + +- Seamless TypeScript and ESM syntax support for Node.js +- Seamless interoperability between ESM and CommonJS +- Asynchronous API to replace `import()` +- Synchronous API to replace `require()` (deprecated) +- Super slim and zero dependency +- Custom resolve aliases +- Smart syntax detection to avoid extra transforms +- Node.js native `require.cache` integration +- Filesystem transpile with hard disk caches +- ESM Loader support +- JSX support (opt-in) + +> [!IMPORTANT] +> To enhance compatibility, jiti `>=2.1` enabled [`interopDefault`](#interopdefault) using a new Proxy method. If you migrated to `2.0.0` earlier, this might have caused behavior changes. In case of any issues during the upgrade, please [report](https://github.com/unjs/jiti/issues) so we can investigate to solve them. 🙏🏼 + +## 💡 Usage + +### CLI + +You can use `jiti` CLI to quickly run any script with TypeScript and native ESM support! + +```bash +npx jiti ./index.ts +``` + +### Programmatic + +Initialize a jiti instance: + +```js +// ESM +import { createJiti } from "jiti"; +const jiti = createJiti(import.meta.url); + +// CommonJS (deprecated) +const { createJiti } = require("jiti"); +const jiti = createJiti(__filename); +``` + +Import (async) and resolve with ESM compatibility: + +```js +// jiti.import(id) is similar to import(id) +const mod = await jiti.import("./path/to/file.ts"); + +// jiti.esmResolve(id) is similar to import.meta.resolve(id) +const resolvedPath = jiti.esmResolve("./src"); +``` + +If you need the default export of module, you can use `jiti.import(id, { default: true })` as shortcut to `mod?.default ?? mod`. + +```js +// shortcut to mod?.default ?? mod +const modDefault = await jiti.import("./path/to/file.ts", { default: true }); +``` + +CommonJS (sync & deprecated): + +```js +// jiti() is similar to require(id) +const mod = jiti("./path/to/file.ts"); + +// jiti.resolve() is similar to require.resolve(id) +const resolvedPath = jiti.resolve("./src"); +``` + +You can also pass options as the second argument: + +```js +const jiti = createJiti(import.meta.url, { debug: true }); +``` + +### Register global ESM loader + +You can globally register jiti using [global hooks](https://nodejs.org/api/module.html#initialize). (Important: Requires Node.js > 20) + +```js +import "jiti/register"; +``` + +Or: + +```bash +node --import jiti/register index.ts +``` + +## 🎈 `jiti/native` + +You can alias `jiti` to `jiti/native` to directly depend on runtime's [`import.meta.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve) and dynamic [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) support. This allows easing up the ecosystem transition to runtime native support by giving the same API of jiti. + +## ⚙️ Options + +### `debug` + +- Type: Boolean +- Default: `false` +- Environment variable: `JITI_DEBUG` + +Enable verbose logging. You can use `JITI_DEBUG=1 ` to enable it. + +### `fsCache` + +- Type: Boolean | String +- Default: `true` +- Environment variable: `JITI_FS_CACHE` + +Filesystem source cache (enabled by default) + +By default (when is `true`), jiti uses `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/jiti`. + +**Note:** It is recommended that this option be enabled for better performance. + +### `rebuildFsCache` + +- Type: Boolean +- Default: `false` +- Environment variable: `JITI_REBUILD_FS_CACHE` + +Rebuild filesystem source cache created by `fsCache`. + +### `moduleCache` + +- Type: String +- Default: `true` +- Environment variable: `JITI_MODULE_CACHE` + +Runtime module cache (enabled by default). + +Disabling allows editing code and importing the same module multiple times. + +When enabled, jiti integrates with Node.js native CommonJS cache-store. + +### `transform` + +- Type: Function +- Default: Babel (lazy loaded) + +Transform function. See [src/babel](./src/babel.ts) for more details + +### `sourceMaps` + +- Type: Boolean +- Default `false` +- Environment variable: `JITI_SOURCE_MAPS` + +Add inline source map to transformed source for better debugging. + +### `interopDefault` + +- Type: Boolean +- Default: `true` +- Environment variable: `JITI_INTEROP_DEFAULT` + +Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105). + +### `alias` + +- Type: Object +- Default: - +- Environment variable: `JITI_ALIAS` + +You can also pass an object to the environment variable for inline config. Example: `JITI_ALIAS='{"~/*": "./src/*"}' jiti ...`. + +Custom alias map used to resolve IDs. + +### `nativeModules` + +- Type: Array +- Default: ['typescript'] +- Environment variable: `JITI_NATIVE_MODULES` + +List of modules (within `node_modules`) to always use native `require()` for them. + +### `transformModules` + +- Type: Array +- Default: [] +- Environment variable: `JITI_TRANSFORM_MODULES` + +List of modules (within `node_modules`) to transform them regardless of syntax. + +### `importMeta` + +Parent module's [`import.meta`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) context to use for ESM resolution. (only used for `jiti/native` import). + +### `tryNative` + +- Type: Boolean +- Default: Enabled if bun is detected +- Environment variable: `JITI_TRY_NATIVE` + +Try to use native require and import without jiti transformations first. + +### `jsx` + +- Type: Boolean | {options} +- Default: `false` +- Environment Variable: `JITI_JSX` + +Enable JSX support using [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/babel-plugin-transform-react-jsx). + +See [`test/fixtures/jsx`](./test/fixtures/jsx) for framework integration examples. + +## Development + +- Clone this repository +- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` +- Install dependencies using `pnpm install` +- Run `pnpm dev` +- Run `pnpm jiti ./test/path/to/file.ts` + +## License + + + +Published under the [MIT](https://github.com/unjs/jiti/blob/main/LICENSE) license. +Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/jiti/graphs/contributors) 💛 +

+ + + + + + + diff --git a/node_modules/@tailwindcss/node/node_modules/jiti/dist/babel.cjs b/node_modules/@tailwindcss/node/node_modules/jiti/dist/babel.cjs new file mode 100644 index 0000000..088011d --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/jiti/dist/babel.cjs @@ -0,0 +1,246 @@ +(()=>{var e={"./node_modules/.pnpm/@babel+core@7.28.4/node_modules/@babel/core/lib/config/files lazy recursive":function(e){function webpackEmptyAsyncContext(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.28.4/node_modules/@babel/core/lib/config/files lazy recursive",e.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.28.4/node_modules/@babel/core/lib/config/files sync recursive":function(e){function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.28.4/node_modules/@babel/core/lib/config/files sync recursive",e.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.28.4/node_modules/@babel/plugin-syntax-class-properties/lib/index.js":function(e,t,r){"use strict";t.default=void 0;var n=(0,r("./node_modules/.pnpm/@babel+helper-plugin-utils@7.27.1/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)(e=>(e.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(e,t){t.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}}));t.default=n},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js":function(e,t,r){var n;!function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/sourcemap-codec"(e,r){r.exports=t}}),c=__commonJS({"umd:@jridgewell/trace-mapping"(e,t){t.exports=r}}),u={};__export(u,{GenMapping:()=>E,addMapping:()=>addMapping,addSegment:()=>addSegment,allMappings:()=>allMappings,fromMap:()=>fromMap,maybeAddMapping:()=>maybeAddMapping,maybeAddSegment:()=>maybeAddSegment,setIgnore:()=>setIgnore,setSourceContent:()=>setSourceContent,toDecodedMap:()=>toDecodedMap,toEncodedMap:()=>toEncodedMap}),e.exports=__toCommonJS(u);var d=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function cast(e){return e}function get(e,t){return cast(e)._indexes[t]}function put(e,t){const r=get(e,t);if(void 0!==r)return r;const{array:n,_indexes:s}=cast(e),i=n.push(t);return s[t]=i-1}function remove(e,t){const r=get(e,t);if(void 0===r)return;const{array:n,_indexes:s}=cast(e);for(let e=r+1;eaddSegmentInternal(!0,e,t,r,n,s,i,o,a),maybeAddMapping=(e,t)=>addMappingInternal(!0,e,t);function setSourceContent(e,t,r){const{_sources:n,_sourcesContent:s}=cast2(e);s[put(n,t)]=r}function setIgnore(e,t,r=!0){const{_sources:n,_sourcesContent:s,_ignoreList:i}=cast2(e),o=put(n,t);o===s.length&&(s[o]=null),r?put(i,o):remove(i,o)}function toDecodedMap(e){const{_mappings:t,_sources:r,_sourcesContent:n,_names:s,_ignoreList:i}=cast2(e);return removeEmptyFinalLines(t),{version:3,file:e.file||void 0,names:s.array,sourceRoot:e.sourceRoot||void 0,sources:r.array,sourcesContent:n,mappings:t,ignoreList:i.array}}function toEncodedMap(e){const t=toDecodedMap(e);return Object.assign({},t,{mappings:(0,h.encode)(t.mappings)})}function fromMap(e){const t=new m.TraceMap(e),r=new E({file:t.file,sourceRoot:t.sourceRoot});return putAll(cast2(r)._names,t.names),putAll(cast2(r)._sources,t.sources),cast2(r)._sourcesContent=t.sourcesContent||t.sources.map(()=>null),cast2(r)._mappings=(0,m.decodedMappings)(t),t.ignoreList&&putAll(cast2(r)._ignoreList,t.ignoreList),r}function allMappings(e){const t=[],{_mappings:r,_sources:n,_names:s}=cast2(e);for(let e=0;e=0&&!(t>=e[n][f]);r=n--);return r}function insert(e,t,r){for(let r=e.length;r>t;r--)e[r]=e[r-1];e[t]=r}function removeEmptyFinalLines(e){const{length:t}=e;let r=t;for(let t=r-1;t>=0&&!(e[t].length>0);r=t,t--);rfunction(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/trace-mapping"(e,t){t.exports=r}}),c=__commonJS({"umd:@jridgewell/gen-mapping"(e,r){r.exports=t}}),u={};__export(u,{default:()=>remapping}),e.exports=__toCommonJS(u);var d=__toESM(p()),h=__toESM(c()),m=__toESM(p()),f=SegmentObject("",-1,-1,"",null,!1),y=[];function SegmentObject(e,t,r,n,s,i){return{source:e,line:t,column:r,name:n,content:s,ignore:i}}function Source(e,t,r,n,s){return{map:e,sources:t,source:r,content:n,ignore:s}}function MapSource(e,t){return Source(e,t,"",null,!1)}function OriginalSource(e,t,r){return Source(null,y,e,t,r)}function traceMappings(e){const t=new h.GenMapping({file:e.map.file}),{sources:r,map:n}=e,s=n.names,i=(0,m.decodedMappings)(n);for(let e=0;enew d.TraceMap(e,"")),n=r.pop();for(let e=0;e1)throw new Error(`Transformation map ${e} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let s=build(n,t,"",0);for(let e=r.length-1;e>=0;e--)s=MapSource(r[e],[s]);return s}function build(e,t,r,n){const{resolvedSources:s,sourcesContent:i,ignoreList:o}=e,a=n+1;return MapSource(e,s.map((e,n)=>{const s={importer:r,depth:a,source:e||"",content:void 0,ignore:void 0},l=t(s.source,s),{source:p,content:c,ignore:u}=s;return l?build(new d.TraceMap(l,p),t,p,a):OriginalSource(p,void 0!==c?c:i?i[n]:null,void 0!==u?u:!!o&&o.includes(n))}))}var b=__toESM(c()),g=class{constructor(e,t){const r=t.decodedMappings?(0,b.toDecodedMap)(e):(0,b.toEncodedMap)(e);this.version=r.version,this.file=r.file,this.mappings=r.mappings,this.names=r.names,this.ignoreList=r.ignoreList,this.sourceRoot=r.sourceRoot,this.sources=r.sources,t.excludeContent||(this.sourcesContent=r.sourcesContent)}toString(){return JSON.stringify(this)}};function remapping(e,t,r){const n="object"==typeof r?r:{excludeContent:!!r,decodedMappings:!1},s=buildSourceMapTree(e,t);return new g(traceMappings(s),n)}}(e=r.nmd(e),r("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"),r("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js")),e.exports="default"in(n=e).exports?n.exports.default:n.exports},"./node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js":function(e){e.exports=function(){"use strict";const e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,r=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function isAbsoluteUrl(t){return e.test(t)}function isSchemeRelativeUrl(e){return e.startsWith("//")}function isAbsolutePath(e){return e.startsWith("/")}function isFileUrl(e){return e.startsWith("file:")}function isRelative(e){return/^[.?#]/.test(e)}function parseAbsoluteUrl(e){const r=t.exec(e);return makeUrl(r[1],r[2]||"",r[3],r[4]||"",r[5]||"/",r[6]||"",r[7]||"")}function parseFileUrl(e){const t=r.exec(e),n=t[2];return makeUrl("file:","",t[1]||"","",isAbsolutePath(n)?n:"/"+n,t[3]||"",t[4]||"")}function makeUrl(e,t,r,n,s,i,o){return{scheme:e,user:t,host:r,port:n,path:s,query:i,hash:o,type:7}}function parseUrl(e){if(isSchemeRelativeUrl(e)){const t=parseAbsoluteUrl("http:"+e);return t.scheme="",t.type=6,t}if(isAbsolutePath(e)){const t=parseAbsoluteUrl("http://foo.com"+e);return t.scheme="",t.host="",t.type=5,t}if(isFileUrl(e))return parseFileUrl(e);if(isAbsoluteUrl(e))return parseAbsoluteUrl(e);const t=parseAbsoluteUrl("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}function stripPathFilename(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function mergePaths(e,t){normalizePath(t,t.type),"/"===e.path?e.path=t.path:e.path=stripPathFilename(t.path)+e.path}function normalizePath(e,t){const r=t<=4,n=e.path.split("/");let s=1,i=0,o=!1;for(let e=1;en&&(n=s)}normalizePath(r,n);const s=r.query+r.hash;switch(n){case 2:case 3:return s;case 4:{const n=r.path.slice(1);return n?isRelative(t||e)&&!isRelative(n)?"./"+n+s:n+s:s||"."}case 5:return r.path+s;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+s}}return resolve}()},"./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js":function(e,t,r){var n;!function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,__copyProps=(e,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of n(i))s.call(e,l)||l===o||t(e,l,{get:()=>i[l],enumerable:!(a=r(i,l))||a.enumerable});return e},__toCommonJS=e=>__copyProps(t({},"__esModule",{value:!0}),e),i={};((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(i,{decode:()=>decode,decodeGeneratedRanges:()=>decodeGeneratedRanges,decodeOriginalScopes:()=>decodeOriginalScopes,encode:()=>encode,encodeGeneratedRanges:()=>encodeGeneratedRanges,encodeOriginalScopes:()=>encodeOriginalScopes}),e.exports=__toCommonJS(i);var o=",".charCodeAt(0),a=";".charCodeAt(0),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=new Uint8Array(64),c=new Uint8Array(128);for(let e=0;e>>=1,i&&(r=-2147483648|-r),t+r}function encodeInteger(e,t,r){let n=t-r;n=n<0?-n<<1|1:n<<1;do{let t=31&n;n>>>=5,n>0&&(t|=32),e.write(p[t])}while(n>0);return t}function hasMoreVlq(e,t){return!(e.pos>=t)&&e.peek()!==o}var u=16384,d="undefined"!=typeof TextDecoder?new TextDecoder:"undefined"!=typeof Buffer?{decode:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}:{decode(e){let t="";for(let r=0;r0?t+d.decode(e.subarray(0,r)):t}},m=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){const{buffer:t,pos:r}=this,n=t.indexOf(e,r);return-1===n?t.length:n}},f=[];function decodeOriginalScopes(e){const{length:t}=e,r=new m(e),n=[],s=[];let i=0;for(;r.pos0&&r.write(o),n[0]=encodeInteger(r,i,n[0]),encodeInteger(r,a,0),encodeInteger(r,c,0),encodeInteger(r,6===s.length?1:0,0),6===s.length&&encodeInteger(r,s[5],0);for(const e of u)encodeInteger(r,e,0);for(t++;tl||i===l&&o>=p)break;t=_encodeOriginalScopes(e,t,r,n)}return r.write(o),n[0]=encodeInteger(r,l,n[0]),encodeInteger(r,p,0),t}function decodeGeneratedRanges(e){const{length:t}=e,r=new m(e),n=[],s=[];let i=0,o=0,a=0,l=0,p=0,c=0,u=0,d=0;do{const e=r.indexOf(";");let t=0;for(;r.pose;t--){const e=u;u=decodeInteger(r,u),d=decodeInteger(r,u===e?d:0);const t=decodeInteger(r,0);n.push([t,u,d])}}else n=[[e]];x.push(n)}while(hasMoreVlq(r,e))}b.bindings=x,n.push(b),s.push(b)}i++,r.pos=e+1}while(r.pos0&&r.write(o),n[1]=encodeInteger(r,s[1],n[1]),encodeInteger(r,(6===s.length?1:0)|(u?2:0)|(c?4:0),0),6===s.length){const{4:e,5:t}=s;e!==n[2]&&(n[3]=0),n[2]=encodeInteger(r,e,n[2]),n[3]=encodeInteger(r,t,n[3])}if(u){const{0:e,1:t,2:i}=s.callsite;e!==n[4]?(n[5]=0,n[6]=0):t!==n[5]&&(n[6]=0),n[4]=encodeInteger(r,e,n[4]),n[5]=encodeInteger(r,t,n[5]),n[6]=encodeInteger(r,i,n[6])}if(d)for(const e of d){e.length>1&&encodeInteger(r,-e.length,0),encodeInteger(r,e[0][0],0);let t=i,n=a;for(let s=1;sl||i===l&&o>=p)break;t=_encodeGeneratedRanges(e,t,r,n)}return n[0]0&&t.write(a),0===p.length)continue;let c=0;for(let e=0;e0&&t.write(o),c=encodeInteger(t,a[0],c),1!==a.length&&(r=encodeInteger(t,a[1],r),n=encodeInteger(t,a[2],n),s=encodeInteger(t,a[3],s),4!==a.length&&(i=encodeInteger(t,a[4],i)))}}return t.flush()}}(e=r.nmd(e)),e.exports="default"in(n=e).exports?n.exports.default:n.exports},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js":function(e,t,r){var n;!function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/sourcemap-codec"(e,t){t.exports=r}}),c=__commonJS({"umd:@jridgewell/resolve-uri"(e,r){r.exports=t}}),u={};__export(u,{AnyMap:()=>FlattenMap,FlattenMap:()=>FlattenMap,GREATEST_LOWER_BOUND:()=>_,LEAST_UPPER_BOUND:()=>P,TraceMap:()=>A,allGeneratedPositionsFor:()=>allGeneratedPositionsFor,decodedMap:()=>decodedMap,decodedMappings:()=>decodedMappings,eachMapping:()=>eachMapping,encodedMap:()=>encodedMap,encodedMappings:()=>encodedMappings,generatedPositionFor:()=>generatedPositionFor,isIgnored:()=>isIgnored,originalPositionFor:()=>originalPositionFor,presortedDecodedMap:()=>presortedDecodedMap,sourceContentFor:()=>sourceContentFor,traceSegment:()=>traceSegment}),e.exports=__toCommonJS(u);var d=__toESM(p()),h=__toESM(c());function stripFilename(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}function resolver(e,t){const r=stripFilename(e),n=t?t+"/":"";return e=>(0,h.default)(n+(e||""),r)}var m=0,f=1,y=2,b=3,g=4,x=1,v=2;function maybeSort(e,t){const r=nextUnsortedSegmentLine(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n[]);for(let t=0;t>1),i=e[s][m]-t;if(0===i)return E=!0,s;i<0?r=s+1:n=s-1}return E=!1,r-1}function upperBound(e,t,r){for(let n=r+1;n=0&&e[n][m]===t;r=n--);return r}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function memoizedBinarySearch(e,t,r,n){const{lastKey:s,lastNeedle:i,lastIndex:o}=r;let a=0,l=e.length-1;if(n===s){if(t===i)return E=-1!==o&&e[o][m]===t,o;t>=i?a=-1===o?0:o:l=o}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=binarySearch(e,t,a,l)}function parse(e){return"string"==typeof e?JSON.parse(e):e}var FlattenMap=function(e,t){const r=parse(e);if(!("sections"in r))return new A(r,t);const n=[],s=[],i=[],o=[],a=[];return recurse(r,t,n,s,i,o,a,0,0,1/0,1/0),presortedDecodedMap({version:3,file:r.file,names:o,sources:s,sourcesContent:i,mappings:n,ignoreList:a})};function recurse(e,t,r,n,s,i,o,a,l,p,c){const{sections:u}=e;for(let e=0;ep)return;const n=getLine(r,t),s=0===e?l:0,i=v[e];for(let e=0;e=c)return;if(1===r.length){n.push([o]);continue}const a=h+r[f],l=r[y],u=r[b];n.push(4===r.length?[o,a,l,u]:[o,a,l,u,x+r[g]])}}}function append(e,t){for(let r=0;r=n.length)return null;const s=n[t],i=traceSegmentInternal(s,cast(e)._decodedMemo,t,r,_);return-1===i?null:s[i]}function originalPositionFor(e,t){let{line:r,column:n,bias:s}=t;if(r--,r<0)throw new Error(T);if(n<0)throw new Error(S);const i=decodedMappings(e);if(r>=i.length)return OMapping(null,null,null,null);const o=i[r],a=traceSegmentInternal(o,cast(e)._decodedMemo,r,n,s||_);if(-1===a)return OMapping(null,null,null,null);const l=o[a];if(1===l.length)return OMapping(null,null,null,null);const{names:p,resolvedSources:c}=e;return OMapping(c[l[f]],l[y]+1,l[b],5===l.length?p[l[g]]:null)}function generatedPositionFor(e,t){const{source:r,line:n,column:s,bias:i}=t;return generatedPosition(e,r,n,s,i||_,!1)}function allGeneratedPositionsFor(e,t){const{source:r,line:n,column:s,bias:i}=t;return generatedPosition(e,r,n,s,i||P,!0)}function eachMapping(e,t){const r=decodedMappings(e),{names:n,resolvedSources:s}=e;for(let e=0;e{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},"./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js":function(e,t,r){e.exports=function(e){function createDebug(e){let t,r,n,s=null;function debug(...e){if(!debug.enabled)return;const r=debug,n=Number(new Date),s=n-(t||n);r.diff=s,r.prev=t,r.curr=n,t=n,e[0]=createDebug.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if("%%"===t)return"%";i++;const s=createDebug.formatters[n];if("function"==typeof s){const n=e[i];t=s.call(r,n),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(r,e);(r.log||createDebug.log).apply(r,e)}return debug.namespace=e,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(e),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==createDebug.namespaces&&(r=createDebug.namespaces,n=createDebug.enabled(e)),n),set:e=>{s=e}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(e,t){const r=createDebug(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function matchesTemplate(e,t){let r=0,n=0,s=-1,i=0;for(;r"-"+e)].join(",");return createDebug.enable(""),e},createDebug.enable=function(e){createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];const t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t)"-"===e[0]?createDebug.skips.push(e.slice(1)):createDebug.names.push(e)},createDebug.enabled=function(e){for(const t of createDebug.skips)if(matchesTemplate(e,t))return!1;for(const t of createDebug.names)if(matchesTemplate(e,t))return!0;return!1},createDebug.humanize=r("./node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"),createDebug.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(e){let t=0;for(let r=0;r{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js":function(e){"use strict";const t=Symbol.for("gensync:v1:start"),r=Symbol.for("gensync:v1:suspend"),n="GENSYNC_OPTIONS_ERROR",s="GENSYNC_RACE_NONEMPTY",i="GENSYNC_ERRBACK_NO_CALLBACK";function assertTypeof(e,t,r,s){if(typeof r===e||s&&void 0===r)return;let i;throw i=s?`Expected opts.${t} to be either a ${e}, or undefined.`:`Expected opts.${t} to be a ${e}.`,makeError(i,n)}function makeError(e,t){return Object.assign(new Error(e),{code:t})}function buildOperation({name:e,arity:n,sync:s,async:i}){return setFunctionMetadata(e,n,function*(...e){const n=yield t;if(!n){return s.call(this,e)}let o;try{i.call(this,e,e=>{o||(o={value:e},n())},e=>{o||(o={err:e},n())})}catch(e){o={err:e},n()}if(yield r,o.hasOwnProperty("err"))throw o.err;return o.value})}function evaluateSync(e){let t;for(;!({value:t}=e.next()).done;)assertStart(t,e);return t}function evaluateAsync(e,t,r){!function step(){try{let r;for(;!({value:r}=e.next()).done;){assertStart(r,e);let t=!0,n=!1;const s=e.next(()=>{t?n=!0:step()});if(t=!1,assertSuspend(s,e),!n)return}return t(r)}catch(e){return r(e)}}()}function assertStart(e,r){e!==t&&throwError(r,makeError(`Got unexpected yielded value in gensync generator: ${JSON.stringify(e)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,"GENSYNC_EXPECTED_START"))}function assertSuspend({value:e,done:t},n){(t||e!==r)&&throwError(n,makeError(t?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(e)}. If you get this, it is probably a gensync bug.`,"GENSYNC_EXPECTED_SUSPEND"))}function throwError(e,t){throw e.throw&&e.throw(t),t}function setFunctionMetadata(e,t,r){if("string"==typeof e){const t=Object.getOwnPropertyDescriptor(r,"name");t&&!t.configurable||Object.defineProperty(r,"name",Object.assign(t||{},{configurable:!0,value:e}))}if("number"==typeof t){const e=Object.getOwnPropertyDescriptor(r,"length");e&&!e.configurable||Object.defineProperty(r,"length",Object.assign(e||{},{configurable:!0,value:t}))}return r}e.exports=Object.assign(function(e){let t=e;return t="function"!=typeof e?function({name:e,arity:t,sync:r,async:s,errback:i}){if(assertTypeof("string","name",e,!0),assertTypeof("number","arity",t,!0),assertTypeof("function","sync",r),assertTypeof("function","async",s,!0),assertTypeof("function","errback",i,!0),s&&i)throw makeError("Expected one of either opts.async or opts.errback, but got _both_.",n);if("string"!=typeof e){let t;i&&i.name&&"errback"!==i.name&&(t=i.name),s&&s.name&&"async"!==s.name&&(t=s.name.replace(/Async$/,"")),r&&r.name&&"sync"!==r.name&&(t=r.name.replace(/Sync$/,"")),"string"==typeof t&&(e=t)}"number"!=typeof t&&(t=r.length);return buildOperation({name:e,arity:t,sync:function(e){return r.apply(this,e)},async:function(e,t,n){s?s.apply(this,e).then(t,n):i?i.call(this,...e,(e,r)=>{null==e?t(r):n(e)}):t(r.apply(this,e))}})}(e):function(e){return setFunctionMetadata(e.name,e.length,function(...t){return e.apply(this,t)})}(e),Object.assign(t,function(e){const t={sync:function(...t){return evaluateSync(e.apply(this,t))},async:function(...t){return new Promise((r,n)=>{evaluateAsync(e.apply(this,t),r,n)})},errback:function(...t){const r=t.pop();if("function"!=typeof r)throw makeError("Asynchronous function called without callback",i);let n;try{n=e.apply(this,t)}catch(e){return void r(e)}evaluateAsync(n,e=>r(void 0,e),e=>r(e))}};return t}(t))},{all:buildOperation({name:"all",arity:1,sync:function(e){return Array.from(e[0]).map(e=>evaluateSync(e))},async:function(e,t,r){const n=Array.from(e[0]);if(0===n.length)return void Promise.resolve().then(()=>t([]));let s=0;const i=n.map(()=>{});n.forEach((e,n)=>{evaluateAsync(e,e=>{i[n]=e,s+=1,s===i.length&&t(i)},r)})}}),race:buildOperation({name:"race",arity:1,sync:function(e){const t=Array.from(e[0]);if(0===t.length)throw makeError("Must race at least 1 item",s);return evaluateSync(t[0])},async:function(e,t,r){const n=Array.from(e[0]);if(0===n.length)throw makeError("Must race at least 1 item",s);for(const e of n)evaluateAsync(e,t,r)}})})},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js":function(e){"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n{for(const n in e)r.call(e,n)&&t(n,e[n])},fourHexEscape=e=>"\\u"+("0000"+e).slice(-4),hexadecimal=(e,t)=>{let r=e.toString(16);return t?r:r.toUpperCase()},n=t.toString,s=Array.isArray,isBigInt=e=>"bigint"==typeof e,i={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},o=/[\\\b\f\n\r\t]/,a=/[0-9]/,l=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,p=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,c=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,jsesc=(e,t)=>{const increaseIndentation=()=>{g=b,++t.indentLevel,b=t.indent.repeat(t.indentLevel)},r={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},u=t&&t.json;var d,h;u&&(r.quotes="double",r.wrap=!0),d=r,"single"!=(t=(h=t)?(forOwn(h,(e,t)=>{d[e]=t}),d):d).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");const m="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",f=t.compact,y=t.lowercaseHex;let b=t.indent.repeat(t.indentLevel),g="";const x=t.__inline1__,v=t.__inline2__,E=f?"":"\n";let T,S=!0;const P="binary"==t.numbers,_="octal"==t.numbers,A="decimal"==t.numbers,C="hexadecimal"==t.numbers;if(u&&e&&(e=>"function"==typeof e)(e.toJSON)&&(e=e.toJSON()),!(e=>"string"==typeof e||"[object String]"==n.call(e))(e)){if((e=>"[object Map]"==n.call(e))(e))return 0==e.size?"new Map()":(f||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+jsesc(Array.from(e),t)+")");if((e=>"[object Set]"==n.call(e))(e))return 0==e.size?"new Set()":"new Set("+jsesc(Array.from(e),t)+")";if((e=>"function"==typeof Buffer&&Buffer.isBuffer(e))(e))return 0==e.length?"Buffer.from([])":"Buffer.from("+jsesc(Array.from(e),t)+")";if(s(e))return T=[],t.wrap=!0,x&&(t.__inline1__=!1,t.__inline2__=!0),v||increaseIndentation(),((e,t)=>{const r=e.length;let n=-1;for(;++n{S=!1,v&&(t.__inline2__=!1),T.push((f||v?"":b)+jsesc(e,t))}),S?"[]":v?"["+T.join(", ")+"]":"["+E+T.join(","+E)+E+(f?"":g)+"]";if((e=>"number"==typeof e||"[object Number]"==n.call(e))(e)||isBigInt(e)){if(u)return JSON.stringify(Number(e));let t;if(A)t=String(e);else if(C){let r=e.toString(16);y||(r=r.toUpperCase()),t="0x"+r}else P?t="0b"+e.toString(2):_&&(t="0o"+e.toString(8));return isBigInt(e)?t+"n":t}return isBigInt(e)?u?JSON.stringify(Number(e)):e+"n":(e=>"[object Object]"==n.call(e))(e)?(T=[],t.wrap=!0,increaseIndentation(),forOwn(e,(e,r)=>{S=!1,T.push((f?"":b)+jsesc(e,t)+":"+(f?"":" ")+jsesc(r,t))}),S?"{}":"{"+E+T.join(","+E)+E+(f?"":g)+"}"):u?JSON.stringify(e)||"null":String(e)}const w=t.escapeEverything?p:c;return T=e.replace(w,(e,r,n,s,p,c)=>{if(r){if(t.minimal)return r;const e=r.charCodeAt(0),n=r.charCodeAt(1);if(t.es6){return"\\u{"+hexadecimal(1024*(e-55296)+n-56320+65536,y)+"}"}return fourHexEscape(hexadecimal(e,y))+fourHexEscape(hexadecimal(n,y))}if(n)return fourHexEscape(hexadecimal(n.charCodeAt(0),y));if("\0"==e&&!u&&!a.test(c.charAt(p+1)))return"\\0";if(s)return s==m||t.escapeEverything?"\\"+s:s;if(o.test(e))return i[e];if(t.minimal&&!l.test(e))return e;const d=hexadecimal(e.charCodeAt(0),y);return u||d.length>2?fourHexEscape(d):"\\x"+("00"+d).slice(-2)}),"`"==m&&(T=T.replace(/\$\{/g,"\\${")),t.isScriptContext&&(T=T.replace(/<\/(script|style)/gi,"<\\/$1").replace(/ + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on + invalid mapping, it will be ignored. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +* `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, { + ignoreInvalidMapping: true, +}); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/array-set.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/array-set.js new file mode 100644 index 0000000..fbd5c81 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64-vlq.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64-vlq.js new file mode 100644 index 0000000..612b404 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64.js new file mode 100644 index 0000000..8aa86b3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/binary-search.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/binary-search.js new file mode 100644 index 0000000..010ac94 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/mapping-list.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/mapping-list.js new file mode 100644 index 0000000..06d1274 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/quick-sort.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/quick-sort.js new file mode 100644 index 0000000..23f9eda --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/quick-sort.js @@ -0,0 +1,132 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +function SortTemplate(comparator) { + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + + return doQuickSort; +} + +function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + +let sortCache = new WeakMap(); +exports.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); +}; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.d.ts b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.d.ts new file mode 100644 index 0000000..744bda7 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.d.ts @@ -0,0 +1 @@ +export { SourceMapConsumer } from '..'; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.js new file mode 100644 index 0000000..ee66114 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-consumer.js @@ -0,0 +1,1188 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + } + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + +const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; +function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } +} +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content || content === '') { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if(source !== null) { + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.d.ts b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.d.ts new file mode 100644 index 0000000..f59d70a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.d.ts @@ -0,0 +1 @@ +export { SourceMapGenerator } from '..'; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.js new file mode 100644 index 0000000..bab04ff --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-map-generator.js @@ -0,0 +1,444 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + })); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name) === false) { + return; + } + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message); + } + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + var message = 'Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + + if (this._ignoreInvalidMapping) { + if (typeof console !== 'undefined' && console.warn) { + console.warn(message); + } + return false; + } else { + throw new Error(message) + } + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.d.ts b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.d.ts new file mode 100644 index 0000000..4df6a1a --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.d.ts @@ -0,0 +1 @@ +export { SourceNode } from '..'; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.js new file mode 100644 index 0000000..8bcdbe3 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/util.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/util.js new file mode 100644 index 0000000..430e2d0 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/lib/util.js @@ -0,0 +1,594 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +var MAX_CACHED_INPUTS = 32; + +/** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ +function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; +} + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +}); +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/package.json b/node_modules/@tailwindcss/node/node_modules/source-map-js/package.json new file mode 100644 index 0000000..f58dbeb --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/package.json @@ -0,0 +1,71 @@ +{ + "name": "source-map-js", + "description": "Generates and consumes source maps", + "version": "1.2.1", + "homepage": "https://github.com/7rulnik/source-map-js", + "author": "Valentin 7rulnik Semirulnik ", + "contributors": [ + "Nick Fitzgerald ", + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": "7rulnik/source-map-js", + "main": "./source-map.js", + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "clean-publish": "^3.1.0", + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "clean-publish": { + "cleanDocs": true + }, + "typings": "source-map.d.ts" +} diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.d.ts b/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.d.ts new file mode 100644 index 0000000..ec8892f --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.d.ts @@ -0,0 +1,104 @@ +export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; +} + +export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; +} + +export interface Position { + line: number; + column: number; +} + +export interface LineRange extends Position { + lastColumn: number; +} + +export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; +} + +export interface SourceFindPosition extends FindPosition { + source: string; +} + +export interface MappedPosition extends Position { + source: string; + name?: string; +} + +export interface MappingItem { + source: string | null; + generatedLine: number; + generatedColumn: number; + originalLine: number | null; + originalColumn: number | null; + name: string | null; +} + +export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + readonly file: string | undefined | null; + readonly sourceRoot: string | undefined | null; + readonly sourcesContent: readonly string[] | null | undefined; + readonly sources: readonly string[] + + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; +} + +export interface Mapping { + generated: Position; + original?: Position | null; + source?: string | null; + name?: string | null; +} + +export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer, startOfSourceMap?: StartOfSourceMap): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string | null | undefined): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; + toJSON(): RawSourceMap; +} + +export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; +} + +export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; +} diff --git a/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.js b/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.js new file mode 100644 index 0000000..bc88fe8 --- /dev/null +++ b/node_modules/@tailwindcss/node/node_modules/source-map-js/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/@tailwindcss/node/package.json b/node_modules/@tailwindcss/node/package.json new file mode 100644 index 0000000..21b2c51 --- /dev/null +++ b/node_modules/@tailwindcss/node/package.json @@ -0,0 +1,48 @@ +{ + "name": "@tailwindcss/node", + "version": "4.1.18", + "description": "A utility-first CSS framework for rapidly building custom user interfaces.", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tailwindlabs/tailwindcss.git", + "directory": "packages/@tailwindcss-node" + }, + "bugs": "https://github.com/tailwindlabs/tailwindcss/issues", + "homepage": "https://tailwindcss.com", + "files": [ + "dist/" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "./require-cache": { + "types": "./dist/require-cache.d.ts", + "default": "./dist/require-cache.js" + }, + "./esm-cache-loader": { + "types": "./dist/esm-cache.loader.d.mts", + "default": "./dist/esm-cache.loader.mjs" + } + }, + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.6.1", + "lightningcss": "1.30.2", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.18" + }, + "scripts": { + "build": "tsup-node", + "dev": "pnpm run build -- --watch" + } +} \ No newline at end of file diff --git a/node_modules/@tailwindcss/oxide/LICENSE b/node_modules/@tailwindcss/oxide/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/oxide/index.d.ts b/node_modules/@tailwindcss/oxide/index.d.ts new file mode 100644 index 0000000..184e089 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/index.d.ts @@ -0,0 +1,48 @@ +/* auto-generated by NAPI-RS */ +/* eslint-disable */ +export declare class Scanner { + constructor(opts: ScannerOptions) + scan(): Array + scanFiles(input: Array): Array + getCandidatesWithPositions(input: ChangedContent): Array + get files(): Array + get globs(): Array + get normalizedSources(): Array +} + +export interface CandidateWithPosition { + /** The candidate string */ + candidate: string + /** The position of the candidate inside the content file */ + position: number +} + +export interface ChangedContent { + /** File path to the changed file */ + file?: string + /** Contents of the changed file */ + content?: string + /** File extension */ + extension: string +} + +export interface GlobEntry { + /** Base path of the glob */ + base: string + /** Glob pattern */ + pattern: string +} + +export interface ScannerOptions { + /** Glob sources */ + sources?: Array +} + +export interface SourceEntry { + /** Base path of the glob */ + base: string + /** Glob pattern */ + pattern: string + /** Negated flag */ + negated: boolean +} diff --git a/node_modules/@tailwindcss/oxide/index.js b/node_modules/@tailwindcss/oxide/index.js new file mode 100644 index 0000000..1817670 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/index.js @@ -0,0 +1,575 @@ +// prettier-ignore +/* eslint-disable */ +// @ts-nocheck +/* auto-generated by NAPI-RS */ + +const { readFileSync } = require('node:fs') +let nativeBinding = null +const loadErrors = [] + +const isMusl = () => { + let musl = false + if (process.platform === 'linux') { + musl = isMuslFromFilesystem() + if (musl === null) { + musl = isMuslFromReport() + } + if (musl === null) { + musl = isMuslFromChildProcess() + } + } + return musl +} + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') + +const isMuslFromFilesystem = () => { + try { + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') + } catch { + return null + } +} + +const isMuslFromReport = () => { + let report = null + if (typeof process.report?.getReport === 'function') { + process.report.excludeNetwork = true + report = process.report.getReport() + } + if (!report) { + return null + } + if (report.header && report.header.glibcVersionRuntime) { + return false + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true + } + } + return false +} + +const isMuslFromChildProcess = () => { + try { + return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') + } catch (e) { + // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false + return false + } +} + +function requireNative() { + if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { + try { + return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); + } catch (err) { + loadErrors.push(err) + } + } else if (process.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.android-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-android-arm64') + const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./tailwindcss-oxide.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-android-arm-eabi') + const bindingPackageVersion = require('@tailwindcss/oxide-android-arm-eabi/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) + } + } else if (process.platform === 'win32') { + if (process.arch === 'x64') { + if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { + try { + return require('./tailwindcss-oxide.win32-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-win32-x64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-win32-x64-msvc') + const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-msvc/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ia32') { + try { + return require('./tailwindcss-oxide.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-win32-ia32-msvc') + const bindingPackageVersion = require('@tailwindcss/oxide-win32-ia32-msvc/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-win32-arm64-msvc') + const bindingPackageVersion = require('@tailwindcss/oxide-win32-arm64-msvc/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) + } + } else if (process.platform === 'darwin') { + try { + return require('./tailwindcss-oxide.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-darwin-universal') + const bindingPackageVersion = require('@tailwindcss/oxide-darwin-universal/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + if (process.arch === 'x64') { + try { + return require('./tailwindcss-oxide.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-darwin-x64') + const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-darwin-arm64') + const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) + } + } else if (process.platform === 'freebsd') { + if (process.arch === 'x64') { + try { + return require('./tailwindcss-oxide.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-freebsd-x64') + const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-freebsd-arm64') + const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) + } + } else if (process.platform === 'linux') { + if (process.arch === 'x64') { + if (isMusl()) { + try { + return require('./tailwindcss-oxide.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-x64-musl') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-musl/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-x64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm64') { + if (isMusl()) { + try { + return require('./tailwindcss-oxide.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-arm64-musl') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-musl/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-arm64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./tailwindcss-oxide.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-arm-musleabihf') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-musleabihf/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-arm-gnueabihf') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-gnueabihf/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'loong64') { + if (isMusl()) { + try { + return require('./tailwindcss-oxide.linux-loong64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-loong64-musl') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-musl/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.linux-loong64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-loong64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'riscv64') { + if (isMusl()) { + try { + return require('./tailwindcss-oxide.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-riscv64-musl') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-musl/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./tailwindcss-oxide.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-riscv64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ppc64') { + try { + return require('./tailwindcss-oxide.linux-ppc64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-ppc64-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-ppc64-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 's390x') { + try { + return require('./tailwindcss-oxide.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-linux-s390x-gnu') + const bindingPackageVersion = require('@tailwindcss/oxide-linux-s390x-gnu/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) + } + } else if (process.platform === 'openharmony') { + if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.openharmony-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-openharmony-arm64') + const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'x64') { + try { + return require('./tailwindcss-oxide.openharmony-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-openharmony-x64') + const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./tailwindcss-oxide.openharmony-arm.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@tailwindcss/oxide-openharmony-arm') + const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version + if (bindingPackageVersion !== '4.1.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 4.1.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) + } + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + let wasiBinding = null + let wasiBindingError = null + try { + wasiBinding = require('./tailwindcss-oxide.wasi.cjs') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + wasiBindingError = err + } + } + if (!nativeBinding) { + try { + wasiBinding = require('@tailwindcss/oxide-wasm32-wasi') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + wasiBindingError.cause = err + loadErrors.push(err) + } + } + } + if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) { + const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error') + error.cause = wasiBindingError + throw error + } +} + +if (!nativeBinding) { + if (loadErrors.length > 0) { + throw new Error( + `Cannot find native binding. ` + + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + + 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', + { + cause: loadErrors.reduce((err, cur) => { + cur.cause = err + return cur + }), + }, + ) + } + throw new Error(`Failed to load native binding`) +} + +module.exports = nativeBinding +module.exports.Scanner = nativeBinding.Scanner diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/LICENSE b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/README.md b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/README.md new file mode 100644 index 0000000..f129c11 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@tailwindcss/oxide-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `@tailwindcss/oxide` diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json new file mode 100644 index 0000000..d7bcf99 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tailwindcss/oxide-linux-x64-gnu", + "version": "4.1.18", + "repository": { + "type": "git", + "url": "git+https://github.com/tailwindlabs/tailwindcss.git", + "directory": "crates/node/npm/linux-x64-gnu" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "tailwindcss-oxide.linux-x64-gnu.node", + "files": [ + "tailwindcss-oxide.linux-x64-gnu.node" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} \ No newline at end of file diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node new file mode 100644 index 0000000..85fc825 Binary files /dev/null and b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node differ diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/LICENSE b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/README.md b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/README.md new file mode 100644 index 0000000..5661d1c --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@tailwindcss/oxide-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `@tailwindcss/oxide` diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json new file mode 100644 index 0000000..1c47085 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tailwindcss/oxide-linux-x64-musl", + "version": "4.1.18", + "repository": { + "type": "git", + "url": "git+https://github.com/tailwindlabs/tailwindcss.git", + "directory": "crates/node/npm/linux-x64-musl" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "tailwindcss-oxide.linux-x64-musl.node", + "files": [ + "tailwindcss-oxide.linux-x64-musl.node" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "musl" + ] +} \ No newline at end of file diff --git a/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node new file mode 100644 index 0000000..f2e2557 Binary files /dev/null and b/node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node differ diff --git a/node_modules/@tailwindcss/oxide/package.json b/node_modules/@tailwindcss/oxide/package.json new file mode 100644 index 0000000..54dbd06 --- /dev/null +++ b/node_modules/@tailwindcss/oxide/package.json @@ -0,0 +1,75 @@ +{ + "name": "@tailwindcss/oxide", + "version": "4.1.18", + "repository": { + "type": "git", + "url": "git+https://github.com/tailwindlabs/tailwindcss.git", + "directory": "crates/node" + }, + "main": "index.js", + "types": "index.d.ts", + "napi": { + "binaryName": "tailwindcss-oxide", + "packageName": "@tailwindcss/oxide", + "targets": [ + "armv7-linux-androideabi", + "aarch64-linux-android", + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "i686-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "wasm32-wasip1-threads" + ], + "wasm": { + "initialMemory": 16384, + "browser": { + "fs": true + } + } + }, + "license": "MIT", + "devDependencies": { + "@napi-rs/cli": "^3.4.1", + "@napi-rs/wasm-runtime": "^1.1.0", + "emnapi": "1.7.1" + }, + "engines": { + "node": ">= 10" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "optionalDependencies": { + "@tailwindcss/oxide-darwin-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-x64": "4.1.18", + "@tailwindcss/oxide-freebsd-x64": "4.1.18", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-x64-musl": "4.1.18", + "@tailwindcss/oxide-wasm32-wasi": "4.1.18", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.18", + "@tailwindcss/oxide-android-arm64": "4.1.18" + }, + "scripts": { + "build": "pnpm run build:platform && pnpm run build:wasm", + "build:platform": "napi build --platform --release", + "postbuild:platform": "node ./scripts/move-artifacts.mjs", + "build:wasm": "napi build --release --target wasm32-wasip1-threads", + "postbuild:wasm": "node ./scripts/move-artifacts.mjs", + "dev": "cargo watch --quiet --shell 'npm run build'", + "build:debug": "napi build --platform", + "version": "napi version" + } +} \ No newline at end of file diff --git a/node_modules/enhanced-resolve/LICENSE b/node_modules/enhanced-resolve/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/node_modules/enhanced-resolve/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/enhanced-resolve/README.md b/node_modules/enhanced-resolve/README.md new file mode 100644 index 0000000..8a6efb2 --- /dev/null +++ b/node_modules/enhanced-resolve/README.md @@ -0,0 +1,186 @@ +# enhanced-resolve + +[![npm][npm]][npm-url] +[![Build Status][build-status]][build-status-url] +[![codecov][codecov-badge]][codecov-url] +[![Install Size][size]][size-url] +[![GitHub Discussions][discussion]][discussion-url] + +Offers an async require.resolve function. It's highly configurable. + +## Features + +- plugin system +- provide a custom filesystem +- sync and async node.js filesystems included + +## Getting Started + +### Install + +```sh +# npm +npm install enhanced-resolve +# or Yarn +yarn add enhanced-resolve +``` + +### Resolve + +There is a Node.js API which allows to resolve requests according to the Node.js resolving rules. +Sync and async APIs are offered. A `create` method allows to create a custom resolve function. + +```js +const resolve = require("enhanced-resolve"); + +resolve("/some/path/to/folder", "module/dir", (err, result) => { + result; // === "/some/path/node_modules/module/dir/index.js" +}); + +resolve.sync("/some/path/to/folder", "../../dir"); +// === "/some/path/dir/index.js" + +const myResolve = resolve.create({ + // or resolve.create.sync + extensions: [".ts", ".js"], + // see more options below +}); + +myResolve("/some/path/to/folder", "ts-module", (err, result) => { + result; // === "/some/node_modules/ts-module/index.ts" +}); +``` + +### Creating a Resolver + +The easiest way to create a resolver is to use the `createResolver` function on `ResolveFactory`, along with one of the supplied File System implementations. + +```js +const fs = require("fs"); +const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); + +// create a resolver +const myResolver = ResolverFactory.createResolver({ + // Typical usage will consume the `fs` + `CachedInputFileSystem`, which wraps Node.js `fs` to add caching. + fileSystem: new CachedInputFileSystem(fs, 4000), + extensions: [".js", ".json"], + /* any other resolver options here. Options/defaults can be seen below */ +}); + +// resolve a file with the new resolver +const context = {}; +const lookupStartPath = "/Users/webpack/some/root/dir"; +const request = "./path/to-look-up.js"; +const resolveContext = {}; +myResolver.resolve( + context, + lookupStartPath, + request, + resolveContext, + (err /* Error */, filepath /* string */) => { + // Do something with the path + }, +); +``` + +#### Resolver Options + +| Field | Default | Description | +| ---------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| alias | [] | A list of module alias configurations or an object which maps key to value | +| aliasFields | [] | A list of alias fields in description files | +| extensionAlias | {} | An object which maps extension to extension aliases | +| cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. | +| cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key | +| conditionNames | [] | A list of exports field condition names | +| descriptionFiles | ["package.json"] | A list of description files to read from | +| enforceExtension | false | Enforce that a extension from extensions must be used | +| exportsFields | ["exports"] | A list of exports fields in description files | +| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files | +| fallback | [] | Same as `alias`, but only used if default resolving fails | +| fileSystem | | The file system which should be used | +| fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) | +| mainFields | ["main"] | A list of main fields in description files | +| mainFiles | ["index"] | A list of main files in directories | +| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | +| plugins | [] | A list of additional resolve plugins which should be applied | +| resolver | undefined | A prepared Resolver to which the plugins are attached | +| resolveToContext | false | Resolve to a context instead of a file | +| preferRelative | false | Prefer to resolve module requests as relative request and fallback to resolving as module | +| preferAbsolute | false | Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots | +| restrictions | [] | A list of resolve restrictions | +| roots | [] | A list of root paths | +| symlinks | true | Whether to resolve symlinks to their symlinked location | +| unsafeCache | false | Use this cache object to unsafely cache the successful requests | + +## Plugins + +Similar to `webpack`, the core of `enhanced-resolve` functionality is implemented as individual plugins that are executed using [`tapable`](https://github.com/webpack/tapable). +These plugins can extend the functionality of the library, adding other ways for files/contexts to be resolved. + +A plugin should be a `class` (or its ES5 equivalent) with an `apply` method. The `apply` method will receive a `resolver` instance, that can be used to hook in to the event system. + +### Plugin Boilerplate + +```js +class MyResolverPlugin { + constructor(source, target) { + this.source = source; + this.target = target; + } + + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("MyResolverPlugin", (request, resolveContext, callback) => { + // Any logic you need to create a new `request` can go here + resolver.doResolve(target, request, null, resolveContext, callback); + }); + } +} +``` + +Plugins are executed in a pipeline, and register which event they should be executed before/after. In the example above, `source` is the name of the event that starts the pipeline, and `target` is what event this plugin should fire, which is what continues the execution of the pipeline. For an example of how these different plugin events create a chain, see `lib/ResolverFactory.js`, in the `//// pipeline ////` section. + +## Escaping + +It's allowed to escape `#` as `\0#` to avoid parsing it as fragment. + +enhanced-resolve will try to resolve requests containing `#` as path and as fragment, so it will automatically figure out if `./some#thing` means `.../some.js#thing` or `.../some#thing.js`. When a `#` is resolved as path it will be escaped in the result. Here: `.../some\0#thing.js`. + +## Tests + +```sh +yarn test +``` + +## Passing options from webpack + +If you are using `webpack`, and you want to pass custom options to `enhanced-resolve`, the options are passed from the `resolve` key of your webpack configuration e.g.: + +``` +resolve: { + extensions: ['.js', '.jsx'], + modules: [path.resolve(__dirname, 'src'), 'node_modules'], + plugins: [new DirectoryNamedWebpackPlugin()] + ... +}, +``` + +## License + +Copyright (c) 2012-2019 JS Foundation and other contributors + +MIT (http://www.opensource.org/licenses/mit-license.php) + +[npm]: https://img.shields.io/npm/v/enhanced-resolve.svg +[npm-url]: https://www.npmjs.com/package/enhanced-resolve +[build-status]: https://github.com/webpack/enhanced-resolve/actions/workflows/test.yml/badge.svg +[build-status-url]: https://github.com/webpack/enhanced-resolve/actions +[codecov-badge]: https://codecov.io/gh/webpack/enhanced-resolve/branch/main/graph/badge.svg?token=6B6NxtsZc3 +[codecov-url]: https://codecov.io/gh/webpack/enhanced-resolve +[size]: https://packagephobia.com/badge?p=enhanced-resolve +[size-url]: https://packagephobia.com/result?p=enhanced-resolve +[discussion]: https://img.shields.io/github/discussions/webpack/webpack +[discussion-url]: https://github.com/webpack/webpack/discussions diff --git a/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js b/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js new file mode 100644 index 0000000..836487b --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js @@ -0,0 +1,103 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const getInnerRequest = require("./getInnerRequest"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class AliasFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | Array} field field + * @param {string | ResolveStepHook} target target + */ + constructor(source, field, target) { + this.source = source; + this.field = field; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { + if (!request.descriptionFileData) return callback(); + const innerRequest = getInnerRequest(resolver, request); + if (!innerRequest) return callback(); + const fieldData = DescriptionFileUtils.getField( + request.descriptionFileData, + this.field, + ); + if (fieldData === null || typeof fieldData !== "object") { + if (resolveContext.log) { + resolveContext.log( + `Field '${this.field}' doesn't contain a valid alias configuration`, + ); + } + return callback(); + } + /** @type {JsonPrimitive | undefined} */ + const data = Object.prototype.hasOwnProperty.call( + fieldData, + innerRequest, + ) + ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ + innerRequest + ] + : innerRequest.startsWith("./") + ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ + innerRequest.slice(2) + ] + : undefined; + if (data === innerRequest) return callback(); + if (data === undefined) return callback(); + if (data === false) { + /** @type {ResolveRequest} */ + const ignoreObj = { + ...request, + path: false, + }; + if (typeof resolveContext.yield === "function") { + resolveContext.yield(ignoreObj); + return callback(null, null); + } + return callback(null, ignoreObj); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: /** @type {string} */ (request.descriptionFileRoot), + request: /** @type {string} */ (data), + fullySpecified: false, + }; + resolver.doResolve( + target, + obj, + `aliased from description file ${ + request.descriptionFilePath + } with mapping '${innerRequest}' to '${/** @type {string} */ data}'`, + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other aliasing or raw request + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/AliasPlugin.js b/node_modules/enhanced-resolve/lib/AliasPlugin.js new file mode 100644 index 0000000..03dbbb1 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AliasPlugin.js @@ -0,0 +1,176 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const { PathType, getType } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {string | Array | false} Alias */ +/** @typedef {{alias: Alias, name: string, onlyModule?: boolean}} AliasOption */ + +module.exports = class AliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {AliasOption | Array} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = Array.isArray(options) ? options : [options]; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + /** + * @param {string} maybeAbsolutePath path + * @returns {null|string} absolute path with slash ending + */ + const getAbsolutePathWithSlashEnding = (maybeAbsolutePath) => { + const type = getType(maybeAbsolutePath); + if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { + return resolver.join(maybeAbsolutePath, "_").slice(0, -1); + } + return null; + }; + /** + * @param {string} path path + * @param {string} maybeSubPath sub path + * @returns {boolean} true, if path is sub path + */ + const isSubPath = (path, maybeSubPath) => { + const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath); + if (!absolutePath) return false; + return path.startsWith(absolutePath); + }; + resolver + .getHook(this.source) + .tapAsync("AliasPlugin", (request, resolveContext, callback) => { + const innerRequest = request.request || request.path; + if (!innerRequest) return callback(); + + forEachBail( + this.options, + (item, callback) => { + /** @type {boolean} */ + let shouldStop = false; + + const matchRequest = + innerRequest === item.name || + (!item.onlyModule && + (request.request + ? innerRequest.startsWith(`${item.name}/`) + : isSubPath(innerRequest, item.name))); + + const splitName = item.name.split("*"); + const matchWildcard = !item.onlyModule && splitName.length === 2; + + if (matchRequest || matchWildcard) { + /** + * @param {Alias} alias alias + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ + const resolveWithAlias = (alias, callback) => { + if (alias === false) { + /** @type {ResolveRequest} */ + const ignoreObj = { + ...request, + path: false, + }; + if (typeof resolveContext.yield === "function") { + resolveContext.yield(ignoreObj); + return callback(null, null); + } + return callback(null, ignoreObj); + } + + let newRequestStr; + + const [prefix, suffix] = splitName; + if ( + matchWildcard && + innerRequest.startsWith(prefix) && + innerRequest.endsWith(suffix) + ) { + const match = innerRequest.slice( + prefix.length, + innerRequest.length - suffix.length, + ); + newRequestStr = alias.toString().replace("*", match); + } + + if ( + matchRequest && + innerRequest !== alias && + !innerRequest.startsWith(`${alias}/`) + ) { + /** @type {string} */ + const remainingRequest = innerRequest.slice(item.name.length); + newRequestStr = alias + remainingRequest; + } + + if (newRequestStr !== undefined) { + shouldStop = true; + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: newRequestStr, + fullySpecified: false, + }; + return resolver.doResolve( + target, + obj, + `aliased with mapping '${item.name}': '${alias}' to '${newRequestStr}'`, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + return callback(); + }, + ); + } + return callback(); + }; + + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + const stoppingCallback = (err, result) => { + if (err) return callback(err); + + if (result) return callback(null, result); + // Don't allow other aliasing or raw request + if (shouldStop) return callback(null, null); + return callback(); + }; + + if (Array.isArray(item.alias)) { + return forEachBail( + item.alias, + resolveWithAlias, + stoppingCallback, + ); + } + return resolveWithAlias(item.alias, stoppingCallback); + } + + return callback(); + }, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/AppendPlugin.js b/node_modules/enhanced-resolve/lib/AppendPlugin.js new file mode 100644 index 0000000..6763d52 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/AppendPlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class AppendPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} appending appending + * @param {string | ResolveStepHook} target target + */ + constructor(source, appending, target) { + this.source = source; + this.appending = appending; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AppendPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: request.path + this.appending, + relativePath: + request.relativePath && request.relativePath + this.appending, + }; + resolver.doResolve( + target, + obj, + this.appending, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js new file mode 100644 index 0000000..18b8195 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js @@ -0,0 +1,677 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// eslint-disable-next-line n/prefer-global/process +const { nextTick } = require("process"); + +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").PathLike} PathLike */ +/** @typedef {import("./Resolver").PathOrFileDescriptor} PathOrFileDescriptor */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {FileSystem & SyncFileSystem} BaseFileSystem */ + +/** + * @template T + * @typedef {import("./Resolver").FileSystemCallback} FileSystemCallback + */ + +/** + * @param {string} path path + * @returns {string} dirname + */ +const dirname = (path) => { + let idx = path.length - 1; + while (idx >= 0) { + const char = path.charCodeAt(idx); + // slash or backslash + if (char === 47 || char === 92) break; + idx--; + } + if (idx < 0) return ""; + return path.slice(0, idx); +}; + +/** + * @template T + * @param {FileSystemCallback[]} callbacks callbacks + * @param {Error | null} err error + * @param {T} result result + */ +const runCallbacks = (callbacks, err, result) => { + if (callbacks.length === 1) { + callbacks[0](err, result); + callbacks.length = 0; + return; + } + let error; + for (const callback of callbacks) { + try { + callback(err, result); + } catch (err) { + if (!error) error = err; + } + } + callbacks.length = 0; + if (error) throw error; +}; + +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {Function} EXPECTED_FUNCTION */ +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {any} EXPECTED_ANY */ + +class OperationMergerBackend { + /** + * @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method in filesystem + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor(provider, syncProvider, providerContext) { + this._provider = provider; + this._syncProvider = syncProvider; + this._providerContext = providerContext; + this._activeAsyncOperations = new Map(); + + this.provide = this._provider + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object | FileSystemCallback | undefined} options options + * @param {FileSystemCallback=} callback callback + * @returns {EXPECTED_ANY} result + */ + (path, options, callback) => { + if (typeof options === "function") { + callback = + /** @type {FileSystemCallback} */ + (options); + options = undefined; + } + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + /** @type {EXPECTED_FUNCTION} */ + (callback)( + new TypeError("path must be a string, Buffer, URL or number"), + ); + return; + } + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( + this._providerContext, + path, + options, + callback, + ); + } + let callbacks = this._activeAsyncOperations.get(path); + if (callbacks) { + callbacks.push(callback); + return; + } + this._activeAsyncOperations.set(path, (callbacks = [callback])); + /** @type {EXPECTED_FUNCTION} */ + (provider)( + path, + /** + * @param {Error} err error + * @param {EXPECTED_ANY} result result + */ + (err, result) => { + this._activeAsyncOperations.delete(path); + runCallbacks(callbacks, err, result); + }, + ); + } + : null; + this.provideSync = this._syncProvider + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object=} options options + * @returns {EXPECTED_ANY} result + */ + (path, options) => + /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + options, + ) + : null; + } + + purge() {} + + purgeParent() {} +} + +/* + +IDLE: + insert data: goto SYNC + +SYNC: + before provide: run ticks + event loop tick: goto ASYNC_ACTIVE + +ASYNC: + timeout: run tick, goto ASYNC_PASSIVE + +ASYNC_PASSIVE: + before provide: run ticks + +IDLE --[insert data]--> SYNC --[event loop tick]--> ASYNC_ACTIVE --[interval tick]-> ASYNC_PASSIVE + ^ | + +---------[insert data]-------+ +*/ + +const STORAGE_MODE_IDLE = 0; +const STORAGE_MODE_SYNC = 1; +const STORAGE_MODE_ASYNC = 2; + +/** + * @callback Provide + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ + +class CacheBackend { + /** + * @param {number} duration max cache duration of items + * @param {EXPECTED_FUNCTION | undefined} provider async method + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor(duration, provider, syncProvider, providerContext) { + this._duration = duration; + this._provider = provider; + this._syncProvider = syncProvider; + this._providerContext = providerContext; + /** @type {Map[]>} */ + this._activeAsyncOperations = new Map(); + /** @type {Map }>} */ + this._data = new Map(); + /** @type {Set[]} */ + this._levels = []; + for (let i = 0; i < 10; i++) this._levels.push(new Set()); + for (let i = 5000; i < duration; i += 500) this._levels.push(new Set()); + this._currentLevel = 0; + this._tickInterval = Math.floor(duration / this._levels.length); + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ + this._mode = STORAGE_MODE_IDLE; + + /** @type {NodeJS.Timeout | undefined} */ + this._timeout = undefined; + /** @type {number | undefined} */ + this._nextDecay = undefined; + + // eslint-disable-next-line no-warning-comments + // @ts-ignore + this.provide = provider ? this.provide.bind(this) : null; + // eslint-disable-next-line no-warning-comments + // @ts-ignore + this.provideSync = syncProvider ? this.provideSync.bind(this) : null; + } + + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ + provide(path, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + callback(new TypeError("path must be a string, Buffer, URL or number")); + return; + } + const strPath = typeof path !== "string" ? path.toString() : path; + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( + this._providerContext, + path, + options, + callback, + ); + } + + // When in sync mode we can move to async mode + if (this._mode === STORAGE_MODE_SYNC) { + this._enterAsyncMode(); + } + + // Check in cache + const cacheEntry = this._data.get(strPath); + if (cacheEntry !== undefined) { + if (cacheEntry.err) return nextTick(callback, cacheEntry.err); + return nextTick(callback, null, cacheEntry.result); + } + + // Check if there is already the same operation running + let callbacks = this._activeAsyncOperations.get(strPath); + if (callbacks !== undefined) { + callbacks.push(callback); + return; + } + this._activeAsyncOperations.set(strPath, (callbacks = [callback])); + + // Run the operation + /** @type {EXPECTED_FUNCTION} */ + (this._provider).call( + this._providerContext, + path, + /** + * @param {Error | null} err error + * @param {EXPECTED_ANY=} result result + */ + (err, result) => { + this._activeAsyncOperations.delete(strPath); + this._storeResult(strPath, err, result); + + // Enter async mode if not yet done + this._enterAsyncMode(); + + runCallbacks( + /** @type {FileSystemCallback[]} */ (callbacks), + err, + result, + ); + }, + ); + } + + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @returns {EXPECTED_ANY} result + */ + provideSync(path, options) { + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + throw new TypeError("path must be a string"); + } + const strPath = typeof path !== "string" ? path.toString() : path; + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + options, + ); + } + + // In sync mode we may have to decay some cache items + if (this._mode === STORAGE_MODE_SYNC) { + this._runDecays(); + } + + // Check in cache + const cacheEntry = this._data.get(strPath); + if (cacheEntry !== undefined) { + if (cacheEntry.err) throw cacheEntry.err; + return cacheEntry.result; + } + + // Get all active async operations + // This sync operation will also complete them + const callbacks = this._activeAsyncOperations.get(strPath); + this._activeAsyncOperations.delete(strPath); + + // Run the operation + // When in idle mode, we will enter sync mode + let result; + try { + result = /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + ); + } catch (err) { + this._storeResult(strPath, /** @type {Error} */ (err), undefined); + this._enterSyncModeWhenIdle(); + if (callbacks) { + runCallbacks(callbacks, /** @type {Error} */ (err), undefined); + } + throw err; + } + this._storeResult(strPath, null, result); + this._enterSyncModeWhenIdle(); + if (callbacks) { + runCallbacks(callbacks, null, result); + } + return result; + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + */ + purge(what) { + if (!what) { + if (this._mode !== STORAGE_MODE_IDLE) { + this._data.clear(); + for (const level of this._levels) { + level.clear(); + } + this._enterIdleMode(); + } + } else if ( + typeof what === "string" || + Buffer.isBuffer(what) || + what instanceof URL || + typeof what === "number" + ) { + const strWhat = typeof what !== "string" ? what.toString() : what; + for (const [key, data] of this._data) { + if (key.startsWith(strWhat)) { + this._data.delete(key); + data.level.delete(key); + } + } + if (this._data.size === 0) { + this._enterIdleMode(); + } + } else { + for (const [key, data] of this._data) { + for (const item of what) { + const strItem = typeof item !== "string" ? item.toString() : item; + if (key.startsWith(strItem)) { + this._data.delete(key); + data.level.delete(key); + break; + } + } + } + if (this._data.size === 0) { + this._enterIdleMode(); + } + } + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + */ + purgeParent(what) { + if (!what) { + this.purge(); + } else if ( + typeof what === "string" || + Buffer.isBuffer(what) || + what instanceof URL || + typeof what === "number" + ) { + const strWhat = typeof what !== "string" ? what.toString() : what; + this.purge(dirname(strWhat)); + } else { + const set = new Set(); + for (const item of what) { + const strItem = typeof item !== "string" ? item.toString() : item; + set.add(dirname(strItem)); + } + this.purge(set); + } + } + + /** + * @param {string} path path + * @param {Error | null} err error + * @param {EXPECTED_ANY} result result + */ + _storeResult(path, err, result) { + if (this._data.has(path)) return; + const level = this._levels[this._currentLevel]; + this._data.set(path, { err, result, level }); + level.add(path); + } + + _decayLevel() { + const nextLevel = (this._currentLevel + 1) % this._levels.length; + const decay = this._levels[nextLevel]; + this._currentLevel = nextLevel; + for (const item of decay) { + this._data.delete(item); + } + decay.clear(); + if (this._data.size === 0) { + this._enterIdleMode(); + } else { + /** @type {number} */ + (this._nextDecay) += this._tickInterval; + } + } + + _runDecays() { + while ( + /** @type {number} */ (this._nextDecay) <= Date.now() && + this._mode !== STORAGE_MODE_IDLE + ) { + this._decayLevel(); + } + } + + _enterAsyncMode() { + let timeout = 0; + switch (this._mode) { + case STORAGE_MODE_ASYNC: + return; + case STORAGE_MODE_IDLE: + this._nextDecay = Date.now() + this._tickInterval; + timeout = this._tickInterval; + break; + case STORAGE_MODE_SYNC: + this._runDecays(); + // _runDecays may change the mode + if ( + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ + (this._mode) === STORAGE_MODE_IDLE + ) { + return; + } + timeout = Math.max( + 0, + /** @type {number} */ (this._nextDecay) - Date.now(), + ); + break; + } + this._mode = STORAGE_MODE_ASYNC; + const ref = setTimeout(() => { + this._mode = STORAGE_MODE_SYNC; + this._runDecays(); + }, timeout); + if (ref.unref) ref.unref(); + this._timeout = ref; + } + + _enterSyncModeWhenIdle() { + if (this._mode === STORAGE_MODE_IDLE) { + this._mode = STORAGE_MODE_SYNC; + this._nextDecay = Date.now() + this._tickInterval; + } + } + + _enterIdleMode() { + this._mode = STORAGE_MODE_IDLE; + this._nextDecay = undefined; + if (this._timeout) clearTimeout(this._timeout); + } +} + +/** + * @template {EXPECTED_FUNCTION} Provider + * @template {EXPECTED_FUNCTION} AsyncProvider + * @template FileSystem + * @param {number} duration duration in ms files are cached + * @param {Provider | undefined} provider provider + * @param {AsyncProvider | undefined} syncProvider sync provider + * @param {BaseFileSystem} providerContext provider context + * @returns {OperationMergerBackend | CacheBackend} backend + */ +const createBackend = (duration, provider, syncProvider, providerContext) => { + if (duration > 0) { + return new CacheBackend(duration, provider, syncProvider, providerContext); + } + return new OperationMergerBackend(provider, syncProvider, providerContext); +}; + +module.exports = class CachedInputFileSystem { + /** + * @param {BaseFileSystem} fileSystem file system + * @param {number} duration duration in ms files are cached + */ + constructor(fileSystem, duration) { + this.fileSystem = fileSystem; + + this._lstatBackend = createBackend( + duration, + this.fileSystem.lstat, + this.fileSystem.lstatSync, + this.fileSystem, + ); + const lstat = this._lstatBackend.provide; + this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); + const lstatSync = this._lstatBackend.provideSync; + this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ (lstatSync); + + this._statBackend = createBackend( + duration, + this.fileSystem.stat, + this.fileSystem.statSync, + this.fileSystem, + ); + const stat = this._statBackend.provide; + this.stat = /** @type {FileSystem["stat"]} */ (stat); + const statSync = this._statBackend.provideSync; + this.statSync = /** @type {SyncFileSystem["statSync"]} */ (statSync); + + this._readdirBackend = createBackend( + duration, + this.fileSystem.readdir, + this.fileSystem.readdirSync, + this.fileSystem, + ); + const readdir = this._readdirBackend.provide; + this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); + const readdirSync = this._readdirBackend.provideSync; + this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( + readdirSync + ); + + this._readFileBackend = createBackend( + duration, + this.fileSystem.readFile, + this.fileSystem.readFileSync, + this.fileSystem, + ); + const readFile = this._readFileBackend.provide; + this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); + const readFileSync = this._readFileBackend.provideSync; + this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ( + readFileSync + ); + + this._readJsonBackend = createBackend( + duration, + // prettier-ignore + this.fileSystem.readJson || + (this.readFile && + ( + /** + * @param {string} path path + * @param {FileSystemCallback} callback callback + */ + (path, callback) => { + this.readFile(path, (err, buffer) => { + if (err) return callback(err); + if (!buffer || buffer.length === 0) + {return callback(new Error("No file content"));} + let data; + try { + data = JSON.parse(buffer.toString("utf8")); + } catch (err_) { + return callback(/** @type {Error} */ (err_)); + } + callback(null, data); + }); + }) + ), + // prettier-ignore + this.fileSystem.readJsonSync || + (this.readFileSync && + ( + /** + * @param {string} path path + * @returns {EXPECTED_ANY} result + */ + (path) => { + const buffer = this.readFileSync(path); + const data = JSON.parse(buffer.toString("utf8")); + return data; + } + )), + this.fileSystem, + ); + const readJson = this._readJsonBackend.provide; + this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); + const readJsonSync = this._readJsonBackend.provideSync; + this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ( + readJsonSync + ); + + this._readlinkBackend = createBackend( + duration, + this.fileSystem.readlink, + this.fileSystem.readlinkSync, + this.fileSystem, + ); + const readlink = this._readlinkBackend.provide; + this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); + const readlinkSync = this._readlinkBackend.provideSync; + this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( + readlinkSync + ); + + this._realpathBackend = createBackend( + duration, + this.fileSystem.realpath, + this.fileSystem.realpathSync, + this.fileSystem, + ); + const realpath = this._realpathBackend.provide; + this.realpath = /** @type {FileSystem["realpath"]} */ (realpath); + const realpathSync = this._realpathBackend.provideSync; + this.realpathSync = /** @type {SyncFileSystem["realpathSync"]} */ ( + realpathSync + ); + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + */ + purge(what) { + this._statBackend.purge(what); + this._lstatBackend.purge(what); + this._readdirBackend.purgeParent(what); + this._readFileBackend.purge(what); + this._readlinkBackend.purge(what); + this._readJsonBackend.purge(what); + this._realpathBackend.purge(what); + } +}; diff --git a/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js b/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js new file mode 100644 index 0000000..295adaa --- /dev/null +++ b/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js @@ -0,0 +1,53 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { basename } = require("./getPaths"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class CloneBasenamePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { + const requestPath = /** @type {string} */ (request.path); + const filename = /** @type {string} */ (basename(requestPath)); + const filePath = resolver.join(requestPath, filename); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, filename), + }; + resolver.doResolve( + target, + obj, + `using path: ${filePath}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ConditionalPlugin.js b/node_modules/enhanced-resolve/lib/ConditionalPlugin.js new file mode 100644 index 0000000..99cc09d --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ConditionalPlugin.js @@ -0,0 +1,59 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ConditionalPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} test compare object + * @param {string | null} message log message + * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches + * @param {string | ResolveStepHook} target target + */ + constructor(source, test, message, allowAlternatives, target) { + this.source = source; + this.test = test; + this.message = message; + this.allowAlternatives = allowAlternatives; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const { test, message, allowAlternatives } = this; + const keys = /** @type {(keyof ResolveRequest)[]} */ (Object.keys(test)); + resolver + .getHook(this.source) + .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { + for (const prop of keys) { + if (request[prop] !== test[prop]) return callback(); + } + resolver.doResolve( + target, + request, + message, + resolveContext, + allowAlternatives + ? callback + : (err, result) => { + if (err) return callback(err); + + // Don't allow other alternatives + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js b/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js new file mode 100644 index 0000000..c20a0c9 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js @@ -0,0 +1,98 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class DescriptionFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string[]} filenames filenames + * @param {boolean} pathIsFile pathIsFile + * @param {string | ResolveStepHook} target target + */ + constructor(source, filenames, pathIsFile, target) { + this.source = source; + this.filenames = filenames; + this.pathIsFile = pathIsFile; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DescriptionFilePlugin", + (request, resolveContext, callback) => { + const { path } = request; + if (!path) return callback(); + const directory = this.pathIsFile + ? DescriptionFileUtils.cdUp(path) + : path; + if (!directory) return callback(); + DescriptionFileUtils.loadDescriptionFile( + resolver, + directory, + this.filenames, + request.descriptionFilePath + ? { + path: request.descriptionFilePath, + content: request.descriptionFileData, + directory: + /** @type {string} */ + (request.descriptionFileRoot), + } + : undefined, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (!result) { + if (resolveContext.log) { + resolveContext.log( + `No description file found in ${directory} or above`, + ); + } + return callback(); + } + const relativePath = `.${path + .slice(result.directory.length) + .replace(/\\/g, "/")}`; + /** @type {ResolveRequest} */ + const obj = { + ...request, + descriptionFilePath: result.path, + descriptionFileData: result.content, + descriptionFileRoot: result.directory, + relativePath, + }; + resolver.doResolve( + target, + obj, + `using description file: ${result.path} (relative path: ${relativePath})`, + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other processing + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }, + ); + }, + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js b/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js new file mode 100644 index 0000000..f41cce3 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js @@ -0,0 +1,200 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").JsonValue} JsonValue */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @typedef {object} DescriptionFileInfo + * @property {JsonObject=} content content + * @property {string} path path + * @property {string} directory directory + */ + +/** + * @callback ErrorFirstCallback + * @param {Error|null=} error + * @param {DescriptionFileInfo=} result + */ + +/** + * @typedef {object} Result + * @property {string} path path to description file + * @property {string} directory directory of description file + * @property {JsonObject} content content of description file + */ + +/** + * @param {string} directory directory + * @returns {string|null} parent directory or null + */ +function cdUp(directory) { + if (directory === "/") return null; + const i = directory.lastIndexOf("/"); + const j = directory.lastIndexOf("\\"); + const path = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (path < 0) return null; + return directory.slice(0, path || 1); +} + +/** + * @param {Resolver} resolver resolver + * @param {string} directory directory + * @param {string[]} filenames filenames + * @param {DescriptionFileInfo|undefined} oldInfo oldInfo + * @param {ResolveContext} resolveContext resolveContext + * @param {ErrorFirstCallback} callback callback + */ +function loadDescriptionFile( + resolver, + directory, + filenames, + oldInfo, + resolveContext, + callback, +) { + (function findDescriptionFile() { + if (oldInfo && oldInfo.directory === directory) { + // We already have info for this directory and can reuse it + return callback(null, oldInfo); + } + forEachBail( + filenames, + /** + * @param {string} filename filename + * @param {(err?: null|Error, result?: null|Result) => void} callback callback + * @returns {void} + */ + (filename, callback) => { + const descriptionFilePath = resolver.join(directory, filename); + + /** + * @param {(null | Error)=} err error + * @param {JsonObject=} resolvedContent content + * @returns {void} + */ + function onJson(err, resolvedContent) { + if (err) { + if (resolveContext.log) { + resolveContext.log( + `${descriptionFilePath} (directory description file): ${err}`, + ); + } else { + err.message = `${descriptionFilePath} (directory description file): ${err}`; + } + return callback(err); + } + callback(null, { + content: /** @type {JsonObject} */ (resolvedContent), + directory, + path: descriptionFilePath, + }); + } + + if (resolver.fileSystem.readJson) { + resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { + if (err) { + if ( + typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !== + "undefined" + ) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(descriptionFilePath); + } + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + return onJson(err); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + onJson(null, content); + }); + } else { + resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { + if (err) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(descriptionFilePath); + } + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + + /** @type {JsonObject | undefined} */ + let json; + + if (content) { + try { + json = JSON.parse(content.toString()); + } catch (/** @type {unknown} */ err_) { + return onJson(/** @type {Error} */ (err_)); + } + } else { + return onJson(new Error("No content in file")); + } + + onJson(null, json); + }); + } + }, + /** + * @param {(null | Error)=} err error + * @param {(null | Result)=} result result + * @returns {void} + */ + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + const dir = cdUp(directory); + if (!dir) { + return callback(); + } + directory = dir; + return findDescriptionFile(); + }, + ); + })(); +} + +/** + * @param {JsonObject} content content + * @param {string|string[]} field field + * @returns {JsonValue | undefined} field data + */ +function getField(content, field) { + if (!content) return undefined; + if (Array.isArray(field)) { + /** @type {JsonValue} */ + let current = content; + for (let j = 0; j < field.length; j++) { + if (current === null || typeof current !== "object") { + current = null; + break; + } + current = /** @type {JsonValue} */ ( + /** @type {JsonObject} */ + (current)[field[j]] + ); + } + return current; + } + return content[field]; +} + +module.exports.cdUp = cdUp; +module.exports.getField = getField; +module.exports.loadDescriptionFile = loadDescriptionFile; diff --git a/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js b/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js new file mode 100644 index 0000000..78a4639 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js @@ -0,0 +1,68 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class DirectoryExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DirectoryExistsPlugin", + (request, resolveContext, callback) => { + const fs = resolver.fileSystem; + const directory = request.path; + if (!directory) return callback(); + fs.stat(directory, (err, stat) => { + if (err || !stat) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(directory); + } + if (resolveContext.log) { + resolveContext.log(`${directory} doesn't exist`); + } + return callback(); + } + if (!stat.isDirectory()) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(directory); + } + if (resolveContext.log) { + resolveContext.log(`${directory} is not a directory`); + } + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(directory); + } + resolver.doResolve( + target, + request, + `existing directory ${directory}`, + resolveContext, + callback, + ); + }); + }, + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js b/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js new file mode 100644 index 0000000..45e3956 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js @@ -0,0 +1,206 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const forEachBail = require("./forEachBail"); +const { processExportsField } = require("./util/entrypoints"); +const { parseIdentifier } = require("./util/identifier"); +const { + deprecatedInvalidSegmentRegEx, + invalidSegmentRegEx, +} = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ +/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ + +module.exports = class ExportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + */ + constructor(source, conditionNames, fieldNamePath, target) { + this.source = source; + this.target = target; + this.conditionNames = conditionNames; + this.fieldName = fieldNamePath; + /** @type {WeakMap} */ + this.fieldProcessorCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ExportsFieldPlugin", (request, resolveContext, callback) => { + // When there is no description file, abort + if (!request.descriptionFilePath) return callback(); + if ( + // When the description file is inherited from parent, abort + // (There is no description file inside of this package) + request.relativePath !== "." || + request.request === undefined + ) { + return callback(); + } + + const remainingRequest = + request.query || request.fragment + ? (request.request === "." ? "./" : request.request) + + request.query + + request.fragment + : request.request; + const exportsField = + /** @type {ExportsField|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.fieldName, + ) + ); + if (!exportsField) return callback(); + + if (request.directory) { + return callback( + new Error( + `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)`, + ), + ); + } + + /** @type {string[]} */ + let paths; + /** @type {string | null} */ + let usedField; + + try { + // We attach the cache to the description file instead of the exportsField value + // because we use a WeakMap and the exportsField could be a string too. + // Description file is always an object when exports field can be accessed. + let fieldProcessor = this.fieldProcessorCache.get( + /** @type {JsonObject} */ (request.descriptionFileData), + ); + if (fieldProcessor === undefined) { + fieldProcessor = processExportsField(exportsField); + this.fieldProcessorCache.set( + /** @type {JsonObject} */ (request.descriptionFileData), + fieldProcessor, + ); + } + [paths, usedField] = fieldProcessor( + remainingRequest, + this.conditionNames, + ); + } catch (/** @type {unknown} */ err) { + if (resolveContext.log) { + resolveContext.log( + `Exports field in ${request.descriptionFilePath} can't be processed: ${err}`, + ); + } + return callback(/** @type {Error} */ (err)); + } + + if (paths.length === 0) { + const conditions = [...this.conditionNames]; + const conditionsStr = + conditions.length === 1 + ? `the condition "${conditions[0]}"` + : `the conditions ${JSON.stringify(conditions)}`; + return callback( + new Error( + `"${remainingRequest}" is not exported under ${conditionsStr} from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})`, + ), + ); + } + + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @param {number} i index + * @returns {void} + */ + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); + + if (!parsedIdentifier) return callback(); + + const [relativePath, query, fragment] = parsedIdentifier; + + if (relativePath.length === 0 || !relativePath.startsWith("./")) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + if ( + invalidSegmentRegEx.exec(relativePath.slice(2)) !== null && + deprecatedInvalidSegmentRegEx.test(relativePath.slice(2)) + ) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: undefined, + path: resolver.join( + /** @type {string} */ (request.descriptionFileRoot), + relativePath, + ), + relativePath, + query, + fragment, + }; + + resolver.doResolve( + target, + obj, + `using exports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }, + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + (err, result) => callback(err, result || null), + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js b/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js new file mode 100644 index 0000000..4184eb3 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js @@ -0,0 +1,100 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {{ alias: string|string[], extension: string }} ExtensionAliasOption */ + +module.exports = class ExtensionAliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {ExtensionAliasOption} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const { extension, alias } = this.options; + resolver + .getHook(this.source) + .tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => { + const requestPath = request.request; + if (!requestPath || !requestPath.endsWith(extension)) return callback(); + const isAliasString = typeof alias === "string"; + /** + * @param {string} alias extension alias + * @param {(err?: null | Error, result?: null|ResolveRequest) => void} callback callback + * @param {number=} index index + * @returns {void} + */ + const resolve = (alias, callback, index) => { + const newRequest = `${requestPath.slice( + 0, + -extension.length, + )}${alias}`; + + return resolver.doResolve( + target, + { + ...request, + request: newRequest, + fullySpecified: true, + }, + `aliased from extension alias with mapping '${extension}' to '${alias}'`, + resolveContext, + (err, result) => { + // Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias + if (!isAliasString && index) { + if (index !== this.options.alias.length) { + if (resolveContext.log) { + resolveContext.log( + `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}`, + ); + } + + return callback(null, result); + } + + return callback(err, result); + } + callback(err, result); + }, + ); + }; + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + const stoppingCallback = (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Don't allow other aliasing or raw request + return callback(null, null); + }; + if (isAliasString) { + resolve(alias, stoppingCallback); + } else if (alias.length > 1) { + forEachBail(alias, resolve, stoppingCallback); + } else { + resolve(alias[0], stoppingCallback); + } + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/FileExistsPlugin.js b/node_modules/enhanced-resolve/lib/FileExistsPlugin.js new file mode 100644 index 0000000..cf9c839 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/FileExistsPlugin.js @@ -0,0 +1,61 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class FileExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { + const file = request.path; + if (!file) return callback(); + fs.stat(file, (err, stat) => { + if (err || !stat) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(file); + } + if (resolveContext.log) resolveContext.log(`${file} doesn't exist`); + return callback(); + } + if (!stat.isFile()) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(file); + } + if (resolveContext.log) resolveContext.log(`${file} is not a file`); + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(file); + } + resolver.doResolve( + target, + request, + `existing file: ${file}`, + resolveContext, + callback, + ); + }); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js b/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js new file mode 100644 index 0000000..1475677 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js @@ -0,0 +1,223 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const forEachBail = require("./forEachBail"); +const { processImportsField } = require("./util/entrypoints"); +const { parseIdentifier } = require("./util/identifier"); +const { + deprecatedInvalidSegmentRegEx, + invalidSegmentRegEx, +} = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ +/** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ + +const dotCode = ".".charCodeAt(0); + +module.exports = class ImportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} targetFile target file + * @param {string | ResolveStepHook} targetPackage target package + */ + constructor( + source, + conditionNames, + fieldNamePath, + targetFile, + targetPackage, + ) { + this.source = source; + this.targetFile = targetFile; + this.targetPackage = targetPackage; + this.conditionNames = conditionNames; + this.fieldName = fieldNamePath; + /** @type {WeakMap} */ + this.fieldProcessorCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const targetFile = resolver.ensureHook(this.targetFile); + const targetPackage = resolver.ensureHook(this.targetPackage); + + resolver + .getHook(this.source) + .tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => { + // When there is no description file, abort + if (!request.descriptionFilePath || request.request === undefined) { + return callback(); + } + + const remainingRequest = + request.request + request.query + request.fragment; + const importsField = + /** @type {ImportsField|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.fieldName, + ) + ); + if (!importsField) return callback(); + + if (request.directory) { + return callback( + new Error( + `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)`, + ), + ); + } + + /** @type {string[]} */ + let paths; + /** @type {string | null} */ + let usedField; + + try { + // We attach the cache to the description file instead of the importsField value + // because we use a WeakMap and the importsField could be a string too. + // Description file is always an object when exports field can be accessed. + let fieldProcessor = this.fieldProcessorCache.get( + /** @type {JsonObject} */ (request.descriptionFileData), + ); + if (fieldProcessor === undefined) { + fieldProcessor = processImportsField(importsField); + this.fieldProcessorCache.set( + /** @type {JsonObject} */ (request.descriptionFileData), + fieldProcessor, + ); + } + [paths, usedField] = fieldProcessor( + remainingRequest, + this.conditionNames, + ); + } catch (/** @type {unknown} */ err) { + if (resolveContext.log) { + resolveContext.log( + `Imports field in ${request.descriptionFilePath} can't be processed: ${err}`, + ); + } + return callback(/** @type {Error} */ (err)); + } + + if (paths.length === 0) { + return callback( + new Error( + `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})`, + ), + ); + } + + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @param {number} i index + * @returns {void} + */ + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); + + if (!parsedIdentifier) return callback(); + + const [path_, query, fragment] = parsedIdentifier; + + switch (path_.charCodeAt(0)) { + // should be relative + case dotCode: { + if ( + invalidSegmentRegEx.exec(path_.slice(2)) !== null && + deprecatedInvalidSegmentRegEx.test(path_.slice(2)) !== null + ) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "imports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: undefined, + path: resolver.join( + /** @type {string} */ (request.descriptionFileRoot), + path_, + ), + relativePath: path_, + query, + fragment, + }; + + resolver.doResolve( + targetFile, + obj, + `using imports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + break; + } + + // package resolving + default: { + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: path_, + relativePath: path_, + fullySpecified: true, + query, + fragment, + }; + + resolver.doResolve( + targetPackage, + obj, + `using imports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + } + } + }, + /** + * @param {(null|Error)=} err error + * @param {(null|ResolveRequest)=} result result + * @returns {void} + */ + (err, result) => callback(err, result || null), + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js b/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js new file mode 100644 index 0000000..a171b98 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js @@ -0,0 +1,75 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const namespaceStartCharCode = "@".charCodeAt(0); + +module.exports = class JoinRequestPartPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "JoinRequestPartPlugin", + (request, resolveContext, callback) => { + const req = request.request || ""; + let i = req.indexOf("/", 3); + + if (i >= 0 && req.charCodeAt(2) === namespaceStartCharCode) { + i = req.indexOf("/", i + 1); + } + + /** @type {string} */ + let moduleName; + /** @type {string} */ + let remainingRequest; + /** @type {boolean} */ + let fullySpecified; + if (i < 0) { + moduleName = req; + remainingRequest = "."; + fullySpecified = false; + } else { + moduleName = req.slice(0, i); + remainingRequest = `.${req.slice(i)}`; + fullySpecified = /** @type {boolean} */ (request.fullySpecified); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolver.join( + /** @type {string} */ + (request.path), + moduleName, + ), + relativePath: + request.relativePath && + resolver.join(request.relativePath, moduleName), + request: remainingRequest, + fullySpecified, + }; + resolver.doResolve(target, obj, null, resolveContext, callback); + }, + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js b/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js new file mode 100644 index 0000000..108958e --- /dev/null +++ b/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js @@ -0,0 +1,45 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class JoinRequestPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { + const requestPath = /** @type {string} */ (request.path); + const requestRequest = /** @type {string} */ (request.request); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolver.join(requestPath, requestRequest), + relativePath: + request.relativePath && + resolver.join(request.relativePath, requestRequest), + request: undefined, + }; + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/LogInfoPlugin.js b/node_modules/enhanced-resolve/lib/LogInfoPlugin.js new file mode 100644 index 0000000..5dbb688 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/LogInfoPlugin.js @@ -0,0 +1,58 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class LogInfoPlugin { + /** + * @param {string | ResolveStepHook} source source + */ + constructor(source) { + this.source = source; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const { source } = this; + resolver + .getHook(this.source) + .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { + if (!resolveContext.log) return callback(); + const { log } = resolveContext; + const prefix = `[${source}] `; + if (request.path) { + log(`${prefix}Resolving in directory: ${request.path}`); + } + if (request.request) { + log(`${prefix}Resolving request: ${request.request}`); + } + if (request.module) log(`${prefix}Request is an module request.`); + if (request.directory) log(`${prefix}Request is a directory request.`); + if (request.query) { + log(`${prefix}Resolving request query: ${request.query}`); + } + if (request.fragment) { + log(`${prefix}Resolving request fragment: ${request.fragment}`); + } + if (request.descriptionFilePath) { + log( + `${prefix}Has description data from ${request.descriptionFilePath}`, + ); + } + if (request.relativePath) { + log( + `${prefix}Relative path from description file is: ${request.relativePath}`, + ); + } + callback(); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/MainFieldPlugin.js b/node_modules/enhanced-resolve/lib/MainFieldPlugin.js new file mode 100644 index 0000000..1a52681 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/MainFieldPlugin.js @@ -0,0 +1,87 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const path = require("path"); +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +/** @typedef {{name: string|Array, forceRelative: boolean}} MainFieldOptions */ + +const alreadyTriedMainField = Symbol("alreadyTriedMainField"); + +module.exports = class MainFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {MainFieldOptions} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { + if ( + request.path !== request.descriptionFileRoot || + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ + (request)[alreadyTriedMainField] === request.descriptionFilePath || + !request.descriptionFilePath + ) { + return callback(); + } + const filename = path.basename(request.descriptionFilePath); + let mainModule = + /** @type {string|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.options.name, + ) + ); + + if ( + !mainModule || + typeof mainModule !== "string" || + mainModule === "." || + mainModule === "./" + ) { + return callback(); + } + if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) { + mainModule = `./${mainModule}`; + } + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ + const obj = { + ...request, + request: mainModule, + module: false, + directory: mainModule.endsWith("/"), + [alreadyTriedMainField]: request.descriptionFilePath, + }; + return resolver.doResolve( + target, + obj, + `use ${mainModule} from ${this.options.name} in ${filename}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js new file mode 100644 index 0000000..06065e8 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js @@ -0,0 +1,9 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// TODO remove in next major +module.exports = require("./ModulesInHierarchicalDirectoriesPlugin"); diff --git a/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js new file mode 100644 index 0000000..8ed78cd --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js @@ -0,0 +1,91 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const getPaths = require("./getPaths"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ModulesInHierarchicalDirectoriesPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | Array} directories directories + * @param {string | ResolveStepHook} target target + */ + constructor(source, directories, target) { + this.source = source; + this.directories = /** @type {Array} */ [...directories]; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "ModulesInHierarchicalDirectoriesPlugin", + (request, resolveContext, callback) => { + const fs = resolver.fileSystem; + const addrs = getPaths(/** @type {string} */ (request.path)) + .paths.map((path) => + this.directories.map((directory) => + resolver.join(path, directory), + ), + ) + .reduce((array, path) => { + array.push(...path); + return array; + }, []); + forEachBail( + addrs, + /** + * @param {string} addr addr + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ + (addr, callback) => { + fs.stat(addr, (err, stat) => { + if (!err && stat && stat.isDirectory()) { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: addr, + request: `./${request.request}`, + module: false, + }; + const message = `looking for modules in ${addr}`; + return resolver.doResolve( + target, + obj, + message, + resolveContext, + callback, + ); + } + if (resolveContext.log) { + resolveContext.log( + `${addr} doesn't exist or is not a directory`, + ); + } + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(addr); + } + return callback(); + }); + }, + callback, + ); + }, + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js new file mode 100644 index 0000000..7797a11 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ModulesInRootPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} path path + * @param {string | ResolveStepHook} target target + */ + constructor(source, path, target) { + this.source = source; + this.path = path; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: this.path, + request: `./${request.request}`, + module: false, + }; + resolver.doResolve( + target, + obj, + `looking for modules in ${this.path}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/NextPlugin.js b/node_modules/enhanced-resolve/lib/NextPlugin.js new file mode 100644 index 0000000..e59c56b --- /dev/null +++ b/node_modules/enhanced-resolve/lib/NextPlugin.js @@ -0,0 +1,33 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class NextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("NextPlugin", (request, resolveContext, callback) => { + resolver.doResolve(target, request, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ParsePlugin.js b/node_modules/enhanced-resolve/lib/ParsePlugin.js new file mode 100644 index 0000000..c96c210 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ParsePlugin.js @@ -0,0 +1,77 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ParsePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} requestOptions request options + * @param {string | ResolveStepHook} target target + */ + constructor(source, requestOptions, target) { + this.source = source; + this.requestOptions = requestOptions; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ParsePlugin", (request, resolveContext, callback) => { + const parsed = resolver.parse(/** @type {string} */ (request.request)); + /** @type {ResolveRequest} */ + const obj = { ...request, ...parsed, ...this.requestOptions }; + if (request.query && !parsed.query) { + obj.query = request.query; + } + if (request.fragment && !parsed.fragment) { + obj.fragment = request.fragment; + } + if (parsed && resolveContext.log) { + if (parsed.module) resolveContext.log("Parsed request is a module"); + if (parsed.directory) { + resolveContext.log("Parsed request is a directory"); + } + } + // There is an edge-case where a request with # can be a path or a fragment -> try both + if (obj.request && !obj.query && obj.fragment) { + const directory = obj.fragment.endsWith("/"); + /** @type {ResolveRequest} */ + const alternative = { + ...obj, + directory, + request: + obj.request + + (obj.directory ? "/" : "") + + (directory ? obj.fragment.slice(0, -1) : obj.fragment), + fragment: "", + }; + resolver.doResolve( + target, + alternative, + null, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + resolver.doResolve(target, obj, null, resolveContext, callback); + }, + ); + return; + } + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/PnpPlugin.js b/node_modules/enhanced-resolve/lib/PnpPlugin.js new file mode 100644 index 0000000..9f767ca --- /dev/null +++ b/node_modules/enhanced-resolve/lib/PnpPlugin.js @@ -0,0 +1,134 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Maël Nison @arcanis +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** + * @typedef {object} PnpApiImpl + * @property {(packageName: string, issuer: string, options: { considerBuiltins: boolean }) => string | null} resolveToUnqualified resolve to unqualified + */ + +module.exports = class PnpPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {PnpApiImpl} pnpApi pnpApi + * @param {string | ResolveStepHook} target target + * @param {string | ResolveStepHook} alternateTarget alternateTarget + */ + constructor(source, pnpApi, target, alternateTarget) { + this.source = source; + this.pnpApi = pnpApi; + this.target = target; + this.alternateTarget = alternateTarget; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + /** @type {ResolveStepHook} */ + const target = resolver.ensureHook(this.target); + const alternateTarget = resolver.ensureHook(this.alternateTarget); + resolver + .getHook(this.source) + .tapAsync("PnpPlugin", (request, resolveContext, callback) => { + const req = request.request; + if (!req) return callback(); + + // The trailing slash indicates to PnP that this value is a folder rather than a file + const issuer = `${request.path}/`; + + const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); + if (!packageMatch) return callback(); + + const [packageName] = packageMatch; + const innerRequest = `.${req.slice(packageName.length)}`; + + /** @type {string|undefined|null} */ + let resolution; + /** @type {string|undefined|null} */ + let apiResolution; + try { + resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { + considerBuiltins: false, + }); + + if (resolution === null) { + // This is either not a PnP managed issuer or it's a Node builtin + // Try to continue resolving with our alternatives + resolver.doResolve( + alternateTarget, + request, + "issuer is not managed by a pnpapi", + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Skip alternatives + return callback(null, null); + }, + ); + return; + } + + if (resolveContext.fileDependencies) { + apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { + considerBuiltins: false, + }); + } + } catch (/** @type {unknown} */ error) { + if ( + /** @type {Error & { code: string }} */ + (error).code === "MODULE_NOT_FOUND" && + /** @type {Error & { pnpCode: string }} */ + (error).pnpCode === "UNDECLARED_DEPENDENCY" + ) { + // This is not a PnP managed dependency. + // Try to continue resolving with our alternatives + if (resolveContext.log) { + resolveContext.log("request is not managed by the pnpapi"); + for (const line of /** @type {Error} */ (error).message + .split("\n") + .filter(Boolean)) { + resolveContext.log(` ${line}`); + } + } + return callback(); + } + return callback(/** @type {Error} */ (error)); + } + + if (resolution === packageName) return callback(); + + if (apiResolution && resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(apiResolution); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolution, + request: innerRequest, + ignoreSymlinks: true, + fullySpecified: request.fullySpecified && innerRequest !== ".", + }; + resolver.doResolve( + target, + obj, + `resolved by pnp to ${resolution}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Skip alternatives + return callback(null, null); + }, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/Resolver.js b/node_modules/enhanced-resolve/lib/Resolver.js new file mode 100644 index 0000000..8267ac2 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/Resolver.js @@ -0,0 +1,799 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = require("tapable"); +const createInnerContext = require("./createInnerContext"); +const { parseIdentifier } = require("./util/identifier"); +const { + PathType, + cachedJoin: join, + getType, + normalize, +} = require("./util/path"); + +/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ + +/** @typedef {Error & { details?: string }} ErrorWithDetail */ + +/** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */ + +/** + * @typedef {object} PossibleFileSystemError + * @property {string=} code code + * @property {number=} errno number + * @property {string=} path path + * @property {string=} syscall syscall + */ + +/** + * @template T + * @callback FileSystemCallback + * @param {PossibleFileSystemError & Error | null} err + * @param {T=} result + */ + +/** + * @typedef {string | Buffer | URL} PathLike + */ + +/** + * @typedef {PathLike | number} PathOrFileDescriptor + */ + +/** + * @typedef {object} ObjectEncodingOptions + * @property {BufferEncoding | null | undefined=} encoding encoding + */ + +/** + * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption + */ + +/** @typedef {(err: NodeJS.ErrnoException | null, result?: string) => void} StringCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer) => void} BufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (string | Buffer)) => void} StringOrBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IStats) => void} StatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IBigIntStats) => void} BigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (IStats | IBigIntStats)) => void} StatsOrBigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | Error | null, result?: JsonObject) => void} ReadJsonCallback */ + +/** + * @template T + * @typedef {object} IStatsBase + * @property {() => boolean} isFile is file + * @property {() => boolean} isDirectory is directory + * @property {() => boolean} isBlockDevice is block device + * @property {() => boolean} isCharacterDevice is character device + * @property {() => boolean} isSymbolicLink is symbolic link + * @property {() => boolean} isFIFO is FIFO + * @property {() => boolean} isSocket is socket + * @property {T} dev dev + * @property {T} ino ino + * @property {T} mode mode + * @property {T} nlink nlink + * @property {T} uid uid + * @property {T} gid gid + * @property {T} rdev rdev + * @property {T} size size + * @property {T} blksize blksize + * @property {T} blocks blocks + * @property {T} atimeMs atime ms + * @property {T} mtimeMs mtime ms + * @property {T} ctimeMs ctime ms + * @property {T} birthtimeMs birthtime ms + * @property {Date} atime atime + * @property {Date} mtime mtime + * @property {Date} ctime ctime + * @property {Date} birthtime birthtime + */ + +/** + * @typedef {IStatsBase} IStats + */ + +/** + * @typedef {IStatsBase & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats + */ + +/** + * @template {string | Buffer} [T=string] + * @typedef {object} Dirent + * @property {() => boolean} isFile true when is file, otherwise false + * @property {() => boolean} isDirectory true when is directory, otherwise false + * @property {() => boolean} isBlockDevice true when is block device, otherwise false + * @property {() => boolean} isCharacterDevice true when is character device, otherwise false + * @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false + * @property {() => boolean} isFIFO true when is FIFO, otherwise false + * @property {() => boolean} isSocket true when is socket, otherwise false + * @property {T} name name + * @property {string} parentPath path + * @property {string=} path path + */ + +/** + * @typedef {object} StatOptions + * @property {(boolean | undefined)=} bigint need bigint values + */ + +/** + * @typedef {object} StatSyncOptions + * @property {(boolean | undefined)=} bigint need bigint values + * @property {(boolean | undefined)=} throwIfNoEntry throw if no entry + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void; + * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void; + * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void; + * (path: PathOrFileDescriptor, callback: BufferCallback): void; + * }} ReadFile + */ + +/** + * @typedef {'buffer'| { encoding: 'buffer' }} BufferEncodingOption + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer; + * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string; + * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer; + * }} ReadFileSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void; + * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer', callback: (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void): void; + * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void): void; + * (path: PathLike, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void; + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files?: Dirent[]) => void): void; + * (path: PathLike, options: { encoding: 'buffer', withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void; + * }} Readdir + */ + +/** + * @typedef {{ + * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined; } | BufferEncoding | null): string[]; + * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer'): Buffer[]; + * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[]; + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[]; + * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }): Dirent[]; + * }} ReaddirSync + */ + +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor, callback: ReadJsonCallback) => void} ReadJson + */ + +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor) => JsonObject} ReadJsonSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void; + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void; + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void; + * (path: PathLike, callback: StringCallback): void; + * }} Readlink + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string; + * (path: PathLike, options: BufferEncodingOption): Buffer; + * (path: PathLike, options?: EncodingOption): string | Buffer; + * }} ReadlinkSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void; + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void; + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void; + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void; + * }} LStat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined; + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats; + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats; + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined; + * }} LStatSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void; + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void; + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void; + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void; + * }} Stat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined; + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats; + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats; + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined; + * }} StatSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void; + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void; + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void; + * (path: PathLike, callback: StringCallback): void; + * }} RealPath + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string; + * (path: PathLike, options: BufferEncodingOption): Buffer; + * (path: PathLike, options?: EncodingOption): string | Buffer; + * }} RealPathSync + */ + +/** + * @typedef {object} FileSystem + * @property {ReadFile} readFile read file method + * @property {Readdir} readdir readdir method + * @property {ReadJson=} readJson read json method + * @property {Readlink} readlink read link method + * @property {LStat=} lstat lstat method + * @property {Stat} stat stat method + * @property {RealPath=} realpath realpath method + */ + +/** + * @typedef {object} SyncFileSystem + * @property {ReadFileSync} readFileSync read file sync method + * @property {ReaddirSync} readdirSync read dir sync method + * @property {ReadJsonSync=} readJsonSync read json sync method + * @property {ReadlinkSync} readlinkSync read link sync method + * @property {LStatSync=} lstatSync lstat sync method + * @property {StatSync} statSync stat sync method + * @property {RealPathSync=} realpathSync real path sync method + */ + +/** + * @typedef {object} ParsedIdentifier + * @property {string} request request + * @property {string} query query + * @property {string} fragment fragment + * @property {boolean} directory is directory + * @property {boolean} module is module + * @property {boolean} file is file + * @property {boolean} internal is internal + */ + +/** @typedef {string | number | boolean | null} JsonPrimitive */ +/** @typedef {JsonValue[]} JsonArray */ +/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ +/** @typedef {{ [Key in string]?: JsonValue | undefined }} JsonObject */ + +// eslint-disable-next-line jsdoc/require-property +/** @typedef {object} Context */ + +/** + * @typedef {object} BaseResolveRequest + * @property {string | false} path path + * @property {Context=} context content + * @property {string=} descriptionFilePath description file path + * @property {string=} descriptionFileRoot description file root + * @property {JsonObject=} descriptionFileData description file data + * @property {string=} relativePath relative path + * @property {boolean=} ignoreSymlinks true when need to ignore symlinks, otherwise false + * @property {boolean=} fullySpecified true when full specified, otherwise false + * @property {string=} __innerRequest inner request for internal usage + * @property {string=} __innerRequest_request inner request for internal usage + * @property {string=} __innerRequest_relativePath inner relative path for internal usage + */ + +/** @typedef {BaseResolveRequest & Partial} ResolveRequest */ + +/** + * String with special formatting + * @typedef {string} StackEntry + */ + +/** + * @template T + * @typedef {{ add: (item: T) => void }} WriteOnlySet + */ + +/** @typedef {(request: ResolveRequest) => void} ResolveContextYield */ + +/** + * Resolve context + * @typedef {object} ResolveContext + * @property {WriteOnlySet=} contextDependencies directories that was found on file system + * @property {WriteOnlySet=} fileDependencies files that was found on file system + * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system + * @property {Set=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, + * @property {((str: string) => void)=} log log function + * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results + */ + +/** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ + +/** + * @typedef {object} KnownHooks + * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep resolve step hook + * @property {SyncHook<[ResolveRequest, Error]>} noResolve no resolve hook + * @property {ResolveStepHook} resolve resolve hook + * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result result hook + */ + +/** + * @typedef {{[key: string]: ResolveStepHook}} EnsuredHooks + */ + +/** + * @param {string} str input string + * @returns {string} in camel case + */ +function toCamelCase(str) { + return str.replace(/-([a-z])/g, (str) => str.slice(1).toUpperCase()); +} + +class Resolver { + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @returns {StackEntry} stack entry + */ + static createStackEntry(hook, request) { + return `${hook.name}: (${request.path}) ${request.request || ""}${ + request.query || "" + }${request.fragment || ""}${request.directory ? " directory" : ""}${ + request.module ? " module" : "" + }`; + } + + /** + * @param {FileSystem} fileSystem a filesystem + * @param {ResolveOptions} options options + */ + constructor(fileSystem, options) { + this.fileSystem = fileSystem; + this.options = options; + /** @type {KnownHooks} */ + this.hooks = { + resolveStep: new SyncHook(["hook", "request"], "resolveStep"), + noResolve: new SyncHook(["request", "error"], "noResolve"), + resolve: new AsyncSeriesBailHook( + ["request", "resolveContext"], + "resolve", + ), + result: new AsyncSeriesHook(["result", "resolveContext"], "result"), + }; + } + + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + ensureHook(name) { + if (typeof name !== "string") { + return name; + } + name = toCamelCase(name); + if (name.startsWith("before")) { + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10, + }) + ); + } + if (name.startsWith("after")) { + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10, + }) + ); + } + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + if (!hook) { + /** @type {KnownHooks & EnsuredHooks} */ + (this.hooks)[name] = new AsyncSeriesBailHook( + ["request", "resolveContext"], + name, + ); + + return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + } + return hook; + } + + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + getHook(name) { + if (typeof name !== "string") { + return name; + } + name = toCamelCase(name); + if (name.startsWith("before")) { + return /** @type {ResolveStepHook} */ ( + this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10, + }) + ); + } + if (name.startsWith("after")) { + return /** @type {ResolveStepHook} */ ( + this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10, + }) + ); + } + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + if (!hook) { + throw new Error(`Hook ${name} doesn't exist`); + } + return hook; + } + + /** + * @param {object} context context information object + * @param {string} path context path + * @param {string} request request string + * @returns {string | false} result + */ + resolveSync(context, path, request) { + /** @type {Error | null | undefined} */ + let err; + /** @type {string | false | undefined} */ + let result; + let sync = false; + this.resolve(context, path, request, {}, (_err, r) => { + err = _err; + result = r; + sync = true; + }); + if (!sync) { + throw new Error( + "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!", + ); + } + if (err) throw err; + if (result === undefined) throw new Error("No result"); + return result; + } + + /** + * @param {object} context context information object + * @param {string} path context path + * @param {string} request request string + * @param {ResolveContext} resolveContext resolve context + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + resolve(context, path, request, resolveContext, callback) { + if (!context || typeof context !== "object") { + return callback(new Error("context argument is not an object")); + } + if (typeof path !== "string") { + return callback(new Error("path argument is not a string")); + } + if (typeof request !== "string") { + return callback(new Error("request argument is not a string")); + } + if (!resolveContext) { + return callback(new Error("resolveContext argument is not set")); + } + + /** @type {ResolveRequest} */ + const obj = { + context, + path, + request, + }; + + /** @type {ResolveContextYield | undefined} */ + let yield_; + let yieldCalled = false; + /** @type {ResolveContextYield | undefined} */ + let finishYield; + if (typeof resolveContext.yield === "function") { + const old = resolveContext.yield; + /** + * @param {ResolveRequest} obj object + */ + yield_ = (obj) => { + old(obj); + yieldCalled = true; + }; + /** + * @param {ResolveRequest} result result + * @returns {void} + */ + finishYield = (result) => { + if (result) { + /** @type {ResolveContextYield} */ (yield_)(result); + } + callback(null); + }; + } + + const message = `resolve '${request}' in '${path}'`; + + /** + * @param {ResolveRequest} result result + * @returns {void} + */ + const finishResolved = (result) => + callback( + null, + result.path === false + ? false + : `${result.path.replace(/#/g, "\0#")}${ + result.query ? result.query.replace(/#/g, "\0#") : "" + }${result.fragment || ""}`, + result, + ); + + /** + * @param {string[]} log logs + * @returns {void} + */ + const finishWithoutResolve = (log) => { + /** + * @type {ErrorWithDetail} + */ + const error = new Error(`Can't ${message}`); + error.details = log.join("\n"); + this.hooks.noResolve.call(obj, error); + return callback(error); + }; + + if (resolveContext.log) { + // We need log anyway to capture it in case of an error + const parentLog = resolveContext.log; + /** @type {string[]} */ + const log = []; + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: (msg) => { + parentLog(msg); + log.push(msg); + }, + yield: yield_, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + if (result) return finishResolved(result); + + return finishWithoutResolve(log); + }, + ); + } + // Try to resolve assuming there is no error + // We don't log stuff in this case + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: undefined, + yield: yield_, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + if (result) return finishResolved(result); + + // log is missing for the error details + // so we redo the resolving for the log info + // this is more expensive to the success case + // is assumed by default + /** @type {string[]} */ + const log = []; + + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: (msg) => log.push(msg), + yield: yield_, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + // In a case that there is a race condition and yield will be called + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + return finishWithoutResolve(log); + }, + ); + }, + ); + } + + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {null|string} message string + * @param {ResolveContext} resolveContext resolver context + * @param {(err?: null|Error, result?: ResolveRequest) => void} callback callback + * @returns {void} + */ + doResolve(hook, request, message, resolveContext, callback) { + const stackEntry = Resolver.createStackEntry(hook, request); + + /** @type {Set | undefined} */ + let newStack; + if (resolveContext.stack) { + newStack = new Set(resolveContext.stack); + if (resolveContext.stack.has(stackEntry)) { + /** + * Prevent recursion + * @type {Error & {recursion?: boolean}} + */ + const recursionError = new Error( + `Recursion in resolving\nStack:\n ${[...newStack].join("\n ")}`, + ); + recursionError.recursion = true; + if (resolveContext.log) { + resolveContext.log("abort resolving because of recursion"); + } + return callback(recursionError); + } + newStack.add(stackEntry); + } else { + // creating a set with new Set([item]) + // allocates a new array that has to be garbage collected + // this is an EXTREMELY hot path, so let's avoid it + newStack = new Set(); + newStack.add(stackEntry); + } + this.hooks.resolveStep.call(hook, request); + + if (hook.isUsed()) { + const innerContext = createInnerContext( + { + log: resolveContext.log, + yield: resolveContext.yield, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: newStack, + }, + message, + ); + return hook.callAsync(request, innerContext, (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + callback(); + }); + } + callback(); + } + + /** + * @param {string} identifier identifier + * @returns {ParsedIdentifier} parsed identifier + */ + parse(identifier) { + const part = { + request: "", + query: "", + fragment: "", + module: false, + directory: false, + file: false, + internal: false, + }; + + const parsedIdentifier = parseIdentifier(identifier); + + if (!parsedIdentifier) return part; + + [part.request, part.query, part.fragment] = parsedIdentifier; + + if (part.request.length > 0) { + part.internal = this.isPrivate(identifier); + part.module = this.isModule(part.request); + part.directory = this.isDirectory(part.request); + if (part.directory) { + part.request = part.request.slice(0, -1); + } + } + + return part; + } + + /** + * @param {string} path path + * @returns {boolean} true, if the path is a module + */ + isModule(path) { + return getType(path) === PathType.Normal; + } + + /** + * @param {string} path path + * @returns {boolean} true, if the path is private + */ + isPrivate(path) { + return getType(path) === PathType.Internal; + } + + /** + * @param {string} path a path + * @returns {boolean} true, if the path is a directory path + */ + isDirectory(path) { + return path.endsWith("/"); + } + + /** + * @param {string} path path + * @param {string} request request + * @returns {string} joined path + */ + join(path, request) { + return join(path, request); + } + + /** + * @param {string} path path + * @returns {string} normalized path + */ + normalize(path) { + return normalize(path); + } +} + +module.exports = Resolver; diff --git a/node_modules/enhanced-resolve/lib/ResolverFactory.js b/node_modules/enhanced-resolve/lib/ResolverFactory.js new file mode 100644 index 0000000..266dd69 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ResolverFactory.js @@ -0,0 +1,731 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// eslint-disable-next-line n/prefer-global/process +const { versions } = require("process"); + +const AliasFieldPlugin = require("./AliasFieldPlugin"); +const AliasPlugin = require("./AliasPlugin"); +const AppendPlugin = require("./AppendPlugin"); +const ConditionalPlugin = require("./ConditionalPlugin"); +const DescriptionFilePlugin = require("./DescriptionFilePlugin"); +const DirectoryExistsPlugin = require("./DirectoryExistsPlugin"); +const ExportsFieldPlugin = require("./ExportsFieldPlugin"); +const ExtensionAliasPlugin = require("./ExtensionAliasPlugin"); +const FileExistsPlugin = require("./FileExistsPlugin"); +const ImportsFieldPlugin = require("./ImportsFieldPlugin"); +const JoinRequestPartPlugin = require("./JoinRequestPartPlugin"); +const JoinRequestPlugin = require("./JoinRequestPlugin"); +const MainFieldPlugin = require("./MainFieldPlugin"); +const ModulesInHierarchicalDirectoriesPlugin = require("./ModulesInHierarchicalDirectoriesPlugin"); +const ModulesInRootPlugin = require("./ModulesInRootPlugin"); +const NextPlugin = require("./NextPlugin"); +const ParsePlugin = require("./ParsePlugin"); +const PnpPlugin = require("./PnpPlugin"); +const Resolver = require("./Resolver"); +const RestrictionsPlugin = require("./RestrictionsPlugin"); +const ResultPlugin = require("./ResultPlugin"); +const RootsPlugin = require("./RootsPlugin"); +const SelfReferencePlugin = require("./SelfReferencePlugin"); +const SymlinkPlugin = require("./SymlinkPlugin"); +const SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator"); +const TryNextPlugin = require("./TryNextPlugin"); +const UnsafeCachePlugin = require("./UnsafeCachePlugin"); +const UseFilePlugin = require("./UseFilePlugin"); +const { PathType, getType } = require("./util/path"); + +/** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ +/** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */ +/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ +/** @typedef {import("./Resolver").EnsuredHooks} EnsuredHooks */ +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").KnownHooks} KnownHooks */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {import("./UnsafeCachePlugin").Cache} Cache */ + +/** @typedef {string | string[] | false} AliasOptionNewRequest */ +/** @typedef {{ [k: string]: AliasOptionNewRequest }} AliasOptions */ +/** @typedef {{ [k: string]: string|string[] }} ExtensionAliasOptions */ +/** @typedef {false | 0 | "" | null | undefined} Falsy */ +/** @typedef {{apply: (resolver: Resolver) => void} | ((this: Resolver, resolver: Resolver) => void) | Falsy} Plugin */ + +/** + * @typedef {object} UserResolveOptions + * @property {(AliasOptions | AliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value + * @property {(AliasOptions | AliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option + * @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases + * @property {(string | string[])[]=} aliasFields A list of alias fields in description files + * @property {((predicate: ResolveRequest) => boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. + * @property {string[]=} descriptionFiles A list of description files to read from + * @property {string[]=} conditionNames A list of exports field condition names. + * @property {boolean=} enforceExtension Enforce that a extension from extensions must be used + * @property {(string | string[])[]=} exportsFields A list of exports fields in description files + * @property {(string | string[])[]=} importsFields A list of imports fields in description files + * @property {string[]=} extensions A list of extensions which should be tried for files + * @property {FileSystem} fileSystem The file system which should be used + * @property {(Cache | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests + * @property {boolean=} symlinks Resolve symlinks to their symlinked location + * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached + * @property {string[] | string=} modules A list of directories to resolve modules from, can be absolute path or folder name + * @property {(string | string[] | {name: string | string[], forceRelative: boolean})[]=} mainFields A list of main fields in description files + * @property {string[]=} mainFiles A list of main files in directories + * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied + * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" + * @property {string[]=} roots A list of root paths + * @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it + * @property {boolean=} resolveToContext Resolve to a context instead of a file + * @property {(string|RegExp)[]=} restrictions A list of resolve restrictions + * @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls + * @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules + * @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots + */ + +/** + * @typedef {object} ResolveOptions + * @property {AliasOptionEntry[]} alias alias + * @property {AliasOptionEntry[]} fallback fallback + * @property {Set} aliasFields alias fields + * @property {ExtensionAliasOption[]} extensionAlias extension alias + * @property {(predicate: ResolveRequest) => boolean} cachePredicate cache predicate + * @property {boolean} cacheWithContext cache with context + * @property {Set} conditionNames A list of exports field condition names. + * @property {string[]} descriptionFiles description files + * @property {boolean} enforceExtension enforce extension + * @property {Set} exportsFields exports fields + * @property {Set} importsFields imports fields + * @property {Set} extensions extensions + * @property {FileSystem} fileSystem fileSystem + * @property {Cache | false} unsafeCache unsafe cache + * @property {boolean} symlinks symlinks + * @property {Resolver=} resolver resolver + * @property {Array} modules modules + * @property {{ name: string[], forceRelative: boolean }[]} mainFields main fields + * @property {Set} mainFiles main files + * @property {Plugin[]} plugins plugins + * @property {PnpApi | null} pnpApi pnp API + * @property {Set} roots roots + * @property {boolean} fullySpecified fully specified + * @property {boolean} resolveToContext resolve to context + * @property {Set} restrictions restrictions + * @property {boolean} preferRelative prefer relative + * @property {boolean} preferAbsolute prefer absolute + */ + +/** + * @param {PnpApi | null=} option option + * @returns {PnpApi | null} processed option + */ +function processPnpApiOption(option) { + if ( + option === undefined && + /** @type {NodeJS.ProcessVersions & {pnp: string}} */ versions.pnp + ) { + const _findPnpApi = + /** @type {(issuer: string) => PnpApi | null}} */ + ( + // @ts-expect-error maybe nothing + require("module").findPnpApi + ); + + if (_findPnpApi) { + return { + resolveToUnqualified(request, issuer, opts) { + const pnpapi = _findPnpApi(issuer); + + if (!pnpapi) { + // Issuer isn't managed by PnP + return null; + } + + return pnpapi.resolveToUnqualified(request, issuer, opts); + }, + }; + } + } + + return option || null; +} + +/** + * @param {AliasOptions | AliasOptionEntry[] | undefined} alias alias + * @returns {AliasOptionEntry[]} normalized aliases + */ +function normalizeAlias(alias) { + return typeof alias === "object" && !Array.isArray(alias) && alias !== null + ? Object.keys(alias).map((key) => { + /** @type {AliasOptionEntry} */ + const obj = { name: key, onlyModule: false, alias: alias[key] }; + + if (/\$$/.test(key)) { + obj.onlyModule = true; + obj.name = key.slice(0, -1); + } + + return obj; + }) + : /** @type {Array} */ (alias) || []; +} + +/** + * Merging filtered elements + * @param {string[]} array source array + * @param {(item: string) => boolean} filter predicate + * @returns {Array} merge result + */ +function mergeFilteredToArray(array, filter) { + /** @type {Array} */ + const result = []; + const set = new Set(array); + + for (const item of set) { + if (filter(item)) { + const lastElement = + result.length > 0 ? result[result.length - 1] : undefined; + if (Array.isArray(lastElement)) { + lastElement.push(item); + } else { + result.push([item]); + } + } else { + result.push(item); + } + } + + return result; +} + +/** + * @param {UserResolveOptions} options input options + * @returns {ResolveOptions} output options + */ +function createOptions(options) { + const mainFieldsSet = new Set(options.mainFields || ["main"]); + /** @type {ResolveOptions["mainFields"]} */ + const mainFields = []; + + for (const item of mainFieldsSet) { + if (typeof item === "string") { + mainFields.push({ + name: [item], + forceRelative: true, + }); + } else if (Array.isArray(item)) { + mainFields.push({ + name: item, + forceRelative: true, + }); + } else { + mainFields.push({ + name: Array.isArray(item.name) ? item.name : [item.name], + forceRelative: item.forceRelative, + }); + } + } + + return { + alias: normalizeAlias(options.alias), + fallback: normalizeAlias(options.fallback), + aliasFields: new Set(options.aliasFields), + cachePredicate: + options.cachePredicate || + function trueFn() { + return true; + }, + cacheWithContext: + typeof options.cacheWithContext !== "undefined" + ? options.cacheWithContext + : true, + exportsFields: new Set(options.exportsFields || ["exports"]), + importsFields: new Set(options.importsFields || ["imports"]), + conditionNames: new Set(options.conditionNames), + descriptionFiles: [ + ...new Set(options.descriptionFiles || ["package.json"]), + ], + enforceExtension: + options.enforceExtension === undefined + ? Boolean(options.extensions && options.extensions.includes("")) + : options.enforceExtension, + extensions: new Set(options.extensions || [".js", ".json", ".node"]), + extensionAlias: options.extensionAlias + ? Object.keys(options.extensionAlias).map((k) => ({ + extension: k, + alias: /** @type {ExtensionAliasOptions} */ (options.extensionAlias)[ + k + ], + })) + : [], + fileSystem: options.useSyncFileSystemCalls + ? new SyncAsyncFileSystemDecorator( + /** @type {SyncFileSystem} */ ( + /** @type {unknown} */ (options.fileSystem) + ), + ) + : options.fileSystem, + unsafeCache: + options.unsafeCache && typeof options.unsafeCache !== "object" + ? /** @type {Cache} */ ({}) + : options.unsafeCache || false, + symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, + resolver: options.resolver, + modules: mergeFilteredToArray( + Array.isArray(options.modules) + ? options.modules + : options.modules + ? [options.modules] + : ["node_modules"], + (item) => { + const type = getType(item); + return type === PathType.Normal || type === PathType.Relative; + }, + ), + mainFields, + mainFiles: new Set(options.mainFiles || ["index"]), + plugins: options.plugins || [], + pnpApi: processPnpApiOption(options.pnpApi), + roots: new Set(options.roots || undefined), + fullySpecified: options.fullySpecified || false, + resolveToContext: options.resolveToContext || false, + preferRelative: options.preferRelative || false, + preferAbsolute: options.preferAbsolute || false, + restrictions: new Set(options.restrictions), + }; +} + +/** + * @param {UserResolveOptions} options resolve options + * @returns {Resolver} created resolver + */ +module.exports.createResolver = function createResolver(options) { + const normalizedOptions = createOptions(options); + + const { + alias, + fallback, + aliasFields, + cachePredicate, + cacheWithContext, + conditionNames, + descriptionFiles, + enforceExtension, + exportsFields, + extensionAlias, + importsFields, + extensions, + fileSystem, + fullySpecified, + mainFields, + mainFiles, + modules, + plugins: userPlugins, + pnpApi, + resolveToContext, + preferRelative, + preferAbsolute, + symlinks, + unsafeCache, + resolver: customResolver, + restrictions, + roots, + } = normalizedOptions; + + const plugins = [...userPlugins]; + + const resolver = + customResolver || new Resolver(fileSystem, normalizedOptions); + + // // pipeline //// + + resolver.ensureHook("resolve"); + resolver.ensureHook("internalResolve"); + resolver.ensureHook("newInternalResolve"); + resolver.ensureHook("parsedResolve"); + resolver.ensureHook("describedResolve"); + resolver.ensureHook("rawResolve"); + resolver.ensureHook("normalResolve"); + resolver.ensureHook("internal"); + resolver.ensureHook("rawModule"); + resolver.ensureHook("alternateRawModule"); + resolver.ensureHook("module"); + resolver.ensureHook("resolveAsModule"); + resolver.ensureHook("undescribedResolveInPackage"); + resolver.ensureHook("resolveInPackage"); + resolver.ensureHook("resolveInExistingDirectory"); + resolver.ensureHook("relative"); + resolver.ensureHook("describedRelative"); + resolver.ensureHook("directory"); + resolver.ensureHook("undescribedExistingDirectory"); + resolver.ensureHook("existingDirectory"); + resolver.ensureHook("undescribedRawFile"); + resolver.ensureHook("rawFile"); + resolver.ensureHook("file"); + resolver.ensureHook("finalFile"); + resolver.ensureHook("existingFile"); + resolver.ensureHook("resolved"); + + // TODO remove in next major + // cspell:word Interal + // Backward-compat + // @ts-expect-error + resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; + + // resolve + for (const { source, resolveOptions } of [ + { source: "resolve", resolveOptions: { fullySpecified } }, + { source: "internal-resolve", resolveOptions: { fullySpecified: false } }, + ]) { + if (unsafeCache) { + plugins.push( + new UnsafeCachePlugin( + source, + cachePredicate, + /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), + cacheWithContext, + `new-${source}`, + ), + ); + plugins.push( + new ParsePlugin(`new-${source}`, resolveOptions, "parsed-resolve"), + ); + } else { + plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); + } + } + + // parsed-resolve + plugins.push( + new DescriptionFilePlugin( + "parsed-resolve", + descriptionFiles, + false, + "described-resolve", + ), + ); + plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); + + // described-resolve + plugins.push(new NextPlugin("described-resolve", "raw-resolve")); + if (fallback.length > 0) { + plugins.push( + new AliasPlugin("described-resolve", fallback, "internal-resolve"), + ); + } + + // raw-resolve + if (alias.length > 0) { + plugins.push(new AliasPlugin("raw-resolve", alias, "internal-resolve")); + } + for (const item of aliasFields) { + plugins.push(new AliasFieldPlugin("raw-resolve", item, "internal-resolve")); + } + for (const item of extensionAlias) { + plugins.push( + new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve"), + ); + } + plugins.push(new NextPlugin("raw-resolve", "normal-resolve")); + + // normal-resolve + if (preferRelative) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + plugins.push( + new ConditionalPlugin( + "after-normal-resolve", + { module: true }, + "resolve as module", + false, + "raw-module", + ), + ); + plugins.push( + new ConditionalPlugin( + "after-normal-resolve", + { internal: true }, + "resolve as internal import", + false, + "internal", + ), + ); + if (preferAbsolute) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + if (roots.size > 0) { + plugins.push(new RootsPlugin("after-normal-resolve", roots, "relative")); + } + if (!preferRelative && !preferAbsolute) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + + // internal + for (const importsField of importsFields) { + plugins.push( + new ImportsFieldPlugin( + "internal", + conditionNames, + importsField, + "relative", + "internal-resolve", + ), + ); + } + + // raw-module + for (const exportsField of exportsFields) { + plugins.push( + new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module"), + ); + } + for (const item of modules) { + if (Array.isArray(item)) { + if (item.includes("node_modules") && pnpApi) { + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "raw-module", + item.filter((i) => i !== "node_modules"), + "module", + ), + ); + plugins.push( + new PnpPlugin( + "raw-module", + pnpApi, + "undescribed-resolve-in-package", + "alternate-raw-module", + ), + ); + + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "alternate-raw-module", + ["node_modules"], + "module", + ), + ); + } else { + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "raw-module", + item, + "module", + ), + ); + } + } else { + plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); + } + } + + // module + plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); + + // resolve-as-module + if (!resolveToContext) { + plugins.push( + new ConditionalPlugin( + "resolve-as-module", + { directory: false, request: "." }, + "single file module", + true, + "undescribed-raw-file", + ), + ); + } + plugins.push( + new DirectoryExistsPlugin( + "resolve-as-module", + "undescribed-resolve-in-package", + ), + ); + + // undescribed-resolve-in-package + plugins.push( + new DescriptionFilePlugin( + "undescribed-resolve-in-package", + descriptionFiles, + false, + "resolve-in-package", + ), + ); + plugins.push( + new NextPlugin( + "after-undescribed-resolve-in-package", + "resolve-in-package", + ), + ); + + // resolve-in-package + for (const exportsField of exportsFields) { + plugins.push( + new ExportsFieldPlugin( + "resolve-in-package", + conditionNames, + exportsField, + "relative", + ), + ); + } + plugins.push( + new NextPlugin("resolve-in-package", "resolve-in-existing-directory"), + ); + + // resolve-in-existing-directory + plugins.push( + new JoinRequestPlugin("resolve-in-existing-directory", "relative"), + ); + + // relative + plugins.push( + new DescriptionFilePlugin( + "relative", + descriptionFiles, + true, + "described-relative", + ), + ); + plugins.push(new NextPlugin("after-relative", "described-relative")); + + // described-relative + if (resolveToContext) { + plugins.push(new NextPlugin("described-relative", "directory")); + } else { + plugins.push( + new ConditionalPlugin( + "described-relative", + { directory: false }, + null, + true, + "raw-file", + ), + ); + plugins.push( + new ConditionalPlugin( + "described-relative", + { fullySpecified: false }, + "as directory", + true, + "directory", + ), + ); + } + + // directory + plugins.push( + new DirectoryExistsPlugin("directory", "undescribed-existing-directory"), + ); + + if (resolveToContext) { + // undescribed-existing-directory + plugins.push(new NextPlugin("undescribed-existing-directory", "resolved")); + } else { + // undescribed-existing-directory + plugins.push( + new DescriptionFilePlugin( + "undescribed-existing-directory", + descriptionFiles, + false, + "existing-directory", + ), + ); + for (const item of mainFiles) { + plugins.push( + new UseFilePlugin( + "undescribed-existing-directory", + item, + "undescribed-raw-file", + ), + ); + } + + // described-existing-directory + for (const item of mainFields) { + plugins.push( + new MainFieldPlugin( + "existing-directory", + item, + "resolve-in-existing-directory", + ), + ); + } + for (const item of mainFiles) { + plugins.push( + new UseFilePlugin("existing-directory", item, "undescribed-raw-file"), + ); + } + + // undescribed-raw-file + plugins.push( + new DescriptionFilePlugin( + "undescribed-raw-file", + descriptionFiles, + true, + "raw-file", + ), + ); + plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); + + // raw-file + plugins.push( + new ConditionalPlugin( + "raw-file", + { fullySpecified: true }, + null, + false, + "file", + ), + ); + if (!enforceExtension) { + plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); + } + for (const item of extensions) { + plugins.push(new AppendPlugin("raw-file", item, "file")); + } + + // file + if (alias.length > 0) { + plugins.push(new AliasPlugin("file", alias, "internal-resolve")); + } + for (const item of aliasFields) { + plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); + } + plugins.push(new NextPlugin("file", "final-file")); + + // final-file + plugins.push(new FileExistsPlugin("final-file", "existing-file")); + + // existing-file + if (symlinks) { + plugins.push(new SymlinkPlugin("existing-file", "existing-file")); + } + plugins.push(new NextPlugin("existing-file", "resolved")); + } + + const { resolved } = + /** @type {KnownHooks & EnsuredHooks} */ + (resolver.hooks); + + // resolved + if (restrictions.size > 0) { + plugins.push(new RestrictionsPlugin(resolved, restrictions)); + } + + plugins.push(new ResultPlugin(resolved)); + + // // RESOLVER //// + + for (const plugin of plugins) { + if (typeof plugin === "function") { + /** @type {(this: Resolver, resolver: Resolver) => void} */ + (plugin).call(resolver, resolver); + } else if (plugin) { + plugin.apply(resolver); + } + } + + return resolver; +}; diff --git a/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js b/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js new file mode 100644 index 0000000..6faaa26 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js @@ -0,0 +1,70 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const slashCode = "/".charCodeAt(0); +const backslashCode = "\\".charCodeAt(0); + +/** + * @param {string} path path + * @param {string} parent parent path + * @returns {boolean} true, if path is inside of parent + */ +const isInside = (path, parent) => { + if (!path.startsWith(parent)) return false; + if (path.length === parent.length) return true; + const charCode = path.charCodeAt(parent.length); + return charCode === slashCode || charCode === backslashCode; +}; + +module.exports = class RestrictionsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} restrictions restrictions + */ + constructor(source, restrictions) { + this.source = source; + this.restrictions = restrictions; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + resolver + .getHook(this.source) + .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { + if (typeof request.path === "string") { + const { path } = request; + for (const rule of this.restrictions) { + if (typeof rule === "string") { + if (!isInside(path, rule)) { + if (resolveContext.log) { + resolveContext.log( + `${path} is not inside of the restriction ${rule}`, + ); + } + return callback(null, null); + } + } else if (!rule.test(path)) { + if (resolveContext.log) { + resolveContext.log( + `${path} doesn't match the restriction ${rule}`, + ); + } + return callback(null, null); + } + } + } + + callback(); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/ResultPlugin.js b/node_modules/enhanced-resolve/lib/ResultPlugin.js new file mode 100644 index 0000000..57dbddd --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ResultPlugin.js @@ -0,0 +1,43 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ResultPlugin { + /** + * @param {ResolveStepHook} source source + */ + constructor(source) { + this.source = source; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + this.source.tapAsync( + "ResultPlugin", + (request, resolverContext, callback) => { + const obj = { ...request }; + if (resolverContext.log) { + resolverContext.log(`reporting result ${obj.path}`); + } + resolver.hooks.result.callAsync(obj, resolverContext, (err) => { + if (err) return callback(err); + if (typeof resolverContext.yield === "function") { + resolverContext.yield(obj); + callback(null, null); + } else { + callback(null, obj); + } + }); + }, + ); + } +}; diff --git a/node_modules/enhanced-resolve/lib/RootsPlugin.js b/node_modules/enhanced-resolve/lib/RootsPlugin.js new file mode 100644 index 0000000..ce5b314 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/RootsPlugin.js @@ -0,0 +1,69 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +class RootsPlugin { + /** + * @param {string | ResolveStepHook} source source hook + * @param {Set} roots roots + * @param {string | ResolveStepHook} target target hook + */ + constructor(source, roots, target) { + this.roots = [...roots]; + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + + resolver + .getHook(this.source) + .tapAsync("RootsPlugin", (request, resolveContext, callback) => { + const req = request.request; + if (!req) return callback(); + if (!req.startsWith("/")) return callback(); + + forEachBail( + this.roots, + /** + * @param {string} root root + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ + (root, callback) => { + const path = resolver.join(root, req.slice(1)); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path, + relativePath: request.relativePath && path, + }; + resolver.doResolve( + target, + obj, + `root path ${root}`, + resolveContext, + callback, + ); + }, + callback, + ); + }); + } +} + +module.exports = RootsPlugin; diff --git a/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js b/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js new file mode 100644 index 0000000..af8e5b2 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js @@ -0,0 +1,82 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const slashCode = "/".charCodeAt(0); + +module.exports = class SelfReferencePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + */ + constructor(source, fieldNamePath, target) { + this.source = source; + this.target = target; + this.fieldName = fieldNamePath; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("SelfReferencePlugin", (request, resolveContext, callback) => { + if (!request.descriptionFilePath) return callback(); + + const req = request.request; + if (!req) return callback(); + + // Feature is only enabled when an exports field is present + const exportsField = DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.fieldName, + ); + if (!exportsField) return callback(); + + const name = DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + "name", + ); + if (typeof name !== "string") return callback(); + + if ( + req.startsWith(name) && + (req.length === name.length || + req.charCodeAt(name.length) === slashCode) + ) { + const remainingRequest = `.${req.slice(name.length)}`; + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: remainingRequest, + path: /** @type {string} */ (request.descriptionFileRoot), + relativePath: ".", + }; + + resolver.doResolve( + target, + obj, + "self reference", + resolveContext, + callback, + ); + } else { + return callback(); + } + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/SymlinkPlugin.js b/node_modules/enhanced-resolve/lib/SymlinkPlugin.js new file mode 100644 index 0000000..939d40a --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SymlinkPlugin.js @@ -0,0 +1,101 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const getPaths = require("./getPaths"); +const { PathType, getType } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class SymlinkPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { + if (request.ignoreSymlinks) return callback(); + const pathsResult = getPaths(/** @type {string} */ (request.path)); + const pathSegments = pathsResult.segments; + const { paths } = pathsResult; + + let containsSymlink = false; + let idx = -1; + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null|Error, result?: null|number) => void} callback callback + * @returns {void} + */ + (path, callback) => { + idx++; + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(path); + } + fs.readlink(path, (err, result) => { + if (!err && result) { + pathSegments[idx] = /** @type {string} */ (result); + containsSymlink = true; + // Shortcut when absolute symlink found + const resultType = getType(result.toString()); + if ( + resultType === PathType.AbsoluteWin || + resultType === PathType.AbsolutePosix + ) { + return callback(null, idx); + } + } + callback(); + }); + }, + /** + * @param {(null | Error)=} err error + * @param {(null|number)=} idx result + * @returns {void} + */ + (err, idx) => { + if (!containsSymlink) return callback(); + const resultSegments = + typeof idx === "number" + ? pathSegments.slice(0, idx + 1) + : [...pathSegments]; + const result = resultSegments.reduceRight((a, b) => + resolver.join(a, b), + ); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: result, + }; + resolver.doResolve( + target, + obj, + `resolved symlink to ${result}`, + resolveContext, + callback, + ); + }, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js b/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js new file mode 100644 index 0000000..c850cda --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js @@ -0,0 +1,258 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").StringCallback} StringCallback */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ + +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {Function} SyncOrAsyncFunction */ +// eslint-disable-next-line jsdoc/no-restricted-syntax +/** @typedef {any} ResultOfSyncOrAsyncFunction */ + +/** + * @param {SyncFileSystem} fs file system implementation + * @constructor + */ +function SyncAsyncFileSystemDecorator(fs) { + this.fs = fs; + + this.lstat = undefined; + this.lstatSync = undefined; + const { lstatSync } = fs; + if (lstatSync) { + this.lstat = + /** @type {FileSystem["lstat"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? lstatSync.call(fs, arg, options) + : lstatSync.call(fs, arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.lstatSync = + /** @type {SyncFileSystem["lstatSync"]} */ + ((arg, options) => lstatSync.call(fs, arg, options)); + } + + this.stat = + /** @type {FileSystem["stat"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.statSync(arg, options) + : fs.statSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.statSync = + /** @type {SyncFileSystem["statSync"]} */ + ((arg, options) => fs.statSync(arg, options)); + + this.readdir = + /** @type {FileSystem["readdir"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readdirSync( + arg, + /** @type {Exclude[1], (err: NodeJS.ErrnoException | null, files: string[]) => void>} */ + (options), + ) + : fs.readdirSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + [], + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readdirSync = + /** @type {SyncFileSystem["readdirSync"]} */ + ( + (arg, options) => + fs.readdirSync( + arg, + /** @type {Parameters[1]} */ (options), + ) + ); + + this.readFile = + /** @type {FileSystem["readFile"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readFileSync(arg, options) + : fs.readFileSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readFileSync = + /** @type {SyncFileSystem["readFileSync"]} */ + ((arg, options) => fs.readFileSync(arg, options)); + + this.readlink = + /** @type {FileSystem["readlink"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readlinkSync( + arg, + /** @type {Exclude[1], StringCallback>} */ + (options), + ) + : fs.readlinkSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readlinkSync = + /** @type {SyncFileSystem["readlinkSync"]} */ + ( + (arg, options) => + fs.readlinkSync( + arg, + /** @type {Parameters[1]} */ ( + options + ), + ) + ); + + this.readJson = undefined; + this.readJsonSync = undefined; + const { readJsonSync } = fs; + if (readJsonSync) { + this.readJson = + /** @type {FileSystem["readJson"]} */ + ( + (arg, callback) => { + let result; + try { + result = readJsonSync.call(fs, arg); + } catch (err) { + return callback( + /** @type {NodeJS.ErrnoException | Error | null} */ (err), + ); + } + + callback(null, result); + } + ); + this.readJsonSync = + /** @type {SyncFileSystem["readJsonSync"]} */ + ((arg) => readJsonSync.call(fs, arg)); + } + + this.realpath = undefined; + this.realpathSync = undefined; + const { realpathSync } = fs; + if (realpathSync) { + this.realpath = + /** @type {FileSystem["realpath"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? realpathSync.call( + fs, + arg, + /** @type {Exclude>[1], StringCallback>} */ + (options), + ) + : realpathSync.call(fs, arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.realpathSync = + /** @type {SyncFileSystem["realpathSync"]} */ + ( + (arg, options) => + realpathSync.call( + fs, + arg, + /** @type {Parameters>[1]} */ + (options), + ) + ); + } +} + +module.exports = SyncAsyncFileSystemDecorator; diff --git a/node_modules/enhanced-resolve/lib/TryNextPlugin.js b/node_modules/enhanced-resolve/lib/TryNextPlugin.js new file mode 100644 index 0000000..4b46787 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/TryNextPlugin.js @@ -0,0 +1,41 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class TryNextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} message message + * @param {string | ResolveStepHook} target target + */ + constructor(source, message, target) { + this.source = source; + this.message = message; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { + resolver.doResolve( + target, + request, + this.message, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js new file mode 100644 index 0000000..56c6217 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js @@ -0,0 +1,114 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ +/** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */ + +/** + * @param {string} type type of cache + * @param {ResolveRequest} request request + * @param {boolean} withContext cache with context? + * @returns {string} cache id + */ +function getCacheId(type, request, withContext) { + return JSON.stringify({ + type, + context: withContext ? request.context : "", + path: request.path, + query: request.query, + fragment: request.fragment, + request: request.request, + }); +} + +module.exports = class UnsafeCachePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate + * @param {Cache} cache cache + * @param {boolean} withContext withContext + * @param {string | ResolveStepHook} target target + */ + constructor(source, filterPredicate, cache, withContext, target) { + this.source = source; + this.filterPredicate = filterPredicate; + this.withContext = withContext; + this.cache = cache; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { + if (!this.filterPredicate(request)) return callback(); + const isYield = typeof resolveContext.yield === "function"; + const cacheId = getCacheId( + isYield ? "yield" : "default", + request, + this.withContext, + ); + const cacheEntry = this.cache[cacheId]; + if (cacheEntry) { + if (isYield) { + const yield_ = + /** @type {ResolveContextYield} */ + (resolveContext.yield); + if (Array.isArray(cacheEntry)) { + for (const result of cacheEntry) yield_(result); + } else { + yield_(cacheEntry); + } + return callback(null, null); + } + return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); + } + + /** @type {ResolveContextYield | undefined} */ + let yieldFn; + /** @type {ResolveContextYield | undefined} */ + let yield_; + /** @type {ResolveRequest[]} */ + const yieldResult = []; + if (isYield) { + yieldFn = resolveContext.yield; + yield_ = (result) => { + yieldResult.push(result); + }; + } + + resolver.doResolve( + target, + request, + null, + yield_ ? { ...resolveContext, yield: yield_ } : resolveContext, + (err, result) => { + if (err) return callback(err); + if (isYield) { + if (result) yieldResult.push(result); + for (const result of yieldResult) { + /** @type {ResolveContextYield} */ + (yieldFn)(result); + } + this.cache[cacheId] = yieldResult; + return callback(null, null); + } + if (result) return callback(null, (this.cache[cacheId] = result)); + callback(); + }, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/UseFilePlugin.js b/node_modules/enhanced-resolve/lib/UseFilePlugin.js new file mode 100644 index 0000000..f81c27f --- /dev/null +++ b/node_modules/enhanced-resolve/lib/UseFilePlugin.js @@ -0,0 +1,55 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class UseFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} filename filename + * @param {string | ResolveStepHook} target target + */ + constructor(source, filename, target) { + this.source = source; + this.filename = filename; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { + const filePath = resolver.join( + /** @type {string} */ (request.path), + this.filename, + ); + + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, this.filename), + }; + resolver.doResolve( + target, + obj, + `using path: ${filePath}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/node_modules/enhanced-resolve/lib/createInnerContext.js b/node_modules/enhanced-resolve/lib/createInnerContext.js new file mode 100644 index 0000000..2ce53f5 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/createInnerContext.js @@ -0,0 +1,46 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ + +/** + * @param {ResolveContext} options options for inner context + * @param {null|string} message message to log + * @returns {ResolveContext} inner context + */ +module.exports = function createInnerContext(options, message) { + let messageReported = false; + let innerLog; + if (options.log) { + if (message) { + /** + * @param {string} msg message + */ + innerLog = (msg) => { + if (!messageReported) { + /** @type {((str: string) => void)} */ + (options.log)(message); + messageReported = true; + } + + /** @type {((str: string) => void)} */ + (options.log)(` ${msg}`); + }; + } else { + innerLog = options.log; + } + } + + return { + log: innerLog, + yield: options.yield, + fileDependencies: options.fileDependencies, + contextDependencies: options.contextDependencies, + missingDependencies: options.missingDependencies, + stack: options.stack, + }; +}; diff --git a/node_modules/enhanced-resolve/lib/forEachBail.js b/node_modules/enhanced-resolve/lib/forEachBail.js new file mode 100644 index 0000000..6dc4d1e --- /dev/null +++ b/node_modules/enhanced-resolve/lib/forEachBail.js @@ -0,0 +1,50 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @template T + * @template Z + * @callback Iterator + * @param {T} item item + * @param {(err?: null|Error, result?: null|Z) => void} callback callback + * @param {number} i index + * @returns {void} + */ + +/** + * @template T + * @template Z + * @param {T[]} array array + * @param {Iterator} iterator iterator + * @param {(err?: null|Error, result?: null|Z, i?: number) => void} callback callback after all items are iterated + * @returns {void} + */ +module.exports = function forEachBail(array, iterator, callback) { + if (array.length === 0) return callback(); + + let i = 0; + const next = () => { + /** @type {boolean|undefined} */ + let loop; + iterator( + array[i++], + (err, result) => { + if (err || result !== undefined || i >= array.length) { + return callback(err, result, i); + } + if (loop === false) while (next()); + loop = true; + }, + i, + ); + if (!loop) loop = false; + return loop; + }; + while (next()); +}; diff --git a/node_modules/enhanced-resolve/lib/getInnerRequest.js b/node_modules/enhanced-resolve/lib/getInnerRequest.js new file mode 100644 index 0000000..58b1474 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/getInnerRequest.js @@ -0,0 +1,39 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @param {Resolver} resolver resolver + * @param {ResolveRequest} request string + * @returns {string} inner request + */ +module.exports = function getInnerRequest(resolver, request) { + if ( + typeof request.__innerRequest === "string" && + request.__innerRequest_request === request.request && + request.__innerRequest_relativePath === request.relativePath + ) { + return request.__innerRequest; + } + /** @type {string|undefined} */ + let innerRequest; + if (request.request) { + innerRequest = request.request; + if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) { + innerRequest = resolver.join(request.relativePath, innerRequest); + } + } else { + innerRequest = request.relativePath; + } + // eslint-disable-next-line camelcase + request.__innerRequest_request = request.request; + // eslint-disable-next-line camelcase + request.__innerRequest_relativePath = request.relativePath; + return (request.__innerRequest = /** @type {string} */ (innerRequest)); +}; diff --git a/node_modules/enhanced-resolve/lib/getPaths.js b/node_modules/enhanced-resolve/lib/getPaths.js new file mode 100644 index 0000000..cf0c9ca --- /dev/null +++ b/node_modules/enhanced-resolve/lib/getPaths.js @@ -0,0 +1,45 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** + * @param {string} path path + * @returns {{paths: string[], segments: string[]}}} paths and segments + */ +module.exports = function getPaths(path) { + if (path === "/") return { paths: ["/"], segments: [""] }; + const parts = path.split(/(.*?[\\/]+)/); + const paths = [path]; + const segments = [parts[parts.length - 1]]; + let part = parts[parts.length - 1]; + path = path.slice(0, Math.max(0, path.length - part.length - 1)); + for (let i = parts.length - 2; i > 2; i -= 2) { + paths.push(path); + part = parts[i]; + path = path.slice(0, Math.max(0, path.length - part.length)) || "/"; + segments.push(part.slice(0, -1)); + } + [, part] = parts; + segments.push(part); + paths.push(part); + return { + paths, + segments, + }; +}; + +/** + * @param {string} path path + * @returns {string|null} basename or null + */ +module.exports.basename = function basename(path) { + const i = path.lastIndexOf("/"); + const j = path.lastIndexOf("\\"); + const resolvedPath = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if (resolvedPath < 0) return null; + const basename = path.slice(resolvedPath + 1); + return basename; +}; diff --git a/node_modules/enhanced-resolve/lib/index.js b/node_modules/enhanced-resolve/lib/index.js new file mode 100644 index 0000000..9b10143 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/index.js @@ -0,0 +1,225 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const memoize = require("./util/memoize"); + +/** @typedef {import("./CachedInputFileSystem").BaseFileSystem} BaseFileSystem */ +/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {import("./ResolverFactory").Plugin} Plugin */ +/** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ + +/** + * @typedef {{ + * (context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; + * (context: object, path: string, request: string, callback: ResolveCallback): void; + * (path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; + * (path: string, request: string, callback: ResolveCallback): void; + * }} ResolveFunctionAsync + */ + +/** + * @typedef {{ + * (context: object, path: string, request: string): string | false; + * (path: string, request: string): string | false; + * }} ResolveFunction + */ + +const getCachedFileSystem = memoize(() => require("./CachedInputFileSystem")); + +const getNodeFileSystem = memoize(() => { + const fs = require("graceful-fs"); + + const CachedInputFileSystem = getCachedFileSystem(); + + return new CachedInputFileSystem(fs, 4000); +}); +const getNodeContext = memoize(() => ({ + environments: ["node+es3+es5+process+native"], +})); + +const getResolverFactory = memoize(() => require("./ResolverFactory")); + +const getAsyncResolver = memoize(() => + getResolverFactory().createResolver({ + conditionNames: ["node"], + extensions: [".js", ".json", ".node"], + fileSystem: getNodeFileSystem(), + }), +); + +/** + * @type {ResolveFunctionAsync} + */ +const resolve = + /** + * @param {object | string} context context + * @param {string} path path + * @param {string | ResolveContext | ResolveCallback} request request + * @param {ResolveContext | ResolveCallback=} resolveContext resolve context + * @param {ResolveCallback=} callback callback + */ + (context, path, request, resolveContext, callback) => { + if (typeof context === "string") { + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (request); + request = path; + path = context; + context = getNodeContext(); + } + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback} */ (resolveContext); + } + getAsyncResolver().resolve( + context, + path, + /** @type {string} */ (request), + /** @type {ResolveContext} */ (resolveContext), + /** @type {ResolveCallback} */ (callback), + ); + }; + +const getSyncResolver = memoize(() => + getResolverFactory().createResolver({ + conditionNames: ["node"], + extensions: [".js", ".json", ".node"], + useSyncFileSystemCalls: true, + fileSystem: getNodeFileSystem(), + }), +); + +/** + * @type {ResolveFunction} + */ +const resolveSync = + /** + * @param {object|string} context context + * @param {string} path path + * @param {string=} request request + * @returns {string | false} result + */ + (context, path, request) => { + if (typeof context === "string") { + request = path; + path = context; + context = getNodeContext(); + } + return getSyncResolver().resolveSync( + context, + path, + /** @type {string} */ (request), + ); + }; + +/** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionAsync} Resolver function + */ +function create(options) { + const resolver = getResolverFactory().createResolver({ + fileSystem: getNodeFileSystem(), + ...options, + }); + /** + * @param {object|string} context Custom context + * @param {string} path Base path + * @param {string|ResolveContext|ResolveCallback} request String to resolve + * @param {ResolveContext|ResolveCallback=} resolveContext Resolve context + * @param {ResolveCallback=} callback Result callback + */ + return function create(context, path, request, resolveContext, callback) { + if (typeof context === "string") { + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (request); + request = path; + path = context; + context = getNodeContext(); + } + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback} */ (resolveContext); + } + resolver.resolve( + context, + path, + /** @type {string} */ (request), + /** @type {ResolveContext} */ (resolveContext), + callback, + ); + }; +} + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunction} Resolver function + */ +function createSync(options) { + const resolver = getResolverFactory().createResolver({ + useSyncFileSystemCalls: true, + fileSystem: getNodeFileSystem(), + ...options, + }); + /** + * @param {object | string} context custom context + * @param {string} path base path + * @param {string=} request request to resolve + * @returns {string | false} Resolved path or false + */ + return function createSync(context, path, request) { + if (typeof context === "string") { + request = path; + path = context; + context = getNodeContext(); + } + return resolver.resolveSync(context, path, /** @type {string} */ (request)); + }; +} + +/** + * @template A + * @template B + * @param {A} obj input a + * @param {B} exports input b + * @returns {A & B} merged + */ +const mergeExports = (obj, exports) => { + const descriptors = Object.getOwnPropertyDescriptors(exports); + Object.defineProperties(obj, descriptors); + return /** @type {A & B} */ (Object.freeze(obj)); +}; + +module.exports = mergeExports(resolve, { + get sync() { + return resolveSync; + }, + create: mergeExports(create, { + get sync() { + return createSync; + }, + }), + get ResolverFactory() { + return getResolverFactory(); + }, + get CachedInputFileSystem() { + return getCachedFileSystem(); + }, + get CloneBasenamePlugin() { + return require("./CloneBasenamePlugin"); + }, + get LogInfoPlugin() { + return require("./LogInfoPlugin"); + }, + get forEachBail() { + return require("./forEachBail"); + }, +}); diff --git a/node_modules/enhanced-resolve/lib/util/entrypoints.js b/node_modules/enhanced-resolve/lib/util/entrypoints.js new file mode 100644 index 0000000..6a560b2 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/entrypoints.js @@ -0,0 +1,573 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const { parseIdentifier } = require("./identifier"); + +/** @typedef {string|(string|ConditionalMapping)[]} DirectMapping */ +/** @typedef {{[k: string]: MappingValue}} ConditionalMapping */ +/** @typedef {ConditionalMapping|DirectMapping|null} MappingValue */ +/** @typedef {Record|ConditionalMapping|DirectMapping} ExportsField */ +/** @typedef {Record} ImportsField */ + +/** + * Processing exports/imports field + * @callback FieldProcessor + * @param {string} request request + * @param {Set} conditionNames condition names + * @returns {[string[], string | null]} resolved paths with used field + */ + +/* +Example exports field: +{ + ".": "./main.js", + "./feature": { + "browser": "./feature-browser.js", + "default": "./feature.js" + } +} +Terminology: + +Enhanced-resolve name keys ("." and "./feature") as exports field keys. + +If value is string or string[], mapping is called as a direct mapping +and value called as a direct export. + +If value is key-value object, mapping is called as a conditional mapping +and value called as a conditional export. + +Key in conditional mapping is called condition name. + +Conditional mapping nested in another conditional mapping is called nested mapping. + +---------- + +Example imports field: +{ + "#a": "./main.js", + "#moment": { + "browser": "./moment/index.js", + "default": "moment" + }, + "#moment/": { + "browser": "./moment/", + "default": "moment/" + } +} +Terminology: + +Enhanced-resolve name keys ("#a" and "#moment/", "#moment") as imports field keys. + +If value is string or string[], mapping is called as a direct mapping +and value called as a direct export. + +If value is key-value object, mapping is called as a conditional mapping +and value called as a conditional export. + +Key in conditional mapping is called condition name. + +Conditional mapping nested in another conditional mapping is called nested mapping. + +*/ + +const slashCode = "/".charCodeAt(0); +const dotCode = ".".charCodeAt(0); +const hashCode = "#".charCodeAt(0); +const patternRegEx = /\*/g; + +/** + * @param {string} a first string + * @param {string} b second string + * @returns {number} compare result + */ +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + + return 0; +} + +/** + * Trying to match request to field + * @param {string} request request + * @param {ExportsField | ImportsField} field exports or import field + * @returns {[MappingValue, string, boolean, boolean, string]|null} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings + */ +function findMatch(request, field) { + if ( + Object.prototype.hasOwnProperty.call(field, request) && + !request.includes("*") && + !request.endsWith("/") + ) { + const target = /** @type {{[k: string]: MappingValue}} */ (field)[request]; + + return [target, "", false, false, request]; + } + + /** @type {string} */ + let bestMatch = ""; + /** @type {string|undefined} */ + let bestMatchSubpath; + + const keys = Object.getOwnPropertyNames(field); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = key.indexOf("*"); + + if (patternIndex !== -1 && request.startsWith(key.slice(0, patternIndex))) { + const patternTrailer = key.slice(patternIndex + 1); + + if ( + request.length >= key.length && + request.endsWith(patternTrailer) && + patternKeyCompare(bestMatch, key) === 1 && + key.lastIndexOf("*") === patternIndex + ) { + bestMatch = key; + bestMatchSubpath = request.slice( + patternIndex, + request.length - patternTrailer.length, + ); + } + } + // For legacy `./foo/` + else if ( + key[key.length - 1] === "/" && + request.startsWith(key) && + patternKeyCompare(bestMatch, key) === 1 + ) { + bestMatch = key; + bestMatchSubpath = request.slice(key.length); + } + } + + if (bestMatch === "") return null; + + const target = /** @type {{[k: string]: MappingValue}} */ (field)[bestMatch]; + const isSubpathMapping = bestMatch.endsWith("/"); + const isPattern = bestMatch.includes("*"); + + return [ + target, + /** @type {string} */ (bestMatchSubpath), + isSubpathMapping, + isPattern, + bestMatch, + ]; +} + +/** + * @param {ConditionalMapping | DirectMapping|null} mapping mapping + * @returns {boolean} is conditional mapping + */ +function isConditionalMapping(mapping) { + return ( + mapping !== null && typeof mapping === "object" && !Array.isArray(mapping) + ); +} + +/** + * @param {ConditionalMapping} conditionalMapping_ conditional mapping + * @param {Set} conditionNames condition names + * @returns {DirectMapping | null} direct mapping if found + */ +function conditionalMapping(conditionalMapping_, conditionNames) { + /** @type {[ConditionalMapping, string[], number][]} */ + const lookup = [[conditionalMapping_, Object.keys(conditionalMapping_), 0]]; + + loop: while (lookup.length > 0) { + const [mapping, conditions, j] = lookup[lookup.length - 1]; + + for (let i = j; i < conditions.length; i++) { + const condition = conditions[i]; + + if (condition === "default") { + const innerMapping = mapping[condition]; + // is nested + if (isConditionalMapping(innerMapping)) { + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); + lookup[lookup.length - 1][2] = i + 1; + lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); + continue loop; + } + + return /** @type {DirectMapping} */ (innerMapping); + } + + if (conditionNames.has(condition)) { + const innerMapping = mapping[condition]; + // is nested + if (isConditionalMapping(innerMapping)) { + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); + lookup[lookup.length - 1][2] = i + 1; + lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); + continue loop; + } + + return /** @type {DirectMapping} */ (innerMapping); + } + } + + lookup.pop(); + } + + return null; +} + +/** + * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings + * @param {string} mappingTarget direct export + * @param {(d: string, f: boolean) => void} assert asserting direct value + * @returns {string} mapping result + */ +function targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert, +) { + if (remainingRequest === undefined) { + assert(mappingTarget, false); + + return mappingTarget; + } + + if (isSubpathMapping) { + assert(mappingTarget, true); + + return mappingTarget + remainingRequest; + } + + assert(mappingTarget, false); + + let result = mappingTarget; + + if (isPattern) { + result = result.replace( + patternRegEx, + remainingRequest.replace(/\$/g, "$$"), + ); + } + + return result; +} + +/** + * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings + * @param {DirectMapping|null} mappingTarget direct export + * @param {Set} conditionNames condition names + * @param {(d: string, f: boolean) => void} assert asserting direct value + * @returns {string[]} mapping result + */ +function directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + conditionNames, + assert, +) { + if (mappingTarget === null) return []; + + if (typeof mappingTarget === "string") { + return [ + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert, + ), + ]; + } + + /** @type {string[]} */ + const targets = []; + + for (const exp of mappingTarget) { + if (typeof exp === "string") { + targets.push( + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + exp, + assert, + ), + ); + continue; + } + + const mapping = conditionalMapping(exp, conditionNames); + if (!mapping) continue; + const innerExports = directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mapping, + conditionNames, + assert, + ); + for (const innerExport of innerExports) { + targets.push(innerExport); + } + } + + return targets; +} + +/** + * @param {ExportsField | ImportsField} field root + * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` + * @param {(s: string) => string} assertRequest assertRequest + * @param {(s: string, f: boolean) => void} assertTarget assertTarget + * @returns {FieldProcessor} field processor + */ +function createFieldProcessor( + field, + normalizeRequest, + assertRequest, + assertTarget, +) { + return function fieldProcessor(request, conditionNames) { + request = assertRequest(request); + + const match = findMatch(normalizeRequest(request), field); + + if (match === null) return [[], null]; + + const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] = + match; + + /** @type {DirectMapping | null} */ + let direct = null; + + if (isConditionalMapping(mapping)) { + direct = conditionalMapping( + /** @type {ConditionalMapping} */ (mapping), + conditionNames, + ); + + // matching not found + if (direct === null) return [[], null]; + } else { + direct = /** @type {DirectMapping} */ (mapping); + } + + return [ + directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + direct, + conditionNames, + assertTarget, + ), + usedField, + ]; + }; +} + +/** + * @param {string} request request + * @returns {string} updated request + */ +function assertExportsFieldRequest(request) { + if (request.charCodeAt(0) !== dotCode) { + throw new Error('Request should be relative path and start with "."'); + } + if (request.length === 1) return ""; + if (request.charCodeAt(1) !== slashCode) { + throw new Error('Request should be relative path and start with "./"'); + } + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); + } + + return request.slice(2); +} + +/** + * @param {ExportsField} field exports field + * @returns {ExportsField} normalized exports field + */ +function buildExportsField(field) { + // handle syntax sugar, if exports field is direct mapping for "." + if (typeof field === "string" || Array.isArray(field)) { + return { ".": field }; + } + + const keys = Object.keys(field); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + + if (key.charCodeAt(0) !== dotCode) { + // handle syntax sugar, if exports field is conditional mapping for "." + if (i === 0) { + while (i < keys.length) { + const charCode = keys[i].charCodeAt(0); + if (charCode === dotCode || charCode === slashCode) { + throw new Error( + `Exports field key should be relative path and start with "." (key: ${JSON.stringify( + key, + )})`, + ); + } + i++; + } + + return { ".": field }; + } + + throw new Error( + `Exports field key should be relative path and start with "." (key: ${JSON.stringify( + key, + )})`, + ); + } + + if (key.length === 1) { + continue; + } + + if (key.charCodeAt(1) !== slashCode) { + throw new Error( + `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( + key, + )})`, + ); + } + } + + return field; +} + +/** + * @param {string} exp export target + * @param {boolean} expectFolder is folder expected + */ +function assertExportTarget(exp, expectFolder) { + const parsedIdentifier = parseIdentifier(exp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + exp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + exp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ExportsField} exportsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processExportsField = function processExportsField( + exportsField, +) { + return createFieldProcessor( + buildExportsField(exportsField), + (request) => (request.length === 0 ? "." : `./${request}`), + assertExportsFieldRequest, + assertExportTarget, + ); +}; + +/** + * @param {string} request request + * @returns {string} updated request + */ +function assertImportsFieldRequest(request) { + if (request.charCodeAt(0) !== hashCode) { + throw new Error('Request should start with "#"'); + } + if (request.length === 1) { + throw new Error("Request should have at least 2 characters"); + } + // Note: #/ patterns are now allowed per Node.js PR #60864 + // https://github.com/nodejs/node/pull/60864 + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); + } + + return request.slice(1); +} + +/** + * @param {string} imp import target + * @param {boolean} expectFolder is folder expected + */ +function assertImportTarget(imp, expectFolder) { + const parsedIdentifier = parseIdentifier(imp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + imp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + imp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ImportsField} importsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processImportsField = function processImportsField( + importsField, +) { + return createFieldProcessor( + importsField, + (request) => `#${request}`, + assertImportsFieldRequest, + assertImportTarget, + ); +}; diff --git a/node_modules/enhanced-resolve/lib/util/identifier.js b/node_modules/enhanced-resolve/lib/util/identifier.js new file mode 100644 index 0000000..46a1255 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/identifier.js @@ -0,0 +1,77 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const memorize = require("./memoize"); + +const getUrl = memorize(() => require("url")); + +const PATH_QUERY_FRAGMENT_REGEXP = + /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; +const ZERO_ESCAPE_REGEXP = /\0(.)/g; +const FILE_REG_EXP = /file:/i; + +/** + * @param {string} identifier identifier + * @returns {[string, string, string] | null} parsed identifier + */ +function parseIdentifier(identifier) { + if (!identifier) { + return null; + } + + if (FILE_REG_EXP.test(identifier)) { + identifier = getUrl().fileURLToPath(identifier); + } + + const firstEscape = identifier.indexOf("\0"); + + // Handle `\0` + if (firstEscape !== -1) { + const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier); + + if (!match) return null; + + return [ + match[1].replace(ZERO_ESCAPE_REGEXP, "$1"), + match[2] ? match[2].replace(ZERO_ESCAPE_REGEXP, "$1") : "", + match[3] || "", + ]; + } + + // Fast path for inputs that don't use \0 escaping. + const queryStart = identifier.indexOf("?"); + // Start at index 1 to ignore a possible leading hash. + const fragmentStart = identifier.indexOf("#", 1); + + if (fragmentStart < 0) { + if (queryStart < 0) { + // No fragment, no query + return [identifier, "", ""]; + } + + // Query, no fragment + return [identifier.slice(0, queryStart), identifier.slice(queryStart), ""]; + } + + if (queryStart < 0 || fragmentStart < queryStart) { + // Fragment, no query + return [ + identifier.slice(0, fragmentStart), + "", + identifier.slice(fragmentStart), + ]; + } + + // Query and fragment + return [ + identifier.slice(0, queryStart), + identifier.slice(queryStart, fragmentStart), + identifier.slice(fragmentStart), + ]; +} + +module.exports.parseIdentifier = parseIdentifier; diff --git a/node_modules/enhanced-resolve/lib/util/memoize.js b/node_modules/enhanced-resolve/lib/util/memoize.js new file mode 100644 index 0000000..b46e252 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/memoize.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** + * @template T + * @typedef {() => T} FunctionReturning + */ + +/** + * @template T + * @param {FunctionReturning} fn memorized function + * @returns {FunctionReturning} new function + */ +const memoize = (fn) => { + let cache = false; + /** @type {T | undefined} */ + let result; + return () => { + if (cache) { + return /** @type {T} */ (result); + } + + result = fn(); + cache = true; + // Allow to clean up memory for fn + // and all dependent resources + /** @type {FunctionReturning | undefined} */ + (fn) = undefined; + return /** @type {T} */ (result); + }; +}; + +module.exports = memoize; diff --git a/node_modules/enhanced-resolve/lib/util/module-browser.js b/node_modules/enhanced-resolve/lib/util/module-browser.js new file mode 100644 index 0000000..1258c22 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/module-browser.js @@ -0,0 +1,8 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +module.exports = {}; diff --git a/node_modules/enhanced-resolve/lib/util/path.js b/node_modules/enhanced-resolve/lib/util/path.js new file mode 100644 index 0000000..af34046 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/path.js @@ -0,0 +1,203 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const path = require("path"); + +const CHAR_HASH = "#".charCodeAt(0); +const CHAR_SLASH = "/".charCodeAt(0); +const CHAR_BACKSLASH = "\\".charCodeAt(0); +const CHAR_A = "A".charCodeAt(0); +const CHAR_Z = "Z".charCodeAt(0); +const CHAR_LOWER_A = "a".charCodeAt(0); +const CHAR_LOWER_Z = "z".charCodeAt(0); +const CHAR_DOT = ".".charCodeAt(0); +const CHAR_COLON = ":".charCodeAt(0); + +const posixNormalize = path.posix.normalize; +const winNormalize = path.win32.normalize; + +/** + * @enum {number} + */ +const PathType = Object.freeze({ + Empty: 0, + Normal: 1, + Relative: 2, + AbsoluteWin: 3, + AbsolutePosix: 4, + Internal: 5, +}); + +const deprecatedInvalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; + +const invalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; + +/** + * @param {string} maybePath a path + * @returns {PathType} type of path + */ +const getType = (maybePath) => { + switch (maybePath.length) { + case 0: + return PathType.Empty; + case 1: { + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: + return PathType.Relative; + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + return PathType.Normal; + } + case 2: { + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: { + const c1 = maybePath.charCodeAt(1); + switch (c1) { + case CHAR_DOT: + case CHAR_SLASH: + return PathType.Relative; + } + return PathType.Normal; + } + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + const c1 = maybePath.charCodeAt(1); + if ( + c1 === CHAR_COLON && + ((c0 >= CHAR_A && c0 <= CHAR_Z) || + (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) + ) { + return PathType.AbsoluteWin; + } + return PathType.Normal; + } + } + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: { + const c1 = maybePath.charCodeAt(1); + switch (c1) { + case CHAR_SLASH: + return PathType.Relative; + case CHAR_DOT: { + const c2 = maybePath.charCodeAt(2); + if (c2 === CHAR_SLASH) return PathType.Relative; + return PathType.Normal; + } + } + return PathType.Normal; + } + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + const c1 = maybePath.charCodeAt(1); + if (c1 === CHAR_COLON) { + const c2 = maybePath.charCodeAt(2); + if ( + (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && + ((c0 >= CHAR_A && c0 <= CHAR_Z) || + (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) + ) { + return PathType.AbsoluteWin; + } + } + return PathType.Normal; +}; + +/** + * @param {string} maybePath a path + * @returns {string} the normalized path + */ +const normalize = (maybePath) => { + switch (getType(maybePath)) { + case PathType.Empty: + return maybePath; + case PathType.AbsoluteWin: + return winNormalize(maybePath); + case PathType.Relative: { + const r = posixNormalize(maybePath); + return getType(r) === PathType.Relative ? r : `./${r}`; + } + } + return posixNormalize(maybePath); +}; + +/** + * @param {string} rootPath the root path + * @param {string | undefined} request the request path + * @returns {string} the joined path + */ +const join = (rootPath, request) => { + if (!request) return normalize(rootPath); + const requestType = getType(request); + switch (requestType) { + case PathType.AbsolutePosix: + return posixNormalize(request); + case PathType.AbsoluteWin: + return winNormalize(request); + } + switch (getType(rootPath)) { + case PathType.Normal: + case PathType.Relative: + case PathType.AbsolutePosix: + return posixNormalize(`${rootPath}/${request}`); + case PathType.AbsoluteWin: + return winNormalize(`${rootPath}\\${request}`); + } + switch (requestType) { + case PathType.Empty: + return rootPath; + case PathType.Relative: { + const r = posixNormalize(rootPath); + return getType(r) === PathType.Relative ? r : `./${r}`; + } + } + return posixNormalize(rootPath); +}; + +/** @type {Map>} */ +const joinCache = new Map(); + +/** + * @param {string} rootPath the root path + * @param {string} request the request path + * @returns {string} the joined path + */ +const cachedJoin = (rootPath, request) => { + /** @type {string | undefined} */ + let cacheEntry; + let cache = joinCache.get(rootPath); + if (cache === undefined) { + joinCache.set(rootPath, (cache = new Map())); + } else { + cacheEntry = cache.get(request); + if (cacheEntry !== undefined) return cacheEntry; + } + cacheEntry = join(rootPath, request); + cache.set(request, cacheEntry); + return cacheEntry; +}; + +module.exports.PathType = PathType; +module.exports.cachedJoin = cachedJoin; +module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx; +module.exports.getType = getType; +module.exports.invalidSegmentRegEx = invalidSegmentRegEx; +module.exports.join = join; +module.exports.normalize = normalize; diff --git a/node_modules/enhanced-resolve/lib/util/process-browser.js b/node_modules/enhanced-resolve/lib/util/process-browser.js new file mode 100644 index 0000000..694334c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/util/process-browser.js @@ -0,0 +1,25 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +module.exports = { + /** + * @type {Record} + */ + versions: {}, + // eslint-disable-next-line jsdoc/no-restricted-syntax + /** + * @param {Function} fn function + */ + nextTick(fn) { + // eslint-disable-next-line prefer-rest-params + const args = Array.prototype.slice.call(arguments, 1); + Promise.resolve().then(() => { + // eslint-disable-next-line prefer-spread + fn.apply(null, args); + }); + }, +}; diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/LICENSE b/node_modules/enhanced-resolve/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..e906a25 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/README.md b/node_modules/enhanced-resolve/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..82d6e4d --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/README.md @@ -0,0 +1,143 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFile('some-file-or-whatever', (err, data) => { + // Do stuff here. +}) +``` + +## Sync methods + +This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync +methods. If you use sync methods which open file descriptors then you are +responsible for dealing with any errors. + +This is a known limitation, not a bug. + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/clone.js b/node_modules/enhanced-resolve/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..dff3cc8 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/clone.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js b/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..8d5b89e --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,448 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/legacy-streams.js b/node_modules/enhanced-resolve/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/package.json b/node_modules/enhanced-resolve/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..87babf0 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/package.json @@ -0,0 +1,53 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^16.3.4" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "tap": { + "reporter": "classic" + } +} diff --git a/node_modules/enhanced-resolve/node_modules/graceful-fs/polyfills.js b/node_modules/enhanced-resolve/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..453f1a9 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,355 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/node_modules/enhanced-resolve/node_modules/tapable/LICENSE b/node_modules/enhanced-resolve/node_modules/tapable/LICENSE new file mode 100644 index 0000000..03c083c --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/enhanced-resolve/node_modules/tapable/README.md b/node_modules/enhanced-resolve/node_modules/tapable/README.md new file mode 100644 index 0000000..53fd476 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/README.md @@ -0,0 +1,332 @@ +# Tapable + +The tapable package exposes many Hook classes, which can be used to create hooks for plugins. + +```javascript +const { + AsyncParallelBailHook, + AsyncParallelHook, + AsyncSeriesBailHook, + AsyncSeriesHook, + AsyncSeriesWaterfallHook, + SyncBailHook, + SyncHook, + SyncLoopHook, + SyncWaterfallHook +} = require("tapable"); +``` + +## Installation + +```shell +npm install --save tapable +``` + +## Usage + +All Hook constructors take one optional argument, which is a list of argument names as strings. + +```js +const hook = new SyncHook(["arg1", "arg2", "arg3"]); +``` + +The best practice is to expose all hooks of a class in a `hooks` property: + +```js +class Car { + constructor() { + this.hooks = { + accelerate: new SyncHook(["newSpeed"]), + brake: new SyncHook(), + calculateRoutes: new AsyncParallelHook(["source", "target", "routesList"]) + }; + } + + /* ... */ +} +``` + +Other people can now use these hooks: + +```js +const myCar = new Car(); + +// Use the tap method to add a consument +myCar.hooks.brake.tap("WarningLampPlugin", () => warningLamp.on()); +``` + +It's required to pass a name to identify the plugin/reason. + +You may receive arguments: + +```js +myCar.hooks.accelerate.tap("LoggerPlugin", (newSpeed) => + console.log(`Accelerating to ${newSpeed}`) +); +``` + +For sync hooks, `tap` is the only valid method to add a plugin. Async hooks also support async plugins: + +```js +myCar.hooks.calculateRoutes.tapPromise( + "GoogleMapsPlugin", + (source, target, routesList) => + // return a promise + google.maps.findRoute(source, target).then((route) => { + routesList.add(route); + }) +); +myCar.hooks.calculateRoutes.tapAsync( + "BingMapsPlugin", + (source, target, routesList, callback) => { + bing.findRoute(source, target, (err, route) => { + if (err) return callback(err); + routesList.add(route); + // call the callback + callback(); + }); + } +); + +// You can still use sync plugins +myCar.hooks.calculateRoutes.tap( + "CachedRoutesPlugin", + (source, target, routesList) => { + const cachedRoute = cache.get(source, target); + if (cachedRoute) routesList.add(cachedRoute); + } +); +``` + +The class declaring these hooks needs to call them: + +```js +class Car { + /** + * You won't get returned value from SyncHook or AsyncParallelHook, + * to do that, use SyncWaterfallHook and AsyncSeriesWaterfallHook respectively + */ + + setSpeed(newSpeed) { + // following call returns undefined even when you returned values + this.hooks.accelerate.call(newSpeed); + } + + useNavigationSystemPromise(source, target) { + const routesList = new List(); + return this.hooks.calculateRoutes + .promise(source, target, routesList) + .then((res) => + // res is undefined for AsyncParallelHook + routesList.getRoutes() + ); + } + + useNavigationSystemAsync(source, target, callback) { + const routesList = new List(); + this.hooks.calculateRoutes.callAsync(source, target, routesList, (err) => { + if (err) return callback(err); + callback(null, routesList.getRoutes()); + }); + } +} +``` + +The Hook will compile a method with the most efficient way of running your plugins. It generates code depending on: + +- The number of registered plugins (none, one, many) +- The kind of registered plugins (sync, async, promise) +- The used call method (sync, async, promise) +- The number of arguments +- Whether interception is used + +This ensures fastest possible execution. + +## Hook types + +Each hook can be tapped with one or several functions. How they are executed depends on the hook type: + +- Basic hook (without “Waterfall”, “Bail” or “Loop” in its name). This hook simply calls every function it tapped in a row. + +- **Waterfall**. A waterfall hook also calls each tapped function in a row. Unlike the basic hook, it passes a return value from each function to the next function. + +- **Bail**. A bail hook allows exiting early. When any of the tapped function returns anything, the bail hook will stop executing the remaining ones. + +- **Loop**. When a plugin in a loop hook returns a non-undefined value the hook will restart from the first plugin. It will loop until all plugins return undefined. + +Additionally, hooks can be synchronous or asynchronous. To reflect this, there’re “Sync”, “AsyncSeries”, and “AsyncParallel” hook classes: + +- **Sync**. A sync hook can only be tapped with synchronous functions (using `myHook.tap()`). + +- **AsyncSeries**. An async-series hook can be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). They call each async method in a row. + +- **AsyncParallel**. An async-parallel hook can also be tapped with synchronous, callback-based and promise-based functions (using `myHook.tap()`, `myHook.tapAsync()` and `myHook.tapPromise()`). However, they run each async method in parallel. + +The hook type is reflected in its class name. E.g., `AsyncSeriesWaterfallHook` allows asynchronous functions and runs them in series, passing each function’s return value into the next function. + +## Interception + +All Hooks offer an additional interception API: + +```js +myCar.hooks.calculateRoutes.intercept({ + call: (source, target, routesList) => { + console.log("Starting to calculate routes"); + }, + register: (tapInfo) => { + // tapInfo = { type: "promise", name: "GoogleMapsPlugin", fn: ... } + console.log(`${tapInfo.name} is doing its job`); + return tapInfo; // may return a new tapInfo object + } +}); +``` + +**call**: `(...args) => void` Adding `call` to your interceptor will trigger when hooks are triggered. You have access to the hooks arguments. + +**tap**: `(tap: Tap) => void` Adding `tap` to your interceptor will trigger when a plugin taps into a hook. Provided is the `Tap` object. `Tap` object can't be changed. + +**loop**: `(...args) => void` Adding `loop` to your interceptor will trigger for each loop of a looping hook. + +**register**: `(tap: Tap) => Tap | undefined` Adding `register` to your interceptor will trigger for each added `Tap` and allows to modify it. + +## Context + +Plugins and interceptors can opt-in to access an optional `context` object, which can be used to pass arbitrary values to subsequent plugins and interceptors. + +```js +myCar.hooks.accelerate.intercept({ + context: true, + tap: (context, tapInfo) => { + // tapInfo = { type: "sync", name: "NoisePlugin", fn: ... } + console.log(`${tapInfo.name} is doing it's job`); + + // `context` starts as an empty object if at least one plugin uses `context: true`. + // If no plugins use `context: true`, then `context` is undefined. + if (context) { + // Arbitrary properties can be added to `context`, which plugins can then access. + context.hasMuffler = true; + } + } +}); + +myCar.hooks.accelerate.tap( + { + name: "NoisePlugin", + context: true + }, + (context, newSpeed) => { + if (context && context.hasMuffler) { + console.log("Silence..."); + } else { + console.log("Vroom!"); + } + } +); +``` + +## HookMap + +A HookMap is a helper class for a Map with Hooks + +```js +const keyedHook = new HookMap((key) => new SyncHook(["arg"])); +``` + +```js +keyedHook.for("some-key").tap("MyPlugin", (arg) => { + /* ... */ +}); +keyedHook.for("some-key").tapAsync("MyPlugin", (arg, callback) => { + /* ... */ +}); +keyedHook.for("some-key").tapPromise("MyPlugin", (arg) => { + /* ... */ +}); +``` + +```js +const hook = keyedHook.get("some-key"); +if (hook !== undefined) { + hook.callAsync("arg", (err) => { + /* ... */ + }); +} +``` + +## Hook/HookMap interface + +Public: + +```ts +interface Hook { + tap: (name: string | Tap, fn: (context?, ...args) => Result) => void; + tapAsync: ( + name: string | Tap, + fn: ( + context?, + ...args, + callback: (err: Error | null, result: Result) => void + ) => void + ) => void; + tapPromise: ( + name: string | Tap, + fn: (context?, ...args) => Promise + ) => void; + intercept: (interceptor: HookInterceptor) => void; +} + +interface HookInterceptor { + call: (context?, ...args) => void; + loop: (context?, ...args) => void; + tap: (context?, tap: Tap) => void; + register: (tap: Tap) => Tap; + context: boolean; +} + +interface HookMap { + for: (key: any) => Hook; + intercept: (interceptor: HookMapInterceptor) => void; +} + +interface HookMapInterceptor { + factory: (key: any, hook: Hook) => Hook; +} + +interface Tap { + name: string; + type: string; + fn: Function; + stage: number; + context: boolean; + before?: string | Array; +} +``` + +Protected (only for the class containing the hook): + +```ts +interface Hook { + isUsed: () => boolean; + call: (...args) => Result; + promise: (...args) => Promise; + callAsync: ( + ...args, + callback: (err: Error | null, result: Result) => void + ) => void; +} + +interface HookMap { + get: (key: any) => Hook | undefined; + for: (key: any) => Hook; +} +``` + +## MultiHook + +A helper Hook-like class to redirect taps to multiple other hooks: + +```js +const { MultiHook } = require("tapable"); + +this.hooks.allHooks = new MultiHook([this.hooks.hookA, this.hooks.hookB]); +``` diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelBailHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelBailHook.js new file mode 100644 index 0000000..5cabeaa --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelBailHook.js @@ -0,0 +1,87 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncParallelBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, onDone }) { + let code = ""; + code += `var _results = new Array(${this.options.taps.length});\n`; + code += "var _checkDone = function() {\n"; + code += "for(var i = 0; i < _results.length; i++) {\n"; + code += "var item = _results[i];\n"; + code += "if(item === undefined) return false;\n"; + code += "if(item.result !== undefined) {\n"; + code += onResult("item.result"); + code += "return true;\n"; + code += "}\n"; + code += "if(item.error) {\n"; + code += onError("item.error"); + code += "return true;\n"; + code += "}\n"; + code += "}\n"; + code += "return false;\n"; + code += "}\n"; + code += this.callTapsParallel({ + onError: (i, err, done, doneBreak) => { + let code = ""; + code += `if(${i} < _results.length && ((_results.length = ${ + i + 1 + }), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`; + code += doneBreak(true); + code += "} else {\n"; + code += done(); + code += "}\n"; + return code; + }, + onResult: (i, result, done, doneBreak) => { + let code = ""; + code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${ + i + 1 + }), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`; + code += doneBreak(true); + code += "} else {\n"; + code += done(); + code += "}\n"; + return code; + }, + onTap: (i, run, done, _doneBreak) => { + let code = ""; + if (i > 0) { + code += `if(${i} >= _results.length) {\n`; + code += done(); + code += "} else {\n"; + } + code += run(); + if (i > 0) code += "}\n"; + return code; + }, + onDone + }); + return code; + } +} + +const factory = new AsyncParallelBailHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncParallelBailHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = AsyncParallelBailHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncParallelBailHook.prototype = null; + +module.exports = AsyncParallelBailHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelHook.js new file mode 100644 index 0000000..3fa0722 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncParallelHook.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncParallelHookCodeFactory extends HookCodeFactory { + content({ onError, onDone }) { + return this.callTapsParallel({ + onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true), + onDone + }); + } +} + +const factory = new AsyncParallelHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncParallelHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = AsyncParallelHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncParallelHook.prototype = null; + +module.exports = AsyncParallelHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesBailHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesBailHook.js new file mode 100644 index 0000000..a46d3d2 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesBailHook.js @@ -0,0 +1,42 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncSeriesBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, onDone }) { + return this.callTapsSeries({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onResult: (i, result, next) => + `if(${result} !== undefined) {\n${onResult( + result + )}\n} else {\n${next()}}\n`, + resultReturns, + onDone + }); + } +} + +const factory = new AsyncSeriesBailHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncSeriesBailHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = AsyncSeriesBailHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncSeriesBailHook.prototype = null; + +module.exports = AsyncSeriesBailHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesHook.js new file mode 100644 index 0000000..569d480 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesHook.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncSeriesHookCodeFactory extends HookCodeFactory { + content({ onError, onDone }) { + return this.callTapsSeries({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onDone + }); + } +} + +const factory = new AsyncSeriesHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncSeriesHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = AsyncSeriesHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncSeriesHook.prototype = null; + +module.exports = AsyncSeriesHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesLoopHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesLoopHook.js new file mode 100644 index 0000000..5c3c21d --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesLoopHook.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncSeriesLoopHookCodeFactory extends HookCodeFactory { + content({ onError, onDone }) { + return this.callTapsLooping({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onDone + }); + } +} + +const factory = new AsyncSeriesLoopHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncSeriesLoopHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = AsyncSeriesLoopHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncSeriesLoopHook.prototype = null; + +module.exports = AsyncSeriesLoopHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js new file mode 100644 index 0000000..21a0701 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/AsyncSeriesWaterfallHook.js @@ -0,0 +1,48 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, _onDone }) { + return this.callTapsSeries({ + onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), + onResult: (i, result, next) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += `${this._args[0]} = ${result};\n`; + code += "}\n"; + code += next(); + return code; + }, + onDone: () => onResult(this._args[0]) + }); + } +} + +const factory = new AsyncSeriesWaterfallHookCodeFactory(); + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function AsyncSeriesWaterfallHook(args = [], name = undefined) { + if (args.length < 1) { + throw new Error("Waterfall hooks must have at least one argument"); + } + const hook = new Hook(args, name); + hook.constructor = AsyncSeriesWaterfallHook; + hook.compile = COMPILE; + hook._call = undefined; + hook.call = undefined; + return hook; +} + +AsyncSeriesWaterfallHook.prototype = null; + +module.exports = AsyncSeriesWaterfallHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/Hook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/Hook.js new file mode 100644 index 0000000..b1e9ceb --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/Hook.js @@ -0,0 +1,183 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const util = require("util"); + +const deprecateContext = util.deprecate( + () => {}, + "Hook.context is deprecated and will be removed" +); + +function CALL_DELEGATE(...args) { + this.call = this._createCall("sync"); + return this.call(...args); +} + +function CALL_ASYNC_DELEGATE(...args) { + this.callAsync = this._createCall("async"); + return this.callAsync(...args); +} + +function PROMISE_DELEGATE(...args) { + this.promise = this._createCall("promise"); + return this.promise(...args); +} + +class Hook { + constructor(args = [], name = undefined) { + this._args = args; + this.name = name; + this.taps = []; + this.interceptors = []; + this._call = CALL_DELEGATE; + this.call = CALL_DELEGATE; + this._callAsync = CALL_ASYNC_DELEGATE; + this.callAsync = CALL_ASYNC_DELEGATE; + this._promise = PROMISE_DELEGATE; + this.promise = PROMISE_DELEGATE; + this._x = undefined; + + // eslint-disable-next-line no-self-assign + this.compile = this.compile; + // eslint-disable-next-line no-self-assign + this.tap = this.tap; + // eslint-disable-next-line no-self-assign + this.tapAsync = this.tapAsync; + // eslint-disable-next-line no-self-assign + this.tapPromise = this.tapPromise; + } + + compile(_options) { + throw new Error("Abstract: should be overridden"); + } + + _createCall(type) { + return this.compile({ + taps: this.taps, + interceptors: this.interceptors, + args: this._args, + type + }); + } + + _tap(type, options, fn) { + if (typeof options === "string") { + options = { + name: options.trim() + }; + } else if (typeof options !== "object" || options === null) { + throw new Error("Invalid tap options"); + } + if (typeof options.name !== "string" || options.name === "") { + throw new Error("Missing name for tap"); + } + if (typeof options.context !== "undefined") { + deprecateContext(); + } + options = Object.assign({ type, fn }, options); + options = this._runRegisterInterceptors(options); + this._insert(options); + } + + tap(options, fn) { + this._tap("sync", options, fn); + } + + tapAsync(options, fn) { + this._tap("async", options, fn); + } + + tapPromise(options, fn) { + this._tap("promise", options, fn); + } + + _runRegisterInterceptors(options) { + for (const interceptor of this.interceptors) { + if (interceptor.register) { + const newOptions = interceptor.register(options); + if (newOptions !== undefined) { + options = newOptions; + } + } + } + return options; + } + + withOptions(options) { + const mergeOptions = (opt) => + Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); + + return { + name: this.name, + tap: (opt, fn) => this.tap(mergeOptions(opt), fn), + tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn), + tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn), + intercept: (interceptor) => this.intercept(interceptor), + isUsed: () => this.isUsed(), + withOptions: (opt) => this.withOptions(mergeOptions(opt)) + }; + } + + isUsed() { + return this.taps.length > 0 || this.interceptors.length > 0; + } + + intercept(interceptor) { + this._resetCompilation(); + this.interceptors.push(Object.assign({}, interceptor)); + if (interceptor.register) { + for (let i = 0; i < this.taps.length; i++) { + this.taps[i] = interceptor.register(this.taps[i]); + } + } + } + + _resetCompilation() { + this.call = this._call; + this.callAsync = this._callAsync; + this.promise = this._promise; + } + + _insert(item) { + this._resetCompilation(); + let before; + if (typeof item.before === "string") { + before = new Set([item.before]); + } else if (Array.isArray(item.before)) { + before = new Set(item.before); + } + let stage = 0; + if (typeof item.stage === "number") { + stage = item.stage; + } + let i = this.taps.length; + while (i > 0) { + i--; + const tap = this.taps[i]; + this.taps[i + 1] = tap; + const xStage = tap.stage || 0; + if (before) { + if (before.has(tap.name)) { + before.delete(tap.name); + continue; + } + if (before.size > 0) { + continue; + } + } + if (xStage > stage) { + continue; + } + i++; + break; + } + this.taps[i] = item; + } +} + +Object.setPrototypeOf(Hook.prototype, null); + +module.exports = Hook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js new file mode 100644 index 0000000..67e4663 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js @@ -0,0 +1,454 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +class HookCodeFactory { + constructor(config) { + this.config = config; + this.options = undefined; + this._args = undefined; + } + + create(options) { + this.init(options); + let fn; + switch (this.options.type) { + case "sync": + fn = new Function( + this.args(), + `"use strict";\n${this.header()}${this.contentWithInterceptors({ + onError: (err) => `throw ${err};\n`, + onResult: (result) => `return ${result};\n`, + resultReturns: true, + onDone: () => "", + rethrowIfPossible: true + })}` + ); + break; + case "async": + fn = new Function( + this.args({ + after: "_callback" + }), + `"use strict";\n${this.header()}${this.contentWithInterceptors({ + onError: (err) => `_callback(${err});\n`, + onResult: (result) => `_callback(null, ${result});\n`, + onDone: () => "_callback();\n" + })}` + ); + break; + case "promise": { + let errorHelperUsed = false; + const content = this.contentWithInterceptors({ + onError: (err) => { + errorHelperUsed = true; + return `_error(${err});\n`; + }, + onResult: (result) => `_resolve(${result});\n`, + onDone: () => "_resolve();\n" + }); + let code = ""; + code += '"use strict";\n'; + code += this.header(); + code += "return new Promise((function(_resolve, _reject) {\n"; + if (errorHelperUsed) { + code += "var _sync = true;\n"; + code += "function _error(_err) {\n"; + code += "if(_sync)\n"; + code += + "_resolve(Promise.resolve().then((function() { throw _err; })));\n"; + code += "else\n"; + code += "_reject(_err);\n"; + code += "};\n"; + } + code += content; + if (errorHelperUsed) { + code += "_sync = false;\n"; + } + code += "}));\n"; + fn = new Function(this.args(), code); + break; + } + } + this.deinit(); + return fn; + } + + setup(instance, options) { + instance._x = options.taps.map((t) => t.fn); + } + + /** + * @param {{ type: "sync" | "promise" | "async", taps: Array, interceptors: Array }} options + */ + init(options) { + this.options = options; + this._args = [...options.args]; + } + + deinit() { + this.options = undefined; + this._args = undefined; + } + + contentWithInterceptors(options) { + if (this.options.interceptors.length > 0) { + const { onError, onResult, onDone } = options; + let code = ""; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.call) { + code += `${this.getInterceptor(i)}.call(${this.args({ + before: interceptor.context ? "_context" : undefined + })});\n`; + } + } + code += this.content( + Object.assign(options, { + onError: + onError && + ((err) => { + let code = ""; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.error) { + code += `${this.getInterceptor(i)}.error(${err});\n`; + } + } + code += onError(err); + return code; + }), + onResult: + onResult && + ((result) => { + let code = ""; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.result) { + code += `${this.getInterceptor(i)}.result(${result});\n`; + } + } + code += onResult(result); + return code; + }), + onDone: + onDone && + (() => { + let code = ""; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.done) { + code += `${this.getInterceptor(i)}.done();\n`; + } + } + code += onDone(); + return code; + }) + }) + ); + return code; + } + return this.content(options); + } + + header() { + let code = ""; + code += this.needContext() ? "var _context = {};\n" : "var _context;\n"; + code += "var _x = this._x;\n"; + if (this.options.interceptors.length > 0) { + code += "var _taps = this.taps;\n"; + code += "var _interceptors = this.interceptors;\n"; + } + return code; + } + + needContext() { + for (const tap of this.options.taps) if (tap.context) return true; + return false; + } + + callTap(tapIndex, { onError, onResult, onDone, rethrowIfPossible }) { + let code = ""; + let hasTapCached = false; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.tap) { + if (!hasTapCached) { + code += `var _tap${tapIndex} = ${this.getTap(tapIndex)};\n`; + hasTapCached = true; + } + code += `${this.getInterceptor(i)}.tap(${ + interceptor.context ? "_context, " : "" + }_tap${tapIndex});\n`; + } + } + code += `var _fn${tapIndex} = ${this.getTapFn(tapIndex)};\n`; + const tap = this.options.taps[tapIndex]; + switch (tap.type) { + case "sync": + if (!rethrowIfPossible) { + code += `var _hasError${tapIndex} = false;\n`; + code += "try {\n"; + } + if (onResult) { + code += `var _result${tapIndex} = _fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + } else { + code += `_fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + } + if (!rethrowIfPossible) { + code += "} catch(_err) {\n"; + code += `_hasError${tapIndex} = true;\n`; + code += onError("_err"); + code += "}\n"; + code += `if(!_hasError${tapIndex}) {\n`; + } + if (onResult) { + code += onResult(`_result${tapIndex}`); + } + if (onDone) { + code += onDone(); + } + if (!rethrowIfPossible) { + code += "}\n"; + } + break; + case "async": { + let cbCode = ""; + cbCode += onResult + ? `(function(_err${tapIndex}, _result${tapIndex}) {\n` + : `(function(_err${tapIndex}) {\n`; + cbCode += `if(_err${tapIndex}) {\n`; + cbCode += onError(`_err${tapIndex}`); + cbCode += "} else {\n"; + if (onResult) { + cbCode += onResult(`_result${tapIndex}`); + } + if (onDone) { + cbCode += onDone(); + } + cbCode += "}\n"; + cbCode += "})"; + code += `_fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined, + after: cbCode + })});\n`; + break; + } + case "promise": + code += `var _hasResult${tapIndex} = false;\n`; + code += `var _promise${tapIndex} = _fn${tapIndex}(${this.args({ + before: tap.context ? "_context" : undefined + })});\n`; + code += `if (!_promise${tapIndex} || !_promise${tapIndex}.then)\n`; + code += ` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${tapIndex} + ')');\n`; + code += `_promise${tapIndex}.then((function(_result${tapIndex}) {\n`; + code += `_hasResult${tapIndex} = true;\n`; + if (onResult) { + code += onResult(`_result${tapIndex}`); + } + if (onDone) { + code += onDone(); + } + code += `}), function(_err${tapIndex}) {\n`; + code += `if(_hasResult${tapIndex}) throw _err${tapIndex};\n`; + code += onError( + `!_err${tapIndex} ? new Error('Tap function (tapPromise) rejects "' + _err${tapIndex} + '" value') : _err${tapIndex}` + ); + code += "});\n"; + break; + } + return code; + } + + callTapsSeries({ + onError, + onResult, + resultReturns, + onDone, + doneReturns, + rethrowIfPossible + }) { + if (this.options.taps.length === 0) return onDone(); + const firstAsync = this.options.taps.findIndex((t) => t.type !== "sync"); + const somethingReturns = resultReturns || doneReturns; + let code = ""; + let current = onDone; + let unrollCounter = 0; + for (let j = this.options.taps.length - 1; j >= 0; j--) { + const i = j; + const unroll = + current !== onDone && + (this.options.taps[i].type !== "sync" || unrollCounter++ > 20); + if (unroll) { + unrollCounter = 0; + code += `function _next${i}() {\n`; + code += current(); + code += "}\n"; + current = () => `${somethingReturns ? "return " : ""}_next${i}();\n`; + } + const done = current; + const doneBreak = (skipDone) => { + if (skipDone) return ""; + return onDone(); + }; + const content = this.callTap(i, { + onError: (error) => onError(i, error, done, doneBreak), + onResult: + onResult && ((result) => onResult(i, result, done, doneBreak)), + onDone: !onResult && done, + rethrowIfPossible: + rethrowIfPossible && (firstAsync < 0 || i < firstAsync) + }); + current = () => content; + } + code += current(); + return code; + } + + callTapsLooping({ onError, onDone, rethrowIfPossible }) { + if (this.options.taps.length === 0) return onDone(); + const syncOnly = this.options.taps.every((t) => t.type === "sync"); + let code = ""; + if (!syncOnly) { + code += "var _looper = (function() {\n"; + code += "var _loopAsync = false;\n"; + } + code += "var _loop;\n"; + code += "do {\n"; + code += "_loop = false;\n"; + for (let i = 0; i < this.options.interceptors.length; i++) { + const interceptor = this.options.interceptors[i]; + if (interceptor.loop) { + code += `${this.getInterceptor(i)}.loop(${this.args({ + before: interceptor.context ? "_context" : undefined + })});\n`; + } + } + code += this.callTapsSeries({ + onError, + onResult: (i, result, next, doneBreak) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += "_loop = true;\n"; + if (!syncOnly) code += "if(_loopAsync) _looper();\n"; + code += doneBreak(true); + code += "} else {\n"; + code += next(); + code += "}\n"; + return code; + }, + onDone: + onDone && + (() => { + let code = ""; + code += "if(!_loop) {\n"; + code += onDone(); + code += "}\n"; + return code; + }), + rethrowIfPossible: rethrowIfPossible && syncOnly + }); + code += "} while(_loop);\n"; + if (!syncOnly) { + code += "_loopAsync = true;\n"; + code += "});\n"; + code += "_looper();\n"; + } + return code; + } + + callTapsParallel({ + onError, + onResult, + onDone, + rethrowIfPossible, + onTap = (i, run) => run() + }) { + if (this.options.taps.length <= 1) { + return this.callTapsSeries({ + onError, + onResult, + onDone, + rethrowIfPossible + }); + } + let code = ""; + code += "do {\n"; + code += `var _counter = ${this.options.taps.length};\n`; + if (onDone) { + code += "var _done = (function() {\n"; + code += onDone(); + code += "});\n"; + } + for (let i = 0; i < this.options.taps.length; i++) { + const done = () => { + if (onDone) return "if(--_counter === 0) _done();\n"; + return "--_counter;"; + }; + const doneBreak = (skipDone) => { + if (skipDone || !onDone) return "_counter = 0;\n"; + return "_counter = 0;\n_done();\n"; + }; + code += "if(_counter <= 0) break;\n"; + code += onTap( + i, + () => + this.callTap(i, { + onError: (error) => { + let code = ""; + code += "if(_counter > 0) {\n"; + code += onError(i, error, done, doneBreak); + code += "}\n"; + return code; + }, + onResult: + onResult && + ((result) => { + let code = ""; + code += "if(_counter > 0) {\n"; + code += onResult(i, result, done, doneBreak); + code += "}\n"; + return code; + }), + onDone: !onResult && (() => done()), + rethrowIfPossible + }), + done, + doneBreak + ); + } + code += "} while(false);\n"; + return code; + } + + args({ before, after } = {}) { + let allArgs = this._args; + if (before) allArgs = [before, ...allArgs]; + if (after) allArgs = [...allArgs, after]; + if (allArgs.length === 0) { + return ""; + } + + return allArgs.join(", "); + } + + getTapFn(idx) { + return `_x[${idx}]`; + } + + getTap(idx) { + return `_taps[${idx}]`; + } + + getInterceptor(idx) { + return `_interceptors[${idx}]`; + } +} + +module.exports = HookCodeFactory; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/HookMap.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/HookMap.js new file mode 100644 index 0000000..8fdc5d6 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/HookMap.js @@ -0,0 +1,69 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const util = require("util"); + +const defaultFactory = (key, hook) => hook; + +class HookMap { + constructor(factory, name = undefined) { + this._map = new Map(); + this.name = name; + this._factory = factory; + this._interceptors = []; + } + + get(key) { + return this._map.get(key); + } + + for(key) { + const hook = this.get(key); + if (hook !== undefined) { + return hook; + } + let newHook = this._factory(key); + const interceptors = this._interceptors; + for (let i = 0; i < interceptors.length; i++) { + newHook = interceptors[i].factory(key, newHook); + } + this._map.set(key, newHook); + return newHook; + } + + intercept(interceptor) { + this._interceptors.push( + Object.assign( + { + factory: defaultFactory + }, + interceptor + ) + ); + } +} + +HookMap.prototype.tap = util.deprecate(function tap(key, options, fn) { + return this.for(key).tap(options, fn); +}, "HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead."); + +HookMap.prototype.tapAsync = util.deprecate(function tapAsync( + key, + options, + fn +) { + return this.for(key).tapAsync(options, fn); +}, "HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead."); + +HookMap.prototype.tapPromise = util.deprecate(function tapPromise( + key, + options, + fn +) { + return this.for(key).tapPromise(options, fn); +}, "HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead."); + +module.exports = HookMap; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/MultiHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/MultiHook.js new file mode 100644 index 0000000..8041264 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/MultiHook.js @@ -0,0 +1,52 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +class MultiHook { + constructor(hooks, name = undefined) { + this.hooks = hooks; + this.name = name; + } + + tap(options, fn) { + for (const hook of this.hooks) { + hook.tap(options, fn); + } + } + + tapAsync(options, fn) { + for (const hook of this.hooks) { + hook.tapAsync(options, fn); + } + } + + tapPromise(options, fn) { + for (const hook of this.hooks) { + hook.tapPromise(options, fn); + } + } + + isUsed() { + for (const hook of this.hooks) { + if (hook.isUsed()) return true; + } + return false; + } + + intercept(interceptor) { + for (const hook of this.hooks) { + hook.intercept(interceptor); + } + } + + withOptions(options) { + return new MultiHook( + this.hooks.map((hook) => hook.withOptions(options)), + this.name + ); + } +} + +module.exports = MultiHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncBailHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncBailHook.js new file mode 100644 index 0000000..4b538c3 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncBailHook.js @@ -0,0 +1,51 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class SyncBailHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onResult: (i, result, next) => + `if(${result} !== undefined) {\n${onResult( + result + )};\n} else {\n${next()}}\n`, + resultReturns, + onDone, + rethrowIfPossible + }); + } +} + +const factory = new SyncBailHookCodeFactory(); + +const TAP_ASYNC = () => { + throw new Error("tapAsync is not supported on a SyncBailHook"); +}; + +const TAP_PROMISE = () => { + throw new Error("tapPromise is not supported on a SyncBailHook"); +}; + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function SyncBailHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = SyncBailHook; + hook.tapAsync = TAP_ASYNC; + hook.tapPromise = TAP_PROMISE; + hook.compile = COMPILE; + return hook; +} + +SyncBailHook.prototype = null; + +module.exports = SyncBailHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncHook.js new file mode 100644 index 0000000..968dea2 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncHook.js @@ -0,0 +1,46 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class SyncHookCodeFactory extends HookCodeFactory { + content({ onError, onDone, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onDone, + rethrowIfPossible + }); + } +} + +const factory = new SyncHookCodeFactory(); + +const TAP_ASYNC = () => { + throw new Error("tapAsync is not supported on a SyncHook"); +}; + +const TAP_PROMISE = () => { + throw new Error("tapPromise is not supported on a SyncHook"); +}; + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function SyncHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = SyncHook; + hook.tapAsync = TAP_ASYNC; + hook.tapPromise = TAP_PROMISE; + hook.compile = COMPILE; + return hook; +} + +SyncHook.prototype = null; + +module.exports = SyncHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncLoopHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncLoopHook.js new file mode 100644 index 0000000..da48ca1 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncLoopHook.js @@ -0,0 +1,46 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class SyncLoopHookCodeFactory extends HookCodeFactory { + content({ onError, onDone, rethrowIfPossible }) { + return this.callTapsLooping({ + onError: (i, err) => onError(err), + onDone, + rethrowIfPossible + }); + } +} + +const factory = new SyncLoopHookCodeFactory(); + +const TAP_ASYNC = () => { + throw new Error("tapAsync is not supported on a SyncLoopHook"); +}; + +const TAP_PROMISE = () => { + throw new Error("tapPromise is not supported on a SyncLoopHook"); +}; + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function SyncLoopHook(args = [], name = undefined) { + const hook = new Hook(args, name); + hook.constructor = SyncLoopHook; + hook.tapAsync = TAP_ASYNC; + hook.tapPromise = TAP_PROMISE; + hook.compile = COMPILE; + return hook; +} + +SyncLoopHook.prototype = null; + +module.exports = SyncLoopHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncWaterfallHook.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncWaterfallHook.js new file mode 100644 index 0000000..8eca528 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/SyncWaterfallHook.js @@ -0,0 +1,58 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Hook = require("./Hook"); +const HookCodeFactory = require("./HookCodeFactory"); + +class SyncWaterfallHookCodeFactory extends HookCodeFactory { + content({ onError, onResult, resultReturns, rethrowIfPossible }) { + return this.callTapsSeries({ + onError: (i, err) => onError(err), + onResult: (i, result, next) => { + let code = ""; + code += `if(${result} !== undefined) {\n`; + code += `${this._args[0]} = ${result};\n`; + code += "}\n"; + code += next(); + return code; + }, + onDone: () => onResult(this._args[0]), + doneReturns: resultReturns, + rethrowIfPossible + }); + } +} + +const factory = new SyncWaterfallHookCodeFactory(); + +const TAP_ASYNC = () => { + throw new Error("tapAsync is not supported on a SyncWaterfallHook"); +}; + +const TAP_PROMISE = () => { + throw new Error("tapPromise is not supported on a SyncWaterfallHook"); +}; + +function COMPILE(options) { + factory.setup(this, options); + return factory.create(options); +} + +function SyncWaterfallHook(args = [], name = undefined) { + if (args.length < 1) { + throw new Error("Waterfall hooks must have at least one argument"); + } + const hook = new Hook(args, name); + hook.constructor = SyncWaterfallHook; + hook.tapAsync = TAP_ASYNC; + hook.tapPromise = TAP_PROMISE; + hook.compile = COMPILE; + return hook; +} + +SyncWaterfallHook.prototype = null; + +module.exports = SyncWaterfallHook; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/index.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/index.js new file mode 100644 index 0000000..3a0dc67 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/index.js @@ -0,0 +1,19 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports.AsyncParallelBailHook = require("./AsyncParallelBailHook"); +module.exports.AsyncParallelHook = require("./AsyncParallelHook"); +module.exports.AsyncSeriesBailHook = require("./AsyncSeriesBailHook"); +module.exports.AsyncSeriesHook = require("./AsyncSeriesHook"); +module.exports.AsyncSeriesLoopHook = require("./AsyncSeriesLoopHook"); +module.exports.AsyncSeriesWaterfallHook = require("./AsyncSeriesWaterfallHook"); +module.exports.HookMap = require("./HookMap"); +module.exports.MultiHook = require("./MultiHook"); +module.exports.SyncBailHook = require("./SyncBailHook"); +module.exports.SyncHook = require("./SyncHook"); +module.exports.SyncLoopHook = require("./SyncLoopHook"); +module.exports.SyncWaterfallHook = require("./SyncWaterfallHook"); +module.exports.__esModule = true; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/lib/util-browser.js b/node_modules/enhanced-resolve/node_modules/tapable/lib/util-browser.js new file mode 100644 index 0000000..d07eb6c --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/lib/util-browser.js @@ -0,0 +1,18 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +module.exports.deprecate = (fn, msg) => { + let once = true; + return function deprecate() { + if (once) { + // eslint-disable-next-line no-console + console.warn(`DeprecationWarning: ${msg}`); + once = false; + } + // eslint-disable-next-line prefer-rest-params + return fn.apply(this, arguments); + }; +}; diff --git a/node_modules/enhanced-resolve/node_modules/tapable/package.json b/node_modules/enhanced-resolve/node_modules/tapable/package.json new file mode 100644 index 0000000..5ac2c4d --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/package.json @@ -0,0 +1,60 @@ +{ + "name": "tapable", + "version": "2.3.0", + "description": "Just a little module for plugins.", + "homepage": "https://github.com/webpack/tapable", + "repository": { + "type": "git", + "url": "http://github.com/webpack/tapable.git" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "license": "MIT", + "author": "Tobias Koppers @sokra", + "main": "lib/index.js", + "browser": { + "util": "./lib/util-browser.js" + }, + "types": "./tapable.d.ts", + "files": ["lib", "!lib/__tests__", "tapable.d.ts"], + "scripts": { + "lint": "yarn lint:code && yarn fmt:check", + "lint:code": "eslint --cache .", + "fmt": "yarn fmt:base --log-level warn --write", + "fmt:check": "yarn fmt:base --check", + "fmt:base": "node ./node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .", + "fix": "yarn fix:code && yarn fmt", + "fix:code": "yarn lint:code --fix", + "test": "jest" + }, + "jest": { + "transform": { + "__tests__[\\\\/].+\\.js$": "babel-jest" + } + }, + "devDependencies": { + "@babel/core": "^7.4.4", + "@babel/preset-env": "^7.4.4", + "@eslint/js": "^9.28.0", + "@eslint/markdown": "^7.1.0", + "@stylistic/eslint-plugin": "^5.2.3", + "babel-jest": "^24.8.0", + "globals": "^16.2.0", + "eslint": "^9.28.0", + "eslint-config-webpack": "^4.6.3", + "eslint-config-prettier": "^10.1.5", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^29.0.1", + "eslint-plugin-n": "^17.19.0", + "eslint-plugin-prettier": "^5.4.1", + "eslint-plugin-unicorn": "^60.0.0", + "jest": "^24.8.0", + "prettier": "^3.5.3", + "prettier-1": "npm:prettier@^1" + }, + "engines": { + "node": ">=6" + } +} diff --git a/node_modules/enhanced-resolve/node_modules/tapable/tapable.d.ts b/node_modules/enhanced-resolve/node_modules/tapable/tapable.d.ts new file mode 100644 index 0000000..e2ca8c2 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/tapable/tapable.d.ts @@ -0,0 +1,174 @@ +type FixedSizeArray = T extends 0 + ? void[] + : ReadonlyArray & { + 0: U; + length: T; + }; +type Measure = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 + ? T + : never; +type Append = { + 0: [U]; + 1: [T[0], U]; + 2: [T[0], T[1], U]; + 3: [T[0], T[1], T[2], U]; + 4: [T[0], T[1], T[2], T[3], U]; + 5: [T[0], T[1], T[2], T[3], T[4], U]; + 6: [T[0], T[1], T[2], T[3], T[4], T[5], U]; + 7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U]; + 8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U]; +}[Measure]; +type AsArray = T extends any[] ? T : [T]; + +declare class UnsetAdditionalOptions { + _UnsetAdditionalOptions: true; +} +type IfSet = X extends UnsetAdditionalOptions ? {} : X; + +type Callback = (error: E | null, result?: T) => void; +type InnerCallback = (error?: E | null | false, result?: T) => void; + +type FullTap = Tap & { + type: "sync" | "async" | "promise"; + fn: Function; +}; + +type Tap = TapOptions & { + name: string; +}; + +type TapOptions = { + before?: string; + stage?: number; +}; + +interface HookInterceptor { + name?: string; + tap?: (tap: FullTap & IfSet) => void; + call?: (...args: any[]) => void; + loop?: (...args: any[]) => void; + error?: (err: Error) => void; + result?: (result: R) => void; + done?: () => void; + register?: ( + tap: FullTap & IfSet + ) => FullTap & IfSet; +} + +type ArgumentNames = FixedSizeArray; + +declare class Hook { + constructor(args?: ArgumentNames>, name?: string); + name: string | undefined; + interceptors: HookInterceptor[]; + taps: FullTap[]; + intercept(interceptor: HookInterceptor): void; + isUsed(): boolean; + callAsync(...args: Append, Callback>): void; + promise(...args: AsArray): Promise; + tap( + options: string | (Tap & IfSet), + fn: (...args: AsArray) => R + ): void; + withOptions( + options: TapOptions & IfSet + ): Omit; +} + +export class SyncHook< + T, + R = void, + AdditionalOptions = UnsetAdditionalOptions +> extends Hook { + call(...args: AsArray): R; +} + +export class SyncBailHook< + T, + R, + AdditionalOptions = UnsetAdditionalOptions +> extends SyncHook {} +export class SyncLoopHook< + T, + AdditionalOptions = UnsetAdditionalOptions +> extends SyncHook {} +export class SyncWaterfallHook< + T, + R = AsArray[0], + AdditionalOptions = UnsetAdditionalOptions +> extends SyncHook {} + +declare class AsyncHook< + T, + R, + AdditionalOptions = UnsetAdditionalOptions +> extends Hook { + tapAsync( + options: string | (Tap & IfSet), + fn: (...args: Append, InnerCallback>) => void + ): void; + tapPromise( + options: string | (Tap & IfSet), + fn: (...args: AsArray) => Promise + ): void; +} + +export class AsyncParallelHook< + T, + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} +export class AsyncParallelBailHook< + T, + R, + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} +export class AsyncSeriesHook< + T, + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} +export class AsyncSeriesBailHook< + T, + R, + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} +export class AsyncSeriesLoopHook< + T, + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} +export class AsyncSeriesWaterfallHook< + T, + R = AsArray[0], + AdditionalOptions = UnsetAdditionalOptions +> extends AsyncHook {} + +type HookFactory = (key: K) => H; + +interface HookMapInterceptor { + factory?: (key: K, hook: H) => H; +} + +export class HookMap { + constructor(factory: HookFactory, name?: string); + name: string | undefined; + get(key: any): H | undefined; + for(key: any): H; + intercept(interceptor: HookMapInterceptor): void; +} + +type AnyHook = Hook; + +export class TypedHookMap> { + constructor(factory: HookFactory, name?: string); + name: string | undefined; + get(key: K): M[K] | undefined; + for(key: K): M[K]; + intercept(interceptor: HookMapInterceptor): void; +} + +export class MultiHook { + constructor(hooks: H[], name?: string); + name: string | undefined; + tap(options: string | Tap, fn?: Function): void; + tapAsync(options: string | Tap, fn?: Function): void; + tapPromise(options: string | Tap, fn?: Function): void; +} diff --git a/node_modules/enhanced-resolve/package.json b/node_modules/enhanced-resolve/package.json new file mode 100644 index 0000000..25784d3 --- /dev/null +++ b/node_modules/enhanced-resolve/package.json @@ -0,0 +1,87 @@ +{ + "name": "enhanced-resolve", + "version": "5.18.4", + "description": "Offers a async require.resolve function. It's highly configurable.", + "homepage": "http://github.com/webpack/enhanced-resolve", + "repository": { + "type": "git", + "url": "git://github.com/webpack/enhanced-resolve.git" + }, + "license": "MIT", + "author": "Tobias Koppers @sokra", + "main": "lib/index.js", + "browser": { + "process": "./lib/util/process-browser.js", + "module": "./lib/util/module-browser.js" + }, + "types": "types.d.ts", + "files": [ + "lib", + "types.d.ts", + "LICENSE" + ], + "scripts": { + "prepare": "husky install", + "lint": "yarn lint:code && yarn lint:types && yarn lint:types-test && yarn lint:special && yarn fmt:check && yarn lint:spellcheck", + "lint:code": "eslint --cache .", + "lint:special": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/generate-types", + "lint:types": "tsc", + "lint:types-test": "tsc -p tsconfig.types.test.json", + "lint:spellcheck": "cspell --no-must-find-files \"**/*.*\"", + "fmt": "yarn fmt:base --loglevel warn --write", + "fmt:check": "yarn fmt:base --check", + "fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .", + "fix": "yarn fix:code && yarn fix:special", + "fix:code": "yarn lint:code --fix", + "fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/generate-types --write", + "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html", + "pretest": "yarn lint", + "test": "yarn test:coverage", + "test:only": "jest", + "test:watch": "yarn test:only --watch", + "test:coverage": "yarn test:only --collectCoverageFrom=\"lib/**/*.js\" --coverage" + }, + "lint-staged": { + "*.{js,cjs,mjs}": [ + "eslint --cache --fix" + ], + "*": [ + "prettier --cache --write --ignore-unknown", + "cspell --cache --no-must-find-files" + ] + }, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "devDependencies": { + "@eslint/js": "^9.28.0", + "@eslint/markdown": "^7.1.0", + "@types/graceful-fs": "^4.1.6", + "@types/jest": "^27.5.1", + "@types/node": "^24.0.3", + "@stylistic/eslint-plugin": "^5.2.2", + "cspell": "4.2.8", + "eslint": "^9.28.0", + "eslint-config-prettier": "^10.1.5", + "eslint-config-webpack": "^4.1.2", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^29.0.1", + "eslint-plugin-jsdoc": "^52.0.2", + "eslint-plugin-n": "^17.19.0", + "eslint-plugin-prettier": "^5.4.1", + "eslint-plugin-unicorn": "^60.0.0", + "globals": "^16.2.0", + "husky": "^6.0.0", + "jest": "^27.5.1", + "lint-staged": "^10.4.0", + "memfs": "^3.2.0", + "prettier": "^3.5.3", + "prettier-2": "npm:prettier@^2", + "tooling": "webpack/tooling#v1.24.0", + "typescript": "^5.8.3" + }, + "engines": { + "node": ">=10.13.0" + } +} diff --git a/node_modules/enhanced-resolve/types.d.ts b/node_modules/enhanced-resolve/types.d.ts new file mode 100644 index 0000000..6953b2c --- /dev/null +++ b/node_modules/enhanced-resolve/types.d.ts @@ -0,0 +1,1658 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn fix:special` to update + */ + +import { Buffer } from "buffer"; +import { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } from "tapable"; +import { URL as URL_Import } from "url"; + +declare interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal; +} +type Alias = string | false | string[]; +declare interface AliasOption { + alias: Alias; + name: string; + onlyModule?: boolean; +} +type AliasOptionNewRequest = string | false | string[]; +declare interface AliasOptions { + [index: string]: AliasOptionNewRequest; +} +type BaseFileSystem = FileSystem & SyncFileSystem; +declare interface BaseResolveRequest { + /** + * path + */ + path: string | false; + + /** + * content + */ + context?: object; + + /** + * description file path + */ + descriptionFilePath?: string; + + /** + * description file root + */ + descriptionFileRoot?: string; + + /** + * description file data + */ + descriptionFileData?: JsonObject; + + /** + * relative path + */ + relativePath?: string; + + /** + * true when need to ignore symlinks, otherwise false + */ + ignoreSymlinks?: boolean; + + /** + * true when full specified, otherwise false + */ + fullySpecified?: boolean; + + /** + * inner request for internal usage + */ + __innerRequest?: string; + + /** + * inner request for internal usage + */ + __innerRequest_request?: string; + + /** + * inner relative path for internal usage + */ + __innerRequest_relativePath?: string; +} +type BufferEncoding = + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex"; +type BufferEncodingOption = "buffer" | { encoding: "buffer" }; +declare interface Cache { + [index: string]: undefined | ResolveRequest | ResolveRequest[]; +} +declare class CachedInputFileSystem { + constructor(fileSystem: BaseFileSystem, duration: number); + fileSystem: BaseFileSystem; + lstat?: LStat; + lstatSync?: LStatSync; + stat: Stat; + statSync: StatSync; + readdir: Readdir; + readdirSync: ReaddirSync; + readFile: ReadFile; + readFileSync: ReadFileSync; + readJson?: ( + pathOrFileDescription: PathOrFileDescriptor, + callback: ( + err: null | Error | NodeJS.ErrnoException, + result?: JsonObject, + ) => void, + ) => void; + readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; + readlink: Readlink; + readlinkSync: ReadlinkSync; + realpath?: RealPath; + realpathSync?: RealPathSync; + purge( + what?: + | string + | number + | Buffer + | URL_url + | (string | number | Buffer | URL_url)[] + | Set, + ): void; +} +declare class CloneBasenamePlugin { + constructor( + source: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + target: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + ); + source: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + target: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + apply(resolver: Resolver): void; +} +declare interface Dirent { + /** + * true when is file, otherwise false + */ + isFile: () => boolean; + + /** + * true when is directory, otherwise false + */ + isDirectory: () => boolean; + + /** + * true when is block device, otherwise false + */ + isBlockDevice: () => boolean; + + /** + * true when is character device, otherwise false + */ + isCharacterDevice: () => boolean; + + /** + * true when is symbolic link, otherwise false + */ + isSymbolicLink: () => boolean; + + /** + * true when is FIFO, otherwise false + */ + isFIFO: () => boolean; + + /** + * true when is socket, otherwise false + */ + isSocket: () => boolean; + + /** + * name + */ + name: T; + + /** + * path + */ + parentPath: string; + + /** + * path + */ + path?: string; +} +type EncodingOption = + | undefined + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | ObjectEncodingOptions; +type ErrorWithDetail = Error & { details?: string }; +declare interface ExtensionAliasOption { + alias: string | string[]; + extension: string; +} +declare interface ExtensionAliasOptions { + [index: string]: string | string[]; +} +declare interface FileSystem { + /** + * read file method + */ + readFile: ReadFile; + + /** + * readdir method + */ + readdir: Readdir; + + /** + * read json method + */ + readJson?: ( + pathOrFileDescription: PathOrFileDescriptor, + callback: ( + err: null | Error | NodeJS.ErrnoException, + result?: JsonObject, + ) => void, + ) => void; + + /** + * read link method + */ + readlink: Readlink; + + /** + * lstat method + */ + lstat?: LStat; + + /** + * stat method + */ + stat: Stat; + + /** + * realpath method + */ + realpath?: RealPath; +} +type IBigIntStats = IStatsBase & { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; +}; +declare interface IStats { + /** + * is file + */ + isFile: () => boolean; + + /** + * is directory + */ + isDirectory: () => boolean; + + /** + * is block device + */ + isBlockDevice: () => boolean; + + /** + * is character device + */ + isCharacterDevice: () => boolean; + + /** + * is symbolic link + */ + isSymbolicLink: () => boolean; + + /** + * is FIFO + */ + isFIFO: () => boolean; + + /** + * is socket + */ + isSocket: () => boolean; + + /** + * dev + */ + dev: number; + + /** + * ino + */ + ino: number; + + /** + * mode + */ + mode: number; + + /** + * nlink + */ + nlink: number; + + /** + * uid + */ + uid: number; + + /** + * gid + */ + gid: number; + + /** + * rdev + */ + rdev: number; + + /** + * size + */ + size: number; + + /** + * blksize + */ + blksize: number; + + /** + * blocks + */ + blocks: number; + + /** + * atime ms + */ + atimeMs: number; + + /** + * mtime ms + */ + mtimeMs: number; + + /** + * ctime ms + */ + ctimeMs: number; + + /** + * birthtime ms + */ + birthtimeMs: number; + + /** + * atime + */ + atime: Date; + + /** + * mtime + */ + mtime: Date; + + /** + * ctime + */ + ctime: Date; + + /** + * birthtime + */ + birthtime: Date; +} +declare interface IStatsBase { + /** + * is file + */ + isFile: () => boolean; + + /** + * is directory + */ + isDirectory: () => boolean; + + /** + * is block device + */ + isBlockDevice: () => boolean; + + /** + * is character device + */ + isCharacterDevice: () => boolean; + + /** + * is symbolic link + */ + isSymbolicLink: () => boolean; + + /** + * is FIFO + */ + isFIFO: () => boolean; + + /** + * is socket + */ + isSocket: () => boolean; + + /** + * dev + */ + dev: T; + + /** + * ino + */ + ino: T; + + /** + * mode + */ + mode: T; + + /** + * nlink + */ + nlink: T; + + /** + * uid + */ + uid: T; + + /** + * gid + */ + gid: T; + + /** + * rdev + */ + rdev: T; + + /** + * size + */ + size: T; + + /** + * blksize + */ + blksize: T; + + /** + * blocks + */ + blocks: T; + + /** + * atime ms + */ + atimeMs: T; + + /** + * mtime ms + */ + mtimeMs: T; + + /** + * ctime ms + */ + ctimeMs: T; + + /** + * birthtime ms + */ + birthtimeMs: T; + + /** + * atime + */ + atime: Date; + + /** + * mtime + */ + mtime: Date; + + /** + * ctime + */ + ctime: Date; + + /** + * birthtime + */ + birthtime: Date; +} +declare interface Iterator { + ( + item: T, + callback: (err?: null | Error, result?: null | Z) => void, + i: number, + ): void; +} +declare interface JsonObject { + [index: string]: + | undefined + | null + | string + | number + | boolean + | JsonObject + | JsonValue[]; +} +type JsonValue = null | string | number | boolean | JsonObject | JsonValue[]; +declare interface KnownHooks { + /** + * resolve step hook + */ + resolveStep: SyncHook< + [ + AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + ResolveRequest, + ] + >; + + /** + * no resolve hook + */ + noResolve: SyncHook<[ResolveRequest, Error]>; + + /** + * resolve hook + */ + resolve: AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + + /** + * result hook + */ + result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>; +} +declare interface LStat { + ( + path: PathLike, + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, + ): void; + ( + path: PathLike, + options: undefined | (StatOptions & { bigint?: false }), + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, + ): void; + ( + path: PathLike, + options: StatOptions & { bigint: true }, + callback: ( + err: null | NodeJS.ErrnoException, + result?: IBigIntStats, + ) => void, + ): void; + ( + path: PathLike, + options: undefined | StatOptions, + callback: ( + err: null | NodeJS.ErrnoException, + result?: IStats | IBigIntStats, + ) => void, + ): void; +} +declare interface LStatSync { + (path: PathLike, options?: undefined): IStats; + ( + path: PathLike, + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, + ): undefined | IStats; + ( + path: PathLike, + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, + ): undefined | IBigIntStats; + (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; + (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, + ): IStats | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): undefined | IStats | IBigIntStats; +} +declare class LogInfoPlugin { + constructor( + source: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + ); + source: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + apply(resolver: Resolver): void; +} +declare interface ObjectEncodingOptions { + /** + * encoding + */ + encoding?: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex"; +} +declare interface ParsedIdentifier { + /** + * request + */ + request: string; + + /** + * query + */ + query: string; + + /** + * fragment + */ + fragment: string; + + /** + * is directory + */ + directory: boolean; + + /** + * is module + */ + module: boolean; + + /** + * is file + */ + file: boolean; + + /** + * is internal + */ + internal: boolean; +} +type PathLike = string | Buffer | URL_url; +type PathOrFileDescriptor = string | number | Buffer | URL_url; +type Plugin = + | undefined + | null + | false + | "" + | 0 + | { apply: (this: Resolver, resolver: Resolver) => void } + | ((this: Resolver, resolver: Resolver) => void); +declare interface PnpApi { + /** + * resolve to unqualified + */ + resolveToUnqualified: ( + packageName: string, + issuer: string, + options: { considerBuiltins: boolean }, + ) => null | string; +} +declare interface ReadFile { + ( + path: PathOrFileDescriptor, + options: + | undefined + | null + | ({ encoding?: null; flag?: string } & Abortable), + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, + ): void; + ( + path: PathOrFileDescriptor, + options: + | ({ encoding: BufferEncoding; flag?: string } & Abortable) + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex", + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, + ): void; + ( + path: PathOrFileDescriptor, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | (ObjectEncodingOptions & { flag?: string } & Abortable), + callback: ( + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, + ): void; + ( + path: PathOrFileDescriptor, + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, + ): void; +} +declare interface ReadFileSync { + ( + path: PathOrFileDescriptor, + options?: null | { encoding?: null; flag?: string }, + ): Buffer; + ( + path: PathOrFileDescriptor, + options: + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | { encoding: BufferEncoding; flag?: string }, + ): string; + ( + path: PathOrFileDescriptor, + options?: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | (ObjectEncodingOptions & { flag?: string }), + ): string | Buffer; +} +declare interface Readdir { + ( + path: PathLike, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | { + encoding: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex"; + withFileTypes?: false; + recursive?: boolean; + }, + callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void, + ): void; + ( + path: PathLike, + options: + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } + | "buffer", + callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void, + ): void; + ( + path: PathLike, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | (ObjectEncodingOptions & { + withFileTypes?: false; + recursive?: boolean; + }), + callback: ( + err: null | NodeJS.ErrnoException, + files?: string[] | Buffer[], + ) => void, + ): void; + ( + path: PathLike, + callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void, + ): void; + ( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean; + }, + callback: ( + err: null | NodeJS.ErrnoException, + files?: Dirent[], + ) => void, + ): void; + ( + path: PathLike, + options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }, + callback: ( + err: null | NodeJS.ErrnoException, + files: Dirent[], + ) => void, + ): void; +} +declare interface ReaddirSync { + ( + path: PathLike, + options?: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | { + encoding: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex"; + withFileTypes?: false; + recursive?: boolean; + }, + ): string[]; + ( + path: PathLike, + options: + | "buffer" + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }, + ): Buffer[]; + ( + path: PathLike, + options?: + | null + | "ascii" + | "utf8" + | "utf-8" + | "utf16le" + | "utf-16le" + | "ucs2" + | "ucs-2" + | "base64" + | "base64url" + | "latin1" + | "binary" + | "hex" + | (ObjectEncodingOptions & { + withFileTypes?: false; + recursive?: boolean; + }), + ): string[] | Buffer[]; + ( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean; + }, + ): Dirent[]; + ( + path: PathLike, + options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }, + ): Dirent[]; +} +declare interface Readlink { + ( + path: PathLike, + options: EncodingOption, + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, + ): void; + ( + path: PathLike, + options: BufferEncodingOption, + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, + ): void; + ( + path: PathLike, + options: EncodingOption, + callback: ( + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, + ): void; + ( + path: PathLike, + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, + ): void; +} +declare interface ReadlinkSync { + (path: PathLike, options?: EncodingOption): string; + (path: PathLike, options: BufferEncodingOption): Buffer; + (path: PathLike, options?: EncodingOption): string | Buffer; +} +declare interface RealPath { + ( + path: PathLike, + options: EncodingOption, + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, + ): void; + ( + path: PathLike, + options: BufferEncodingOption, + callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, + ): void; + ( + path: PathLike, + options: EncodingOption, + callback: ( + err: null | NodeJS.ErrnoException, + result?: string | Buffer, + ) => void, + ): void; + ( + path: PathLike, + callback: (err: null | NodeJS.ErrnoException, result?: string) => void, + ): void; +} +declare interface RealPathSync { + (path: PathLike, options?: EncodingOption): string; + (path: PathLike, options: BufferEncodingOption): Buffer; + (path: PathLike, options?: EncodingOption): string | Buffer; +} +declare interface ResolveContext { + /** + * directories that was found on file system + */ + contextDependencies?: WriteOnlySet; + + /** + * files that was found on file system + */ + fileDependencies?: WriteOnlySet; + + /** + * dependencies that was not found on file system + */ + missingDependencies?: WriteOnlySet; + + /** + * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, + */ + stack?: Set; + + /** + * log function + */ + log?: (str: string) => void; + + /** + * yield result, if provided plugins can return several results + */ + yield?: (request: ResolveRequest) => void; +} +declare interface ResolveFunction { + (context: object, path: string, request: string): string | false; + (path: string, request: string): string | false; +} +declare interface ResolveFunctionAsync { + ( + context: object, + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, + ): void; + ( + context: object, + path: string, + request: string, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, + ): void; + ( + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, + ): void; + ( + path: string, + request: string, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, + ): void; +} +type ResolveOptionsOptionalFS = Omit< + ResolveOptionsResolverFactoryObject_2, + "fileSystem" +> & + Partial>; +declare interface ResolveOptionsResolverFactoryObject_1 { + /** + * alias + */ + alias: AliasOption[]; + + /** + * fallback + */ + fallback: AliasOption[]; + + /** + * alias fields + */ + aliasFields: Set; + + /** + * extension alias + */ + extensionAlias: ExtensionAliasOption[]; + + /** + * cache predicate + */ + cachePredicate: (predicate: ResolveRequest) => boolean; + + /** + * cache with context + */ + cacheWithContext: boolean; + + /** + * A list of exports field condition names. + */ + conditionNames: Set; + + /** + * description files + */ + descriptionFiles: string[]; + + /** + * enforce extension + */ + enforceExtension: boolean; + + /** + * exports fields + */ + exportsFields: Set; + + /** + * imports fields + */ + importsFields: Set; + + /** + * extensions + */ + extensions: Set; + + /** + * fileSystem + */ + fileSystem: FileSystem; + + /** + * unsafe cache + */ + unsafeCache: false | Cache; + + /** + * symlinks + */ + symlinks: boolean; + + /** + * resolver + */ + resolver?: Resolver; + + /** + * modules + */ + modules: (string | string[])[]; + + /** + * main fields + */ + mainFields: { name: string[]; forceRelative: boolean }[]; + + /** + * main files + */ + mainFiles: Set; + + /** + * plugins + */ + plugins: Plugin[]; + + /** + * pnp API + */ + pnpApi: null | PnpApi; + + /** + * roots + */ + roots: Set; + + /** + * fully specified + */ + fullySpecified: boolean; + + /** + * resolve to context + */ + resolveToContext: boolean; + + /** + * restrictions + */ + restrictions: Set; + + /** + * prefer relative + */ + preferRelative: boolean; + + /** + * prefer absolute + */ + preferAbsolute: boolean; +} +declare interface ResolveOptionsResolverFactoryObject_2 { + /** + * A list of module alias configurations or an object which maps key to value + */ + alias?: AliasOptions | AliasOption[]; + + /** + * A list of module alias configurations or an object which maps key to value, applied only after modules option + */ + fallback?: AliasOptions | AliasOption[]; + + /** + * An object which maps extension to extension aliases + */ + extensionAlias?: ExtensionAliasOptions; + + /** + * A list of alias fields in description files + */ + aliasFields?: (string | string[])[]; + + /** + * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + */ + cachePredicate?: (predicate: ResolveRequest) => boolean; + + /** + * Whether or not the unsafeCache should include request context as part of the cache key. + */ + cacheWithContext?: boolean; + + /** + * A list of description files to read from + */ + descriptionFiles?: string[]; + + /** + * A list of exports field condition names. + */ + conditionNames?: string[]; + + /** + * Enforce that a extension from extensions must be used + */ + enforceExtension?: boolean; + + /** + * A list of exports fields in description files + */ + exportsFields?: (string | string[])[]; + + /** + * A list of imports fields in description files + */ + importsFields?: (string | string[])[]; + + /** + * A list of extensions which should be tried for files + */ + extensions?: string[]; + + /** + * The file system which should be used + */ + fileSystem: FileSystem; + + /** + * Use this cache object to unsafely cache the successful requests + */ + unsafeCache?: boolean | Cache; + + /** + * Resolve symlinks to their symlinked location + */ + symlinks?: boolean; + + /** + * A prepared Resolver to which the plugins are attached + */ + resolver?: Resolver; + + /** + * A list of directories to resolve modules from, can be absolute path or folder name + */ + modules?: string | string[]; + + /** + * A list of main fields in description files + */ + mainFields?: ( + | string + | string[] + | { name: string | string[]; forceRelative: boolean } + )[]; + + /** + * A list of main files in directories + */ + mainFiles?: string[]; + + /** + * A list of additional resolve plugins which should be applied + */ + plugins?: Plugin[]; + + /** + * A PnP API that should be used - null is "never", undefined is "auto" + */ + pnpApi?: null | PnpApi; + + /** + * A list of root paths + */ + roots?: string[]; + + /** + * The request is already fully specified and no extensions or directories are resolved for it + */ + fullySpecified?: boolean; + + /** + * Resolve to a context instead of a file + */ + resolveToContext?: boolean; + + /** + * A list of resolve restrictions + */ + restrictions?: (string | RegExp)[]; + + /** + * Use only the sync constraints of the file system calls + */ + useSyncFileSystemCalls?: boolean; + + /** + * Prefer to resolve module requests as relative requests before falling back to modules + */ + preferRelative?: boolean; + + /** + * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots + */ + preferAbsolute?: boolean; +} +type ResolveRequest = BaseResolveRequest & Partial; +declare abstract class Resolver { + fileSystem: FileSystem; + options: ResolveOptionsResolverFactoryObject_1; + hooks: KnownHooks; + ensureHook( + name: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + ): AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + getHook( + name: + | string + | AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + ): AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >; + resolveSync(context: object, path: string, request: string): string | false; + resolve( + context: object, + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, + ): void; + doResolve( + hook: AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + null | ResolveRequest + >, + request: ResolveRequest, + message: null | string, + resolveContext: ResolveContext, + callback: (err?: null | Error, result?: ResolveRequest) => void, + ): void; + parse(identifier: string): ParsedIdentifier; + isModule(path: string): boolean; + isPrivate(path: string): boolean; + isDirectory(path: string): boolean; + join(path: string, request: string): string; + normalize(path: string): string; +} +declare interface Stat { + ( + path: PathLike, + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, + ): void; + ( + path: PathLike, + options: undefined | (StatOptions & { bigint?: false }), + callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, + ): void; + ( + path: PathLike, + options: StatOptions & { bigint: true }, + callback: ( + err: null | NodeJS.ErrnoException, + result?: IBigIntStats, + ) => void, + ): void; + ( + path: PathLike, + options: undefined | StatOptions, + callback: ( + err: null | NodeJS.ErrnoException, + result?: IStats | IBigIntStats, + ) => void, + ): void; +} +declare interface StatOptions { + /** + * need bigint values + */ + bigint?: boolean; +} +declare interface StatSync { + (path: PathLike, options?: undefined): IStats; + ( + path: PathLike, + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, + ): undefined | IStats; + ( + path: PathLike, + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, + ): undefined | IBigIntStats; + (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; + (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, + ): IStats | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): undefined | IStats | IBigIntStats; +} +declare interface StatSyncOptions { + /** + * need bigint values + */ + bigint?: boolean; + + /** + * throw if no entry + */ + throwIfNoEntry?: boolean; +} +declare interface SyncFileSystem { + /** + * read file sync method + */ + readFileSync: ReadFileSync; + + /** + * read dir sync method + */ + readdirSync: ReaddirSync; + + /** + * read json sync method + */ + readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; + + /** + * read link sync method + */ + readlinkSync: ReadlinkSync; + + /** + * lstat sync method + */ + lstatSync?: LStatSync; + + /** + * stat sync method + */ + statSync: StatSync; + + /** + * real path sync method + */ + realpathSync?: RealPathSync; +} +declare interface URL_url extends URL_Import {} +declare interface WriteOnlySet { + add: (item: T) => void; +} +declare function exports( + context: object, + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, +): void; +declare function exports( + context: object, + path: string, + request: string, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, +): void; +declare function exports( + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, +): void; +declare function exports( + path: string, + request: string, + callback: ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void, +): void; +declare namespace exports { + export const sync: ResolveFunction; + export function create( + options: ResolveOptionsOptionalFS, + ): ResolveFunctionAsync; + export namespace create { + export const sync: (options: ResolveOptionsOptionalFS) => ResolveFunction; + } + export namespace ResolverFactory { + export let createResolver: ( + options: ResolveOptionsResolverFactoryObject_2, + ) => Resolver; + } + export const forEachBail: ( + array: T[], + iterator: Iterator, + callback: (err?: null | Error, result?: null | Z, i?: number) => void, + ) => void; + export type ResolveCallback = ( + err: null | ErrorWithDetail, + res?: string | false, + req?: ResolveRequest, + ) => void; + export { + CachedInputFileSystem, + CloneBasenamePlugin, + LogInfoPlugin, + ResolveOptionsOptionalFS, + BaseFileSystem, + PnpApi, + Resolver, + FileSystem, + ResolveContext, + ResolveRequest, + SyncFileSystem, + Plugin, + ResolveOptionsResolverFactoryObject_2 as ResolveOptions, + ResolveFunctionAsync, + ResolveFunction, + }; +} + +export = exports; diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..7a90836 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..740724b --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..620f563 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..858af03 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/node_modules/mri/index.d.ts b/node_modules/mri/index.d.ts new file mode 100644 index 0000000..a46e43d --- /dev/null +++ b/node_modules/mri/index.d.ts @@ -0,0 +1,21 @@ +type Dict = Record; +type Arrayable = T | T[]; +type Default = Dict; + +declare function mri(args?: string[], options?: mri.Options): mri.Argv; + +declare namespace mri { + export interface Options { + boolean?: Arrayable; + string?: Arrayable; + alias?: Dict>; + default?: Dict; + unknown?(flag: string): void; + } + + export type Argv = T & { + _: string[]; + } +} + +export = mri; diff --git a/node_modules/mri/lib/index.js b/node_modules/mri/lib/index.js new file mode 100644 index 0000000..f17f13a --- /dev/null +++ b/node_modules/mri/lib/index.js @@ -0,0 +1,119 @@ +function toArr(any) { + return any == null ? [] : Array.isArray(any) ? any : [any]; +} + +function toVal(out, key, val, opts) { + var x, old=out[key], nxt=( + !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) + : typeof val === 'boolean' ? val + : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) + : (x = +val,x * 0 === 0) ? x : val + ); + out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); +} + +module.exports = function (args, opts) { + args = args || []; + opts = opts || {}; + + var k, arr, arg, name, val, out={ _:[] }; + var i=0, j=0, idx=0, len=args.length; + + const alibi = opts.alias !== void 0; + const strict = opts.unknown !== void 0; + const defaults = opts.default !== void 0; + + opts.alias = opts.alias || {}; + opts.string = toArr(opts.string); + opts.boolean = toArr(opts.boolean); + + if (alibi) { + for (k in opts.alias) { + arr = opts.alias[k] = toArr(opts.alias[k]); + for (i=0; i < arr.length; i++) { + (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); + } + } + } + + for (i=opts.boolean.length; i-- > 0;) { + arr = opts.alias[opts.boolean[i]] || []; + for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); + } + + for (i=opts.string.length; i-- > 0;) { + arr = opts.alias[opts.string[i]] || []; + for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); + } + + if (defaults) { + for (k in opts.default) { + name = typeof opts.default[k]; + arr = opts.alias[k] = opts.alias[k] || []; + if (opts[name] !== void 0) { + opts[name].push(k); + for (i=0; i < arr.length; i++) { + opts[name].push(arr[i]); + } + } + } + } + + const keys = strict ? Object.keys(opts.alias) : []; + + for (i=0; i < len; i++) { + arg = args[i]; + + if (arg === '--') { + out._ = out._.concat(args.slice(++i)); + break; + } + + for (j=0; j < arg.length; j++) { + if (arg.charCodeAt(j) !== 45) break; // "-" + } + + if (j === 0) { + out._.push(arg); + } else if (arg.substring(j, j + 3) === 'no-') { + name = arg.substring(j + 3); + if (strict && !~keys.indexOf(name)) { + return opts.unknown(arg); + } + out[name] = false; + } else { + for (idx=j+1; idx < arg.length; idx++) { + if (arg.charCodeAt(idx) === 61) break; // "=" + } + + name = arg.substring(j, idx); + val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); + arr = (j === 2 ? [name] : name); + + for (idx=0; idx < arr.length; idx++) { + name = arr[idx]; + if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); + toVal(out, name, (idx + 1 < arr.length) || val, opts); + } + } + } + + if (defaults) { + for (k in opts.default) { + if (out[k] === void 0) { + out[k] = opts.default[k]; + } + } + } + + if (alibi) { + for (k in out) { + arr = opts.alias[k] || []; + while (arr.length > 0) { + out[arr.shift()] = out[k]; + } + } + } + + return out; +} diff --git a/node_modules/mri/lib/index.mjs b/node_modules/mri/lib/index.mjs new file mode 100644 index 0000000..1a233e5 --- /dev/null +++ b/node_modules/mri/lib/index.mjs @@ -0,0 +1,119 @@ +function toArr(any) { + return any == null ? [] : Array.isArray(any) ? any : [any]; +} + +function toVal(out, key, val, opts) { + var x, old=out[key], nxt=( + !!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)) + : typeof val === 'boolean' ? val + : !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)) + : (x = +val,x * 0 === 0) ? x : val + ); + out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]); +} + +export default function (args, opts) { + args = args || []; + opts = opts || {}; + + var k, arr, arg, name, val, out={ _:[] }; + var i=0, j=0, idx=0, len=args.length; + + const alibi = opts.alias !== void 0; + const strict = opts.unknown !== void 0; + const defaults = opts.default !== void 0; + + opts.alias = opts.alias || {}; + opts.string = toArr(opts.string); + opts.boolean = toArr(opts.boolean); + + if (alibi) { + for (k in opts.alias) { + arr = opts.alias[k] = toArr(opts.alias[k]); + for (i=0; i < arr.length; i++) { + (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1); + } + } + } + + for (i=opts.boolean.length; i-- > 0;) { + arr = opts.alias[opts.boolean[i]] || []; + for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]); + } + + for (i=opts.string.length; i-- > 0;) { + arr = opts.alias[opts.string[i]] || []; + for (j=arr.length; j-- > 0;) opts.string.push(arr[j]); + } + + if (defaults) { + for (k in opts.default) { + name = typeof opts.default[k]; + arr = opts.alias[k] = opts.alias[k] || []; + if (opts[name] !== void 0) { + opts[name].push(k); + for (i=0; i < arr.length; i++) { + opts[name].push(arr[i]); + } + } + } + } + + const keys = strict ? Object.keys(opts.alias) : []; + + for (i=0; i < len; i++) { + arg = args[i]; + + if (arg === '--') { + out._ = out._.concat(args.slice(++i)); + break; + } + + for (j=0; j < arg.length; j++) { + if (arg.charCodeAt(j) !== 45) break; // "-" + } + + if (j === 0) { + out._.push(arg); + } else if (arg.substring(j, j + 3) === 'no-') { + name = arg.substring(j + 3); + if (strict && !~keys.indexOf(name)) { + return opts.unknown(arg); + } + out[name] = false; + } else { + for (idx=j+1; idx < arg.length; idx++) { + if (arg.charCodeAt(idx) === 61) break; // "=" + } + + name = arg.substring(j, idx); + val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]); + arr = (j === 2 ? [name] : name); + + for (idx=0; idx < arr.length; idx++) { + name = arr[idx]; + if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name); + toVal(out, name, (idx + 1 < arr.length) || val, opts); + } + } + } + + if (defaults) { + for (k in opts.default) { + if (out[k] === void 0) { + out[k] = opts.default[k]; + } + } + } + + if (alibi) { + for (k in out) { + arr = opts.alias[k] || []; + while (arr.length > 0) { + out[arr.shift()] = out[k]; + } + } + } + + return out; +} diff --git a/node_modules/mri/license.md b/node_modules/mri/license.md new file mode 100644 index 0000000..a3f96f8 --- /dev/null +++ b/node_modules/mri/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Luke Edwards (lukeed.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mri/package.json b/node_modules/mri/package.json new file mode 100644 index 0000000..5a224b2 --- /dev/null +++ b/node_modules/mri/package.json @@ -0,0 +1,43 @@ +{ + "name": "mri", + "version": "1.2.0", + "description": "Quickly scan for CLI flags and arguments", + "repository": "lukeed/mri", + "module": "lib/index.mjs", + "main": "lib/index.js", + "types": "index.d.ts", + "license": "MIT", + "files": [ + "*.d.ts", + "lib" + ], + "author": { + "name": "Luke Edwards", + "email": "luke.edwards05@gmail.com", + "url": "https://lukeed.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "build": "bundt", + "bench": "node bench", + "pretest": "npm run build", + "test": "tape test/*.js | tap-spec" + }, + "keywords": [ + "argv", + "arguments", + "cli", + "minimist", + "options", + "optimist", + "parser", + "args" + ], + "devDependencies": { + "bundt": "1.0.2", + "tap-spec": "4.1.2", + "tape": "4.13.3" + } +} diff --git a/node_modules/mri/readme.md b/node_modules/mri/readme.md new file mode 100644 index 0000000..9067e80 --- /dev/null +++ b/node_modules/mri/readme.md @@ -0,0 +1,166 @@ +# mri [![CI](https://github.com/lukeed/mri/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/lukeed/mri/actions) + +> Quickly scan for CLI flags and arguments + +This is a [fast](#benchmarks) and lightweight alternative to [`minimist`](https://github.com/substack/minimist) and [`yargs-parser`](https://github.com/yargs/yargs-parser). + +It only exists because I find that I usually don't need most of what `minimist` and `yargs-parser` have to offer. However, `mri` is similar _enough_ that it might function as a "drop-in replacement" for you, too! + +See [Comparisons](#comparisons) for more info. + +## Install + +```sh +$ npm install --save mri +``` + +## Usage + +```sh +$ demo-cli --foo --bar=baz -mtv -- hello world +``` + +```js +const mri = require('mri'); + +const argv = process.argv.slice(2); + +mri(argv); +//=> { _: ['hello', 'world'], foo:true, bar:'baz', m:true, t:true, v:true } + +mri(argv, { boolean:['bar'] }); +//=> { _: ['baz', 'hello', 'world'], foo:true, bar:true, m:true, t:true, v:true } + +mri(argv, { + alias: { + b: 'bar', + foo: ['f', 'fuz'] + } +}); +//=> { _: ['hello', 'world'], foo:true, f:true, fuz:true, b:'baz', bar:'baz', m:true, t:true, v:true } +``` + +## API + +### mri(args, options) +Return: `Object` + +#### args +Type: `Array`
+Default: `[]` + +An array of arguments to parse. For CLI usage, send `process.argv.slice(2)`. See [`process.argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) for info. + +#### options.alias +Type: `Object`
+Default: `{}` + +An object of keys whose values are `String`s or `Array` of aliases. These will be added to the parsed output with matching values. + +#### options.boolean +Type: `Array|String`
+Default: `[]` + +A single key (or array of keys) that should be parsed as `Boolean`s. + +#### options.default +Type: `Object`
+Default: `{}` + +An `key:value` object of defaults. If a default is provided for a key, its type (`typeof`) will be used to cast parsed arguments. + +```js +mri(['--foo', 'bar']); +//=> { _:[], foo:'bar' } + +mri(['--foo', 'bar'], { + default: { foo:true, baz:'hello', bat:42 } +}); +//=> { _:['bar'], foo:true, baz:'hello', bat:42 } +``` + +> **Note:** Because `--foo` has a default of `true`, its output is cast to a Boolean. This means that `foo=true`, making `'bar'` an extra argument (`_` key). + +#### options.string +Type: `Array|String`
+Default: `[]` + +A single key (or array of keys) that should be parsed as `String`s. + +#### options.unknown +Type: `Function`
+Default: `undefined` + +Callback that is run when a parsed flag has not been defined as a known key or alias. Its only parameter is the unknown flag itself; eg `--foobar` or `-f`. + +Once an unknown flag is encountered, parsing will terminate, regardless of your return value. + +> **Note:** `mri` _only_ checks for unknown flags if `options.unknown` **and** `options.alias` are populated. Otherwise, everything will be accepted. + + +## Comparisons + +#### minimist + +- `mri` is 5x faster (see [benchmarks](#benchmarks)) +- Numerical values are cast as `Number`s when possible + - A key (and its aliases) will always honor `opts.boolean` or `opts.string` +- Short flag groups are treated as `Boolean`s by default: + ```js + minimist(['-abc', 'hello']); + //=> { _:[], a:'', b:'', c:'hello' } + + mri(['-abc', 'hello']); + //=> { _:[], a:true, b:true, c:'hello' } + ``` +- The `opts.unknown` behaves differently: + - Unlike `minimist`, `mri` will not continue continue parsing after encountering an unknown flag +- Missing `options`: + - `opts.stopEarly` + - `opts['--']` +- Ignores newlines (`\n`) within args (see [test](https://github.com/substack/minimist/blob/master/test/parse.js#L69-L80)) +- Ignores slashBreaks within args (see [test](https://github.com/substack/minimist/blob/master/test/parse.js#L147-L157)) +- Ignores dot-nested flags (see [test](https://github.com/substack/minimist/blob/master/test/parse.js#L180-L197)) + +#### yargs-parser + +- `mri` is 40x faster (see [benchmarks](#benchmarks)) +- Numerical values are cast as `Number`s when possible + - A key (and its aliases) will always honor `opts.boolean` or `opts.string` +- Missing `options`: + - `opts.array` + - `opts.config` + - `opts.coerce` + - `opts.count` + - `opts.envPrefix` + - `opts.narg` + - `opts.normalize` + - `opts.configuration` + - `opts.number` + - `opts['--']` +- Missing [`parser.detailed()`](https://github.com/yargs/yargs-parser#requireyargs-parserdetailedargs-opts) method +- No [additional configuration](https://github.com/yargs/yargs-parser#configuration) object +- Added [`options.unknown`](#optionsunknown) feature + + +## Benchmarks + +> Running Node.js v10.13.0 + +``` +Load Times: + nopt 3.179ms + yargs-parser 2.137ms + minimist 0.746ms + mri 0.517ms + +Benchmark: + minimist x 328,747 ops/sec ±1.09% (89 runs sampled) + mri x 1,622,801 ops/sec ±0.94% (92 runs sampled) + nopt x 888,223 ops/sec ±0.22% (92 runs sampled) + yargs-parser x 30,538 ops/sec ±0.81% (91 runs sampled) +``` + +## License + +MIT © [Luke Edwards](https://lukeed.com) diff --git a/node_modules/node-addon-api/LICENSE.md b/node_modules/node-addon-api/LICENSE.md new file mode 100644 index 0000000..819d91a --- /dev/null +++ b/node_modules/node-addon-api/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2017 [Node.js API collaborators](https://github.com/nodejs/node-addon-api#collaborators) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/node-addon-api/README.md b/node_modules/node-addon-api/README.md new file mode 100644 index 0000000..e90eb7c --- /dev/null +++ b/node_modules/node-addon-api/README.md @@ -0,0 +1,319 @@ +NOTE: The default branch has been renamed! +master is now named main + +If you have a local clone, you can update it by running: + +```shell +git branch -m master main +git fetch origin +git branch -u origin/main main +``` + +# **node-addon-api module** +This module contains **header-only C++ wrapper classes** which simplify +the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) +provided by Node.js when using C++. It provides a C++ object model +and exception handling semantics with low overhead. + +There are three options for implementing addons: Node-API, nan, or direct +use of internal V8, libuv, and Node.js libraries. Unless there is a need for +direct access to functionality that is not exposed by Node-API as outlined +in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html) +in Node.js core, use Node-API. Refer to +[C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) +for more information on Node-API. + +Node-API is an ABI stable C interface provided by Node.js for building native +addons. It is independent of the underlying JavaScript runtime (e.g. V8 or ChakraCore) +and is maintained as part of Node.js itself. It is intended to insulate +native addons from changes in the underlying JavaScript engine and allow +modules compiled for one version to run on later versions of Node.js without +recompilation. + +The `node-addon-api` module, which is not part of Node.js, preserves the benefits +of the Node-API as it consists only of inline code that depends only on the stable API +provided by Node-API. As such, modules built against one version of Node.js +using node-addon-api should run without having to be rebuilt with newer versions +of Node.js. + +It is important to remember that *other* Node.js interfaces such as +`libuv` (included in a project via `#include `) are not ABI-stable across +Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api` +exclusively and build against a version of Node.js that includes an +implementation of Node-API (meaning an active LTS version of Node.js) in +order to benefit from ABI stability across Node.js major versions. Node.js +provides an [ABI stability guide][] containing a detailed explanation of ABI +stability in general, and the Node-API ABI stability guarantee in particular. + +As new APIs are added to Node-API, node-addon-api must be updated to provide +wrappers for those new APIs. For this reason, node-addon-api provides +methods that allow callers to obtain the underlying Node-API handles so +direct calls to Node-API and the use of the objects/methods provided by +node-addon-api can be used together. For example, in order to be able +to use an API for which the node-addon-api does not yet provide a wrapper. + +APIs exposed by node-addon-api are generally used to create and +manipulate JavaScript values. Concepts and operations generally map +to ideas specified in the **ECMA262 Language Specification**. + +The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an +excellent orientation and tips for developers just getting started with Node-API +and node-addon-api. + +- **[Setup](#setup)** +- **[API Documentation](#api)** +- **[Examples](#examples)** +- **[Tests](#tests)** +- **[More resource and info about native Addons](#resources)** +- **[Badges](#badges)** +- **[Code of Conduct](CODE_OF_CONDUCT.md)** +- **[Contributors](#contributors)** +- **[License](#license)** + +## **Current version: 7.1.1** + +(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog) + +[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/) + + + +node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions. +This allows addons built with it to run with Node.js versions which support the targeted Node-API version. +**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that +every year there will be a new major which drops support for the Node.js LTS version which has gone out of service. + +The oldest Node.js version supported by the current version of node-addon-api is Node.js 16.x. + +## Setup + - [Installation and usage](doc/setup.md) + - [node-gyp](doc/node-gyp.md) + - [cmake-js](doc/cmake-js.md) + - [Conversion tool](doc/conversion-tool.md) + - [Checker tool](doc/checker-tool.md) + - [Generator](doc/generator.md) + - [Prebuild tools](doc/prebuild_tools.md) + + + +### **API Documentation** + +The following is the documentation for node-addon-api. + + - [Full Class Hierarchy](doc/hierarchy.md) + - [Addon Structure](doc/addon.md) + - Data Types: + - [Env](doc/env.md) + - [CallbackInfo](doc/callbackinfo.md) + - [Reference](doc/reference.md) + - [Value](doc/value.md) + - [Name](doc/name.md) + - [Symbol](doc/symbol.md) + - [String](doc/string.md) + - [Number](doc/number.md) + - [Date](doc/date.md) + - [BigInt](doc/bigint.md) + - [Boolean](doc/boolean.md) + - [External](doc/external.md) + - [Object](doc/object.md) + - [Array](doc/array.md) + - [ObjectReference](doc/object_reference.md) + - [PropertyDescriptor](doc/property_descriptor.md) + - [Function](doc/function.md) + - [FunctionReference](doc/function_reference.md) + - [ObjectWrap](doc/object_wrap.md) + - [ClassPropertyDescriptor](doc/class_property_descriptor.md) + - [Buffer](doc/buffer.md) + - [ArrayBuffer](doc/array_buffer.md) + - [TypedArray](doc/typed_array.md) + - [TypedArrayOf](doc/typed_array_of.md) + - [DataView](doc/dataview.md) + - [Error Handling](doc/error_handling.md) + - [Error](doc/error.md) + - [TypeError](doc/type_error.md) + - [RangeError](doc/range_error.md) + - [SyntaxError](doc/syntax_error.md) + - [Object Lifetime Management](doc/object_lifetime_management.md) + - [HandleScope](doc/handle_scope.md) + - [EscapableHandleScope](doc/escapable_handle_scope.md) + - [Memory Management](doc/memory_management.md) + - [Async Operations](doc/async_operations.md) + - [AsyncWorker](doc/async_worker.md) + - [AsyncContext](doc/async_context.md) + - [AsyncWorker Variants](doc/async_worker_variants.md) + - [Thread-safe Functions](doc/threadsafe.md) + - [ThreadSafeFunction](doc/threadsafe_function.md) + - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md) + - [Promises](doc/promises.md) + - [Version management](doc/version_management.md) + + + +### **Examples** + +Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)** + +- **[Hello World](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/1_hello_world)** +- **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/2_function_arguments/node-addon-api)** +- **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/3_callbacks/node-addon-api)** +- **[Object factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/4_object_factory/node-addon-api)** +- **[Function factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/5_function_factory/node-addon-api)** +- **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/6_object_wrap/node-addon-api)** +- **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/7_factory_wrap/node-addon-api)** +- **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/main/src/2-js-to-native-conversion/8_passing_wrapped/node-addon-api)** + + + +### **Tests** + +To run the **node-addon-api** tests do: + +``` +npm install +npm test +``` + +To avoid testing the deprecated portions of the API run +``` +npm install +npm test --disable-deprecated +``` + +To run the tests targeting a specific version of Node-API run +``` +npm install +export NAPI_VERSION=X +npm test --NAPI_VERSION=X +``` + +where X is the version of Node-API you want to target. + +To run a specific unit test, filter conditions are available + +**Example:** + compile and run only tests on objectwrap.cc and objectwrap.js + ``` + npm run unit --filter=objectwrap + ``` + +Multiple unit tests cane be selected with wildcards + +**Example:** +compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc + ``` + npm run unit --filter=*reference + ``` + +Multiple filter conditions can be joined to broaden the test selection + +**Example:** + compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file + npm run unit --filter='*function objectwrap' + +### **Debug** + +To run the **node-addon-api** tests with `--debug` option: + +``` +npm run-script dev +``` + +If you want a faster build, you might use the following option: + +``` +npm run-script dev:incremental +``` + +Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)** + +### **Benchmarks** + +You can run the available benchmarks using the following command: + +``` +npm run-script benchmark +``` + +See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks. + + + +### **More resource and info about native Addons** +- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)** +- **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)** +- **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)** +- **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)** + +As node-addon-api's core mission is to expose the plain C Node-API as C++ +wrappers, tools that facilitate n-api/node-addon-api providing more +convenient patterns for developing a Node.js add-on with n-api/node-addon-api +can be published to NPM as standalone packages. It is also recommended to tag +such packages with `node-addon-api` to provide more visibility to the community. + +Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api). + + + +### **Other bindings** + +- **[napi-rs](https://napi.rs)** - (`Rust`) + + + +### **Badges** + +The use of badges is recommended to indicate the minimum version of Node-API +required for the module. This helps to determine which Node.js major versions are +supported. Addon maintainers can consult the [Node-API support matrix][] to determine +which Node.js versions provide a given Node-API version. The following badges are +available: + +![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg) +![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg) +![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg) +![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg) +![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg) +![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg) +![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg) +![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg) +![Node-API v9 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v9%20Badge.svg) +![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg) + +## **Contributing** + +We love contributions from the community to **node-addon-api**! +See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module. + + + +## Team members + +### Active +| Name | GitHub Link | +| ------------------- | ----------------------------------------------------- | +| Anna Henningsen | [addaleax](https://github.com/addaleax) | +| Chengzhong Wu | [legendecas](https://github.com/legendecas) | +| Jack Xia | [JckXia](https://github.com/JckXia) | +| Kevin Eady | [KevinEady](https://github.com/KevinEady) | +| Michael Dawson | [mhdawson](https://github.com/mhdawson) | +| Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) | +| Vladimir Morozov | [vmoroz](https://github.com/vmoroz) | + +### Emeritus +| Name | GitHub Link | +| ------------------- | ----------------------------------------------------- | +| Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) | +| Benjamin Byholm | [kkoopa](https://github.com/kkoopa) | +| Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) | +| Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) | +| Jason Ginchereau | [jasongin](https://github.com/jasongin) | +| Jim Schlight | [jschlight](https://github.com/jschlight) | +| Sampson Gao | [sampsongao](https://github.com/sampsongao) | +| Taylor Woll | [boingoing](https://github.com/boingoing) | + + + +Licensed under [MIT](./LICENSE.md) + +[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/ +[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix diff --git a/node_modules/node-addon-api/common.gypi b/node_modules/node-addon-api/common.gypi new file mode 100644 index 0000000..06c0176 --- /dev/null +++ b/node_modules/node-addon-api/common.gypi @@ -0,0 +1,20 @@ +{ + 'variables': { + 'NAPI_VERSION%': " +inline PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, + Getter getter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + napi_value name, + Getter getter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, nullptr}); + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Name name, Getter getter, napi_property_attributes attributes, void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Accessor(nameValue, getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::AccessorCallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, setter, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + napi_value name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* /*data*/) { + using CbData = details::AccessorCallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({getter, setter, nullptr}); + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Accessor( + nameValue, getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + const char* utf8name, + Callable cb, + napi_property_attributes attributes, + void* /*data*/) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({cb, nullptr}); + + return PropertyDescriptor({utf8name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return Function(utf8name.c_str(), cb, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + napi_value name, + Callable cb, + napi_property_attributes attributes, + void* /*data*/) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + // TODO: Delete when the function is destroyed + auto callbackData = new CbData({cb, nullptr}); + + return PropertyDescriptor({nullptr, + name, + CbData::Wrapper, + nullptr, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Name name, Callable cb, napi_property_attributes attributes, void* data) { + napi_value nameValue = name; + return PropertyDescriptor::Function(nameValue, cb, attributes, data); +} + +#endif // !SRC_NAPI_INL_DEPRECATED_H_ diff --git a/node_modules/node-addon-api/napi-inl.h b/node_modules/node-addon-api/napi-inl.h new file mode 100644 index 0000000..a5ae7af --- /dev/null +++ b/node_modules/node-addon-api/napi-inl.h @@ -0,0 +1,6607 @@ +#ifndef SRC_NAPI_INL_H_ +#define SRC_NAPI_INL_H_ + +//////////////////////////////////////////////////////////////////////////////// +// Node-API C++ Wrapper Classes +// +// Inline header-only implementations for "Node-API" ABI-stable C APIs for +// Node.js. +//////////////////////////////////////////////////////////////////////////////// + +// Note: Do not include this file directly! Include "napi.h" instead. + +#include +#include +#if NAPI_HAS_THREADS +#include +#endif // NAPI_HAS_THREADS +#include +#include + +namespace Napi { + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +namespace NAPI_CPP_CUSTOM_NAMESPACE { +#endif + +// Helpers to handle functions exposed from C++ and internal constants. +namespace details { + +// New napi_status constants not yet available in all supported versions of +// Node.js releases. Only necessary when they are used in napi.h and napi-inl.h. +constexpr int napi_no_external_buffers_allowed = 22; + +template +inline void default_finalizer(napi_env /*env*/, void* data, void* /*hint*/) { + delete static_cast(data); +} + +// Attach a data item to an object and delete it when the object gets +// garbage-collected. +// TODO: Replace this code with `napi_add_finalizer()` whenever it becomes +// available on all supported versions of Node.js. +template > +inline napi_status AttachData(napi_env env, + napi_value obj, + FreeType* data, + void* hint = nullptr) { + napi_status status; +#if (NAPI_VERSION < 5) + napi_value symbol, external; + status = napi_create_symbol(env, nullptr, &symbol); + if (status == napi_ok) { + status = napi_create_external(env, data, finalizer, hint, &external); + if (status == napi_ok) { + napi_property_descriptor desc = {nullptr, + symbol, + nullptr, + nullptr, + nullptr, + external, + napi_default, + nullptr}; + status = napi_define_properties(env, obj, 1, &desc); + } + } +#else // NAPI_VERSION >= 5 + status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr); +#endif + return status; +} + +// For use in JS to C++ callback wrappers to catch any Napi::Error exceptions +// and rethrow them as JavaScript exceptions before returning from the callback. +template +inline napi_value WrapCallback(Callable callback) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + return callback(); + } catch (const Error& e) { + e.ThrowAsJavaScriptException(); + return nullptr; + } +#else // NAPI_CPP_EXCEPTIONS + // When C++ exceptions are disabled, errors are immediately thrown as JS + // exceptions, so there is no need to catch and rethrow them here. + return callback(); +#endif // NAPI_CPP_EXCEPTIONS +} + +// For use in JS to C++ void callback wrappers to catch any Napi::Error +// exceptions and rethrow them as JavaScript exceptions before returning from +// the callback. +template +inline void WrapVoidCallback(Callable callback) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + callback(); + } catch (const Error& e) { + e.ThrowAsJavaScriptException(); + } +#else // NAPI_CPP_EXCEPTIONS + // When C++ exceptions are disabled, errors are immediately thrown as JS + // exceptions, so there is no need to catch and rethrow them here. + callback(); +#endif // NAPI_CPP_EXCEPTIONS +} + +template +struct CallbackData { + static inline napi_value Wrapper(napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + CallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->callback(callbackInfo); + }); + } + + Callable callback; + void* data; +}; + +template +struct CallbackData { + static inline napi_value Wrapper(napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + CallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->callback(callbackInfo); + return nullptr; + }); + } + + Callable callback; + void* data; +}; + +template +napi_value TemplatedVoidCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + Callback(cbInfo); + return nullptr; + }); +} + +template +napi_value TemplatedCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + return Callback(cbInfo); + }); +} + +template +napi_value TemplatedInstanceCallback(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + return instance ? (instance->*UnwrapCallback)(cbInfo) : Napi::Value(); + }); +} + +template +napi_value TemplatedInstanceVoidCallback(napi_env env, napi_callback_info info) + NAPI_NOEXCEPT { + return details::WrapCallback([&] { + CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + if (instance) (instance->*UnwrapCallback)(cbInfo); + return nullptr; + }); +} + +template +struct FinalizeData { + static inline void Wrapper(napi_env env, + void* data, + void* finalizeHint) NAPI_NOEXCEPT { + WrapVoidCallback([&] { + FinalizeData* finalizeData = static_cast(finalizeHint); + finalizeData->callback(Env(env), static_cast(data)); + delete finalizeData; + }); + } + + static inline void WrapperWithHint(napi_env env, + void* data, + void* finalizeHint) NAPI_NOEXCEPT { + WrapVoidCallback([&] { + FinalizeData* finalizeData = static_cast(finalizeHint); + finalizeData->callback( + Env(env), static_cast(data), finalizeData->hint); + delete finalizeData; + }); + } + + Finalizer callback; + Hint* hint; +}; + +#if (NAPI_VERSION > 3 && NAPI_HAS_THREADS) +template , + typename FinalizerDataType = void> +struct ThreadSafeFinalize { + static inline void Wrapper(napi_env env, + void* rawFinalizeData, + void* /* rawContext */) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env)); + delete finalizeData; + } + + static inline void FinalizeWrapperWithData(napi_env env, + void* rawFinalizeData, + void* /* rawContext */) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env), finalizeData->data); + delete finalizeData; + } + + static inline void FinalizeWrapperWithContext(napi_env env, + void* rawFinalizeData, + void* rawContext) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback(Env(env), static_cast(rawContext)); + delete finalizeData; + } + + static inline void FinalizeFinalizeWrapperWithDataAndContext( + napi_env env, void* rawFinalizeData, void* rawContext) { + if (rawFinalizeData == nullptr) return; + + ThreadSafeFinalize* finalizeData = + static_cast(rawFinalizeData); + finalizeData->callback( + Env(env), finalizeData->data, static_cast(rawContext)); + delete finalizeData; + } + + FinalizerDataType* data; + Finalizer callback; +}; + +template +inline typename std::enable_if(nullptr)>::type +CallJsWrapper(napi_env env, napi_value jsCallback, void* context, void* data) { + details::WrapVoidCallback([&]() { + call(env, + Function(env, jsCallback), + static_cast(context), + static_cast(data)); + }); +} + +template +inline typename std::enable_if(nullptr)>::type +CallJsWrapper(napi_env env, + napi_value jsCallback, + void* /*context*/, + void* /*data*/) { + details::WrapVoidCallback([&]() { + if (jsCallback != nullptr) { + Function(env, jsCallback).Call(0, nullptr); + } + }); +} + +#if NAPI_VERSION > 4 + +template +napi_value DefaultCallbackWrapper(napi_env /*env*/, std::nullptr_t /*cb*/) { + return nullptr; +} + +template +napi_value DefaultCallbackWrapper(napi_env /*env*/, Napi::Function cb) { + return cb; +} + +#else +template +napi_value DefaultCallbackWrapper(napi_env env, Napi::Function cb) { + if (cb.IsEmpty()) { + return TSFN::EmptyFunctionFactory(env); + } + return cb; +} +#endif // NAPI_VERSION > 4 +#endif // NAPI_VERSION > 3 && NAPI_HAS_THREADS + +template +struct AccessorCallbackData { + static inline napi_value GetterWrapper(napi_env env, + napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + AccessorCallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->getterCallback(callbackInfo); + }); + } + + static inline napi_value SetterWrapper(napi_env env, + napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + AccessorCallbackData* callbackData = + static_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->setterCallback(callbackInfo); + return nullptr; + }); + } + + Getter getterCallback; + Setter setterCallback; + void* data; +}; + +} // namespace details + +#ifndef NODE_ADDON_API_DISABLE_DEPRECATED +#include "napi-inl.deprecated.h" +#endif // !NODE_ADDON_API_DISABLE_DEPRECATED + +//////////////////////////////////////////////////////////////////////////////// +// Module registration +//////////////////////////////////////////////////////////////////////////////// + +// Register an add-on based on an initializer function. +#define NODE_API_MODULE(modname, regfunc) \ + static napi_value __napi_##regfunc(napi_env env, napi_value exports) { \ + return Napi::RegisterModule(env, exports, regfunc); \ + } \ + NAPI_MODULE(modname, __napi_##regfunc) + +// Register an add-on based on a subclass of `Addon` with a custom Node.js +// module name. +#define NODE_API_NAMED_ADDON(modname, classname) \ + static napi_value __napi_##classname(napi_env env, napi_value exports) { \ + return Napi::RegisterModule(env, exports, &classname::Init); \ + } \ + NAPI_MODULE(modname, __napi_##classname) + +// Register an add-on based on a subclass of `Addon` with the Node.js module +// name given by node-gyp from the `target_name` in binding.gyp. +#define NODE_API_ADDON(classname) \ + NODE_API_NAMED_ADDON(NODE_GYP_MODULE_NAME, classname) + +// Adapt the NAPI_MODULE registration function: +// - Wrap the arguments in NAPI wrappers. +// - Catch any NAPI errors and rethrow as JS exceptions. +inline napi_value RegisterModule(napi_env env, + napi_value exports, + ModuleRegisterCallback registerCallback) { + return details::WrapCallback([&] { + return napi_value( + registerCallback(Napi::Env(env), Napi::Object(env, exports))); + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// Maybe class +//////////////////////////////////////////////////////////////////////////////// + +template +bool Maybe::IsNothing() const { + return !_has_value; +} + +template +bool Maybe::IsJust() const { + return _has_value; +} + +template +void Maybe::Check() const { + NAPI_CHECK(IsJust(), "Napi::Maybe::Check", "Maybe value is Nothing."); +} + +template +T Maybe::Unwrap() const { + NAPI_CHECK(IsJust(), "Napi::Maybe::Unwrap", "Maybe value is Nothing."); + return _value; +} + +template +T Maybe::UnwrapOr(const T& default_value) const { + return _has_value ? _value : default_value; +} + +template +bool Maybe::UnwrapTo(T* out) const { + if (IsJust()) { + *out = _value; + return true; + }; + return false; +} + +template +bool Maybe::operator==(const Maybe& other) const { + return (IsJust() == other.IsJust()) && + (!IsJust() || Unwrap() == other.Unwrap()); +} + +template +bool Maybe::operator!=(const Maybe& other) const { + return !operator==(other); +} + +template +Maybe::Maybe() : _has_value(false) {} + +template +Maybe::Maybe(const T& t) : _has_value(true), _value(t) {} + +template +inline Maybe Nothing() { + return Maybe(); +} + +template +inline Maybe Just(const T& t) { + return Maybe(t); +} + +//////////////////////////////////////////////////////////////////////////////// +// Env class +//////////////////////////////////////////////////////////////////////////////// + +inline Env::Env(napi_env env) : _env(env) {} + +inline Env::operator napi_env() const { + return _env; +} + +inline Object Env::Global() const { + napi_value value; + napi_status status = napi_get_global(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Object()); + return Object(*this, value); +} + +inline Value Env::Undefined() const { + napi_value value; + napi_status status = napi_get_undefined(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Value()); + return Value(*this, value); +} + +inline Value Env::Null() const { + napi_value value; + napi_status status = napi_get_null(*this, &value); + NAPI_THROW_IF_FAILED(*this, status, Value()); + return Value(*this, value); +} + +inline bool Env::IsExceptionPending() const { + bool result; + napi_status status = napi_is_exception_pending(_env, &result); + if (status != napi_ok) + result = false; // Checking for a pending exception shouldn't throw. + return result; +} + +inline Error Env::GetAndClearPendingException() const { + napi_value value; + napi_status status = napi_get_and_clear_last_exception(_env, &value); + if (status != napi_ok) { + // Don't throw another exception when failing to get the exception! + return Error(); + } + return Error(_env, value); +} + +inline MaybeOrValue Env::RunScript(const char* utf8script) const { + String script = String::New(_env, utf8script); + return RunScript(script); +} + +inline MaybeOrValue Env::RunScript(const std::string& utf8script) const { + return RunScript(utf8script.c_str()); +} + +inline MaybeOrValue Env::RunScript(String script) const { + napi_value result; + napi_status status = napi_run_script(_env, script, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +#if NAPI_VERSION > 2 +template +void Env::CleanupHook::Wrapper(void* data) NAPI_NOEXCEPT { + auto* cleanupData = + static_cast::CleanupData*>( + data); + cleanupData->hook(); + delete cleanupData; +} + +template +void Env::CleanupHook::WrapperWithArg(void* data) NAPI_NOEXCEPT { + auto* cleanupData = + static_cast::CleanupData*>( + data); + cleanupData->hook(static_cast(cleanupData->arg)); + delete cleanupData; +} +#endif // NAPI_VERSION > 2 + +#if NAPI_VERSION > 5 +template fini> +inline void Env::SetInstanceData(T* data) const { + napi_status status = napi_set_instance_data( + _env, + data, + [](napi_env env, void* data, void*) { fini(env, static_cast(data)); }, + nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template fini> +inline void Env::SetInstanceData(DataType* data, HintType* hint) const { + napi_status status = napi_set_instance_data( + _env, + data, + [](napi_env env, void* data, void* hint) { + fini(env, static_cast(data), static_cast(hint)); + }, + hint); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template +inline T* Env::GetInstanceData() const { + void* data = nullptr; + + napi_status status = napi_get_instance_data(_env, &data); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + + return static_cast(data); +} + +template +void Env::DefaultFini(Env, T* data) { + delete data; +} + +template +void Env::DefaultFiniWithHint(Env, DataType* data, HintType*) { + delete data; +} +#endif // NAPI_VERSION > 5 + +#if NAPI_VERSION > 8 +inline const char* Env::GetModuleFileName() const { + const char* result; + napi_status status = node_api_get_module_file_name(_env, &result); + NAPI_THROW_IF_FAILED(*this, status, nullptr); + return result; +} +#endif // NAPI_VERSION > 8 +//////////////////////////////////////////////////////////////////////////////// +// Value class +//////////////////////////////////////////////////////////////////////////////// + +inline Value::Value() : _env(nullptr), _value(nullptr) {} + +inline Value::Value(napi_env env, napi_value value) + : _env(env), _value(value) {} + +inline Value::operator napi_value() const { + return _value; +} + +inline bool Value::operator==(const Value& other) const { + return StrictEquals(other); +} + +inline bool Value::operator!=(const Value& other) const { + return !this->operator==(other); +} + +inline bool Value::StrictEquals(const Value& other) const { + bool result; + napi_status status = napi_strict_equals(_env, *this, other, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline Napi::Env Value::Env() const { + return Napi::Env(_env); +} + +inline bool Value::IsEmpty() const { + return _value == nullptr; +} + +inline napi_valuetype Value::Type() const { + if (IsEmpty()) { + return napi_undefined; + } + + napi_valuetype type; + napi_status status = napi_typeof(_env, _value, &type); + NAPI_THROW_IF_FAILED(_env, status, napi_undefined); + return type; +} + +inline bool Value::IsUndefined() const { + return Type() == napi_undefined; +} + +inline bool Value::IsNull() const { + return Type() == napi_null; +} + +inline bool Value::IsBoolean() const { + return Type() == napi_boolean; +} + +inline bool Value::IsNumber() const { + return Type() == napi_number; +} + +#if NAPI_VERSION > 5 +inline bool Value::IsBigInt() const { + return Type() == napi_bigint; +} +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +inline bool Value::IsDate() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_date(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} +#endif + +inline bool Value::IsString() const { + return Type() == napi_string; +} + +inline bool Value::IsSymbol() const { + return Type() == napi_symbol; +} + +inline bool Value::IsArray() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_array(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsArrayBuffer() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_arraybuffer(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsTypedArray() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_typedarray(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsObject() const { + return Type() == napi_object || IsFunction(); +} + +inline bool Value::IsFunction() const { + return Type() == napi_function; +} + +inline bool Value::IsPromise() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_promise(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsDataView() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_dataview(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsBuffer() const { + if (IsEmpty()) { + return false; + } + + bool result; + napi_status status = napi_is_buffer(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +inline bool Value::IsExternal() const { + return Type() == napi_external; +} + +template +inline T Value::As() const { +#ifdef NODE_ADDON_API_ENABLE_TYPE_CHECK_ON_AS + T::CheckCast(_env, _value); +#endif + return T(_env, _value); +} + +inline MaybeOrValue Value::ToBoolean() const { + napi_value result; + napi_status status = napi_coerce_to_bool(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Boolean(_env, result), Napi::Boolean); +} + +inline MaybeOrValue Value::ToNumber() const { + napi_value result; + napi_status status = napi_coerce_to_number(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Number(_env, result), Napi::Number); +} + +inline MaybeOrValue Value::ToString() const { + napi_value result; + napi_status status = napi_coerce_to_string(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::String(_env, result), Napi::String); +} + +inline MaybeOrValue Value::ToObject() const { + napi_value result; + napi_status status = napi_coerce_to_object(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Object(_env, result), Napi::Object); +} + +//////////////////////////////////////////////////////////////////////////////// +// Boolean class +//////////////////////////////////////////////////////////////////////////////// + +inline Boolean Boolean::New(napi_env env, bool val) { + napi_value value; + napi_status status = napi_get_boolean(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Boolean()); + return Boolean(env, value); +} + +inline void Boolean::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Boolean::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Boolean::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_boolean, "Boolean::CheckCast", "value is not napi_boolean"); +} + +inline Boolean::Boolean() : Napi::Value() {} + +inline Boolean::Boolean(napi_env env, napi_value value) + : Napi::Value(env, value) {} + +inline Boolean::operator bool() const { + return Value(); +} + +inline bool Boolean::Value() const { + bool result; + napi_status status = napi_get_value_bool(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// Number class +//////////////////////////////////////////////////////////////////////////////// + +inline Number Number::New(napi_env env, double val) { + napi_value value; + napi_status status = napi_create_double(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Number()); + return Number(env, value); +} + +inline void Number::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Number::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Number::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_number, "Number::CheckCast", "value is not napi_number"); +} + +inline Number::Number() : Value() {} + +inline Number::Number(napi_env env, napi_value value) : Value(env, value) {} + +inline Number::operator int32_t() const { + return Int32Value(); +} + +inline Number::operator uint32_t() const { + return Uint32Value(); +} + +inline Number::operator int64_t() const { + return Int64Value(); +} + +inline Number::operator float() const { + return FloatValue(); +} + +inline Number::operator double() const { + return DoubleValue(); +} + +inline int32_t Number::Int32Value() const { + int32_t result; + napi_status status = napi_get_value_int32(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline uint32_t Number::Uint32Value() const { + uint32_t result; + napi_status status = napi_get_value_uint32(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline int64_t Number::Int64Value() const { + int64_t result; + napi_status status = napi_get_value_int64(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline float Number::FloatValue() const { + return static_cast(DoubleValue()); +} + +inline double Number::DoubleValue() const { + double result; + napi_status status = napi_get_value_double(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +#if NAPI_VERSION > 5 +//////////////////////////////////////////////////////////////////////////////// +// BigInt Class +//////////////////////////////////////////////////////////////////////////////// + +inline BigInt BigInt::New(napi_env env, int64_t val) { + napi_value value; + napi_status status = napi_create_bigint_int64(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline BigInt BigInt::New(napi_env env, uint64_t val) { + napi_value value; + napi_status status = napi_create_bigint_uint64(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline BigInt BigInt::New(napi_env env, + int sign_bit, + size_t word_count, + const uint64_t* words) { + napi_value value; + napi_status status = + napi_create_bigint_words(env, sign_bit, word_count, words, &value); + NAPI_THROW_IF_FAILED(env, status, BigInt()); + return BigInt(env, value); +} + +inline void BigInt::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "BigInt::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "BigInt::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_bigint, "BigInt::CheckCast", "value is not napi_bigint"); +} + +inline BigInt::BigInt() : Value() {} + +inline BigInt::BigInt(napi_env env, napi_value value) : Value(env, value) {} + +inline int64_t BigInt::Int64Value(bool* lossless) const { + int64_t result; + napi_status status = + napi_get_value_bigint_int64(_env, _value, &result, lossless); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline uint64_t BigInt::Uint64Value(bool* lossless) const { + uint64_t result; + napi_status status = + napi_get_value_bigint_uint64(_env, _value, &result, lossless); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +inline size_t BigInt::WordCount() const { + size_t word_count; + napi_status status = + napi_get_value_bigint_words(_env, _value, nullptr, &word_count, nullptr); + NAPI_THROW_IF_FAILED(_env, status, 0); + return word_count; +} + +inline void BigInt::ToWords(int* sign_bit, + size_t* word_count, + uint64_t* words) { + napi_status status = + napi_get_value_bigint_words(_env, _value, sign_bit, word_count, words); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +//////////////////////////////////////////////////////////////////////////////// +// Date Class +//////////////////////////////////////////////////////////////////////////////// + +inline Date Date::New(napi_env env, double val) { + napi_value value; + napi_status status = napi_create_date(env, val, &value); + NAPI_THROW_IF_FAILED(env, status, Date()); + return Date(env, value); +} + +inline void Date::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Date::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_date(env, value, &result); + NAPI_CHECK(status == napi_ok, "Date::CheckCast", "napi_is_date failed"); + NAPI_CHECK(result, "Date::CheckCast", "value is not date"); +} + +inline Date::Date() : Value() {} + +inline Date::Date(napi_env env, napi_value value) : Value(env, value) {} + +inline Date::operator double() const { + return ValueOf(); +} + +inline double Date::ValueOf() const { + double result; + napi_status status = napi_get_date_value(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Name class +//////////////////////////////////////////////////////////////////////////////// +inline void Name::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Name::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Name::CheckCast", "napi_typeof failed"); + NAPI_CHECK(type == napi_string || type == napi_symbol, + "Name::CheckCast", + "value is not napi_string or napi_symbol"); +} + +inline Name::Name() : Value() {} + +inline Name::Name(napi_env env, napi_value value) : Value(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// String class +//////////////////////////////////////////////////////////////////////////////// + +inline String String::New(napi_env env, const std::string& val) { + return String::New(env, val.c_str(), val.size()); +} + +inline String String::New(napi_env env, const std::u16string& val) { + return String::New(env, val.c_str(), val.size()); +} + +inline String String::New(napi_env env, const char* val) { + // TODO(@gabrielschulhof) Remove if-statement when core's error handling is + // available in all supported versions. + if (val == nullptr) { + // Throw an error that looks like it came from core. + NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); + } + napi_value value; + napi_status status = + napi_create_string_utf8(env, val, std::strlen(val), &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char16_t* val) { + napi_value value; + // TODO(@gabrielschulhof) Remove if-statement when core's error handling is + // available in all supported versions. + if (val == nullptr) { + // Throw an error that looks like it came from core. + NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); + } + napi_status status = + napi_create_string_utf16(env, val, std::u16string(val).size(), &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char* val, size_t length) { + napi_value value; + napi_status status = napi_create_string_utf8(env, val, length, &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline String String::New(napi_env env, const char16_t* val, size_t length) { + napi_value value; + napi_status status = napi_create_string_utf16(env, val, length, &value); + NAPI_THROW_IF_FAILED(env, status, String()); + return String(env, value); +} + +inline void String::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "String::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "String::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_string, "String::CheckCast", "value is not napi_string"); +} + +inline String::String() : Name() {} + +inline String::String(napi_env env, napi_value value) : Name(env, value) {} + +inline String::operator std::string() const { + return Utf8Value(); +} + +inline String::operator std::u16string() const { + return Utf16Value(); +} + +inline std::string String::Utf8Value() const { + size_t length; + napi_status status = + napi_get_value_string_utf8(_env, _value, nullptr, 0, &length); + NAPI_THROW_IF_FAILED(_env, status, ""); + + std::string value; + value.reserve(length + 1); + value.resize(length); + status = napi_get_value_string_utf8( + _env, _value, &value[0], value.capacity(), nullptr); + NAPI_THROW_IF_FAILED(_env, status, ""); + return value; +} + +inline std::u16string String::Utf16Value() const { + size_t length; + napi_status status = + napi_get_value_string_utf16(_env, _value, nullptr, 0, &length); + NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); + + std::u16string value; + value.reserve(length + 1); + value.resize(length); + status = napi_get_value_string_utf16( + _env, _value, &value[0], value.capacity(), nullptr); + NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); + return value; +} + +//////////////////////////////////////////////////////////////////////////////// +// Symbol class +//////////////////////////////////////////////////////////////////////////////// + +inline Symbol Symbol::New(napi_env env, const char* description) { + napi_value descriptionValue = description != nullptr + ? String::New(env, description) + : static_cast(nullptr); + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, const std::string& description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, String description) { + napi_value descriptionValue = description; + return Symbol::New(env, descriptionValue); +} + +inline Symbol Symbol::New(napi_env env, napi_value description) { + napi_value value; + napi_status status = napi_create_symbol(env, description, &value); + NAPI_THROW_IF_FAILED(env, status, Symbol()); + return Symbol(env, value); +} + +inline MaybeOrValue Symbol::WellKnown(napi_env env, + const std::string& name) { +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Value symbol_obj; + Value symbol_value; + if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && + symbol_obj.As().Get(name).UnwrapTo(&symbol_value)) { + return Just(symbol_value.As()); + } + return Nothing(); +#else + return Napi::Env(env) + .Global() + .Get("Symbol") + .As() + .Get(name) + .As(); +#endif +} + +inline MaybeOrValue Symbol::For(napi_env env, + const std::string& description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::For(env, descriptionValue); +} + +inline MaybeOrValue Symbol::For(napi_env env, const char* description) { + napi_value descriptionValue = String::New(env, description); + return Symbol::For(env, descriptionValue); +} + +inline MaybeOrValue Symbol::For(napi_env env, String description) { + return Symbol::For(env, static_cast(description)); +} + +inline MaybeOrValue Symbol::For(napi_env env, napi_value description) { +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Value symbol_obj; + Value symbol_for_value; + Value symbol_value; + if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && + symbol_obj.As().Get("for").UnwrapTo(&symbol_for_value) && + symbol_for_value.As() + .Call(symbol_obj, {description}) + .UnwrapTo(&symbol_value)) { + return Just(symbol_value.As()); + } + return Nothing(); +#else + Object symbol_obj = Napi::Env(env).Global().Get("Symbol").As(); + return symbol_obj.Get("for") + .As() + .Call(symbol_obj, {description}) + .As(); +#endif +} + +inline void Symbol::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Symbol::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Symbol::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_symbol, "Symbol::CheckCast", "value is not napi_symbol"); +} + +inline Symbol::Symbol() : Name() {} + +inline Symbol::Symbol(napi_env env, napi_value value) : Name(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// Automagic value creation +//////////////////////////////////////////////////////////////////////////////// + +namespace details { +template +struct vf_number { + static Number From(napi_env env, T value) { + return Number::New(env, static_cast(value)); + } +}; + +template <> +struct vf_number { + static Boolean From(napi_env env, bool value) { + return Boolean::New(env, value); + } +}; + +struct vf_utf8_charp { + static String From(napi_env env, const char* value) { + return String::New(env, value); + } +}; + +struct vf_utf16_charp { + static String From(napi_env env, const char16_t* value) { + return String::New(env, value); + } +}; +struct vf_utf8_string { + static String From(napi_env env, const std::string& value) { + return String::New(env, value); + } +}; + +struct vf_utf16_string { + static String From(napi_env env, const std::u16string& value) { + return String::New(env, value); + } +}; + +template +struct vf_fallback { + static Value From(napi_env env, const T& value) { return Value(env, value); } +}; + +template +struct disjunction : std::false_type {}; +template +struct disjunction : B {}; +template +struct disjunction + : std::conditional>::type {}; + +template +struct can_make_string + : disjunction::type, + typename std::is_convertible::type, + typename std::is_convertible::type, + typename std::is_convertible::type> {}; +} // namespace details + +template +Value Value::From(napi_env env, const T& value) { + using Helper = typename std::conditional< + std::is_integral::value || std::is_floating_point::value, + details::vf_number, + typename std::conditional::value, + String, + details::vf_fallback>::type>::type; + return Helper::From(env, value); +} + +template +String String::From(napi_env env, const T& value) { + struct Dummy {}; + using Helper = typename std::conditional< + std::is_convertible::value, + details::vf_utf8_charp, + typename std::conditional< + std::is_convertible::value, + details::vf_utf16_charp, + typename std::conditional< + std::is_convertible::value, + details::vf_utf8_string, + typename std::conditional< + std::is_convertible::value, + details::vf_utf16_string, + Dummy>::type>::type>::type>::type; + return Helper::From(env, value); +} + +//////////////////////////////////////////////////////////////////////////////// +// TypeTaggable class +//////////////////////////////////////////////////////////////////////////////// + +inline TypeTaggable::TypeTaggable() : Value() {} + +inline TypeTaggable::TypeTaggable(napi_env _env, napi_value _value) + : Value(_env, _value) {} + +#if NAPI_VERSION >= 8 + +inline void TypeTaggable::TypeTag(const napi_type_tag* type_tag) const { + napi_status status = napi_type_tag_object(_env, _value, type_tag); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline bool TypeTaggable::CheckTypeTag(const napi_type_tag* type_tag) const { + bool result; + napi_status status = + napi_check_object_type_tag(_env, _value, type_tag, &result); + NAPI_THROW_IF_FAILED(_env, status, false); + return result; +} + +#endif // NAPI_VERSION >= 8 + +//////////////////////////////////////////////////////////////////////////////// +// Object class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Object::PropertyLValue::operator Value() const { + MaybeOrValue val = Object(_env, _object).Get(_key); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + return val.Unwrap(); +#else + return val; +#endif +} + +template +template +inline Object::PropertyLValue& Object::PropertyLValue::operator=( + ValueType value) { +#ifdef NODE_ADDON_API_ENABLE_MAYBE + MaybeOrValue result = +#endif + Object(_env, _object).Set(_key, value); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + result.Unwrap(); +#endif + return *this; +} + +template +inline Object::PropertyLValue::PropertyLValue(Object object, Key key) + : _env(object.Env()), _object(object), _key(key) {} + +inline Object Object::New(napi_env env) { + napi_value value; + napi_status status = napi_create_object(env, &value); + NAPI_THROW_IF_FAILED(env, status, Object()); + return Object(env, value); +} + +inline void Object::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Object::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Object::CheckCast", "napi_typeof failed"); + NAPI_CHECK( + type == napi_object, "Object::CheckCast", "value is not napi_object"); +} + +inline Object::Object() : TypeTaggable() {} + +inline Object::Object(napi_env env, napi_value value) + : TypeTaggable(env, value) {} + +inline Object::PropertyLValue Object::operator[]( + const char* utf8name) { + return PropertyLValue(*this, utf8name); +} + +inline Object::PropertyLValue Object::operator[]( + const std::string& utf8name) { + return PropertyLValue(*this, utf8name); +} + +inline Object::PropertyLValue Object::operator[](uint32_t index) { + return PropertyLValue(*this, index); +} + +inline Object::PropertyLValue Object::operator[](Value index) const { + return PropertyLValue(*this, index); +} + +inline MaybeOrValue Object::operator[](const char* utf8name) const { + return Get(utf8name); +} + +inline MaybeOrValue Object::operator[]( + const std::string& utf8name) const { + return Get(utf8name); +} + +inline MaybeOrValue Object::operator[](uint32_t index) const { + return Get(index); +} + +inline MaybeOrValue Object::Has(napi_value key) const { + bool result; + napi_status status = napi_has_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(Value key) const { + bool result; + napi_status status = napi_has_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(const char* utf8name) const { + bool result; + napi_status status = napi_has_named_property(_env, _value, utf8name, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Has(const std::string& utf8name) const { + return Has(utf8name.c_str()); +} + +inline MaybeOrValue Object::HasOwnProperty(napi_value key) const { + bool result; + napi_status status = napi_has_own_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::HasOwnProperty(Value key) const { + bool result; + napi_status status = napi_has_own_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::HasOwnProperty(const char* utf8name) const { + napi_value key; + napi_status status = + napi_create_string_utf8(_env, utf8name, std::strlen(utf8name), &key); + NAPI_MAYBE_THROW_IF_FAILED(_env, status, bool); + return HasOwnProperty(key); +} + +inline MaybeOrValue Object::HasOwnProperty( + const std::string& utf8name) const { + return HasOwnProperty(utf8name.c_str()); +} + +inline MaybeOrValue Object::Get(napi_value key) const { + napi_value result; + napi_status status = napi_get_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(Value key) const { + napi_value result; + napi_status status = napi_get_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(const char* utf8name) const { + napi_value result; + napi_status status = napi_get_named_property(_env, _value, utf8name, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); +} + +inline MaybeOrValue Object::Get(const std::string& utf8name) const { + return Get(utf8name.c_str()); +} + +template +inline MaybeOrValue Object::Set(napi_value key, + const ValueType& value) const { + napi_status status = + napi_set_property(_env, _value, key, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(Value key, const ValueType& value) const { + napi_status status = + napi_set_property(_env, _value, key, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(const char* utf8name, + const ValueType& value) const { + napi_status status = + napi_set_named_property(_env, _value, utf8name, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +template +inline MaybeOrValue Object::Set(const std::string& utf8name, + const ValueType& value) const { + return Set(utf8name.c_str(), value); +} + +inline MaybeOrValue Object::Delete(napi_value key) const { + bool result; + napi_status status = napi_delete_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Delete(Value key) const { + bool result; + napi_status status = napi_delete_property(_env, _value, key, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Delete(const char* utf8name) const { + return Delete(String::New(_env, utf8name)); +} + +inline MaybeOrValue Object::Delete(const std::string& utf8name) const { + return Delete(String::New(_env, utf8name)); +} + +inline MaybeOrValue Object::Has(uint32_t index) const { + bool result; + napi_status status = napi_has_element(_env, _value, index, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::Get(uint32_t index) const { + napi_value value; + napi_status status = napi_get_element(_env, _value, index, &value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, value), Value); +} + +template +inline MaybeOrValue Object::Set(uint32_t index, + const ValueType& value) const { + napi_status status = + napi_set_element(_env, _value, index, Value::From(_env, value)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::Delete(uint32_t index) const { + bool result; + napi_status status = napi_delete_element(_env, _value, index, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +inline MaybeOrValue Object::GetPropertyNames() const { + napi_value result; + napi_status status = napi_get_property_names(_env, _value, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Array(_env, result), Array); +} + +inline MaybeOrValue Object::DefineProperty( + const PropertyDescriptor& property) const { + napi_status status = napi_define_properties( + _env, + _value, + 1, + reinterpret_cast(&property)); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::DefineProperties( + const std::initializer_list& properties) const { + napi_status status = napi_define_properties( + _env, + _value, + properties.size(), + reinterpret_cast(properties.begin())); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::DefineProperties( + const std::vector& properties) const { + napi_status status = napi_define_properties( + _env, + _value, + properties.size(), + reinterpret_cast(properties.data())); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::InstanceOf( + const Function& constructor) const { + bool result; + napi_status status = napi_instanceof(_env, _value, constructor, &result); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); +} + +template +inline void Object::AddFinalizer(Finalizer finalizeCallback, T* data) const { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + details::AttachData::Wrapper>( + _env, *this, data, finalizeData); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +template +inline void Object::AddFinalizer(Finalizer finalizeCallback, + T* data, + Hint* finalizeHint) const { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = details:: + AttachData::WrapperWithHint>( + _env, *this, data, finalizeData); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +#ifdef NAPI_CPP_EXCEPTIONS +inline Object::const_iterator::const_iterator(const Object* object, + const Type type) { + _object = object; + _keys = object->GetPropertyNames(); + _index = type == Type::BEGIN ? 0 : _keys.Length(); +} + +inline Object::const_iterator Napi::Object::begin() const { + const_iterator it(this, Object::const_iterator::Type::BEGIN); + return it; +} + +inline Object::const_iterator Napi::Object::end() const { + const_iterator it(this, Object::const_iterator::Type::END); + return it; +} + +inline Object::const_iterator& Object::const_iterator::operator++() { + ++_index; + return *this; +} + +inline bool Object::const_iterator::operator==( + const const_iterator& other) const { + return _index == other._index; +} + +inline bool Object::const_iterator::operator!=( + const const_iterator& other) const { + return _index != other._index; +} + +inline const std::pair> +Object::const_iterator::operator*() const { + const Value key = _keys[_index]; + const PropertyLValue value = (*_object)[key]; + return {key, value}; +} + +inline Object::iterator::iterator(Object* object, const Type type) { + _object = object; + _keys = object->GetPropertyNames(); + _index = type == Type::BEGIN ? 0 : _keys.Length(); +} + +inline Object::iterator Napi::Object::begin() { + iterator it(this, Object::iterator::Type::BEGIN); + return it; +} + +inline Object::iterator Napi::Object::end() { + iterator it(this, Object::iterator::Type::END); + return it; +} + +inline Object::iterator& Object::iterator::operator++() { + ++_index; + return *this; +} + +inline bool Object::iterator::operator==(const iterator& other) const { + return _index == other._index; +} + +inline bool Object::iterator::operator!=(const iterator& other) const { + return _index != other._index; +} + +inline std::pair> +Object::iterator::operator*() { + Value key = _keys[_index]; + PropertyLValue value = (*_object)[key]; + return {key, value}; +} +#endif // NAPI_CPP_EXCEPTIONS + +#if NAPI_VERSION >= 8 +inline MaybeOrValue Object::Freeze() const { + napi_status status = napi_object_freeze(_env, _value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} + +inline MaybeOrValue Object::Seal() const { + napi_status status = napi_object_seal(_env, _value); + NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); +} +#endif // NAPI_VERSION >= 8 + +//////////////////////////////////////////////////////////////////////////////// +// External class +//////////////////////////////////////////////////////////////////////////////// + +template +inline External External::New(napi_env env, T* data) { + napi_value value; + napi_status status = + napi_create_external(env, data, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, External()); + return External(env, value); +} + +template +template +inline External External::New(napi_env env, + T* data, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + napi_create_external(env, + data, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, External()); + } + return External(env, value); +} + +template +template +inline External External::New(napi_env env, + T* data, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external( + env, + data, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, External()); + } + return External(env, value); +} + +template +inline void External::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "External::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "External::CheckCast", "napi_typeof failed"); + NAPI_CHECK(type == napi_external, + "External::CheckCast", + "value is not napi_external"); +} + +template +inline External::External() : TypeTaggable() {} + +template +inline External::External(napi_env env, napi_value value) + : TypeTaggable(env, value) {} + +template +inline T* External::Data() const { + void* data; + napi_status status = napi_get_value_external(_env, _value, &data); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + return reinterpret_cast(data); +} + +//////////////////////////////////////////////////////////////////////////////// +// Array class +//////////////////////////////////////////////////////////////////////////////// + +inline Array Array::New(napi_env env) { + napi_value value; + napi_status status = napi_create_array(env, &value); + NAPI_THROW_IF_FAILED(env, status, Array()); + return Array(env, value); +} + +inline Array Array::New(napi_env env, size_t length) { + napi_value value; + napi_status status = napi_create_array_with_length(env, length, &value); + NAPI_THROW_IF_FAILED(env, status, Array()); + return Array(env, value); +} + +inline void Array::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Array::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_array(env, value, &result); + NAPI_CHECK(status == napi_ok, "Array::CheckCast", "napi_is_array failed"); + NAPI_CHECK(result, "Array::CheckCast", "value is not array"); +} + +inline Array::Array() : Object() {} + +inline Array::Array(napi_env env, napi_value value) : Object(env, value) {} + +inline uint32_t Array::Length() const { + uint32_t result; + napi_status status = napi_get_array_length(_env, _value, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// ArrayBuffer class +//////////////////////////////////////////////////////////////////////////////// + +inline ArrayBuffer ArrayBuffer::New(napi_env env, size_t byteLength) { + napi_value value; + void* data; + napi_status status = napi_create_arraybuffer(env, byteLength, &data, &value); + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + + return ArrayBuffer(env, value); +} + +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength) { + napi_value value; + napi_status status = napi_create_external_arraybuffer( + env, externalData, byteLength, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + + return ArrayBuffer(env, value); +} + +template +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = napi_create_external_arraybuffer( + env, + externalData, + byteLength, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + } + + return ArrayBuffer(env, value); +} + +template +inline ArrayBuffer ArrayBuffer::New(napi_env env, + void* externalData, + size_t byteLength, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external_arraybuffer( + env, + externalData, + byteLength, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); + } + + return ArrayBuffer(env, value); +} +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + +inline void ArrayBuffer::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "ArrayBuffer::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_arraybuffer(env, value, &result); + NAPI_CHECK(status == napi_ok, + "ArrayBuffer::CheckCast", + "napi_is_arraybuffer failed"); + NAPI_CHECK(result, "ArrayBuffer::CheckCast", "value is not arraybuffer"); +} + +inline ArrayBuffer::ArrayBuffer() : Object() {} + +inline ArrayBuffer::ArrayBuffer(napi_env env, napi_value value) + : Object(env, value) {} + +inline void* ArrayBuffer::Data() { + void* data; + napi_status status = napi_get_arraybuffer_info(_env, _value, &data, nullptr); + NAPI_THROW_IF_FAILED(_env, status, nullptr); + return data; +} + +inline size_t ArrayBuffer::ByteLength() { + size_t length; + napi_status status = + napi_get_arraybuffer_info(_env, _value, nullptr, &length); + NAPI_THROW_IF_FAILED(_env, status, 0); + return length; +} + +#if NAPI_VERSION >= 7 +inline bool ArrayBuffer::IsDetached() const { + bool detached; + napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached); + NAPI_THROW_IF_FAILED(_env, status, false); + return detached; +} + +inline void ArrayBuffer::Detach() { + napi_status status = napi_detach_arraybuffer(_env, _value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} +#endif // NAPI_VERSION >= 7 + +//////////////////////////////////////////////////////////////////////////////// +// DataView class +//////////////////////////////////////////////////////////////////////////////// +inline DataView DataView::New(napi_env env, Napi::ArrayBuffer arrayBuffer) { + return New(env, arrayBuffer, 0, arrayBuffer.ByteLength()); +} + +inline DataView DataView::New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset) { + if (byteOffset > arrayBuffer.ByteLength()) { + NAPI_THROW(RangeError::New( + env, "Start offset is outside the bounds of the buffer"), + DataView()); + } + return New( + env, arrayBuffer, byteOffset, arrayBuffer.ByteLength() - byteOffset); +} + +inline DataView DataView::New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset, + size_t byteLength) { + if (byteOffset + byteLength > arrayBuffer.ByteLength()) { + NAPI_THROW(RangeError::New(env, "Invalid DataView length"), DataView()); + } + napi_value value; + napi_status status = + napi_create_dataview(env, byteLength, arrayBuffer, byteOffset, &value); + NAPI_THROW_IF_FAILED(env, status, DataView()); + return DataView(env, value); +} + +inline void DataView::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "DataView::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_dataview(env, value, &result); + NAPI_CHECK( + status == napi_ok, "DataView::CheckCast", "napi_is_dataview failed"); + NAPI_CHECK(result, "DataView::CheckCast", "value is not dataview"); +} + +inline DataView::DataView() : Object() {} + +inline DataView::DataView(napi_env env, napi_value value) : Object(env, value) { + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + &_length /* byteLength */, + &_data /* data */, + nullptr /* arrayBuffer */, + nullptr /* byteOffset */); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline Napi::ArrayBuffer DataView::ArrayBuffer() const { + napi_value arrayBuffer; + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + nullptr /* byteLength */, + nullptr /* data */, + &arrayBuffer /* arrayBuffer */, + nullptr /* byteOffset */); + NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); + return Napi::ArrayBuffer(_env, arrayBuffer); +} + +inline size_t DataView::ByteOffset() const { + size_t byteOffset; + napi_status status = napi_get_dataview_info(_env, + _value /* dataView */, + nullptr /* byteLength */, + nullptr /* data */, + nullptr /* arrayBuffer */, + &byteOffset /* byteOffset */); + NAPI_THROW_IF_FAILED(_env, status, 0); + return byteOffset; +} + +inline size_t DataView::ByteLength() const { + return _length; +} + +inline void* DataView::Data() const { + return _data; +} + +inline float DataView::GetFloat32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline double DataView::GetFloat64(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int8_t DataView::GetInt8(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int16_t DataView::GetInt16(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline int32_t DataView::GetInt32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint8_t DataView::GetUint8(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint16_t DataView::GetUint16(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline uint32_t DataView::GetUint32(size_t byteOffset) const { + return ReadData(byteOffset); +} + +inline void DataView::SetFloat32(size_t byteOffset, float value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetFloat64(size_t byteOffset, double value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt8(size_t byteOffset, int8_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt16(size_t byteOffset, int16_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetInt32(size_t byteOffset, int32_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint8(size_t byteOffset, uint8_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint16(size_t byteOffset, uint16_t value) const { + WriteData(byteOffset, value); +} + +inline void DataView::SetUint32(size_t byteOffset, uint32_t value) const { + WriteData(byteOffset, value); +} + +template +inline T DataView::ReadData(size_t byteOffset) const { + if (byteOffset + sizeof(T) > _length || + byteOffset + sizeof(T) < byteOffset) { // overflow + NAPI_THROW( + RangeError::New(_env, "Offset is outside the bounds of the DataView"), + 0); + } + + return *reinterpret_cast(static_cast(_data) + byteOffset); +} + +template +inline void DataView::WriteData(size_t byteOffset, T value) const { + if (byteOffset + sizeof(T) > _length || + byteOffset + sizeof(T) < byteOffset) { // overflow + NAPI_THROW_VOID( + RangeError::New(_env, "Offset is outside the bounds of the DataView")); + } + + *reinterpret_cast(static_cast(_data) + byteOffset) = value; +} + +//////////////////////////////////////////////////////////////////////////////// +// TypedArray class +//////////////////////////////////////////////////////////////////////////////// +inline void TypedArray::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "TypedArray::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_typedarray(env, value, &result); + NAPI_CHECK( + status == napi_ok, "TypedArray::CheckCast", "napi_is_typedarray failed"); + NAPI_CHECK(result, "TypedArray::CheckCast", "value is not typedarray"); +} + +inline TypedArray::TypedArray() + : Object(), _type(napi_typedarray_type::napi_int8_array), _length(0) {} + +inline TypedArray::TypedArray(napi_env env, napi_value value) + : Object(env, value), + _type(napi_typedarray_type::napi_int8_array), + _length(0) { + if (value != nullptr) { + napi_status status = + napi_get_typedarray_info(_env, + _value, + &const_cast(this)->_type, + &const_cast(this)->_length, + nullptr, + nullptr, + nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +inline TypedArray::TypedArray(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length) + : Object(env, value), _type(type), _length(length) {} + +inline napi_typedarray_type TypedArray::TypedArrayType() const { + return _type; +} + +inline uint8_t TypedArray::ElementSize() const { + switch (_type) { + case napi_int8_array: + case napi_uint8_array: + case napi_uint8_clamped_array: + return 1; + case napi_int16_array: + case napi_uint16_array: + return 2; + case napi_int32_array: + case napi_uint32_array: + case napi_float32_array: + return 4; + case napi_float64_array: +#if (NAPI_VERSION > 5) + case napi_bigint64_array: + case napi_biguint64_array: +#endif // (NAPI_VERSION > 5) + return 8; + default: + return 0; + } +} + +inline size_t TypedArray::ElementLength() const { + return _length; +} + +inline size_t TypedArray::ByteOffset() const { + size_t byteOffset; + napi_status status = napi_get_typedarray_info( + _env, _value, nullptr, nullptr, nullptr, nullptr, &byteOffset); + NAPI_THROW_IF_FAILED(_env, status, 0); + return byteOffset; +} + +inline size_t TypedArray::ByteLength() const { + return ElementSize() * ElementLength(); +} + +inline Napi::ArrayBuffer TypedArray::ArrayBuffer() const { + napi_value arrayBuffer; + napi_status status = napi_get_typedarray_info( + _env, _value, nullptr, nullptr, nullptr, &arrayBuffer, nullptr); + NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); + return Napi::ArrayBuffer(_env, arrayBuffer); +} + +//////////////////////////////////////////////////////////////////////////////// +// TypedArrayOf class +//////////////////////////////////////////////////////////////////////////////// +template +inline void TypedArrayOf::CheckCast(napi_env env, napi_value value) { + TypedArray::CheckCast(env, value); + napi_typedarray_type type; + napi_status status = napi_get_typedarray_info( + env, value, &type, nullptr, nullptr, nullptr, nullptr); + NAPI_CHECK(status == napi_ok, + "TypedArrayOf::CheckCast", + "napi_is_typedarray failed"); + + NAPI_CHECK( + (type == TypedArrayTypeForPrimitiveType() || + (type == napi_uint8_clamped_array && std::is_same::value)), + "TypedArrayOf::CheckCast", + "Array type must match the template parameter. (Uint8 arrays may " + "optionally have the \"clamped\" array type.)"); +} + +template +inline TypedArrayOf TypedArrayOf::New(napi_env env, + size_t elementLength, + napi_typedarray_type type) { + Napi::ArrayBuffer arrayBuffer = + Napi::ArrayBuffer::New(env, elementLength * sizeof(T)); + return New(env, elementLength, arrayBuffer, 0, type); +} + +template +inline TypedArrayOf TypedArrayOf::New(napi_env env, + size_t elementLength, + Napi::ArrayBuffer arrayBuffer, + size_t bufferOffset, + napi_typedarray_type type) { + napi_value value; + napi_status status = napi_create_typedarray( + env, type, elementLength, arrayBuffer, bufferOffset, &value); + NAPI_THROW_IF_FAILED(env, status, TypedArrayOf()); + + return TypedArrayOf( + env, + value, + type, + elementLength, + reinterpret_cast(reinterpret_cast(arrayBuffer.Data()) + + bufferOffset)); +} + +template +inline TypedArrayOf::TypedArrayOf() : TypedArray(), _data(nullptr) {} + +template +inline TypedArrayOf::TypedArrayOf(napi_env env, napi_value value) + : TypedArray(env, value), _data(nullptr) { + napi_status status = napi_ok; + if (value != nullptr) { + void* data = nullptr; + status = napi_get_typedarray_info( + _env, _value, &_type, &_length, &data, nullptr, nullptr); + _data = static_cast(data); + } else { + _type = TypedArrayTypeForPrimitiveType(); + _length = 0; + } + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +template +inline TypedArrayOf::TypedArrayOf(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length, + T* data) + : TypedArray(env, value, type, length), _data(data) { + if (!(type == TypedArrayTypeForPrimitiveType() || + (type == napi_uint8_clamped_array && + std::is_same::value))) { + NAPI_THROW_VOID(TypeError::New( + env, + "Array type must match the template parameter. " + "(Uint8 arrays may optionally have the \"clamped\" array type.)")); + } +} + +template +inline T& TypedArrayOf::operator[](size_t index) { + return _data[index]; +} + +template +inline const T& TypedArrayOf::operator[](size_t index) const { + return _data[index]; +} + +template +inline T* TypedArrayOf::Data() { + return _data; +} + +template +inline const T* TypedArrayOf::Data() const { + return _data; +} + +//////////////////////////////////////////////////////////////////////////////// +// Function class +//////////////////////////////////////////////////////////////////////////////// + +template +inline napi_status CreateFunction(napi_env env, + const char* utf8name, + napi_callback cb, + CbData* data, + napi_value* result) { + napi_status status = + napi_create_function(env, utf8name, NAPI_AUTO_LENGTH, cb, data, result); + if (status == napi_ok) { + status = Napi::details::AttachData(env, *result, data); + } + + return status; +} + +template +inline Function Function::New(napi_env env, const char* utf8name, void* data) { + napi_value result = nullptr; + napi_status status = napi_create_function(env, + utf8name, + NAPI_AUTO_LENGTH, + details::TemplatedVoidCallback, + data, + &result); + NAPI_THROW_IF_FAILED(env, status, Function()); + return Function(env, result); +} + +template +inline Function Function::New(napi_env env, const char* utf8name, void* data) { + napi_value result = nullptr; + napi_status status = napi_create_function(env, + utf8name, + NAPI_AUTO_LENGTH, + details::TemplatedCallback, + data, + &result); + NAPI_THROW_IF_FAILED(env, status, Function()); + return Function(env, result); +} + +template +inline Function Function::New(napi_env env, + const std::string& utf8name, + void* data) { + return Function::New(env, utf8name.c_str(), data); +} + +template +inline Function Function::New(napi_env env, + const std::string& utf8name, + void* data) { + return Function::New(env, utf8name.c_str(), data); +} + +template +inline Function Function::New(napi_env env, + Callable cb, + const char* utf8name, + void* data) { + using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); + using CbData = details::CallbackData; + auto callbackData = new CbData{std::move(cb), data}; + + napi_value value; + napi_status status = + CreateFunction(env, utf8name, CbData::Wrapper, callbackData, &value); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, Function()); + } + + return Function(env, value); +} + +template +inline Function Function::New(napi_env env, + Callable cb, + const std::string& utf8name, + void* data) { + return New(env, cb, utf8name.c_str(), data); +} + +inline void Function::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Function::CheckCast", "empty value"); + + napi_valuetype type; + napi_status status = napi_typeof(env, value, &type); + NAPI_CHECK(status == napi_ok, "Function::CheckCast", "napi_typeof failed"); + NAPI_CHECK(type == napi_function, + "Function::CheckCast", + "value is not napi_function"); +} + +inline Function::Function() : Object() {} + +inline Function::Function(napi_env env, napi_value value) + : Object(env, value) {} + +inline MaybeOrValue Function::operator()( + const std::initializer_list& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::initializer_list& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::vector& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call( + const std::vector& args) const { + return Call(Env().Undefined(), args); +} + +inline MaybeOrValue Function::Call(size_t argc, + const napi_value* args) const { + return Call(Env().Undefined(), argc, args); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::initializer_list& args) const { + return Call(recv, args.size(), args.begin()); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::vector& args) const { + return Call(recv, args.size(), args.data()); +} + +inline MaybeOrValue Function::Call( + napi_value recv, const std::vector& args) const { + const size_t argc = args.size(); + const size_t stackArgsCount = 6; + napi_value stackArgs[stackArgsCount]; + std::vector heapArgs; + napi_value* argv; + if (argc <= stackArgsCount) { + argv = stackArgs; + } else { + heapArgs.resize(argc); + argv = heapArgs.data(); + } + + for (size_t index = 0; index < argc; index++) { + argv[index] = static_cast(args[index]); + } + + return Call(recv, argc, argv); +} + +inline MaybeOrValue Function::Call(napi_value recv, + size_t argc, + const napi_value* args) const { + napi_value result; + napi_status status = + napi_call_function(_env, recv, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context) const { + return MakeCallback(recv, args.size(), args.begin(), context); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context) const { + return MakeCallback(recv, args.size(), args.data(), context); +} + +inline MaybeOrValue Function::MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context) const { + napi_value result; + napi_status status = + napi_make_callback(_env, context, recv, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Value(_env, result), Napi::Value); +} + +inline MaybeOrValue Function::New( + const std::initializer_list& args) const { + return New(args.size(), args.begin()); +} + +inline MaybeOrValue Function::New( + const std::vector& args) const { + return New(args.size(), args.data()); +} + +inline MaybeOrValue Function::New(size_t argc, + const napi_value* args) const { + napi_value result; + napi_status status = napi_new_instance(_env, _value, argc, args, &result); + NAPI_RETURN_OR_THROW_IF_FAILED( + _env, status, Napi::Object(_env, result), Napi::Object); +} + +//////////////////////////////////////////////////////////////////////////////// +// Promise class +//////////////////////////////////////////////////////////////////////////////// + +inline Promise::Deferred Promise::Deferred::New(napi_env env) { + return Promise::Deferred(env); +} + +inline Promise::Deferred::Deferred(napi_env env) : _env(env) { + napi_status status = napi_create_promise(_env, &_deferred, &_promise); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline Promise Promise::Deferred::Promise() const { + return Napi::Promise(_env, _promise); +} + +inline Napi::Env Promise::Deferred::Env() const { + return Napi::Env(_env); +} + +inline void Promise::Deferred::Resolve(napi_value value) const { + napi_status status = napi_resolve_deferred(_env, _deferred, value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline void Promise::Deferred::Reject(napi_value value) const { + napi_status status = napi_reject_deferred(_env, _deferred, value); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline void Promise::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Promise::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_promise(env, value, &result); + NAPI_CHECK(status == napi_ok, "Promise::CheckCast", "napi_is_promise failed"); + NAPI_CHECK(result, "Promise::CheckCast", "value is not promise"); +} + +inline Promise::Promise(napi_env env, napi_value value) : Object(env, value) {} + +//////////////////////////////////////////////////////////////////////////////// +// Buffer class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Buffer Buffer::New(napi_env env, size_t length) { + napi_value value; + void* data; + napi_status status = + napi_create_buffer(env, length * sizeof(T), &data, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value); +} + +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED +template +inline Buffer Buffer::New(napi_env env, T* data, size_t length) { + napi_value value; + napi_status status = napi_create_external_buffer( + env, length * sizeof(T), data, nullptr, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value); +} + +template +template +inline Buffer Buffer::New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); + napi_status status = + napi_create_external_buffer(env, + length * sizeof(T), + data, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value); +} + +template +template +inline Buffer Buffer::New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint) { + napi_value value; + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); + napi_status status = napi_create_external_buffer( + env, + length * sizeof(T), + data, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value); +} +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + +template +inline Buffer Buffer::NewOrCopy(napi_env env, T* data, size_t length) { +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + napi_value value; + napi_status status = napi_create_external_buffer( + env, length * sizeof(T), data, nullptr, nullptr, &value); + if (status == details::napi_no_external_buffers_allowed) { +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + // If we can't create an external buffer, we'll just copy the data. + return Buffer::Copy(env, data, length); +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + } + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value); +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED +} + +template +template +inline Buffer Buffer::NewOrCopy(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback) { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), nullptr}); +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + napi_value value; + napi_status status = + napi_create_external_buffer(env, + length * sizeof(T), + data, + details::FinalizeData::Wrapper, + finalizeData, + &value); + if (status == details::napi_no_external_buffers_allowed) { +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + // If we can't create an external buffer, we'll just copy the data. + Buffer ret = Buffer::Copy(env, data, length); + details::FinalizeData::Wrapper(env, data, finalizeData); + return ret; +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + } + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value); +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED +} + +template +template +inline Buffer Buffer::NewOrCopy(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint) { + details::FinalizeData* finalizeData = + new details::FinalizeData( + {std::move(finalizeCallback), finalizeHint}); +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + napi_value value; + napi_status status = napi_create_external_buffer( + env, + length * sizeof(T), + data, + details::FinalizeData::WrapperWithHint, + finalizeData, + &value); + if (status == details::napi_no_external_buffers_allowed) { +#endif + // If we can't create an external buffer, we'll just copy the data. + Buffer ret = Buffer::Copy(env, data, length); + details::FinalizeData::WrapperWithHint( + env, data, finalizeData); + return ret; +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + } + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, Buffer()); + } + return Buffer(env, value); +#endif +} + +template +inline Buffer Buffer::Copy(napi_env env, const T* data, size_t length) { + napi_value value; + napi_status status = + napi_create_buffer_copy(env, length * sizeof(T), data, nullptr, &value); + NAPI_THROW_IF_FAILED(env, status, Buffer()); + return Buffer(env, value); +} + +template +inline void Buffer::CheckCast(napi_env env, napi_value value) { + NAPI_CHECK(value != nullptr, "Buffer::CheckCast", "empty value"); + + bool result; + napi_status status = napi_is_buffer(env, value, &result); + NAPI_CHECK(status == napi_ok, "Buffer::CheckCast", "napi_is_buffer failed"); + NAPI_CHECK(result, "Buffer::CheckCast", "value is not buffer"); +} + +template +inline Buffer::Buffer() : Uint8Array() {} + +template +inline Buffer::Buffer(napi_env env, napi_value value) + : Uint8Array(env, value) {} + +template +inline size_t Buffer::Length() const { + return ByteLength() / sizeof(T); +} + +template +inline T* Buffer::Data() const { + return reinterpret_cast(const_cast(Uint8Array::Data())); +} + +//////////////////////////////////////////////////////////////////////////////// +// Error class +//////////////////////////////////////////////////////////////////////////////// + +inline Error Error::New(napi_env env) { + napi_status status; + napi_value error = nullptr; + bool is_exception_pending; + napi_extended_error_info last_error_info_copy; + + { + // We must retrieve the last error info before doing anything else because + // doing anything else will replace the last error info. + const napi_extended_error_info* last_error_info; + status = napi_get_last_error_info(env, &last_error_info); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_get_last_error_info"); + + // All fields of the `napi_extended_error_info` structure gets reset in + // subsequent Node-API function calls on the same `env`. This includes a + // call to `napi_is_exception_pending()`. So here it is necessary to make a + // copy of the information as the `error_code` field is used later on. + memcpy(&last_error_info_copy, + last_error_info, + sizeof(napi_extended_error_info)); + } + + status = napi_is_exception_pending(env, &is_exception_pending); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_is_exception_pending"); + + // A pending exception takes precedence over any internal error status. + if (is_exception_pending) { + status = napi_get_and_clear_last_exception(env, &error); + NAPI_FATAL_IF_FAILED( + status, "Error::New", "napi_get_and_clear_last_exception"); + } else { + const char* error_message = last_error_info_copy.error_message != nullptr + ? last_error_info_copy.error_message + : "Error in native callback"; + + napi_value message; + status = napi_create_string_utf8( + env, error_message, std::strlen(error_message), &message); + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_string_utf8"); + + switch (last_error_info_copy.error_code) { + case napi_object_expected: + case napi_string_expected: + case napi_boolean_expected: + case napi_number_expected: + status = napi_create_type_error(env, nullptr, message, &error); + break; + default: + status = napi_create_error(env, nullptr, message, &error); + break; + } + NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_error"); + } + + return Error(env, error); +} + +inline Error Error::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_error); +} + +inline Error Error::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_error); +} + +inline NAPI_NO_RETURN void Error::Fatal(const char* location, + const char* message) { + napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH); +} + +inline Error::Error() : ObjectReference() {} + +inline Error::Error(napi_env env, napi_value value) + : ObjectReference(env, nullptr) { + if (value != nullptr) { + // Attempting to create a reference on the error object. + // If it's not a Object/Function/Symbol, this call will return an error + // status. + napi_status status = napi_create_reference(env, value, 1, &_ref); + + if (status != napi_ok) { + napi_value wrappedErrorObj; + + // Create an error object + status = napi_create_object(env, &wrappedErrorObj); + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_object"); + + // property flag that we attach to show the error object is wrapped + napi_property_descriptor wrapObjFlag = { + ERROR_WRAP_VALUE(), // Unique GUID identifier since Symbol isn't a + // viable option + nullptr, + nullptr, + nullptr, + nullptr, + Value::From(env, value), + napi_enumerable, + nullptr}; + + status = napi_define_properties(env, wrappedErrorObj, 1, &wrapObjFlag); +#ifdef NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS + if (status == napi_pending_exception) { + // Test if the pending exception was reported because the environment is + // shutting down. We assume that a status of napi_pending_exception + // coupled with the absence of an actual pending exception means that + // the environment is shutting down. If so, we replace the + // napi_pending_exception status with napi_ok. + bool is_exception_pending = false; + status = napi_is_exception_pending(env, &is_exception_pending); + if (status == napi_ok && !is_exception_pending) { + status = napi_ok; + } else { + status = napi_pending_exception; + } + } +#endif // NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_define_properties"); + + // Create a reference on the newly wrapped object + status = napi_create_reference(env, wrappedErrorObj, 1, &_ref); + } + + // Avoid infinite recursion in the failure case. + NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_reference"); + } +} + +inline Object Error::Value() const { + if (_ref == nullptr) { + return Object(_env, nullptr); + } + + napi_value refValue; + napi_status status = napi_get_reference_value(_env, _ref, &refValue); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + napi_valuetype type; + status = napi_typeof(_env, refValue, &type); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + // If refValue isn't a symbol, then we proceed to whether the refValue has the + // wrapped error flag + if (type != napi_symbol) { + // We are checking if the object is wrapped + bool isWrappedObject = false; + + status = napi_has_property(_env, + refValue, + String::From(_env, ERROR_WRAP_VALUE()), + &isWrappedObject); + + // Don't care about status + if (isWrappedObject) { + napi_value unwrappedValue; + status = napi_get_property(_env, + refValue, + String::From(_env, ERROR_WRAP_VALUE()), + &unwrappedValue); + NAPI_THROW_IF_FAILED(_env, status, Object()); + + return Object(_env, unwrappedValue); + } + } + + return Object(_env, refValue); +} + +inline Error::Error(Error&& other) : ObjectReference(std::move(other)) {} + +inline Error& Error::operator=(Error&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline Error::Error(const Error& other) : ObjectReference(other) {} + +inline Error& Error::operator=(const Error& other) { + Reset(); + + _env = other.Env(); + HandleScope scope(_env); + + napi_value value = other.Value(); + if (value != nullptr) { + napi_status status = napi_create_reference(_env, value, 1, &_ref); + NAPI_THROW_IF_FAILED(_env, status, *this); + } + + return *this; +} + +inline const std::string& Error::Message() const NAPI_NOEXCEPT { + if (_message.size() == 0 && _env != nullptr) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + _message = Get("message").As(); + } catch (...) { + // Catch all errors here, to include e.g. a std::bad_alloc from + // the std::string::operator=, because this method may not throw. + } +#else // NAPI_CPP_EXCEPTIONS +#if defined(NODE_ADDON_API_ENABLE_MAYBE) + Napi::Value message_val; + if (Get("message").UnwrapTo(&message_val)) { + _message = message_val.As(); + } +#else + _message = Get("message").As(); +#endif +#endif // NAPI_CPP_EXCEPTIONS + } + return _message; +} + +// we created an object on the &_ref +inline void Error::ThrowAsJavaScriptException() const { + HandleScope scope(_env); + if (!IsEmpty()) { +#ifdef NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS + bool pendingException = false; + + // check if there is already a pending exception. If so don't try to throw a + // new one as that is not allowed/possible + napi_status status = napi_is_exception_pending(_env, &pendingException); + + if ((status != napi_ok) || + ((status == napi_ok) && (pendingException == false))) { + // We intentionally don't use `NAPI_THROW_*` macros here to ensure + // that there is no possible recursion as `ThrowAsJavaScriptException` + // is part of `NAPI_THROW_*` macro definition for noexcept. + + status = napi_throw(_env, Value()); + + if (status == napi_pending_exception) { + // The environment must be terminating as we checked earlier and there + // was no pending exception. In this case continuing will result + // in a fatal error and there is nothing the author has done incorrectly + // in their code that is worth flagging through a fatal error + return; + } + } else { + status = napi_pending_exception; + } +#else + // We intentionally don't use `NAPI_THROW_*` macros here to ensure + // that there is no possible recursion as `ThrowAsJavaScriptException` + // is part of `NAPI_THROW_*` macro definition for noexcept. + + napi_status status = napi_throw(_env, Value()); +#endif + +#ifdef NAPI_CPP_EXCEPTIONS + if (status != napi_ok) { + throw Error::New(_env); + } +#else // NAPI_CPP_EXCEPTIONS + NAPI_FATAL_IF_FAILED( + status, "Error::ThrowAsJavaScriptException", "napi_throw"); +#endif // NAPI_CPP_EXCEPTIONS + } +} + +#ifdef NAPI_CPP_EXCEPTIONS + +inline const char* Error::what() const NAPI_NOEXCEPT { + return Message().c_str(); +} + +#endif // NAPI_CPP_EXCEPTIONS + +inline const char* Error::ERROR_WRAP_VALUE() NAPI_NOEXCEPT { + return "4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal"; +} + +template +inline TError Error::New(napi_env env, + const char* message, + size_t length, + create_error_fn create_error) { + napi_value str; + napi_status status = napi_create_string_utf8(env, message, length, &str); + NAPI_THROW_IF_FAILED(env, status, TError()); + + napi_value error; + status = create_error(env, nullptr, str, &error); + NAPI_THROW_IF_FAILED(env, status, TError()); + + return TError(env, error); +} + +inline TypeError TypeError::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_type_error); +} + +inline TypeError TypeError::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_type_error); +} + +inline TypeError::TypeError() : Error() {} + +inline TypeError::TypeError(napi_env env, napi_value value) + : Error(env, value) {} + +inline RangeError RangeError::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), napi_create_range_error); +} + +inline RangeError RangeError::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), napi_create_range_error); +} + +inline RangeError::RangeError() : Error() {} + +inline RangeError::RangeError(napi_env env, napi_value value) + : Error(env, value) {} + +#if NAPI_VERSION > 8 +inline SyntaxError SyntaxError::New(napi_env env, const char* message) { + return Error::New( + env, message, std::strlen(message), node_api_create_syntax_error); +} + +inline SyntaxError SyntaxError::New(napi_env env, const std::string& message) { + return Error::New( + env, message.c_str(), message.size(), node_api_create_syntax_error); +} + +inline SyntaxError::SyntaxError() : Error() {} + +inline SyntaxError::SyntaxError(napi_env env, napi_value value) + : Error(env, value) {} +#endif // NAPI_VERSION > 8 + +//////////////////////////////////////////////////////////////////////////////// +// Reference class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Reference Reference::New(const T& value, + uint32_t initialRefcount) { + napi_env env = value.Env(); + napi_value val = value; + + if (val == nullptr) { + return Reference(env, nullptr); + } + + napi_ref ref; + napi_status status = napi_create_reference(env, value, initialRefcount, &ref); + NAPI_THROW_IF_FAILED(env, status, Reference()); + + return Reference(env, ref); +} + +template +inline Reference::Reference() + : _env(nullptr), _ref(nullptr), _suppressDestruct(false) {} + +template +inline Reference::Reference(napi_env env, napi_ref ref) + : _env(env), _ref(ref), _suppressDestruct(false) {} + +template +inline Reference::~Reference() { + if (_ref != nullptr) { + if (!_suppressDestruct) { + napi_delete_reference(_env, _ref); + } + + _ref = nullptr; + } +} + +template +inline Reference::Reference(Reference&& other) + : _env(other._env), + _ref(other._ref), + _suppressDestruct(other._suppressDestruct) { + other._env = nullptr; + other._ref = nullptr; + other._suppressDestruct = false; +} + +template +inline Reference& Reference::operator=(Reference&& other) { + Reset(); + _env = other._env; + _ref = other._ref; + _suppressDestruct = other._suppressDestruct; + other._env = nullptr; + other._ref = nullptr; + other._suppressDestruct = false; + return *this; +} + +template +inline Reference::Reference(const Reference& other) + : _env(other._env), _ref(nullptr), _suppressDestruct(false) { + HandleScope scope(_env); + + napi_value value = other.Value(); + if (value != nullptr) { + // Copying is a limited scenario (currently only used for Error object) and + // always creates a strong reference to the given value even if the incoming + // reference is weak. + napi_status status = napi_create_reference(_env, value, 1, &_ref); + NAPI_FATAL_IF_FAILED( + status, "Reference::Reference", "napi_create_reference"); + } +} + +template +inline Reference::operator napi_ref() const { + return _ref; +} + +template +inline bool Reference::operator==(const Reference& other) const { + HandleScope scope(_env); + return this->Value().StrictEquals(other.Value()); +} + +template +inline bool Reference::operator!=(const Reference& other) const { + return !this->operator==(other); +} + +template +inline Napi::Env Reference::Env() const { + return Napi::Env(_env); +} + +template +inline bool Reference::IsEmpty() const { + return _ref == nullptr; +} + +template +inline T Reference::Value() const { + if (_ref == nullptr) { + return T(_env, nullptr); + } + + napi_value value; + napi_status status = napi_get_reference_value(_env, _ref, &value); + NAPI_THROW_IF_FAILED(_env, status, T()); + return T(_env, value); +} + +template +inline uint32_t Reference::Ref() const { + uint32_t result; + napi_status status = napi_reference_ref(_env, _ref, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +template +inline uint32_t Reference::Unref() const { + uint32_t result; + napi_status status = napi_reference_unref(_env, _ref, &result); + NAPI_THROW_IF_FAILED(_env, status, 0); + return result; +} + +template +inline void Reference::Reset() { + if (_ref != nullptr) { + napi_status status = napi_delete_reference(_env, _ref); + NAPI_THROW_IF_FAILED_VOID(_env, status); + _ref = nullptr; + } +} + +template +inline void Reference::Reset(const T& value, uint32_t refcount) { + Reset(); + _env = value.Env(); + + napi_value val = value; + if (val != nullptr) { + napi_status status = napi_create_reference(_env, value, refcount, &_ref); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +template +inline void Reference::SuppressDestruct() { + _suppressDestruct = true; +} + +template +inline Reference Weak(T value) { + return Reference::New(value, 0); +} + +inline ObjectReference Weak(Object value) { + return Reference::New(value, 0); +} + +inline FunctionReference Weak(Function value) { + return Reference::New(value, 0); +} + +template +inline Reference Persistent(T value) { + return Reference::New(value, 1); +} + +inline ObjectReference Persistent(Object value) { + return Reference::New(value, 1); +} + +inline FunctionReference Persistent(Function value) { + return Reference::New(value, 1); +} + +//////////////////////////////////////////////////////////////////////////////// +// ObjectReference class +//////////////////////////////////////////////////////////////////////////////// + +inline ObjectReference::ObjectReference() : Reference() {} + +inline ObjectReference::ObjectReference(napi_env env, napi_ref ref) + : Reference(env, ref) {} + +inline ObjectReference::ObjectReference(Reference&& other) + : Reference(std::move(other)) {} + +inline ObjectReference& ObjectReference::operator=(Reference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline ObjectReference::ObjectReference(ObjectReference&& other) + : Reference(std::move(other)) {} + +inline ObjectReference& ObjectReference::operator=(ObjectReference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline ObjectReference::ObjectReference(const ObjectReference& other) + : Reference(other) {} + +inline MaybeOrValue ObjectReference::Get( + const char* utf8name) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(utf8name); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Get( + const std::string& utf8name) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(utf8name); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + const char* utf8value) const { + HandleScope scope(_env); + return Value().Set(utf8name, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(const char* utf8name, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, numberValue); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(utf8name, value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + std::string& utf8value) const { + HandleScope scope(_env); + return Value().Set(utf8name, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(utf8name, numberValue); +} + +inline MaybeOrValue ObjectReference::Get(uint32_t index) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Get(index); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + napi_value value) const { + HandleScope scope(_env); + return Value().Set(index, value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + Napi::Value value) const { + HandleScope scope(_env); + return Value().Set(index, value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + const char* utf8value) const { + HandleScope scope(_env); + return Value().Set(index, utf8value); +} + +inline MaybeOrValue ObjectReference::Set( + uint32_t index, const std::string& utf8value) const { + HandleScope scope(_env); + return Value().Set(index, utf8value); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + bool boolValue) const { + HandleScope scope(_env); + return Value().Set(index, boolValue); +} + +inline MaybeOrValue ObjectReference::Set(uint32_t index, + double numberValue) const { + HandleScope scope(_env); + return Value().Set(index, numberValue); +} + +//////////////////////////////////////////////////////////////////////////////// +// FunctionReference class +//////////////////////////////////////////////////////////////////////////////// + +inline FunctionReference::FunctionReference() : Reference() {} + +inline FunctionReference::FunctionReference(napi_env env, napi_ref ref) + : Reference(env, ref) {} + +inline FunctionReference::FunctionReference(Reference&& other) + : Reference(std::move(other)) {} + +inline FunctionReference& FunctionReference::operator=( + Reference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline FunctionReference::FunctionReference(FunctionReference&& other) + : Reference(std::move(other)) {} + +inline FunctionReference& FunctionReference::operator=( + FunctionReference&& other) { + static_cast*>(this)->operator=(std::move(other)); + return *this; +} + +inline MaybeOrValue FunctionReference::operator()( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value()(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::Call( + napi_value recv, size_t argc, const napi_value* args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().Call(recv, argc, args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().MakeCallback(recv, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().MakeCallback(recv, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = + Value().MakeCallback(recv, argc, args, context); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap())); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Value(); + } + return scope.Escape(result); +#endif +} + +inline MaybeOrValue FunctionReference::New( + const std::initializer_list& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().New(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap()).As()); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Object(); + } + return scope.Escape(result).As(); +#endif +} + +inline MaybeOrValue FunctionReference::New( + const std::vector& args) const { + EscapableHandleScope scope(_env); + MaybeOrValue result = Value().New(args); +#ifdef NODE_ADDON_API_ENABLE_MAYBE + if (result.IsJust()) { + return Just(scope.Escape(result.Unwrap()).As()); + } + return result; +#else + if (scope.Env().IsExceptionPending()) { + return Object(); + } + return scope.Escape(result).As(); +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +// CallbackInfo class +//////////////////////////////////////////////////////////////////////////////// + +inline CallbackInfo::CallbackInfo(napi_env env, napi_callback_info info) + : _env(env), + _info(info), + _this(nullptr), + _dynamicArgs(nullptr), + _data(nullptr) { + _argc = _staticArgCount; + _argv = _staticArgs; + napi_status status = + napi_get_cb_info(env, info, &_argc, _argv, &_this, &_data); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + if (_argc > _staticArgCount) { + // Use either a fixed-size array (on the stack) or a dynamically-allocated + // array (on the heap) depending on the number of args. + _dynamicArgs = new napi_value[_argc]; + _argv = _dynamicArgs; + + status = napi_get_cb_info(env, info, &_argc, _argv, nullptr, nullptr); + NAPI_THROW_IF_FAILED_VOID(_env, status); + } +} + +inline CallbackInfo::~CallbackInfo() { + if (_dynamicArgs != nullptr) { + delete[] _dynamicArgs; + } +} + +inline CallbackInfo::operator napi_callback_info() const { + return _info; +} + +inline Value CallbackInfo::NewTarget() const { + napi_value newTarget; + napi_status status = napi_get_new_target(_env, _info, &newTarget); + NAPI_THROW_IF_FAILED(_env, status, Value()); + return Value(_env, newTarget); +} + +inline bool CallbackInfo::IsConstructCall() const { + return !NewTarget().IsEmpty(); +} + +inline Napi::Env CallbackInfo::Env() const { + return Napi::Env(_env); +} + +inline size_t CallbackInfo::Length() const { + return _argc; +} + +inline const Value CallbackInfo::operator[](size_t index) const { + return index < _argc ? Value(_env, _argv[index]) : Env().Undefined(); +} + +inline Value CallbackInfo::This() const { + if (_this == nullptr) { + return Env().Undefined(); + } + return Object(_env, _this); +} + +inline void* CallbackInfo::Data() const { + return _data; +} + +inline void CallbackInfo::SetData(void* data) { + _data = data; +} + +//////////////////////////////////////////////////////////////////////////////// +// PropertyDescriptor class +//////////////////////////////////////////////////////////////////////////////// + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), attributes, data); +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + Name name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.setter = details::TemplatedVoidCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + const std::string& utf8name, + napi_property_attributes attributes, + void* data) { + return Accessor(utf8name.c_str(), attributes, data); +} + +template +PropertyDescriptor PropertyDescriptor::Accessor( + Name name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.setter = details::TemplatedVoidCallback; + desc.attributes = attributes; + desc.data = data; + + return desc; +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + using CbData = details::CallbackData; + auto callbackData = new CbData({getter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes, + void* data) { + return Accessor(env, object, utf8name.c_str(), getter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + napi_property_attributes attributes, + void* data) { + using CbData = details::CallbackData; + auto callbackData = new CbData({getter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::Wrapper, + nullptr, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + using CbData = details::AccessorCallbackData; + auto callbackData = new CbData({getter, setter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + return Accessor( + env, object, utf8name.c_str(), getter, setter, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes, + void* data) { + using CbData = details::AccessorCallbackData; + auto callbackData = new CbData({getter, setter, data}); + + napi_status status = AttachData(env, object, callbackData); + if (status != napi_ok) { + delete callbackData; + NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); + } + + return PropertyDescriptor({nullptr, + name, + nullptr, + CbData::GetterWrapper, + CbData::SetterWrapper, + nullptr, + attributes, + callbackData}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object /*object*/, + const char* utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + nullptr, + nullptr, + Napi::Function::New(env, cb, utf8name, data), + attributes, + nullptr}); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return Function(env, object, utf8name.c_str(), cb, attributes, data); +} + +template +inline PropertyDescriptor PropertyDescriptor::Function( + Napi::Env env, + Napi::Object /*object*/, + Name name, + Callable cb, + napi_property_attributes attributes, + void* data) { + return PropertyDescriptor({nullptr, + name, + nullptr, + nullptr, + nullptr, + Napi::Function::New(env, cb, nullptr, data), + attributes, + nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + const char* utf8name, + napi_value value, + napi_property_attributes attributes) { + return PropertyDescriptor({utf8name, + nullptr, + nullptr, + nullptr, + nullptr, + value, + attributes, + nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + const std::string& utf8name, + napi_value value, + napi_property_attributes attributes) { + return Value(utf8name.c_str(), value, attributes); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + napi_value name, napi_value value, napi_property_attributes attributes) { + return PropertyDescriptor( + {nullptr, name, nullptr, nullptr, nullptr, value, attributes, nullptr}); +} + +inline PropertyDescriptor PropertyDescriptor::Value( + Name name, Napi::Value value, napi_property_attributes attributes) { + napi_value nameValue = name; + napi_value valueValue = value; + return PropertyDescriptor::Value(nameValue, valueValue, attributes); +} + +inline PropertyDescriptor::PropertyDescriptor(napi_property_descriptor desc) + : _desc(desc) {} + +inline PropertyDescriptor::operator napi_property_descriptor&() { + return _desc; +} + +inline PropertyDescriptor::operator const napi_property_descriptor&() const { + return _desc; +} + +//////////////////////////////////////////////////////////////////////////////// +// InstanceWrap class +//////////////////////////////////////////////////////////////////////////////// + +template +inline void InstanceWrap::AttachPropData( + napi_env env, napi_value value, const napi_property_descriptor* prop) { + napi_status status; + if (!(prop->attributes & napi_static)) { + if (prop->method == T::InstanceVoidMethodCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } else if (prop->method == T::InstanceMethodCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } else if (prop->getter == T::InstanceGetterCallbackWrapper || + prop->setter == T::InstanceSetterCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED_VOID(env, status); + } + } +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceVoidMethodCallbackData* callbackData = + new InstanceVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::InstanceVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, + InstanceMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceMethodCallbackData* callbackData = + new InstanceMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::InstanceMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceVoidMethodCallbackData* callbackData = + new InstanceVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::InstanceVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, + InstanceMethodCallback method, + napi_property_attributes attributes, + void* data) { + InstanceMethodCallbackData* callbackData = + new InstanceMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::InstanceMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceVoidMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedInstanceVoidCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedInstanceCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceVoidMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedInstanceVoidCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceMethodCallback method> +inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedInstanceCallback; + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + const char* utf8name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes, + void* data) { + InstanceAccessorCallbackData* callbackData = + new InstanceAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + Symbol name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes, + void* data) { + InstanceAccessorCallbackData* callbackData = + new InstanceAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceGetterCallback getter, + typename InstanceWrap::InstanceSetterCallback setter> +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = details::TemplatedInstanceCallback; + desc.setter = This::WrapSetter(This::SetterTag()); + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +template ::InstanceGetterCallback getter, + typename InstanceWrap::InstanceSetterCallback setter> +inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = details::TemplatedInstanceCallback; + desc.setter = This::WrapSetter(This::SetterTag()); + desc.data = data; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.value = value; + desc.attributes = attributes; + return desc; +} + +template +inline ClassPropertyDescriptor InstanceWrap::InstanceValue( + Symbol name, Napi::Value value, napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.value = value; + desc.attributes = attributes; + return desc; +} + +template +inline napi_value InstanceWrap::InstanceVoidMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceVoidMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->callback; + if (instance) (instance->*cb)(callbackInfo); + return nullptr; + }); +} + +template +inline napi_value InstanceWrap::InstanceMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->callback; + return instance ? (instance->*cb)(callbackInfo) : Napi::Value(); + }); +} + +template +inline napi_value InstanceWrap::InstanceGetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->getterCallback; + return instance ? (instance->*cb)(callbackInfo) : Napi::Value(); + }); +} + +template +inline napi_value InstanceWrap::InstanceSetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + InstanceAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + T* instance = T::Unwrap(callbackInfo.This().As()); + auto cb = callbackData->setterCallback; + if (instance) (instance->*cb)(callbackInfo, callbackInfo[0]); + return nullptr; + }); +} + +template +template ::InstanceSetterCallback method> +inline napi_value InstanceWrap::WrappedMethod( + napi_env env, napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + const CallbackInfo cbInfo(env, info); + T* instance = T::Unwrap(cbInfo.This().As()); + if (instance) (instance->*method)(cbInfo, cbInfo[0]); + return nullptr; + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// ObjectWrap class +//////////////////////////////////////////////////////////////////////////////// + +template +inline ObjectWrap::ObjectWrap(const Napi::CallbackInfo& callbackInfo) { + napi_env env = callbackInfo.Env(); + napi_value wrapper = callbackInfo.This(); + napi_status status; + napi_ref ref; + T* instance = static_cast(this); + status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref); + NAPI_THROW_IF_FAILED_VOID(env, status); + + Reference* instanceRef = instance; + *instanceRef = Reference(env, ref); +} + +template +inline ObjectWrap::~ObjectWrap() { + // If the JS object still exists at this point, remove the finalizer added + // through `napi_wrap()`. + if (!IsEmpty()) { + Object object = Value(); + // It is not valid to call `napi_remove_wrap()` with an empty `object`. + // This happens e.g. during garbage collection. + if (!object.IsEmpty() && _construction_failed) { + napi_remove_wrap(Env(), object, nullptr); + } + } +} + +template +inline T* ObjectWrap::Unwrap(Object wrapper) { + void* unwrapped; + napi_status status = napi_unwrap(wrapper.Env(), wrapper, &unwrapped); + NAPI_THROW_IF_FAILED(wrapper.Env(), status, nullptr); + return static_cast(unwrapped); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const size_t props_count, + const napi_property_descriptor* descriptors, + void* data) { + napi_status status; + std::vector props(props_count); + + // We copy the descriptors to a local array because before defining the class + // we must replace static method property descriptors with value property + // descriptors such that the value is a function-valued `napi_value` created + // with `CreateFunction()`. + // + // This replacement could be made for instance methods as well, but V8 aborts + // if we do that, because it expects methods defined on the prototype template + // to have `FunctionTemplate`s. + for (size_t index = 0; index < props_count; index++) { + props[index] = descriptors[index]; + napi_property_descriptor* prop = &props[index]; + if (prop->method == T::StaticMethodCallbackWrapper) { + status = + CreateFunction(env, + utf8name, + prop->method, + static_cast(prop->data), + &(prop->value)); + NAPI_THROW_IF_FAILED(env, status, Function()); + prop->method = nullptr; + prop->data = nullptr; + } else if (prop->method == T::StaticVoidMethodCallbackWrapper) { + status = + CreateFunction(env, + utf8name, + prop->method, + static_cast(prop->data), + &(prop->value)); + NAPI_THROW_IF_FAILED(env, status, Function()); + prop->method = nullptr; + prop->data = nullptr; + } + } + + napi_value value; + status = napi_define_class(env, + utf8name, + NAPI_AUTO_LENGTH, + T::ConstructorCallbackWrapper, + data, + props_count, + props.data(), + &value); + NAPI_THROW_IF_FAILED(env, status, Function()); + + // After defining the class we iterate once more over the property descriptors + // and attach the data associated with accessors and instance methods to the + // newly created JavaScript class. + for (size_t idx = 0; idx < props_count; idx++) { + const napi_property_descriptor* prop = &props[idx]; + + if (prop->getter == T::StaticGetterCallbackWrapper || + prop->setter == T::StaticSetterCallbackWrapper) { + status = Napi::details::AttachData( + env, value, static_cast(prop->data)); + NAPI_THROW_IF_FAILED(env, status, Function()); + } else { + // InstanceWrap::AttachPropData is responsible for attaching the data + // of instance methods and accessors. + T::AttachPropData(env, value, prop); + } + } + + return Function(env, value); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const std::initializer_list>& properties, + void* data) { + return DefineClass( + env, + utf8name, + properties.size(), + reinterpret_cast(properties.begin()), + data); +} + +template +inline Function ObjectWrap::DefineClass( + Napi::Env env, + const char* utf8name, + const std::vector>& properties, + void* data) { + return DefineClass( + env, + utf8name, + properties.size(), + reinterpret_cast(properties.data()), + data); +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, + StaticVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticVoidMethodCallbackData* callbackData = + new StaticVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::StaticVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, + StaticMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticMethodCallbackData* callbackData = + new StaticMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = T::StaticMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, + StaticVoidMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticVoidMethodCallbackData* callbackData = + new StaticVoidMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::StaticVoidMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, + StaticMethodCallback method, + napi_property_attributes attributes, + void* data) { + StaticMethodCallbackData* callbackData = + new StaticMethodCallbackData({method, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = T::StaticMethodCallbackWrapper; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticVoidMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedVoidCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticVoidMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedVoidCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.method = details::TemplatedCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticMethodCallback method> +inline ClassPropertyDescriptor ObjectWrap::StaticMethod( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.method = details::TemplatedCallback; + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + const char* utf8name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes, + void* data) { + StaticAccessorCallbackData* callbackData = + new StaticAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + Symbol name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes, + void* data) { + StaticAccessorCallbackData* callbackData = + new StaticAccessorCallbackData({getter, setter, data}); + + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; + desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; + desc.data = callbackData; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticGetterCallback getter, + typename ObjectWrap::StaticSetterCallback setter> +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + const char* utf8name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.getter = details::TemplatedCallback; + desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +template ::StaticGetterCallback getter, + typename ObjectWrap::StaticSetterCallback setter> +inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( + Symbol name, napi_property_attributes attributes, void* data) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.getter = details::TemplatedCallback; + desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.data = data; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.utf8name = utf8name; + desc.value = value; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline ClassPropertyDescriptor ObjectWrap::StaticValue( + Symbol name, Napi::Value value, napi_property_attributes attributes) { + napi_property_descriptor desc = napi_property_descriptor(); + desc.name = name; + desc.value = value; + desc.attributes = + static_cast(attributes | napi_static); + return desc; +} + +template +inline Value ObjectWrap::OnCalledAsFunction( + const Napi::CallbackInfo& callbackInfo) { + NAPI_THROW( + TypeError::New(callbackInfo.Env(), + "Class constructors cannot be invoked without 'new'"), + Napi::Value()); +} + +template +inline void ObjectWrap::Finalize(Napi::Env /*env*/) {} + +template +inline napi_value ObjectWrap::ConstructorCallbackWrapper( + napi_env env, napi_callback_info info) { + napi_value new_target; + napi_status status = napi_get_new_target(env, info, &new_target); + if (status != napi_ok) return nullptr; + + bool isConstructCall = (new_target != nullptr); + if (!isConstructCall) { + return details::WrapCallback( + [&] { return T::OnCalledAsFunction(CallbackInfo(env, info)); }); + } + + napi_value wrapper = details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + T* instance = new T(callbackInfo); +#ifdef NAPI_CPP_EXCEPTIONS + instance->_construction_failed = false; +#else + if (callbackInfo.Env().IsExceptionPending()) { + // We need to clear the exception so that removing the wrap might work. + Error e = callbackInfo.Env().GetAndClearPendingException(); + delete instance; + e.ThrowAsJavaScriptException(); + } else { + instance->_construction_failed = false; + } +#endif // NAPI_CPP_EXCEPTIONS + return callbackInfo.This(); + }); + + return wrapper; +} + +template +inline napi_value ObjectWrap::StaticVoidMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticVoidMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->callback(callbackInfo); + return nullptr; + }); +} + +template +inline napi_value ObjectWrap::StaticMethodCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticMethodCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->callback(callbackInfo); + }); +} + +template +inline napi_value ObjectWrap::StaticGetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + return callbackData->getterCallback(callbackInfo); + }); +} + +template +inline napi_value ObjectWrap::StaticSetterCallbackWrapper( + napi_env env, napi_callback_info info) { + return details::WrapCallback([&] { + CallbackInfo callbackInfo(env, info); + StaticAccessorCallbackData* callbackData = + reinterpret_cast(callbackInfo.Data()); + callbackInfo.SetData(callbackData->data); + callbackData->setterCallback(callbackInfo, callbackInfo[0]); + return nullptr; + }); +} + +template +inline void ObjectWrap::FinalizeCallback(napi_env env, + void* data, + void* /*hint*/) { + HandleScope scope(env); + T* instance = static_cast(data); + instance->Finalize(Napi::Env(env)); + delete instance; +} + +template +template ::StaticSetterCallback method> +inline napi_value ObjectWrap::WrappedMethod( + napi_env env, napi_callback_info info) NAPI_NOEXCEPT { + return details::WrapCallback([&] { + const CallbackInfo cbInfo(env, info); + method(cbInfo, cbInfo[0]); + return nullptr; + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// HandleScope class +//////////////////////////////////////////////////////////////////////////////// + +inline HandleScope::HandleScope(napi_env env, napi_handle_scope scope) + : _env(env), _scope(scope) {} + +inline HandleScope::HandleScope(Napi::Env env) : _env(env) { + napi_status status = napi_open_handle_scope(_env, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline HandleScope::~HandleScope() { + napi_status status = napi_close_handle_scope(_env, _scope); + NAPI_FATAL_IF_FAILED( + status, "HandleScope::~HandleScope", "napi_close_handle_scope"); +} + +inline HandleScope::operator napi_handle_scope() const { + return _scope; +} + +inline Napi::Env HandleScope::Env() const { + return Napi::Env(_env); +} + +//////////////////////////////////////////////////////////////////////////////// +// EscapableHandleScope class +//////////////////////////////////////////////////////////////////////////////// + +inline EscapableHandleScope::EscapableHandleScope( + napi_env env, napi_escapable_handle_scope scope) + : _env(env), _scope(scope) {} + +inline EscapableHandleScope::EscapableHandleScope(Napi::Env env) : _env(env) { + napi_status status = napi_open_escapable_handle_scope(_env, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline EscapableHandleScope::~EscapableHandleScope() { + napi_status status = napi_close_escapable_handle_scope(_env, _scope); + NAPI_FATAL_IF_FAILED(status, + "EscapableHandleScope::~EscapableHandleScope", + "napi_close_escapable_handle_scope"); +} + +inline EscapableHandleScope::operator napi_escapable_handle_scope() const { + return _scope; +} + +inline Napi::Env EscapableHandleScope::Env() const { + return Napi::Env(_env); +} + +inline Value EscapableHandleScope::Escape(napi_value escapee) { + napi_value result; + napi_status status = napi_escape_handle(_env, _scope, escapee, &result); + NAPI_THROW_IF_FAILED(_env, status, Value()); + return Value(_env, result); +} + +#if (NAPI_VERSION > 2) +//////////////////////////////////////////////////////////////////////////////// +// CallbackScope class +//////////////////////////////////////////////////////////////////////////////// + +inline CallbackScope::CallbackScope(napi_env env, napi_callback_scope scope) + : _env(env), _scope(scope) {} + +inline CallbackScope::CallbackScope(napi_env env, napi_async_context context) + : _env(env) { + napi_status status = + napi_open_callback_scope(_env, Object::New(env), context, &_scope); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline CallbackScope::~CallbackScope() { + napi_status status = napi_close_callback_scope(_env, _scope); + NAPI_FATAL_IF_FAILED( + status, "CallbackScope::~CallbackScope", "napi_close_callback_scope"); +} + +inline CallbackScope::operator napi_callback_scope() const { + return _scope; +} + +inline Napi::Env CallbackScope::Env() const { + return Napi::Env(_env); +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +// AsyncContext class +//////////////////////////////////////////////////////////////////////////////// + +inline AsyncContext::AsyncContext(napi_env env, const char* resource_name) + : AsyncContext(env, resource_name, Object::New(env)) {} + +inline AsyncContext::AsyncContext(napi_env env, + const char* resource_name, + const Object& resource) + : _env(env), _context(nullptr) { + napi_value resource_id; + napi_status status = napi_create_string_utf8( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_async_init(_env, resource, resource_id, &_context); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncContext::~AsyncContext() { + if (_context != nullptr) { + napi_async_destroy(_env, _context); + _context = nullptr; + } +} + +inline AsyncContext::AsyncContext(AsyncContext&& other) { + _env = other._env; + other._env = nullptr; + _context = other._context; + other._context = nullptr; +} + +inline AsyncContext& AsyncContext::operator=(AsyncContext&& other) { + _env = other._env; + other._env = nullptr; + _context = other._context; + other._context = nullptr; + return *this; +} + +inline AsyncContext::operator napi_async_context() const { + return _context; +} + +inline Napi::Env AsyncContext::Env() const { + return Napi::Env(_env); +} + +//////////////////////////////////////////////////////////////////////////////// +// AsyncWorker class +//////////////////////////////////////////////////////////////////////////////// + +#if NAPI_HAS_THREADS + +inline AsyncWorker::AsyncWorker(const Function& callback) + : AsyncWorker(callback, "generic") {} + +inline AsyncWorker::AsyncWorker(const Function& callback, + const char* resource_name) + : AsyncWorker(callback, resource_name, Object::New(callback.Env())) {} + +inline AsyncWorker::AsyncWorker(const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback) + : AsyncWorker(receiver, callback, "generic") {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name) + : AsyncWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +inline AsyncWorker::AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : _env(callback.Env()), + _receiver(Napi::Persistent(receiver)), + _callback(Napi::Persistent(callback)), + _suppress_destruct(false) { + napi_value resource_id; + napi_status status = napi_create_string_latin1( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_create_async_work(_env, + resource, + resource_id, + OnAsyncWorkExecute, + OnAsyncWorkComplete, + this, + &_work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncWorker::AsyncWorker(Napi::Env env) : AsyncWorker(env, "generic") {} + +inline AsyncWorker::AsyncWorker(Napi::Env env, const char* resource_name) + : AsyncWorker(env, resource_name, Object::New(env)) {} + +inline AsyncWorker::AsyncWorker(Napi::Env env, + const char* resource_name, + const Object& resource) + : _env(env), _receiver(), _callback(), _suppress_destruct(false) { + napi_value resource_id; + napi_status status = napi_create_string_latin1( + _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); + NAPI_THROW_IF_FAILED_VOID(_env, status); + + status = napi_create_async_work(_env, + resource, + resource_id, + OnAsyncWorkExecute, + OnAsyncWorkComplete, + this, + &_work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline AsyncWorker::~AsyncWorker() { + if (_work != nullptr) { + napi_delete_async_work(_env, _work); + _work = nullptr; + } +} + +inline void AsyncWorker::Destroy() { + delete this; +} + +inline AsyncWorker::operator napi_async_work() const { + return _work; +} + +inline Napi::Env AsyncWorker::Env() const { + return Napi::Env(_env); +} + +inline void AsyncWorker::Queue() { + napi_status status = napi_queue_async_work(_env, _work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline void AsyncWorker::Cancel() { + napi_status status = napi_cancel_async_work(_env, _work); + NAPI_THROW_IF_FAILED_VOID(_env, status); +} + +inline ObjectReference& AsyncWorker::Receiver() { + return _receiver; +} + +inline FunctionReference& AsyncWorker::Callback() { + return _callback; +} + +inline void AsyncWorker::SuppressDestruct() { + _suppress_destruct = true; +} + +inline void AsyncWorker::OnOK() { + if (!_callback.IsEmpty()) { + _callback.Call(_receiver.Value(), GetResult(_callback.Env())); + } +} + +inline void AsyncWorker::OnError(const Error& e) { + if (!_callback.IsEmpty()) { + _callback.Call(_receiver.Value(), + std::initializer_list{e.Value()}); + } +} + +inline void AsyncWorker::SetError(const std::string& error) { + _error = error; +} + +inline std::vector AsyncWorker::GetResult(Napi::Env /*env*/) { + return {}; +} +// The OnAsyncWorkExecute method receives an napi_env argument. However, do NOT +// use it within this method, as it does not run on the JavaScript thread and +// must not run any method that would cause JavaScript to run. In practice, +// this means that almost any use of napi_env will be incorrect. +inline void AsyncWorker::OnAsyncWorkExecute(napi_env env, void* asyncworker) { + AsyncWorker* self = static_cast(asyncworker); + self->OnExecute(env); +} +// The OnExecute method receives an napi_env argument. However, do NOT +// use it within this method, as it does not run on the JavaScript thread and +// must not run any method that would cause JavaScript to run. In practice, +// this means that almost any use of napi_env will be incorrect. +inline void AsyncWorker::OnExecute(Napi::Env /*DO_NOT_USE*/) { +#ifdef NAPI_CPP_EXCEPTIONS + try { + Execute(); + } catch (const std::exception& e) { + SetError(e.what()); + } +#else // NAPI_CPP_EXCEPTIONS + Execute(); +#endif // NAPI_CPP_EXCEPTIONS +} + +inline void AsyncWorker::OnAsyncWorkComplete(napi_env env, + napi_status status, + void* asyncworker) { + AsyncWorker* self = static_cast(asyncworker); + self->OnWorkComplete(env, status); +} +inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) { + if (status != napi_cancelled) { + HandleScope scope(_env); + details::WrapCallback([&] { + if (_error.size() == 0) { + OnOK(); + } else { + OnError(Error::New(_env, _error)); + } + return nullptr; + }); + } + if (!_suppress_destruct) { + Destroy(); + } +} + +#endif // NAPI_HAS_THREADS + +#if (NAPI_VERSION > 3 && NAPI_HAS_THREADS) +//////////////////////////////////////////////////////////////////////////////// +// TypedThreadSafeFunction class +//////////////////////////////////////////////////////////////////////////////// + +// Starting with NAPI 5, the JavaScript function `func` parameter of +// `napi_create_threadsafe_function` is optional. +#if NAPI_VERSION > 4 +// static, with Callback [missing] Resource [missing] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + nullptr, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [passed] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + nullptr, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [missing] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + nullptr, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [missing] Resource [passed] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + nullptr, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} +#endif + +// static, with Callback [passed] Resource [missing] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + callback, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [passed] Resource [passed] Finalizer [missing] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + TypedThreadSafeFunction tsfn; + + napi_status status = + napi_create_threadsafe_function(env, + callback, + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + nullptr, + nullptr, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with Callback [passed] Resource [missing] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + callback, + nullptr, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +// static, with: Callback [passed] Resource [passed] Finalizer [passed] +template +template +inline TypedThreadSafeFunction +TypedThreadSafeFunction::New( + napi_env env, + CallbackType callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + TypedThreadSafeFunction tsfn; + + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = napi_create_threadsafe_function( + env, + details::DefaultCallbackWrapper< + CallbackType, + TypedThreadSafeFunction>(env, + callback), + resource, + String::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext, + context, + CallJsInternal, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED( + env, status, TypedThreadSafeFunction()); + } + + return tsfn; +} + +template +inline TypedThreadSafeFunction:: + TypedThreadSafeFunction() + : _tsfn() {} + +template +inline TypedThreadSafeFunction:: + TypedThreadSafeFunction(napi_threadsafe_function tsfn) + : _tsfn(tsfn) {} + +template +inline TypedThreadSafeFunction:: +operator napi_threadsafe_function() const { + return _tsfn; +} + +template +inline napi_status +TypedThreadSafeFunction::BlockingCall( + DataType* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); +} + +template +inline napi_status +TypedThreadSafeFunction::NonBlockingCall( + DataType* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); +} + +template +inline void TypedThreadSafeFunction::Ref( + napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_ref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +template +inline void TypedThreadSafeFunction::Unref( + napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_unref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +template +inline napi_status +TypedThreadSafeFunction::Acquire() const { + return napi_acquire_threadsafe_function(_tsfn); +} + +template +inline napi_status +TypedThreadSafeFunction::Release() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); +} + +template +inline napi_status +TypedThreadSafeFunction::Abort() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); +} + +template +inline ContextType* +TypedThreadSafeFunction::GetContext() const { + void* context; + napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); + NAPI_FATAL_IF_FAILED(status, + "TypedThreadSafeFunction::GetContext", + "napi_get_threadsafe_function_context"); + return static_cast(context); +} + +// static +template +void TypedThreadSafeFunction::CallJsInternal( + napi_env env, napi_value jsCallback, void* context, void* data) { + details::CallJsWrapper( + env, jsCallback, context, data); +} + +#if NAPI_VERSION == 4 +// static +template +Napi::Function +TypedThreadSafeFunction::EmptyFunctionFactory( + Napi::Env env) { + return Napi::Function::New(env, [](const CallbackInfo& cb) {}); +} + +// static +template +Napi::Function +TypedThreadSafeFunction::FunctionOrEmpty( + Napi::Env env, Napi::Function& callback) { + if (callback.IsEmpty()) { + return EmptyFunctionFactory(env); + } + return callback; +} + +#else +// static +template +std::nullptr_t +TypedThreadSafeFunction::EmptyFunctionFactory( + Napi::Env /*env*/) { + return nullptr; +} + +// static +template +Napi::Function +TypedThreadSafeFunction::FunctionOrEmpty( + Napi::Env /*env*/, Napi::Function& callback) { + return callback; +} + +#endif + +//////////////////////////////////////////////////////////////////////////////// +// ThreadSafeFunction class +//////////////////////////////////////////////////////////////////////////////// + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount) { + return New( + env, callback, Object(), resourceName, maxQueueSize, initialThreadCount); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + finalizeCallback); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + finalizeCallback, + data); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + Object(), + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + data); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + [](Env, ContextType*) {} /* empty finalizer */); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */, + finalizeCallback, + static_cast(nullptr) /* data */, + details::ThreadSafeFinalize::Wrapper); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New(env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + static_cast(nullptr) /* context */, + finalizeCallback, + data, + details::ThreadSafeFinalize:: + FinalizeWrapperWithData); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback) { + return New( + env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + static_cast(nullptr) /* data */, + details::ThreadSafeFinalize::FinalizeWrapperWithContext); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data) { + return New( + env, + callback, + resource, + resourceName, + maxQueueSize, + initialThreadCount, + context, + finalizeCallback, + data, + details::ThreadSafeFinalize:: + FinalizeFinalizeWrapperWithDataAndContext); +} + +inline ThreadSafeFunction::ThreadSafeFunction() : _tsfn() {} + +inline ThreadSafeFunction::ThreadSafeFunction(napi_threadsafe_function tsfn) + : _tsfn(tsfn) {} + +inline ThreadSafeFunction::operator napi_threadsafe_function() const { + return _tsfn; +} + +inline napi_status ThreadSafeFunction::BlockingCall() const { + return CallInternal(nullptr, napi_tsfn_blocking); +} + +template <> +inline napi_status ThreadSafeFunction::BlockingCall(void* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); +} + +template +inline napi_status ThreadSafeFunction::BlockingCall(Callback callback) const { + return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking); +} + +template +inline napi_status ThreadSafeFunction::BlockingCall(DataType* data, + Callback callback) const { + auto wrapper = [data, callback](Env env, Function jsCallback) { + callback(env, jsCallback, data); + }; + return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking); +} + +inline napi_status ThreadSafeFunction::NonBlockingCall() const { + return CallInternal(nullptr, napi_tsfn_nonblocking); +} + +template <> +inline napi_status ThreadSafeFunction::NonBlockingCall(void* data) const { + return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); +} + +template +inline napi_status ThreadSafeFunction::NonBlockingCall( + Callback callback) const { + return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking); +} + +template +inline napi_status ThreadSafeFunction::NonBlockingCall( + DataType* data, Callback callback) const { + auto wrapper = [data, callback](Env env, Function jsCallback) { + callback(env, jsCallback, data); + }; + return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking); +} + +inline void ThreadSafeFunction::Ref(napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_ref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +inline void ThreadSafeFunction::Unref(napi_env env) const { + if (_tsfn != nullptr) { + napi_status status = napi_unref_threadsafe_function(env, _tsfn); + NAPI_THROW_IF_FAILED_VOID(env, status); + } +} + +inline napi_status ThreadSafeFunction::Acquire() const { + return napi_acquire_threadsafe_function(_tsfn); +} + +inline napi_status ThreadSafeFunction::Release() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); +} + +inline napi_status ThreadSafeFunction::Abort() const { + return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); +} + +inline ThreadSafeFunction::ConvertibleContext ThreadSafeFunction::GetContext() + const { + void* context; + napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); + NAPI_FATAL_IF_FAILED(status, + "ThreadSafeFunction::GetContext", + "napi_get_threadsafe_function_context"); + return ConvertibleContext({context}); +} + +// static +template +inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper) { + static_assert(details::can_make_string::value || + std::is_convertible::value, + "Resource name should be convertible to the string type"); + + ThreadSafeFunction tsfn; + auto* finalizeData = new details:: + ThreadSafeFinalize( + {data, finalizeCallback}); + napi_status status = + napi_create_threadsafe_function(env, + callback, + resource, + Value::From(env, resourceName), + maxQueueSize, + initialThreadCount, + finalizeData, + wrapper, + context, + CallJS, + &tsfn._tsfn); + if (status != napi_ok) { + delete finalizeData; + NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction()); + } + + return tsfn; +} + +inline napi_status ThreadSafeFunction::CallInternal( + CallbackWrapper* callbackWrapper, + napi_threadsafe_function_call_mode mode) const { + napi_status status = + napi_call_threadsafe_function(_tsfn, callbackWrapper, mode); + if (status != napi_ok && callbackWrapper != nullptr) { + delete callbackWrapper; + } + + return status; +} + +// static +inline void ThreadSafeFunction::CallJS(napi_env env, + napi_value jsCallback, + void* /* context */, + void* data) { + if (env == nullptr && jsCallback == nullptr) { + return; + } + + details::WrapVoidCallback([&]() { + if (data != nullptr) { + auto* callbackWrapper = static_cast(data); + (*callbackWrapper)(env, Function(env, jsCallback)); + delete callbackWrapper; + } else if (jsCallback != nullptr) { + Function(env, jsCallback).Call({}); + } + }); +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Worker Base class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( + const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource, + size_t queue_size) + : AsyncWorker(receiver, callback, resource_name, resource) { + // Fill all possible arguments to work around ambiguous + // ThreadSafeFunction::New signatures. + _tsfn = ThreadSafeFunction::New(callback.Env(), + callback, + resource, + resource_name, + queue_size, + /** initialThreadCount */ 1, + /** context */ this, + OnThreadSafeFunctionFinalize, + /** finalizeData */ this); +} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( + Napi::Env env, + const char* resource_name, + const Object& resource, + size_t queue_size) + : AsyncWorker(env, resource_name, resource) { + // TODO: Once the changes to make the callback optional for threadsafe + // functions are available on all versions we can remove the dummy Function + // here. + Function callback; + // Fill all possible arguments to work around ambiguous + // ThreadSafeFunction::New signatures. + _tsfn = ThreadSafeFunction::New(env, + callback, + resource, + resource_name, + queue_size, + /** initialThreadCount */ 1, + /** context */ this, + OnThreadSafeFunctionFinalize, + /** finalizeData */ this); +} +#endif + +template +inline AsyncProgressWorkerBase::~AsyncProgressWorkerBase() { + // Abort pending tsfn call. + // Don't send progress events after we've already completed. + // It's ok to call ThreadSafeFunction::Abort and ThreadSafeFunction::Release + // duplicated. + _tsfn.Abort(); +} + +template +inline void AsyncProgressWorkerBase::OnAsyncWorkProgress( + Napi::Env /* env */, Napi::Function /* jsCallback */, void* data) { + ThreadSafeData* tsd = static_cast(data); + tsd->asyncprogressworker()->OnWorkProgress(tsd->data()); + delete tsd; +} + +template +inline napi_status AsyncProgressWorkerBase::NonBlockingCall( + DataType* data) { + auto tsd = new AsyncProgressWorkerBase::ThreadSafeData(this, data); + auto ret = _tsfn.NonBlockingCall(tsd, OnAsyncWorkProgress); + if (ret != napi_ok) { + delete tsd; + } + return ret; +} + +template +inline void AsyncProgressWorkerBase::OnWorkComplete( + Napi::Env /* env */, napi_status status) { + _work_completed = true; + _complete_status = status; + _tsfn.Release(); +} + +template +inline void AsyncProgressWorkerBase::OnThreadSafeFunctionFinalize( + Napi::Env env, void* /* data */, AsyncProgressWorkerBase* context) { + if (context->_work_completed) { + context->AsyncWorker::OnWorkComplete(env, context->_complete_status); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Worker class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback) + : AsyncProgressWorker(callback, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, + const char* resource_name) + : AsyncProgressWorker( + callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback) + : AsyncProgressWorker(receiver, callback, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name) + : AsyncProgressWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase(receiver, callback, resource_name, resource), + _asyncdata(nullptr), + _asyncsize(0), + _signaled(false) {} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env) + : AsyncProgressWorker(env, "generic") {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, + const char* resource_name) + : AsyncProgressWorker(env, resource_name, Object::New(env)) {} + +template +inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase(env, resource_name, resource), + _asyncdata(nullptr), + _asyncsize(0) {} +#endif + +template +inline AsyncProgressWorker::~AsyncProgressWorker() { + { + std::lock_guard lock(this->_mutex); + _asyncdata = nullptr; + _asyncsize = 0; + } +} + +template +inline void AsyncProgressWorker::Execute() { + ExecutionProgress progress(this); + Execute(progress); +} + +template +inline void AsyncProgressWorker::OnWorkProgress(void*) { + T* data; + size_t size; + bool signaled; + { + std::lock_guard lock(this->_mutex); + data = this->_asyncdata; + size = this->_asyncsize; + signaled = this->_signaled; + this->_asyncdata = nullptr; + this->_asyncsize = 0; + this->_signaled = false; + } + + /** + * The callback of ThreadSafeFunction is not been invoked immediately on the + * callback of uv_async_t (uv io poll), rather the callback of TSFN is + * invoked on the right next uv idle callback. There are chances that during + * the deferring the signal of uv_async_t is been sent again, i.e. potential + * not coalesced two calls of the TSFN callback. + */ + if (data == nullptr && !signaled) { + return; + } + + this->OnProgress(data, size); + delete[] data; +} + +template +inline void AsyncProgressWorker::SendProgress_(const T* data, size_t count) { + T* new_data = new T[count]; + std::copy(data, data + count, new_data); + + T* old_data; + { + std::lock_guard lock(this->_mutex); + old_data = _asyncdata; + _asyncdata = new_data; + _asyncsize = count; + _signaled = false; + } + this->NonBlockingCall(nullptr); + + delete[] old_data; +} + +template +inline void AsyncProgressWorker::Signal() { + { + std::lock_guard lock(this->_mutex); + _signaled = true; + } + this->NonBlockingCall(static_cast(nullptr)); +} + +template +inline void AsyncProgressWorker::ExecutionProgress::Signal() const { + this->_worker->Signal(); +} + +template +inline void AsyncProgressWorker::ExecutionProgress::Send( + const T* data, size_t count) const { + _worker->SendProgress_(data, count); +} + +//////////////////////////////////////////////////////////////////////////////// +// Async Progress Queue Worker class +//////////////////////////////////////////////////////////////////////////////// +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback) + : AsyncProgressQueueWorker(callback, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback, const char* resource_name) + : AsyncProgressQueueWorker( + callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Function& callback, const char* resource_name, const Object& resource) + : AsyncProgressQueueWorker( + Object::New(callback.Env()), callback, resource_name, resource) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, const Function& callback) + : AsyncProgressQueueWorker(receiver, callback, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, const Function& callback, const char* resource_name) + : AsyncProgressQueueWorker( + receiver, callback, resource_name, Object::New(callback.Env())) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource) + : AsyncProgressWorkerBase>( + receiver, + callback, + resource_name, + resource, + /** unlimited queue size */ 0) {} + +#if NAPI_VERSION > 4 +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env) + : AsyncProgressQueueWorker(env, "generic") {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + Napi::Env env, const char* resource_name) + : AsyncProgressQueueWorker(env, resource_name, Object::New(env)) {} + +template +inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( + Napi::Env env, const char* resource_name, const Object& resource) + : AsyncProgressWorkerBase>( + env, resource_name, resource, /** unlimited queue size */ 0) {} +#endif + +template +inline void AsyncProgressQueueWorker::Execute() { + ExecutionProgress progress(this); + Execute(progress); +} + +template +inline void AsyncProgressQueueWorker::OnWorkProgress( + std::pair* datapair) { + if (datapair == nullptr) { + return; + } + + T* data = datapair->first; + size_t size = datapair->second; + + this->OnProgress(data, size); + delete datapair; + delete[] data; +} + +template +inline void AsyncProgressQueueWorker::SendProgress_(const T* data, + size_t count) { + T* new_data = new T[count]; + std::copy(data, data + count, new_data); + + auto pair = new std::pair(new_data, count); + this->NonBlockingCall(pair); +} + +template +inline void AsyncProgressQueueWorker::Signal() const { + this->SendProgress_(static_cast(nullptr), 0); +} + +template +inline void AsyncProgressQueueWorker::OnWorkComplete(Napi::Env env, + napi_status status) { + // Draining queued items in TSFN. + AsyncProgressWorkerBase>::OnWorkComplete(env, status); +} + +template +inline void AsyncProgressQueueWorker::ExecutionProgress::Signal() const { + _worker->SendProgress_(static_cast(nullptr), 0); +} + +template +inline void AsyncProgressQueueWorker::ExecutionProgress::Send( + const T* data, size_t count) const { + _worker->SendProgress_(data, count); +} +#endif // NAPI_VERSION > 3 && NAPI_HAS_THREADS + +//////////////////////////////////////////////////////////////////////////////// +// Memory Management class +//////////////////////////////////////////////////////////////////////////////// + +inline int64_t MemoryManagement::AdjustExternalMemory(Env env, + int64_t change_in_bytes) { + int64_t result; + napi_status status = + napi_adjust_external_memory(env, change_in_bytes, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +//////////////////////////////////////////////////////////////////////////////// +// Version Management class +//////////////////////////////////////////////////////////////////////////////// + +inline uint32_t VersionManagement::GetNapiVersion(Env env) { + uint32_t result; + napi_status status = napi_get_version(env, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +inline const napi_node_version* VersionManagement::GetNodeVersion(Env env) { + const napi_node_version* result; + napi_status status = napi_get_node_version(env, &result); + NAPI_THROW_IF_FAILED(env, status, 0); + return result; +} + +#if NAPI_VERSION > 5 +//////////////////////////////////////////////////////////////////////////////// +// Addon class +//////////////////////////////////////////////////////////////////////////////// + +template +inline Object Addon::Init(Env env, Object exports) { + T* addon = new T(env, exports); + env.SetInstanceData(addon); + return addon->entry_point_; +} + +template +inline T* Addon::Unwrap(Object wrapper) { + return wrapper.Env().GetInstanceData(); +} + +template +inline void Addon::DefineAddon( + Object exports, const std::initializer_list& props) { + DefineProperties(exports, props); + entry_point_ = exports; +} + +template +inline Napi::Object Addon::DefineProperties( + Object object, const std::initializer_list& props) { + const napi_property_descriptor* properties = + reinterpret_cast(props.begin()); + size_t size = props.size(); + napi_status status = + napi_define_properties(object.Env(), object, size, properties); + NAPI_THROW_IF_FAILED(object.Env(), status, object); + for (size_t idx = 0; idx < size; idx++) + T::AttachPropData(object.Env(), object, &properties[idx]); + return object; +} +#endif // NAPI_VERSION > 5 + +#if NAPI_VERSION > 2 +template +Env::CleanupHook Env::AddCleanupHook(Hook hook, Arg* arg) { + return CleanupHook(*this, hook, arg); +} + +template +Env::CleanupHook Env::AddCleanupHook(Hook hook) { + return CleanupHook(*this, hook); +} + +template +Env::CleanupHook::CleanupHook() { + data = nullptr; +} + +template +Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook) + : wrapper(Env::CleanupHook::Wrapper) { + data = new CleanupData{std::move(hook), nullptr}; + napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); + if (status != napi_ok) { + delete data; + data = nullptr; + } +} + +template +Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook, Arg* arg) + : wrapper(Env::CleanupHook::WrapperWithArg) { + data = new CleanupData{std::move(hook), arg}; + napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); + if (status != napi_ok) { + delete data; + data = nullptr; + } +} + +template +bool Env::CleanupHook::Remove(Env env) { + napi_status status = napi_remove_env_cleanup_hook(env, wrapper, data); + delete data; + data = nullptr; + return status == napi_ok; +} + +template +bool Env::CleanupHook::IsEmpty() const { + return data == nullptr; +} +#endif // NAPI_VERSION > 2 + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +} // namespace NAPI_CPP_CUSTOM_NAMESPACE +#endif + +} // namespace Napi + +#endif // SRC_NAPI_INL_H_ diff --git a/node_modules/node-addon-api/napi.h b/node_modules/node-addon-api/napi.h new file mode 100644 index 0000000..9f20cb8 --- /dev/null +++ b/node_modules/node-addon-api/napi.h @@ -0,0 +1,3201 @@ +#ifndef SRC_NAPI_H_ +#define SRC_NAPI_H_ + +#ifndef NAPI_HAS_THREADS +#if !defined(__wasm__) || (defined(__EMSCRIPTEN_PTHREADS__) || \ + (defined(__wasi__) && defined(_REENTRANT))) +#define NAPI_HAS_THREADS 1 +#else +#define NAPI_HAS_THREADS 0 +#endif +#endif + +#include +#include +#include +#include +#if NAPI_HAS_THREADS +#include +#endif // NAPI_HAS_THREADS +#include +#include + +// VS2015 RTM has bugs with constexpr, so require min of VS2015 Update 3 (known +// good version) +#if !defined(_MSC_VER) || _MSC_FULL_VER >= 190024210 +#define NAPI_HAS_CONSTEXPR 1 +#endif + +// VS2013 does not support char16_t literal strings, so we'll work around it +// using wchar_t strings and casting them. This is safe as long as the character +// sizes are the same. +#if defined(_MSC_VER) && _MSC_VER <= 1800 +static_assert(sizeof(char16_t) == sizeof(wchar_t), + "Size mismatch between char16_t and wchar_t"); +#define NAPI_WIDE_TEXT(x) reinterpret_cast(L##x) +#else +#define NAPI_WIDE_TEXT(x) u##x +#endif + +// If C++ exceptions are not explicitly enabled or disabled, enable them +// if exceptions were enabled in the compiler settings. +#if !defined(NAPI_CPP_EXCEPTIONS) && !defined(NAPI_DISABLE_CPP_EXCEPTIONS) +#if defined(_CPPUNWIND) || defined(__EXCEPTIONS) +#define NAPI_CPP_EXCEPTIONS +#else +#error Exception support not detected. \ + Define either NAPI_CPP_EXCEPTIONS or NAPI_DISABLE_CPP_EXCEPTIONS. +#endif +#endif + +// If C++ NAPI_CPP_EXCEPTIONS are enabled, NODE_ADDON_API_ENABLE_MAYBE should +// not be set +#if defined(NAPI_CPP_EXCEPTIONS) && defined(NODE_ADDON_API_ENABLE_MAYBE) +#error NODE_ADDON_API_ENABLE_MAYBE should not be set when \ + NAPI_CPP_EXCEPTIONS is defined. +#endif + +#ifdef _NOEXCEPT +#define NAPI_NOEXCEPT _NOEXCEPT +#else +#define NAPI_NOEXCEPT noexcept +#endif + +#ifdef NAPI_CPP_EXCEPTIONS + +// When C++ exceptions are enabled, Errors are thrown directly. There is no need +// to return anything after the throw statements. The variadic parameter is an +// optional return value that is ignored. +// We need _VOID versions of the macros to avoid warnings resulting from +// leaving the NAPI_THROW_* `...` argument empty. + +#define NAPI_THROW(e, ...) throw e +#define NAPI_THROW_VOID(e) throw e + +#define NAPI_THROW_IF_FAILED(env, status, ...) \ + if ((status) != napi_ok) throw Napi::Error::New(env); + +#define NAPI_THROW_IF_FAILED_VOID(env, status) \ + if ((status) != napi_ok) throw Napi::Error::New(env); + +#else // NAPI_CPP_EXCEPTIONS + +// When C++ exceptions are disabled, Errors are thrown as JavaScript exceptions, +// which are pending until the callback returns to JS. The variadic parameter +// is an optional return value; usually it is an empty result. +// We need _VOID versions of the macros to avoid warnings resulting from +// leaving the NAPI_THROW_* `...` argument empty. + +#define NAPI_THROW(e, ...) \ + do { \ + (e).ThrowAsJavaScriptException(); \ + return __VA_ARGS__; \ + } while (0) + +#define NAPI_THROW_VOID(e) \ + do { \ + (e).ThrowAsJavaScriptException(); \ + return; \ + } while (0) + +#define NAPI_THROW_IF_FAILED(env, status, ...) \ + if ((status) != napi_ok) { \ + Napi::Error::New(env).ThrowAsJavaScriptException(); \ + return __VA_ARGS__; \ + } + +#define NAPI_THROW_IF_FAILED_VOID(env, status) \ + if ((status) != napi_ok) { \ + Napi::Error::New(env).ThrowAsJavaScriptException(); \ + return; \ + } + +#endif // NAPI_CPP_EXCEPTIONS + +#ifdef NODE_ADDON_API_ENABLE_MAYBE +#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ + NAPI_THROW_IF_FAILED(env, status, Napi::Nothing()) + +#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ + NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ + return Napi::Just(result); +#else +#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ + NAPI_THROW_IF_FAILED(env, status, type()) + +#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ + NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ + return result; +#endif + +#define NAPI_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; +#define NAPI_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; + +#define NAPI_DISALLOW_ASSIGN_COPY(CLASS) \ + NAPI_DISALLOW_ASSIGN(CLASS) \ + NAPI_DISALLOW_COPY(CLASS) + +#define NAPI_CHECK(condition, location, message) \ + do { \ + if (!(condition)) { \ + Napi::Error::Fatal((location), (message)); \ + } \ + } while (0) + +#define NAPI_FATAL_IF_FAILED(status, location, message) \ + NAPI_CHECK((status) == napi_ok, location, message) + +//////////////////////////////////////////////////////////////////////////////// +/// Node-API C++ Wrapper Classes +/// +/// These classes wrap the "Node-API" ABI-stable C APIs for Node.js, providing a +/// C++ object model and C++ exception-handling semantics with low overhead. +/// The wrappers are all header-only so that they do not affect the ABI. +//////////////////////////////////////////////////////////////////////////////// +namespace Napi { + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +// NAPI_CPP_CUSTOM_NAMESPACE can be #define'd per-addon to avoid symbol +// conflicts between different instances of node-addon-api + +// First dummy definition of the namespace to make sure that Napi::(name) still +// refers to the right things inside this file. +namespace NAPI_CPP_CUSTOM_NAMESPACE {} +using namespace NAPI_CPP_CUSTOM_NAMESPACE; + +namespace NAPI_CPP_CUSTOM_NAMESPACE { +#endif + +// Forward declarations +class Env; +class Value; +class Boolean; +class Number; +#if NAPI_VERSION > 5 +class BigInt; +#endif // NAPI_VERSION > 5 +#if (NAPI_VERSION > 4) +class Date; +#endif +class String; +class Object; +class Array; +class ArrayBuffer; +class Function; +class Error; +class PropertyDescriptor; +class CallbackInfo; +class TypedArray; +template +class TypedArrayOf; + +using Int8Array = + TypedArrayOf; ///< Typed-array of signed 8-bit integers +using Uint8Array = + TypedArrayOf; ///< Typed-array of unsigned 8-bit integers +using Int16Array = + TypedArrayOf; ///< Typed-array of signed 16-bit integers +using Uint16Array = + TypedArrayOf; ///< Typed-array of unsigned 16-bit integers +using Int32Array = + TypedArrayOf; ///< Typed-array of signed 32-bit integers +using Uint32Array = + TypedArrayOf; ///< Typed-array of unsigned 32-bit integers +using Float32Array = + TypedArrayOf; ///< Typed-array of 32-bit floating-point values +using Float64Array = + TypedArrayOf; ///< Typed-array of 64-bit floating-point values +#if NAPI_VERSION > 5 +using BigInt64Array = + TypedArrayOf; ///< Typed array of signed 64-bit integers +using BigUint64Array = + TypedArrayOf; ///< Typed array of unsigned 64-bit integers +#endif // NAPI_VERSION > 5 + +/// Defines the signature of a Node-API C++ module's registration callback +/// (init) function. +using ModuleRegisterCallback = Object (*)(Env env, Object exports); + +class MemoryManagement; + +/// A simple Maybe type, representing an object which may or may not have a +/// value. +/// +/// If an API method returns a Maybe<>, the API method can potentially fail +/// either because an exception is thrown, or because an exception is pending, +/// e.g. because a previous API call threw an exception that hasn't been +/// caught yet. In that case, a "Nothing" value is returned. +template +class Maybe { + public: + bool IsNothing() const; + bool IsJust() const; + + /// Short-hand for Unwrap(), which doesn't return a value. Could be used + /// where the actual value of the Maybe is not needed like Object::Set. + /// If this Maybe is nothing (empty), node-addon-api will crash the + /// process. + void Check() const; + + /// Return the value of type T contained in the Maybe. If this Maybe is + /// nothing (empty), node-addon-api will crash the process. + T Unwrap() const; + + /// Return the value of type T contained in the Maybe, or using a default + /// value if this Maybe is nothing (empty). + T UnwrapOr(const T& default_value) const; + + /// Converts this Maybe to a value of type T in the out. If this Maybe is + /// nothing (empty), `false` is returned and `out` is left untouched. + bool UnwrapTo(T* out) const; + + bool operator==(const Maybe& other) const; + bool operator!=(const Maybe& other) const; + + private: + Maybe(); + explicit Maybe(const T& t); + + bool _has_value; + T _value; + + template + friend Maybe Nothing(); + template + friend Maybe Just(const U& u); +}; + +template +inline Maybe Nothing(); + +template +inline Maybe Just(const T& t); + +#if defined(NODE_ADDON_API_ENABLE_MAYBE) +template +using MaybeOrValue = Maybe; +#else +template +using MaybeOrValue = T; +#endif + +/// Environment for Node-API values and operations. +/// +/// All Node-API values and operations must be associated with an environment. +/// An environment instance is always provided to callback functions; that +/// environment must then be used for any creation of Node-API values or other +/// Node-API operations within the callback. (Many methods infer the +/// environment from the `this` instance that the method is called on.) +/// +/// In the future, multiple environments per process may be supported, +/// although current implementations only support one environment per process. +/// +/// In the V8 JavaScript engine, a Node-API environment approximately +/// corresponds to an Isolate. +class Env { + private: + napi_env _env; +#if NAPI_VERSION > 5 + template + static void DefaultFini(Env, T* data); + template + static void DefaultFiniWithHint(Env, DataType* data, HintType* hint); +#endif // NAPI_VERSION > 5 + public: + Env(napi_env env); + + operator napi_env() const; + + Object Global() const; + Value Undefined() const; + Value Null() const; + + bool IsExceptionPending() const; + Error GetAndClearPendingException() const; + + MaybeOrValue RunScript(const char* utf8script) const; + MaybeOrValue RunScript(const std::string& utf8script) const; + MaybeOrValue RunScript(String script) const; + +#if NAPI_VERSION > 2 + template + class CleanupHook; + + template + CleanupHook AddCleanupHook(Hook hook); + + template + CleanupHook AddCleanupHook(Hook hook, Arg* arg); +#endif // NAPI_VERSION > 2 + +#if NAPI_VERSION > 5 + template + T* GetInstanceData() const; + + template + using Finalizer = void (*)(Env, T*); + template fini = Env::DefaultFini> + void SetInstanceData(T* data) const; + + template + using FinalizerWithHint = void (*)(Env, DataType*, HintType*); + template fini = + Env::DefaultFiniWithHint> + void SetInstanceData(DataType* data, HintType* hint) const; +#endif // NAPI_VERSION > 5 + +#if NAPI_VERSION > 2 + template + class CleanupHook { + public: + CleanupHook(); + CleanupHook(Env env, Hook hook, Arg* arg); + CleanupHook(Env env, Hook hook); + bool Remove(Env env); + bool IsEmpty() const; + + private: + static inline void Wrapper(void* data) NAPI_NOEXCEPT; + static inline void WrapperWithArg(void* data) NAPI_NOEXCEPT; + + void (*wrapper)(void* arg); + struct CleanupData { + Hook hook; + Arg* arg; + } * data; + }; +#endif // NAPI_VERSION > 2 + +#if NAPI_VERSION > 8 + const char* GetModuleFileName() const; +#endif // NAPI_VERSION > 8 +}; + +/// A JavaScript value of unknown type. +/// +/// For type-specific operations, convert to one of the Value subclasses using a +/// `To*` or `As()` method. The `To*` methods do type coercion; the `As()` +/// method does not. +/// +/// Napi::Value value = ... +/// if (!value.IsString()) throw Napi::TypeError::New(env, "Invalid +/// arg..."); Napi::String str = value.As(); // Cast to a +/// string value +/// +/// Napi::Value anotherValue = ... +/// bool isTruthy = anotherValue.ToBoolean(); // Coerce to a boolean value +class Value { + public: + Value(); ///< Creates a new _empty_ Value instance. + Value(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + /// Creates a JS value from a C++ primitive. + /// + /// `value` may be any of: + /// - bool + /// - Any integer type + /// - Any floating point type + /// - const char* (encoded using UTF-8, null-terminated) + /// - const char16_t* (encoded using UTF-16-LE, null-terminated) + /// - std::string (encoded using UTF-8) + /// - std::u16string + /// - napi::Value + /// - napi_value + template + static Value From(napi_env env, const T& value); + + /// Converts to a Node-API value primitive. + /// + /// If the instance is _empty_, this returns `nullptr`. + operator napi_value() const; + + /// Tests if this value strictly equals another value. + bool operator==(const Value& other) const; + + /// Tests if this value does not strictly equal another value. + bool operator!=(const Value& other) const; + + /// Tests if this value strictly equals another value. + bool StrictEquals(const Value& other) const; + + /// Gets the environment the value is associated with. + Napi::Env Env() const; + + /// Checks if the value is empty (uninitialized). + /// + /// An empty value is invalid, and most attempts to perform an operation on an + /// empty value will result in an exception. Note an empty value is distinct + /// from JavaScript `null` or `undefined`, which are valid values. + /// + /// When C++ exceptions are disabled at compile time, a method with a `Value` + /// return type may return an empty value to indicate a pending exception. So + /// when not using C++ exceptions, callers should check whether the value is + /// empty before attempting to use it. + bool IsEmpty() const; + + napi_valuetype Type() const; ///< Gets the type of the value. + + bool IsUndefined() + const; ///< Tests if a value is an undefined JavaScript value. + bool IsNull() const; ///< Tests if a value is a null JavaScript value. + bool IsBoolean() const; ///< Tests if a value is a JavaScript boolean. + bool IsNumber() const; ///< Tests if a value is a JavaScript number. +#if NAPI_VERSION > 5 + bool IsBigInt() const; ///< Tests if a value is a JavaScript bigint. +#endif // NAPI_VERSION > 5 +#if (NAPI_VERSION > 4) + bool IsDate() const; ///< Tests if a value is a JavaScript date. +#endif + bool IsString() const; ///< Tests if a value is a JavaScript string. + bool IsSymbol() const; ///< Tests if a value is a JavaScript symbol. + bool IsArray() const; ///< Tests if a value is a JavaScript array. + bool IsArrayBuffer() + const; ///< Tests if a value is a JavaScript array buffer. + bool IsTypedArray() const; ///< Tests if a value is a JavaScript typed array. + bool IsObject() const; ///< Tests if a value is a JavaScript object. + bool IsFunction() const; ///< Tests if a value is a JavaScript function. + bool IsPromise() const; ///< Tests if a value is a JavaScript promise. + bool IsDataView() const; ///< Tests if a value is a JavaScript data view. + bool IsBuffer() const; ///< Tests if a value is a Node buffer. + bool IsExternal() const; ///< Tests if a value is a pointer to external data. + + /// Casts to another type of `Napi::Value`, when the actual type is known or + /// assumed. + /// + /// This conversion does NOT coerce the type. Calling any methods + /// inappropriate for the actual value type will throw `Napi::Error`. + /// + /// If `NODE_ADDON_API_ENABLE_TYPE_CHECK_ON_AS` is defined, this method + /// asserts that the actual type is the expected type. + template + T As() const; + + MaybeOrValue ToBoolean() + const; ///< Coerces a value to a JavaScript boolean. + MaybeOrValue ToNumber() + const; ///< Coerces a value to a JavaScript number. + MaybeOrValue ToString() + const; ///< Coerces a value to a JavaScript string. + MaybeOrValue ToObject() + const; ///< Coerces a value to a JavaScript object. + + protected: + /// !cond INTERNAL + napi_env _env; + napi_value _value; + /// !endcond +}; + +/// A JavaScript boolean value. +class Boolean : public Value { + public: + static Boolean New(napi_env env, ///< Node-API environment + bool value ///< Boolean value + ); + + static void CheckCast(napi_env env, napi_value value); + + Boolean(); ///< Creates a new _empty_ Boolean instance. + Boolean(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator bool() const; ///< Converts a Boolean value to a boolean primitive. + bool Value() const; ///< Converts a Boolean value to a boolean primitive. +}; + +/// A JavaScript number value. +class Number : public Value { + public: + static Number New(napi_env env, ///< Node-API environment + double value ///< Number value + ); + + static void CheckCast(napi_env env, napi_value value); + + Number(); ///< Creates a new _empty_ Number instance. + Number(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator int32_t() + const; ///< Converts a Number value to a 32-bit signed integer value. + operator uint32_t() + const; ///< Converts a Number value to a 32-bit unsigned integer value. + operator int64_t() + const; ///< Converts a Number value to a 64-bit signed integer value. + operator float() + const; ///< Converts a Number value to a 32-bit floating-point value. + operator double() + const; ///< Converts a Number value to a 64-bit floating-point value. + + int32_t Int32Value() + const; ///< Converts a Number value to a 32-bit signed integer value. + uint32_t Uint32Value() + const; ///< Converts a Number value to a 32-bit unsigned integer value. + int64_t Int64Value() + const; ///< Converts a Number value to a 64-bit signed integer value. + float FloatValue() + const; ///< Converts a Number value to a 32-bit floating-point value. + double DoubleValue() + const; ///< Converts a Number value to a 64-bit floating-point value. +}; + +#if NAPI_VERSION > 5 +/// A JavaScript bigint value. +class BigInt : public Value { + public: + static BigInt New(napi_env env, ///< Node-API environment + int64_t value ///< Number value + ); + static BigInt New(napi_env env, ///< Node-API environment + uint64_t value ///< Number value + ); + + /// Creates a new BigInt object using a specified sign bit and a + /// specified list of digits/words. + /// The resulting number is calculated as: + /// (-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...) + static BigInt New(napi_env env, ///< Node-API environment + int sign_bit, ///< Sign bit. 1 if negative. + size_t word_count, ///< Number of words in array + const uint64_t* words ///< Array of words + ); + + static void CheckCast(napi_env env, napi_value value); + + BigInt(); ///< Creates a new _empty_ BigInt instance. + BigInt(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + int64_t Int64Value(bool* lossless) + const; ///< Converts a BigInt value to a 64-bit signed integer value. + uint64_t Uint64Value(bool* lossless) + const; ///< Converts a BigInt value to a 64-bit unsigned integer value. + + size_t WordCount() const; ///< The number of 64-bit words needed to store + ///< the result of ToWords(). + + /// Writes the contents of this BigInt to a specified memory location. + /// `sign_bit` must be provided and will be set to 1 if this BigInt is + /// negative. + /// `*word_count` has to be initialized to the length of the `words` array. + /// Upon return, it will be set to the actual number of words that would + /// be needed to store this BigInt (i.e. the return value of `WordCount()`). + void ToWords(int* sign_bit, size_t* word_count, uint64_t* words); +}; +#endif // NAPI_VERSION > 5 + +#if (NAPI_VERSION > 4) +/// A JavaScript date value. +class Date : public Value { + public: + /// Creates a new Date value from a double primitive. + static Date New(napi_env env, ///< Node-API environment + double value ///< Number value + ); + + static void CheckCast(napi_env env, napi_value value); + + Date(); ///< Creates a new _empty_ Date instance. + Date(napi_env env, napi_value value); ///< Wraps a Node-API value primitive. + operator double() const; ///< Converts a Date value to double primitive + + double ValueOf() const; ///< Converts a Date value to a double primitive. +}; +#endif + +/// A JavaScript string or symbol value (that can be used as a property name). +class Name : public Value { + public: + static void CheckCast(napi_env env, napi_value value); + + Name(); ///< Creates a new _empty_ Name instance. + Name(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. +}; + +/// A JavaScript string value. +class String : public Name { + public: + /// Creates a new String value from a UTF-8 encoded C++ string. + static String New(napi_env env, ///< Node-API environment + const std::string& value ///< UTF-8 encoded C++ string + ); + + /// Creates a new String value from a UTF-16 encoded C++ string. + static String New(napi_env env, ///< Node-API environment + const std::u16string& value ///< UTF-16 encoded C++ string + ); + + /// Creates a new String value from a UTF-8 encoded C string. + static String New( + napi_env env, ///< Node-API environment + const char* value ///< UTF-8 encoded null-terminated C string + ); + + /// Creates a new String value from a UTF-16 encoded C string. + static String New( + napi_env env, ///< Node-API environment + const char16_t* value ///< UTF-16 encoded null-terminated C string + ); + + /// Creates a new String value from a UTF-8 encoded C string with specified + /// length. + static String New(napi_env env, ///< Node-API environment + const char* value, ///< UTF-8 encoded C string (not + ///< necessarily null-terminated) + size_t length ///< length of the string in bytes + ); + + /// Creates a new String value from a UTF-16 encoded C string with specified + /// length. + static String New( + napi_env env, ///< Node-API environment + const char16_t* value, ///< UTF-16 encoded C string (not necessarily + ///< null-terminated) + size_t length ///< Length of the string in 2-byte code units + ); + + /// Creates a new String based on the original object's type. + /// + /// `value` may be any of: + /// - const char* (encoded using UTF-8, null-terminated) + /// - const char16_t* (encoded using UTF-16-LE, null-terminated) + /// - std::string (encoded using UTF-8) + /// - std::u16string + template + static String From(napi_env env, const T& value); + + static void CheckCast(napi_env env, napi_value value); + + String(); ///< Creates a new _empty_ String instance. + String(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + operator std::string() + const; ///< Converts a String value to a UTF-8 encoded C++ string. + operator std::u16string() + const; ///< Converts a String value to a UTF-16 encoded C++ string. + std::string Utf8Value() + const; ///< Converts a String value to a UTF-8 encoded C++ string. + std::u16string Utf16Value() + const; ///< Converts a String value to a UTF-16 encoded C++ string. +}; + +/// A JavaScript symbol value. +class Symbol : public Name { + public: + /// Creates a new Symbol value with an optional description. + static Symbol New( + napi_env env, ///< Node-API environment + const char* description = + nullptr ///< Optional UTF-8 encoded null-terminated C string + /// describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New( + napi_env env, ///< Node-API environment + const std::string& + description ///< UTF-8 encoded C++ string describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New(napi_env env, ///< Node-API environment + String description ///< String value describing the symbol + ); + + /// Creates a new Symbol value with a description. + static Symbol New( + napi_env env, ///< Node-API environment + napi_value description ///< String value describing the symbol + ); + + /// Get a public Symbol (e.g. Symbol.iterator). + static MaybeOrValue WellKnown(napi_env, const std::string& name); + + // Create a symbol in the global registry, UTF-8 Encoded cpp string + static MaybeOrValue For(napi_env env, const std::string& description); + + // Create a symbol in the global registry, C style string (null terminated) + static MaybeOrValue For(napi_env env, const char* description); + + // Create a symbol in the global registry, String value describing the symbol + static MaybeOrValue For(napi_env env, String description); + + // Create a symbol in the global registry, napi_value describing the symbol + static MaybeOrValue For(napi_env env, napi_value description); + + static void CheckCast(napi_env env, napi_value value); + + Symbol(); ///< Creates a new _empty_ Symbol instance. + Symbol(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. +}; + +class TypeTaggable : public Value { + public: +#if NAPI_VERSION >= 8 + void TypeTag(const napi_type_tag* type_tag) const; + bool CheckTypeTag(const napi_type_tag* type_tag) const; +#endif // NAPI_VERSION >= 8 + protected: + TypeTaggable(); + TypeTaggable(napi_env env, napi_value value); +}; + +/// A JavaScript object value. +class Object : public TypeTaggable { + public: + /// Enables property and element assignments using indexing syntax. + /// + /// This is a convenient helper to get and set object properties. As + /// getting and setting object properties may throw with JavaScript + /// exceptions, it is notable that these operations may fail. + /// When NODE_ADDON_API_ENABLE_MAYBE is defined, the process will abort + /// on JavaScript exceptions. + /// + /// Example: + /// + /// Napi::Value propertyValue = object1['A']; + /// object2['A'] = propertyValue; + /// Napi::Value elementValue = array[0]; + /// array[1] = elementValue; + template + class PropertyLValue { + public: + /// Converts an L-value to a value. + operator Value() const; + + /// Assigns a value to the property. The type of value can be + /// anything supported by `Object::Set`. + template + PropertyLValue& operator=(ValueType value); + + private: + PropertyLValue() = delete; + PropertyLValue(Object object, Key key); + napi_env _env; + napi_value _object; + Key _key; + + friend class Napi::Object; + }; + + /// Creates a new Object value. + static Object New(napi_env env ///< Node-API environment + ); + + static void CheckCast(napi_env env, napi_value value); + + Object(); ///< Creates a new _empty_ Object instance. + Object(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + /// Gets or sets a named property. + PropertyLValue operator[]( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ); + + /// Gets or sets a named property. + PropertyLValue operator[]( + const std::string& utf8name ///< UTF-8 encoded property name + ); + + /// Gets or sets an indexed property or array element. + PropertyLValue operator[]( + uint32_t index /// Property / element index + ); + + /// Gets or sets an indexed property or array element. + PropertyLValue operator[](Value index /// Property / element index + ) const; + + /// Gets a named property. + MaybeOrValue operator[]( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Gets a named property. + MaybeOrValue operator[]( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Gets an indexed property or array element. + MaybeOrValue operator[](uint32_t index ///< Property / element index + ) const; + + /// Checks whether a property is present. + MaybeOrValue Has(napi_value key ///< Property key primitive + ) const; + + /// Checks whether a property is present. + MaybeOrValue Has(Value key ///< Property key + ) const; + + /// Checks whether a named property is present. + MaybeOrValue Has( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Checks whether a named property is present. + MaybeOrValue Has( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty(napi_value key ///< Property key primitive + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty(Value key ///< Property key + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Checks whether a own property is present. + MaybeOrValue HasOwnProperty( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Gets a property. + MaybeOrValue Get(napi_value key ///< Property key primitive + ) const; + + /// Gets a property. + MaybeOrValue Get(Value key ///< Property key + ) const; + + /// Gets a named property. + MaybeOrValue Get( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Gets a named property. + MaybeOrValue Get( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Sets a property. + template + MaybeOrValue Set(napi_value key, ///< Property key primitive + const ValueType& value ///< Property value primitive + ) const; + + /// Sets a property. + template + MaybeOrValue Set(Value key, ///< Property key + const ValueType& value ///< Property value + ) const; + + /// Sets a named property. + template + MaybeOrValue Set( + const char* utf8name, ///< UTF-8 encoded null-terminated property name + const ValueType& value) const; + + /// Sets a named property. + template + MaybeOrValue Set( + const std::string& utf8name, ///< UTF-8 encoded property name + const ValueType& value ///< Property value primitive + ) const; + + /// Delete property. + MaybeOrValue Delete(napi_value key ///< Property key primitive + ) const; + + /// Delete property. + MaybeOrValue Delete(Value key ///< Property key + ) const; + + /// Delete property. + MaybeOrValue Delete( + const char* utf8name ///< UTF-8 encoded null-terminated property name + ) const; + + /// Delete property. + MaybeOrValue Delete( + const std::string& utf8name ///< UTF-8 encoded property name + ) const; + + /// Checks whether an indexed property is present. + MaybeOrValue Has(uint32_t index ///< Property / element index + ) const; + + /// Gets an indexed property or array element. + MaybeOrValue Get(uint32_t index ///< Property / element index + ) const; + + /// Sets an indexed property or array element. + template + MaybeOrValue Set(uint32_t index, ///< Property / element index + const ValueType& value ///< Property value primitive + ) const; + + /// Deletes an indexed property or array element. + MaybeOrValue Delete(uint32_t index ///< Property / element index + ) const; + + /// This operation can fail in case of Proxy.[[OwnPropertyKeys]] and + /// Proxy.[[GetOwnProperty]] calling into JavaScript. See: + /// - + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys + /// - + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p + MaybeOrValue GetPropertyNames() const; ///< Get all property names + + /// Defines a property on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperty( + const PropertyDescriptor& + property ///< Descriptor for the property to be defined + ) const; + + /// Defines properties on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperties( + const std::initializer_list& properties + ///< List of descriptors for the properties to be defined + ) const; + + /// Defines properties on the object. + /// + /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling + /// into JavaScript. See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc + MaybeOrValue DefineProperties( + const std::vector& properties + ///< Vector of descriptors for the properties to be defined + ) const; + + /// Checks if an object is an instance created by a constructor function. + /// + /// This is equivalent to the JavaScript `instanceof` operator. + /// + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue InstanceOf( + const Function& constructor ///< Constructor function + ) const; + + template + inline void AddFinalizer(Finalizer finalizeCallback, T* data) const; + + template + inline void AddFinalizer(Finalizer finalizeCallback, + T* data, + Hint* finalizeHint) const; + +#ifdef NAPI_CPP_EXCEPTIONS + class const_iterator; + + inline const_iterator begin() const; + + inline const_iterator end() const; + + class iterator; + + inline iterator begin(); + + inline iterator end(); +#endif // NAPI_CPP_EXCEPTIONS + +#if NAPI_VERSION >= 8 + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue Freeze() const; + /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into + /// JavaScript. + /// See + /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof + MaybeOrValue Seal() const; +#endif // NAPI_VERSION >= 8 +}; + +template +class External : public TypeTaggable { + public: + static External New(napi_env env, T* data); + + // Finalizer must implement `void operator()(Env env, T* data)`. + template + static External New(napi_env env, T* data, Finalizer finalizeCallback); + // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. + template + static External New(napi_env env, + T* data, + Finalizer finalizeCallback, + Hint* finalizeHint); + + static void CheckCast(napi_env env, napi_value value); + + External(); + External(napi_env env, napi_value value); + + T* Data() const; +}; + +class Array : public Object { + public: + static Array New(napi_env env); + static Array New(napi_env env, size_t length); + + static void CheckCast(napi_env env, napi_value value); + + Array(); + Array(napi_env env, napi_value value); + + uint32_t Length() const; +}; + +#ifdef NAPI_CPP_EXCEPTIONS +class Object::const_iterator { + private: + enum class Type { BEGIN, END }; + + inline const_iterator(const Object* object, const Type type); + + public: + inline const_iterator& operator++(); + + inline bool operator==(const const_iterator& other) const; + + inline bool operator!=(const const_iterator& other) const; + + inline const std::pair> operator*() + const; + + private: + const Napi::Object* _object; + Array _keys; + uint32_t _index; + + friend class Object; +}; + +class Object::iterator { + private: + enum class Type { BEGIN, END }; + + inline iterator(Object* object, const Type type); + + public: + inline iterator& operator++(); + + inline bool operator==(const iterator& other) const; + + inline bool operator!=(const iterator& other) const; + + inline std::pair> operator*(); + + private: + Napi::Object* _object; + Array _keys; + uint32_t _index; + + friend class Object; +}; +#endif // NAPI_CPP_EXCEPTIONS + +/// A JavaScript array buffer value. +class ArrayBuffer : public Object { + public: + /// Creates a new ArrayBuffer instance over a new automatically-allocated + /// buffer. + static ArrayBuffer New( + napi_env env, ///< Node-API environment + size_t byteLength ///< Length of the buffer to be allocated, in bytes + ); + +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength ///< Length of the external buffer to be used by the + ///< array, in bytes + ); + + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + template + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength, ///< Length of the external buffer to be used by the + ///< array, + /// in bytes + Finalizer finalizeCallback ///< Function to be called when the array + ///< buffer is destroyed; + /// must implement `void operator()(Env env, + /// void* externalData)` + ); + + /// Creates a new ArrayBuffer instance, using an external buffer with + /// specified byte length. + template + static ArrayBuffer New( + napi_env env, ///< Node-API environment + void* externalData, ///< Pointer to the external buffer to be used by + ///< the array + size_t byteLength, ///< Length of the external buffer to be used by the + ///< array, + /// in bytes + Finalizer finalizeCallback, ///< Function to be called when the array + ///< buffer is destroyed; + /// must implement `void operator()(Env + /// env, void* externalData, Hint* hint)` + Hint* finalizeHint ///< Hint (second parameter) to be passed to the + ///< finalize callback + ); +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + + static void CheckCast(napi_env env, napi_value value); + + ArrayBuffer(); ///< Creates a new _empty_ ArrayBuffer instance. + ArrayBuffer(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + void* Data(); ///< Gets a pointer to the data buffer. + size_t ByteLength(); ///< Gets the length of the array buffer in bytes. + +#if NAPI_VERSION >= 7 + bool IsDetached() const; + void Detach(); +#endif // NAPI_VERSION >= 7 +}; + +/// A JavaScript typed-array value with unknown array type. +/// +/// For type-specific operations, cast to a `TypedArrayOf` instance using the +/// `As()` method: +/// +/// Napi::TypedArray array = ... +/// if (t.TypedArrayType() == napi_int32_array) { +/// Napi::Int32Array int32Array = t.As(); +/// } +class TypedArray : public Object { + public: + static void CheckCast(napi_env env, napi_value value); + + TypedArray(); ///< Creates a new _empty_ TypedArray instance. + TypedArray(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + napi_typedarray_type TypedArrayType() + const; ///< Gets the type of this typed-array. + Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. + + uint8_t ElementSize() + const; ///< Gets the size in bytes of one element in the array. + size_t ElementLength() const; ///< Gets the number of elements in the array. + size_t ByteOffset() + const; ///< Gets the offset into the buffer where the array starts. + size_t ByteLength() const; ///< Gets the length of the array in bytes. + + protected: + /// !cond INTERNAL + napi_typedarray_type _type; + size_t _length; + + TypedArray(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length); + + template + static +#if defined(NAPI_HAS_CONSTEXPR) + constexpr +#endif + napi_typedarray_type + TypedArrayTypeForPrimitiveType() { + return std::is_same::value ? napi_int8_array + : std::is_same::value ? napi_uint8_array + : std::is_same::value ? napi_int16_array + : std::is_same::value ? napi_uint16_array + : std::is_same::value ? napi_int32_array + : std::is_same::value ? napi_uint32_array + : std::is_same::value ? napi_float32_array + : std::is_same::value ? napi_float64_array +#if NAPI_VERSION > 5 + : std::is_same::value ? napi_bigint64_array + : std::is_same::value ? napi_biguint64_array +#endif // NAPI_VERSION > 5 + : napi_int8_array; + } + /// !endcond +}; + +/// A JavaScript typed-array value with known array type. +/// +/// Note while it is possible to create and access Uint8 "clamped" arrays using +/// this class, the _clamping_ behavior is only applied in JavaScript. +template +class TypedArrayOf : public TypedArray { + public: + /// Creates a new TypedArray instance over a new automatically-allocated array + /// buffer. + /// + /// The array type parameter can normally be omitted (because it is inferred + /// from the template parameter T), except when creating a "clamped" array: + /// + /// Uint8Array::New(env, length, napi_uint8_clamped_array) + static TypedArrayOf New( + napi_env env, ///< Node-API environment + size_t elementLength, ///< Length of the created array, as a number of + ///< elements +#if defined(NAPI_HAS_CONSTEXPR) + napi_typedarray_type type = + TypedArray::TypedArrayTypeForPrimitiveType() +#else + napi_typedarray_type type +#endif + ///< Type of array, if different from the default array type for the + ///< template parameter T. + ); + + /// Creates a new TypedArray instance over a provided array buffer. + /// + /// The array type parameter can normally be omitted (because it is inferred + /// from the template parameter T), except when creating a "clamped" array: + /// + /// Uint8Array::New(env, length, buffer, 0, napi_uint8_clamped_array) + static TypedArrayOf New( + napi_env env, ///< Node-API environment + size_t elementLength, ///< Length of the created array, as a number of + ///< elements + Napi::ArrayBuffer arrayBuffer, ///< Backing array buffer instance to use + size_t bufferOffset, ///< Offset into the array buffer where the + ///< typed-array starts +#if defined(NAPI_HAS_CONSTEXPR) + napi_typedarray_type type = + TypedArray::TypedArrayTypeForPrimitiveType() +#else + napi_typedarray_type type +#endif + ///< Type of array, if different from the default array type for the + ///< template parameter T. + ); + + static void CheckCast(napi_env env, napi_value value); + + TypedArrayOf(); ///< Creates a new _empty_ TypedArrayOf instance. + TypedArrayOf(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + T& operator[](size_t index); ///< Gets or sets an element in the array. + const T& operator[](size_t index) const; ///< Gets an element in the array. + + /// Gets a pointer to the array's backing buffer. + /// + /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, + /// because the typed-array may have a non-zero `ByteOffset()` into the + /// `ArrayBuffer`. + T* Data(); + + /// Gets a pointer to the array's backing buffer. + /// + /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, + /// because the typed-array may have a non-zero `ByteOffset()` into the + /// `ArrayBuffer`. + const T* Data() const; + + private: + T* _data; + + TypedArrayOf(napi_env env, + napi_value value, + napi_typedarray_type type, + size_t length, + T* data); +}; + +/// The DataView provides a low-level interface for reading/writing multiple +/// number types in an ArrayBuffer irrespective of the platform's endianness. +class DataView : public Object { + public: + static DataView New(napi_env env, Napi::ArrayBuffer arrayBuffer); + static DataView New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset); + static DataView New(napi_env env, + Napi::ArrayBuffer arrayBuffer, + size_t byteOffset, + size_t byteLength); + + static void CheckCast(napi_env env, napi_value value); + + DataView(); ///< Creates a new _empty_ DataView instance. + DataView(napi_env env, + napi_value value); ///< Wraps a Node-API value primitive. + + Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. + size_t ByteOffset() + const; ///< Gets the offset into the buffer where the array starts. + size_t ByteLength() const; ///< Gets the length of the array in bytes. + + void* Data() const; + + float GetFloat32(size_t byteOffset) const; + double GetFloat64(size_t byteOffset) const; + int8_t GetInt8(size_t byteOffset) const; + int16_t GetInt16(size_t byteOffset) const; + int32_t GetInt32(size_t byteOffset) const; + uint8_t GetUint8(size_t byteOffset) const; + uint16_t GetUint16(size_t byteOffset) const; + uint32_t GetUint32(size_t byteOffset) const; + + void SetFloat32(size_t byteOffset, float value) const; + void SetFloat64(size_t byteOffset, double value) const; + void SetInt8(size_t byteOffset, int8_t value) const; + void SetInt16(size_t byteOffset, int16_t value) const; + void SetInt32(size_t byteOffset, int32_t value) const; + void SetUint8(size_t byteOffset, uint8_t value) const; + void SetUint16(size_t byteOffset, uint16_t value) const; + void SetUint32(size_t byteOffset, uint32_t value) const; + + private: + template + T ReadData(size_t byteOffset) const; + + template + void WriteData(size_t byteOffset, T value) const; + + void* _data; + size_t _length; +}; + +class Function : public Object { + public: + using VoidCallback = void (*)(const CallbackInfo& info); + using Callback = Value (*)(const CallbackInfo& info); + + template + static Function New(napi_env env, + const char* utf8name = nullptr, + void* data = nullptr); + + template + static Function New(napi_env env, + const char* utf8name = nullptr, + void* data = nullptr); + + template + static Function New(napi_env env, + const std::string& utf8name, + void* data = nullptr); + + template + static Function New(napi_env env, + const std::string& utf8name, + void* data = nullptr); + + /// Callable must implement operator() accepting a const CallbackInfo& + /// and return either void or Value. + template + static Function New(napi_env env, + Callable cb, + const char* utf8name = nullptr, + void* data = nullptr); + /// Callable must implement operator() accepting a const CallbackInfo& + /// and return either void or Value. + template + static Function New(napi_env env, + Callable cb, + const std::string& utf8name, + void* data = nullptr); + + static void CheckCast(napi_env env, napi_value value); + + Function(); + Function(napi_env env, napi_value value); + + MaybeOrValue operator()( + const std::initializer_list& args) const; + + MaybeOrValue Call(const std::initializer_list& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call(size_t argc, const napi_value* args) const; + MaybeOrValue Call(napi_value recv, + const std::initializer_list& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + size_t argc, + const napi_value* args) const; + + MaybeOrValue MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback(napi_value recv, + const std::vector& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback(napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context = nullptr) const; + + MaybeOrValue New(const std::initializer_list& args) const; + MaybeOrValue New(const std::vector& args) const; + MaybeOrValue New(size_t argc, const napi_value* args) const; +}; + +class Promise : public Object { + public: + class Deferred { + public: + static Deferred New(napi_env env); + Deferred(napi_env env); + + Napi::Promise Promise() const; + Napi::Env Env() const; + + void Resolve(napi_value value) const; + void Reject(napi_value value) const; + + private: + napi_env _env; + napi_deferred _deferred; + napi_value _promise; + }; + + static void CheckCast(napi_env env, napi_value value); + + Promise(napi_env env, napi_value value); +}; + +template +class Buffer : public Uint8Array { + public: + static Buffer New(napi_env env, size_t length); +#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + static Buffer New(napi_env env, T* data, size_t length); + + // Finalizer must implement `void operator()(Env env, T* data)`. + template + static Buffer New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback); + // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. + template + static Buffer New(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint); +#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED + + static Buffer NewOrCopy(napi_env env, T* data, size_t length); + // Finalizer must implement `void operator()(Env env, T* data)`. + template + static Buffer NewOrCopy(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback); + // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. + template + static Buffer NewOrCopy(napi_env env, + T* data, + size_t length, + Finalizer finalizeCallback, + Hint* finalizeHint); + + static Buffer Copy(napi_env env, const T* data, size_t length); + + static void CheckCast(napi_env env, napi_value value); + + Buffer(); + Buffer(napi_env env, napi_value value); + size_t Length() const; + T* Data() const; + + private: +}; + +/// Holds a counted reference to a value; initially a weak reference unless +/// otherwise specified, may be changed to/from a strong reference by adjusting +/// the refcount. +/// +/// The referenced value is not immediately destroyed when the reference count +/// is zero; it is merely then eligible for garbage-collection if there are no +/// other references to the value. +template +class Reference { + public: + static Reference New(const T& value, uint32_t initialRefcount = 0); + + Reference(); + Reference(napi_env env, napi_ref ref); + ~Reference(); + + // A reference can be moved but cannot be copied. + Reference(Reference&& other); + Reference& operator=(Reference&& other); + NAPI_DISALLOW_ASSIGN(Reference) + + operator napi_ref() const; + bool operator==(const Reference& other) const; + bool operator!=(const Reference& other) const; + + Napi::Env Env() const; + bool IsEmpty() const; + + // Note when getting the value of a Reference it is usually correct to do so + // within a HandleScope so that the value handle gets cleaned up efficiently. + T Value() const; + + uint32_t Ref() const; + uint32_t Unref() const; + void Reset(); + void Reset(const T& value, uint32_t refcount = 0); + + // Call this on a reference that is declared as static data, to prevent its + // destructor from running at program shutdown time, which would attempt to + // reset the reference when the environment is no longer valid. Avoid using + // this if at all possible. If you do need to use static data, MAKE SURE to + // warn your users that your addon is NOT threadsafe. + void SuppressDestruct(); + + protected: + Reference(const Reference&); + + /// !cond INTERNAL + napi_env _env; + napi_ref _ref; + /// !endcond + + private: + bool _suppressDestruct; +}; + +class ObjectReference : public Reference { + public: + ObjectReference(); + ObjectReference(napi_env env, napi_ref ref); + + // A reference can be moved but cannot be copied. + ObjectReference(Reference&& other); + ObjectReference& operator=(Reference&& other); + ObjectReference(ObjectReference&& other); + ObjectReference& operator=(ObjectReference&& other); + NAPI_DISALLOW_ASSIGN(ObjectReference) + + MaybeOrValue Get(const char* utf8name) const; + MaybeOrValue Get(const std::string& utf8name) const; + MaybeOrValue Set(const char* utf8name, napi_value value) const; + MaybeOrValue Set(const char* utf8name, Napi::Value value) const; + MaybeOrValue Set(const char* utf8name, const char* utf8value) const; + MaybeOrValue Set(const char* utf8name, bool boolValue) const; + MaybeOrValue Set(const char* utf8name, double numberValue) const; + MaybeOrValue Set(const std::string& utf8name, napi_value value) const; + MaybeOrValue Set(const std::string& utf8name, Napi::Value value) const; + MaybeOrValue Set(const std::string& utf8name, + std::string& utf8value) const; + MaybeOrValue Set(const std::string& utf8name, bool boolValue) const; + MaybeOrValue Set(const std::string& utf8name, double numberValue) const; + + MaybeOrValue Get(uint32_t index) const; + MaybeOrValue Set(uint32_t index, const napi_value value) const; + MaybeOrValue Set(uint32_t index, const Napi::Value value) const; + MaybeOrValue Set(uint32_t index, const char* utf8value) const; + MaybeOrValue Set(uint32_t index, const std::string& utf8value) const; + MaybeOrValue Set(uint32_t index, bool boolValue) const; + MaybeOrValue Set(uint32_t index, double numberValue) const; + + protected: + ObjectReference(const ObjectReference&); +}; + +class FunctionReference : public Reference { + public: + FunctionReference(); + FunctionReference(napi_env env, napi_ref ref); + + // A reference can be moved but cannot be copied. + FunctionReference(Reference&& other); + FunctionReference& operator=(Reference&& other); + FunctionReference(FunctionReference&& other); + FunctionReference& operator=(FunctionReference&& other); + NAPI_DISALLOW_ASSIGN_COPY(FunctionReference) + + MaybeOrValue operator()( + const std::initializer_list& args) const; + + MaybeOrValue Call( + const std::initializer_list& args) const; + MaybeOrValue Call(const std::vector& args) const; + MaybeOrValue Call( + napi_value recv, const std::initializer_list& args) const; + MaybeOrValue Call(napi_value recv, + const std::vector& args) const; + MaybeOrValue Call(napi_value recv, + size_t argc, + const napi_value* args) const; + + MaybeOrValue MakeCallback( + napi_value recv, + const std::initializer_list& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback( + napi_value recv, + const std::vector& args, + napi_async_context context = nullptr) const; + MaybeOrValue MakeCallback( + napi_value recv, + size_t argc, + const napi_value* args, + napi_async_context context = nullptr) const; + + MaybeOrValue New(const std::initializer_list& args) const; + MaybeOrValue New(const std::vector& args) const; +}; + +// Shortcuts to creating a new reference with inferred type and refcount = 0. +template +Reference Weak(T value); +ObjectReference Weak(Object value); +FunctionReference Weak(Function value); + +// Shortcuts to creating a new reference with inferred type and refcount = 1. +template +Reference Persistent(T value); +ObjectReference Persistent(Object value); +FunctionReference Persistent(Function value); + +/// A persistent reference to a JavaScript error object. Use of this class +/// depends somewhat on whether C++ exceptions are enabled at compile time. +/// +/// ### Handling Errors With C++ Exceptions +/// +/// If C++ exceptions are enabled, then the `Error` class extends +/// `std::exception` and enables integrated error-handling for C++ exceptions +/// and JavaScript exceptions. +/// +/// If a Node-API call fails without executing any JavaScript code (for +/// example due to an invalid argument), then the Node-API wrapper +/// automatically converts and throws the error as a C++ exception of type +/// `Napi::Error`. Or if a JavaScript function called by C++ code via Node-API +/// throws a JavaScript exception, then the Node-API wrapper automatically +/// converts and throws it as a C++ exception of type `Napi::Error`. +/// +/// If a C++ exception of type `Napi::Error` escapes from a Node-API C++ +/// callback, then the Node-API wrapper automatically converts and throws it +/// as a JavaScript exception. Therefore, catching a C++ exception of type +/// `Napi::Error` prevents a JavaScript exception from being thrown. +/// +/// #### Example 1A - Throwing a C++ exception: +/// +/// Napi::Env env = ... +/// throw Napi::Error::New(env, "Example exception"); +/// +/// Following C++ statements will not be executed. The exception will bubble +/// up as a C++ exception of type `Napi::Error`, until it is either caught +/// while still in C++, or else automatically propataged as a JavaScript +/// exception when the callback returns to JavaScript. +/// +/// #### Example 2A - Propagating a Node-API C++ exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// +/// Following C++ statements will not be executed. The exception will bubble +/// up as a C++ exception of type `Napi::Error`, until it is either caught +/// while still in C++, or else automatically propagated as a JavaScript +/// exception when the callback returns to JavaScript. +/// +/// #### Example 3A - Handling a Node-API C++ exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result; +/// try { +/// result = jsFunctionThatThrows({ arg1, arg2 }); +/// } catch (const Napi::Error& e) { +/// cerr << "Caught JavaScript exception: " + e.what(); +/// } +/// +/// Since the exception was caught here, it will not be propagated as a +/// JavaScript exception. +/// +/// ### Handling Errors Without C++ Exceptions +/// +/// If C++ exceptions are disabled (by defining `NAPI_DISABLE_CPP_EXCEPTIONS`) +/// then this class does not extend `std::exception`, and APIs in the `Napi` +/// namespace do not throw C++ exceptions when they fail. Instead, they raise +/// _pending_ JavaScript exceptions and return _empty_ `Value`s. Calling code +/// should check `Value::IsEmpty()` before attempting to use a returned value, +/// and may use methods on the `Env` class to check for, get, and clear a +/// pending JavaScript exception. If the pending exception is not cleared, it +/// will be thrown when the native callback returns to JavaScript. +/// +/// #### Example 1B - Throwing a JS exception +/// +/// Napi::Env env = ... +/// Napi::Error::New(env, "Example +/// exception").ThrowAsJavaScriptException(); return; +/// +/// After throwing a JS exception, the code should generally return +/// immediately from the native callback, after performing any necessary +/// cleanup. +/// +/// #### Example 2B - Propagating a Node-API JS exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// if (result.IsEmpty()) return; +/// +/// An empty value result from a Node-API call indicates an error occurred, +/// and a JavaScript exception is pending. To let the exception propagate, the +/// code should generally return immediately from the native callback, after +/// performing any necessary cleanup. +/// +/// #### Example 3B - Handling a Node-API JS exception: +/// +/// Napi::Function jsFunctionThatThrows = someObj.As(); +/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); +/// if (result.IsEmpty()) { +/// Napi::Error e = env.GetAndClearPendingException(); +/// cerr << "Caught JavaScript exception: " + e.Message(); +/// } +/// +/// Since the exception was cleared here, it will not be propagated as a +/// JavaScript exception after the native callback returns. +class Error : public ObjectReference +#ifdef NAPI_CPP_EXCEPTIONS + , + public std::exception +#endif // NAPI_CPP_EXCEPTIONS +{ + public: + static Error New(napi_env env); + static Error New(napi_env env, const char* message); + static Error New(napi_env env, const std::string& message); + + static NAPI_NO_RETURN void Fatal(const char* location, const char* message); + + Error(); + Error(napi_env env, napi_value value); + + // An error can be moved or copied. + Error(Error&& other); + Error& operator=(Error&& other); + Error(const Error&); + Error& operator=(const Error&); + + const std::string& Message() const NAPI_NOEXCEPT; + void ThrowAsJavaScriptException() const; + + Object Value() const; + +#ifdef NAPI_CPP_EXCEPTIONS + const char* what() const NAPI_NOEXCEPT override; +#endif // NAPI_CPP_EXCEPTIONS + + protected: + /// !cond INTERNAL + using create_error_fn = napi_status (*)(napi_env envb, + napi_value code, + napi_value msg, + napi_value* result); + + template + static TError New(napi_env env, + const char* message, + size_t length, + create_error_fn create_error); + /// !endcond + + private: + static inline const char* ERROR_WRAP_VALUE() NAPI_NOEXCEPT; + mutable std::string _message; +}; + +class TypeError : public Error { + public: + static TypeError New(napi_env env, const char* message); + static TypeError New(napi_env env, const std::string& message); + + TypeError(); + TypeError(napi_env env, napi_value value); +}; + +class RangeError : public Error { + public: + static RangeError New(napi_env env, const char* message); + static RangeError New(napi_env env, const std::string& message); + + RangeError(); + RangeError(napi_env env, napi_value value); +}; + +#if NAPI_VERSION > 8 +class SyntaxError : public Error { + public: + static SyntaxError New(napi_env env, const char* message); + static SyntaxError New(napi_env env, const std::string& message); + + SyntaxError(); + SyntaxError(napi_env env, napi_value value); +}; +#endif // NAPI_VERSION > 8 + +class CallbackInfo { + public: + CallbackInfo(napi_env env, napi_callback_info info); + ~CallbackInfo(); + + // Disallow copying to prevent multiple free of _dynamicArgs + NAPI_DISALLOW_ASSIGN_COPY(CallbackInfo) + + Napi::Env Env() const; + Value NewTarget() const; + bool IsConstructCall() const; + size_t Length() const; + const Value operator[](size_t index) const; + Value This() const; + void* Data() const; + void SetData(void* data); + explicit operator napi_callback_info() const; + + private: + const size_t _staticArgCount = 6; + napi_env _env; + napi_callback_info _info; + napi_value _this; + size_t _argc; + napi_value* _argv; + napi_value _staticArgs[6]; + napi_value* _dynamicArgs; + void* _data; +}; + +class PropertyDescriptor { + public: + using GetterCallback = Napi::Value (*)(const Napi::CallbackInfo& info); + using SetterCallback = void (*)(const Napi::CallbackInfo& info); + +#ifndef NODE_ADDON_API_DISABLE_DEPRECATED + template + static PropertyDescriptor Accessor( + const char* utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + napi_value name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Name name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + napi_value name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + const char* utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + napi_value name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Name name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); +#endif // !NODE_ADDON_API_DISABLE_DEPRECATED + + template + static PropertyDescriptor Accessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Name name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + const std::string& utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Name name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Accessor( + Napi::Env env, + Napi::Object object, + Name name, + Getter getter, + Setter setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + const char* utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + const std::string& utf8name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor Function( + Napi::Env env, + Napi::Object object, + Name name, + Callable cb, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor Value( + const char* utf8name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + const std::string& utf8name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + napi_value name, + napi_value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor Value( + Name name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + + PropertyDescriptor(napi_property_descriptor desc); + + operator napi_property_descriptor&(); + operator const napi_property_descriptor&() const; + + private: + napi_property_descriptor _desc; +}; + +/// Property descriptor for use with `ObjectWrap::DefineClass()`. +/// +/// This is different from the standalone `PropertyDescriptor` because it is +/// specific to each `ObjectWrap` subclass. This prevents using descriptors +/// from a different class when defining a new class (preventing the callbacks +/// from having incorrect `this` pointers). +template +class ClassPropertyDescriptor { + public: + ClassPropertyDescriptor(napi_property_descriptor desc) : _desc(desc) {} + + operator napi_property_descriptor&() { return _desc; } + operator const napi_property_descriptor&() const { return _desc; } + + private: + napi_property_descriptor _desc; +}; + +template +struct MethodCallbackData { + TCallback callback; + void* data; +}; + +template +struct AccessorCallbackData { + TGetterCallback getterCallback; + TSetterCallback setterCallback; + void* data; +}; + +template +class InstanceWrap { + public: + using InstanceVoidMethodCallback = void (T::*)(const CallbackInfo& info); + using InstanceMethodCallback = Napi::Value (T::*)(const CallbackInfo& info); + using InstanceGetterCallback = Napi::Value (T::*)(const CallbackInfo& info); + using InstanceSetterCallback = void (T::*)(const CallbackInfo& info, + const Napi::Value& value); + + using PropertyDescriptor = ClassPropertyDescriptor; + + static PropertyDescriptor InstanceMethod( + const char* utf8name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + const char* utf8name, + InstanceMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + Symbol name, + InstanceVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceMethod( + Symbol name, + InstanceMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceAccessor( + const char* utf8name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceAccessor( + Symbol name, + InstanceGetterCallback getter, + InstanceSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceAccessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor InstanceAccessor( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor InstanceValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor InstanceValue( + Symbol name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + + protected: + static void AttachPropData(napi_env env, + napi_value value, + const napi_property_descriptor* prop); + + private: + using This = InstanceWrap; + + using InstanceVoidMethodCallbackData = + MethodCallbackData; + using InstanceMethodCallbackData = + MethodCallbackData; + using InstanceAccessorCallbackData = + AccessorCallbackData; + + static napi_value InstanceVoidMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceGetterCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value InstanceSetterCallbackWrapper(napi_env env, + napi_callback_info info); + + template + static napi_value WrappedMethod(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT; + + template + struct SetterTag {}; + + template + static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { + return &This::WrappedMethod; + } + static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { + return nullptr; + } +}; + +/// Base class to be extended by C++ classes exposed to JavaScript; each C++ +/// class instance gets "wrapped" by a JavaScript object that is managed by this +/// class. +/// +/// At initialization time, the `DefineClass()` method must be used to +/// hook up the accessor and method callbacks. It takes a list of +/// property descriptors, which can be constructed via the various +/// static methods on the base class. +/// +/// #### Example: +/// +/// class Example: public Napi::ObjectWrap { +/// public: +/// static void Initialize(Napi::Env& env, Napi::Object& target) { +/// Napi::Function constructor = DefineClass(env, "Example", { +/// InstanceAccessor<&Example::GetSomething, +/// &Example::SetSomething>("value"), +/// InstanceMethod<&Example::DoSomething>("doSomething"), +/// }); +/// target.Set("Example", constructor); +/// } +/// +/// Example(const Napi::CallbackInfo& info); // Constructor +/// Napi::Value GetSomething(const Napi::CallbackInfo& info); +/// void SetSomething(const Napi::CallbackInfo& info, const Napi::Value& +/// value); Napi::Value DoSomething(const Napi::CallbackInfo& info); +/// } +template +class ObjectWrap : public InstanceWrap, public Reference { + public: + ObjectWrap(const CallbackInfo& callbackInfo); + virtual ~ObjectWrap(); + + static T* Unwrap(Object wrapper); + + // Methods exposed to JavaScript must conform to one of these callback + // signatures. + using StaticVoidMethodCallback = void (*)(const CallbackInfo& info); + using StaticMethodCallback = Napi::Value (*)(const CallbackInfo& info); + using StaticGetterCallback = Napi::Value (*)(const CallbackInfo& info); + using StaticSetterCallback = void (*)(const CallbackInfo& info, + const Napi::Value& value); + + using PropertyDescriptor = ClassPropertyDescriptor; + + static Function DefineClass( + Napi::Env env, + const char* utf8name, + const std::initializer_list& properties, + void* data = nullptr); + static Function DefineClass(Napi::Env env, + const char* utf8name, + const std::vector& properties, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + const char* utf8name, + StaticVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + const char* utf8name, + StaticMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + Symbol name, + StaticVoidMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticMethod( + Symbol name, + StaticMethodCallback method, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticMethod( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticAccessor( + const char* utf8name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticAccessor( + Symbol name, + StaticGetterCallback getter, + StaticSetterCallback setter, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticAccessor( + const char* utf8name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + template + static PropertyDescriptor StaticAccessor( + Symbol name, + napi_property_attributes attributes = napi_default, + void* data = nullptr); + static PropertyDescriptor StaticValue( + const char* utf8name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static PropertyDescriptor StaticValue( + Symbol name, + Napi::Value value, + napi_property_attributes attributes = napi_default); + static Napi::Value OnCalledAsFunction(const Napi::CallbackInfo& callbackInfo); + virtual void Finalize(Napi::Env env); + + private: + using This = ObjectWrap; + + static napi_value ConstructorCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticVoidMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticMethodCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticGetterCallbackWrapper(napi_env env, + napi_callback_info info); + static napi_value StaticSetterCallbackWrapper(napi_env env, + napi_callback_info info); + static void FinalizeCallback(napi_env env, void* data, void* hint); + static Function DefineClass(Napi::Env env, + const char* utf8name, + const size_t props_count, + const napi_property_descriptor* props, + void* data = nullptr); + + using StaticVoidMethodCallbackData = + MethodCallbackData; + using StaticMethodCallbackData = MethodCallbackData; + + using StaticAccessorCallbackData = + AccessorCallbackData; + + template + static napi_value WrappedMethod(napi_env env, + napi_callback_info info) NAPI_NOEXCEPT; + + template + struct StaticSetterTag {}; + + template + static napi_callback WrapStaticSetter(StaticSetterTag) NAPI_NOEXCEPT { + return &This::WrappedMethod; + } + static napi_callback WrapStaticSetter(StaticSetterTag) + NAPI_NOEXCEPT { + return nullptr; + } + + bool _construction_failed = true; +}; + +class HandleScope { + public: + HandleScope(napi_env env, napi_handle_scope scope); + explicit HandleScope(Napi::Env env); + ~HandleScope(); + + // Disallow copying to prevent double close of napi_handle_scope + NAPI_DISALLOW_ASSIGN_COPY(HandleScope) + + operator napi_handle_scope() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_handle_scope _scope; +}; + +class EscapableHandleScope { + public: + EscapableHandleScope(napi_env env, napi_escapable_handle_scope scope); + explicit EscapableHandleScope(Napi::Env env); + ~EscapableHandleScope(); + + // Disallow copying to prevent double close of napi_escapable_handle_scope + NAPI_DISALLOW_ASSIGN_COPY(EscapableHandleScope) + + operator napi_escapable_handle_scope() const; + + Napi::Env Env() const; + Value Escape(napi_value escapee); + + private: + napi_env _env; + napi_escapable_handle_scope _scope; +}; + +#if (NAPI_VERSION > 2) +class CallbackScope { + public: + CallbackScope(napi_env env, napi_callback_scope scope); + CallbackScope(napi_env env, napi_async_context context); + virtual ~CallbackScope(); + + // Disallow copying to prevent double close of napi_callback_scope + NAPI_DISALLOW_ASSIGN_COPY(CallbackScope) + + operator napi_callback_scope() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_callback_scope _scope; +}; +#endif + +class AsyncContext { + public: + explicit AsyncContext(napi_env env, const char* resource_name); + explicit AsyncContext(napi_env env, + const char* resource_name, + const Object& resource); + virtual ~AsyncContext(); + + AsyncContext(AsyncContext&& other); + AsyncContext& operator=(AsyncContext&& other); + NAPI_DISALLOW_ASSIGN_COPY(AsyncContext) + + operator napi_async_context() const; + + Napi::Env Env() const; + + private: + napi_env _env; + napi_async_context _context; +}; + +#if NAPI_HAS_THREADS +class AsyncWorker { + public: + virtual ~AsyncWorker(); + + NAPI_DISALLOW_ASSIGN_COPY(AsyncWorker) + + operator napi_async_work() const; + + Napi::Env Env() const; + + void Queue(); + void Cancel(); + void SuppressDestruct(); + + ObjectReference& Receiver(); + FunctionReference& Callback(); + + virtual void OnExecute(Napi::Env env); + virtual void OnWorkComplete(Napi::Env env, napi_status status); + + protected: + explicit AsyncWorker(const Function& callback); + explicit AsyncWorker(const Function& callback, const char* resource_name); + explicit AsyncWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncWorker(const Object& receiver, const Function& callback); + explicit AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + + explicit AsyncWorker(Napi::Env env); + explicit AsyncWorker(Napi::Env env, const char* resource_name); + explicit AsyncWorker(Napi::Env env, + const char* resource_name, + const Object& resource); + + virtual void Execute() = 0; + virtual void OnOK(); + virtual void OnError(const Error& e); + virtual void Destroy(); + virtual std::vector GetResult(Napi::Env env); + + void SetError(const std::string& error); + + private: + static inline void OnAsyncWorkExecute(napi_env env, void* asyncworker); + static inline void OnAsyncWorkComplete(napi_env env, + napi_status status, + void* asyncworker); + + napi_env _env; + napi_async_work _work; + ObjectReference _receiver; + FunctionReference _callback; + std::string _error; + bool _suppress_destruct; +}; +#endif // NAPI_HAS_THREADS + +#if (NAPI_VERSION > 3 && NAPI_HAS_THREADS) +class ThreadSafeFunction { + public: + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + Finalizer finalizeCallback, + FinalizerDataType* data); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback); + + // This API may only be called from the main thread. + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data); + + ThreadSafeFunction(); + ThreadSafeFunction(napi_threadsafe_function tsFunctionValue); + + operator napi_threadsafe_function() const; + + // This API may be called from any thread. + napi_status BlockingCall() const; + + // This API may be called from any thread. + template + napi_status BlockingCall(Callback callback) const; + + // This API may be called from any thread. + template + napi_status BlockingCall(DataType* data, Callback callback) const; + + // This API may be called from any thread. + napi_status NonBlockingCall() const; + + // This API may be called from any thread. + template + napi_status NonBlockingCall(Callback callback) const; + + // This API may be called from any thread. + template + napi_status NonBlockingCall(DataType* data, Callback callback) const; + + // This API may only be called from the main thread. + void Ref(napi_env env) const; + + // This API may only be called from the main thread. + void Unref(napi_env env) const; + + // This API may be called from any thread. + napi_status Acquire() const; + + // This API may be called from any thread. + napi_status Release() const; + + // This API may be called from any thread. + napi_status Abort() const; + + struct ConvertibleContext { + template + operator T*() { + return static_cast(context); + } + void* context; + }; + + // This API may be called from any thread. + ConvertibleContext GetContext() const; + + private: + using CallbackWrapper = std::function; + + template + static ThreadSafeFunction New(napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper); + + napi_status CallInternal(CallbackWrapper* callbackWrapper, + napi_threadsafe_function_call_mode mode) const; + + static void CallJS(napi_env env, + napi_value jsCallback, + void* context, + void* data); + + napi_threadsafe_function _tsfn; +}; + +// A TypedThreadSafeFunction by default has no context (nullptr) and can +// accept any type (void) to its CallJs. +template +class TypedThreadSafeFunction { + public: + // This API may only be called from the main thread. + // Helper function that returns nullptr if running Node-API 5+, otherwise a + // non-empty, no-op Function. This provides the ability to specify at + // compile-time a callback parameter to `New` that safely does no action + // when targeting _any_ Node-API version. +#if NAPI_VERSION > 4 + static std::nullptr_t EmptyFunctionFactory(Napi::Env env); +#else + static Napi::Function EmptyFunctionFactory(Napi::Env env); +#endif + static Napi::Function FunctionOrEmpty(Napi::Env env, + Napi::Function& callback); + +#if NAPI_VERSION > 4 + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [missing] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [passed] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [missing] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [missing] Resource [passed] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); +#endif + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [missing] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [passed] Finalizer [missing] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [missing] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + // This API may only be called from the main thread. + // Creates a new threadsafe function with: + // Callback [passed] Resource [passed] Finalizer [passed] + template + static TypedThreadSafeFunction New( + napi_env env, + CallbackType callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data = nullptr); + + TypedThreadSafeFunction(); + TypedThreadSafeFunction(napi_threadsafe_function tsFunctionValue); + + operator napi_threadsafe_function() const; + + // This API may be called from any thread. + napi_status BlockingCall(DataType* data = nullptr) const; + + // This API may be called from any thread. + napi_status NonBlockingCall(DataType* data = nullptr) const; + + // This API may only be called from the main thread. + void Ref(napi_env env) const; + + // This API may only be called from the main thread. + void Unref(napi_env env) const; + + // This API may be called from any thread. + napi_status Acquire() const; + + // This API may be called from any thread. + napi_status Release() const; + + // This API may be called from any thread. + napi_status Abort() const; + + // This API may be called from any thread. + ContextType* GetContext() const; + + private: + template + static TypedThreadSafeFunction New( + napi_env env, + const Function& callback, + const Object& resource, + ResourceString resourceName, + size_t maxQueueSize, + size_t initialThreadCount, + ContextType* context, + Finalizer finalizeCallback, + FinalizerDataType* data, + napi_finalize wrapper); + + static void CallJsInternal(napi_env env, + napi_value jsCallback, + void* context, + void* data); + + protected: + napi_threadsafe_function _tsfn; +}; +template +class AsyncProgressWorkerBase : public AsyncWorker { + public: + virtual void OnWorkProgress(DataType* data) = 0; + class ThreadSafeData { + public: + ThreadSafeData(AsyncProgressWorkerBase* asyncprogressworker, DataType* data) + : _asyncprogressworker(asyncprogressworker), _data(data) {} + + AsyncProgressWorkerBase* asyncprogressworker() { + return _asyncprogressworker; + }; + DataType* data() { return _data; }; + + private: + AsyncProgressWorkerBase* _asyncprogressworker; + DataType* _data; + }; + void OnWorkComplete(Napi::Env env, napi_status status) override; + + protected: + explicit AsyncProgressWorkerBase(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource, + size_t queue_size = 1); + virtual ~AsyncProgressWorkerBase(); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressWorkerBase(Napi::Env env, + const char* resource_name, + const Object& resource, + size_t queue_size = 1); +#endif + + static inline void OnAsyncWorkProgress(Napi::Env env, + Napi::Function jsCallback, + void* data); + + napi_status NonBlockingCall(DataType* data); + + private: + ThreadSafeFunction _tsfn; + bool _work_completed = false; + napi_status _complete_status; + static inline void OnThreadSafeFunctionFinalize( + Napi::Env env, void* data, AsyncProgressWorkerBase* context); +}; + +template +class AsyncProgressWorker : public AsyncProgressWorkerBase { + public: + virtual ~AsyncProgressWorker(); + + class ExecutionProgress { + friend class AsyncProgressWorker; + + public: + void Signal() const; + void Send(const T* data, size_t count) const; + + private: + explicit ExecutionProgress(AsyncProgressWorker* worker) : _worker(worker) {} + AsyncProgressWorker* const _worker; + }; + + void OnWorkProgress(void*) override; + + protected: + explicit AsyncProgressWorker(const Function& callback); + explicit AsyncProgressWorker(const Function& callback, + const char* resource_name); + explicit AsyncProgressWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncProgressWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressWorker(Napi::Env env); + explicit AsyncProgressWorker(Napi::Env env, const char* resource_name); + explicit AsyncProgressWorker(Napi::Env env, + const char* resource_name, + const Object& resource); +#endif + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void OnProgress(const T* data, size_t count) = 0; + + private: + void Execute() override; + void Signal(); + void SendProgress_(const T* data, size_t count); + + std::mutex _mutex; + T* _asyncdata; + size_t _asyncsize; + bool _signaled; +}; + +template +class AsyncProgressQueueWorker + : public AsyncProgressWorkerBase> { + public: + virtual ~AsyncProgressQueueWorker(){}; + + class ExecutionProgress { + friend class AsyncProgressQueueWorker; + + public: + void Signal() const; + void Send(const T* data, size_t count) const; + + private: + explicit ExecutionProgress(AsyncProgressQueueWorker* worker) + : _worker(worker) {} + AsyncProgressQueueWorker* const _worker; + }; + + void OnWorkComplete(Napi::Env env, napi_status status) override; + void OnWorkProgress(std::pair*) override; + + protected: + explicit AsyncProgressQueueWorker(const Function& callback); + explicit AsyncProgressQueueWorker(const Function& callback, + const char* resource_name); + explicit AsyncProgressQueueWorker(const Function& callback, + const char* resource_name, + const Object& resource); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback, + const char* resource_name); + explicit AsyncProgressQueueWorker(const Object& receiver, + const Function& callback, + const char* resource_name, + const Object& resource); + +// Optional callback of Napi::ThreadSafeFunction only available after +// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 +#if NAPI_VERSION > 4 + explicit AsyncProgressQueueWorker(Napi::Env env); + explicit AsyncProgressQueueWorker(Napi::Env env, const char* resource_name); + explicit AsyncProgressQueueWorker(Napi::Env env, + const char* resource_name, + const Object& resource); +#endif + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void OnProgress(const T* data, size_t count) = 0; + + private: + void Execute() override; + void Signal() const; + void SendProgress_(const T* data, size_t count); +}; +#endif // NAPI_VERSION > 3 && NAPI_HAS_THREADS + +// Memory management. +class MemoryManagement { + public: + static int64_t AdjustExternalMemory(Env env, int64_t change_in_bytes); +}; + +// Version management +class VersionManagement { + public: + static uint32_t GetNapiVersion(Env env); + static const napi_node_version* GetNodeVersion(Env env); +}; + +#if NAPI_VERSION > 5 +template +class Addon : public InstanceWrap { + public: + static inline Object Init(Env env, Object exports); + static T* Unwrap(Object wrapper); + + protected: + using AddonProp = ClassPropertyDescriptor; + void DefineAddon(Object exports, + const std::initializer_list& props); + Napi::Object DefineProperties(Object object, + const std::initializer_list& props); + + private: + Object entry_point_; +}; +#endif // NAPI_VERSION > 5 + +#ifdef NAPI_CPP_CUSTOM_NAMESPACE +} // namespace NAPI_CPP_CUSTOM_NAMESPACE +#endif + +} // namespace Napi + +// Inline implementations of all the above class methods are included here. +#include "napi-inl.h" + +#endif // SRC_NAPI_H_ diff --git a/node_modules/node-addon-api/node_addon_api.gyp b/node_modules/node-addon-api/node_addon_api.gyp new file mode 100644 index 0000000..29905ed --- /dev/null +++ b/node_modules/node-addon-api/node_addon_api.gyp @@ -0,0 +1,32 @@ +{ + 'targets': [ + { + 'target_name': 'node_addon_api', + 'type': 'none', + 'sources': [ 'napi.h', 'napi-inl.h' ], + 'direct_dependent_settings': { + 'include_dirs': [ '.' ], + 'includes': ['noexcept.gypi'], + } + }, + { + 'target_name': 'node_addon_api_except', + 'type': 'none', + 'sources': [ 'napi.h', 'napi-inl.h' ], + 'direct_dependent_settings': { + 'include_dirs': [ '.' ], + 'includes': ['except.gypi'], + } + }, + { + 'target_name': 'node_addon_api_maybe', + 'type': 'none', + 'sources': [ 'napi.h', 'napi-inl.h' ], + 'direct_dependent_settings': { + 'include_dirs': [ '.' ], + 'includes': ['noexcept.gypi'], + 'defines': ['NODE_ADDON_API_ENABLE_MAYBE'] + } + }, + ] +} diff --git a/node_modules/node-addon-api/node_api.gyp b/node_modules/node-addon-api/node_api.gyp new file mode 100644 index 0000000..4ff0ae7 --- /dev/null +++ b/node_modules/node-addon-api/node_api.gyp @@ -0,0 +1,9 @@ +{ + 'targets': [ + { + 'target_name': 'nothing', + 'type': 'static_library', + 'sources': [ 'nothing.c' ] + } + ] +} diff --git a/node_modules/node-addon-api/noexcept.gypi b/node_modules/node-addon-api/noexcept.gypi new file mode 100644 index 0000000..404a05f --- /dev/null +++ b/node_modules/node-addon-api/noexcept.gypi @@ -0,0 +1,26 @@ +{ + 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], + 'cflags': [ '-fno-exceptions' ], + 'cflags_cc': [ '-fno-exceptions' ], + 'conditions': [ + ["OS=='win'", { + # _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi + #"defines": [ + # "_HAS_EXCEPTIONS=0" + #], + "msvs_settings": { + "VCCLCompilerTool": { + 'ExceptionHandling': 0, + 'EnablePREfast': 'true', + }, + }, + }], + ["OS=='mac'", { + 'xcode_settings': { + 'CLANG_CXX_LIBRARY': 'libc++', + 'MACOSX_DEPLOYMENT_TARGET': '10.7', + 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', + }, + }], + ], +} diff --git a/node_modules/node-addon-api/nothing.c b/node_modules/node-addon-api/nothing.c new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/node-addon-api/package-support.json b/node_modules/node-addon-api/package-support.json new file mode 100644 index 0000000..10d3607 --- /dev/null +++ b/node_modules/node-addon-api/package-support.json @@ -0,0 +1,21 @@ +{ + "versions": [ + { + "version": "*", + "target": { + "node": "active" + }, + "response": { + "type": "time-permitting", + "paid": false, + "contact": { + "name": "node-addon-api team", + "url": "https://github.com/nodejs/node-addon-api/issues" + } + }, + "backing": [ { "project": "https://github.com/nodejs" }, + { "foundation": "https://openjsf.org/" } + ] + } + ] +} diff --git a/node_modules/node-addon-api/package.json b/node_modules/node-addon-api/package.json new file mode 100644 index 0000000..d772ddc --- /dev/null +++ b/node_modules/node-addon-api/package.json @@ -0,0 +1,480 @@ +{ + "bugs": { + "url": "https://github.com/nodejs/node-addon-api/issues" + }, + "contributors": [ + { + "name": "Abhishek Kumar Singh", + "url": "https://github.com/abhi11210646" + }, + { + "name": "Alba Mendez", + "url": "https://github.com/jmendeth" + }, + { + "name": "Alexander Floh", + "url": "https://github.com/alexanderfloh" + }, + { + "name": "Ammar Faizi", + "url": "https://github.com/ammarfaizi2" + }, + { + "name": "András Timár, Dr", + "url": "https://github.com/timarandras" + }, + { + "name": "Andrew Petersen", + "url": "https://github.com/kirbysayshi" + }, + { + "name": "Anisha Rohra", + "url": "https://github.com/anisha-rohra" + }, + { + "name": "Anna Henningsen", + "url": "https://github.com/addaleax" + }, + { + "name": "Arnaud Botella", + "url": "https://github.com/BotellaA" + }, + { + "name": "Arunesh Chandra", + "url": "https://github.com/aruneshchandra" + }, + { + "name": "Azlan Mukhtar", + "url": "https://github.com/azlan" + }, + { + "name": "Ben Berman", + "url": "https://github.com/rivertam" + }, + { + "name": "Benjamin Byholm", + "url": "https://github.com/kkoopa" + }, + { + "name": "Bill Gallafent", + "url": "https://github.com/gallafent" + }, + { + "name": "blagoev", + "url": "https://github.com/blagoev" + }, + { + "name": "Bruce A. MacNaughton", + "url": "https://github.com/bmacnaughton" + }, + { + "name": "Cory Mickelson", + "url": "https://github.com/corymickelson" + }, + { + "name": "Daniel Bevenius", + "url": "https://github.com/danbev" + }, + { + "name": "Dante Calderón", + "url": "https://github.com/dantehemerson" + }, + { + "name": "Darshan Sen", + "url": "https://github.com/RaisinTen" + }, + { + "name": "David Halls", + "url": "https://github.com/davedoesdev" + }, + { + "name": "Deepak Rajamohan", + "url": "https://github.com/deepakrkris" + }, + { + "name": "Dmitry Ashkadov", + "url": "https://github.com/dmitryash" + }, + { + "name": "Dongjin Na", + "url": "https://github.com/nadongguri" + }, + { + "name": "Doni Rubiagatra", + "url": "https://github.com/rubiagatra" + }, + { + "name": "Eric Bickle", + "url": "https://github.com/ebickle" + }, + { + "name": "extremeheat", + "url": "https://github.com/extremeheat" + }, + { + "name": "Feng Yu", + "url": "https://github.com/F3n67u" + }, + { + "name": "Ferdinand Holzer", + "url": "https://github.com/fholzer" + }, + { + "name": "Gabriel Schulhof", + "url": "https://github.com/gabrielschulhof" + }, + { + "name": "Guenter Sandner", + "url": "https://github.com/gms1" + }, + { + "name": "Gus Caplan", + "url": "https://github.com/devsnek" + }, + { + "name": "Helio Frota", + "url": "https://github.com/helio-frota" + }, + { + "name": "Hitesh Kanwathirtha", + "url": "https://github.com/digitalinfinity" + }, + { + "name": "ikokostya", + "url": "https://github.com/ikokostya" + }, + { + "name": "Jack Xia", + "url": "https://github.com/JckXia" + }, + { + "name": "Jake Barnes", + "url": "https://github.com/DuBistKomisch" + }, + { + "name": "Jake Yoon", + "url": "https://github.com/yjaeseok" + }, + { + "name": "Jason Ginchereau", + "url": "https://github.com/jasongin" + }, + { + "name": "Jenny", + "url": "https://github.com/egg-bread" + }, + { + "name": "Jeroen Janssen", + "url": "https://github.com/japj" + }, + { + "name": "Jim Schlight", + "url": "https://github.com/jschlight" + }, + { + "name": "Jinho Bang", + "url": "https://github.com/romandev" + }, + { + "name": "José Expósito", + "url": "https://github.com/JoseExposito" + }, + { + "name": "joshgarde", + "url": "https://github.com/joshgarde" + }, + { + "name": "Julian Mesa", + "url": "https://github.com/julianmesa-gitkraken" + }, + { + "name": "Kasumi Hanazuki", + "url": "https://github.com/hanazuki" + }, + { + "name": "Kelvin", + "url": "https://github.com/kelvinhammond" + }, + { + "name": "Kevin Eady", + "url": "https://github.com/KevinEady" + }, + { + "name": "Kévin VOYER", + "url": "https://github.com/kecsou" + }, + { + "name": "kidneysolo", + "url": "https://github.com/kidneysolo" + }, + { + "name": "Koki Nishihara", + "url": "https://github.com/Nishikoh" + }, + { + "name": "Konstantin Tarkus", + "url": "https://github.com/koistya" + }, + { + "name": "Kyle Farnung", + "url": "https://github.com/kfarnung" + }, + { + "name": "Kyle Kovacs", + "url": "https://github.com/nullromo" + }, + { + "name": "legendecas", + "url": "https://github.com/legendecas" + }, + { + "name": "LongYinan", + "url": "https://github.com/Brooooooklyn" + }, + { + "name": "Lovell Fuller", + "url": "https://github.com/lovell" + }, + { + "name": "Luciano Martorella", + "url": "https://github.com/lmartorella" + }, + { + "name": "mastergberry", + "url": "https://github.com/mastergberry" + }, + { + "name": "Mathias Küsel", + "url": "https://github.com/mathiask88" + }, + { + "name": "Mathias Stearn", + "url": "https://github.com/RedBeard0531" + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina" + }, + { + "name": "Michael Dawson", + "url": "https://github.com/mhdawson" + }, + { + "name": "Michael Price", + "url": "https://github.com/mikepricedev" + }, + { + "name": "Michele Campus", + "url": "https://github.com/kYroL01" + }, + { + "name": "Mikhail Cheshkov", + "url": "https://github.com/mcheshkov" + }, + { + "name": "nempoBu4", + "url": "https://github.com/nempoBu4" + }, + { + "name": "Nicola Del Gobbo", + "url": "https://github.com/NickNaso" + }, + { + "name": "Nick Soggin", + "url": "https://github.com/iSkore" + }, + { + "name": "Nikolai Vavilov", + "url": "https://github.com/seishun" + }, + { + "name": "Nurbol Alpysbayev", + "url": "https://github.com/anurbol" + }, + { + "name": "pacop", + "url": "https://github.com/pacop" + }, + { + "name": "Peter Šándor", + "url": "https://github.com/petersandor" + }, + { + "name": "Philipp Renoth", + "url": "https://github.com/DaAitch" + }, + { + "name": "rgerd", + "url": "https://github.com/rgerd" + }, + { + "name": "Richard Lau", + "url": "https://github.com/richardlau" + }, + { + "name": "Rolf Timmermans", + "url": "https://github.com/rolftimmermans" + }, + { + "name": "Ross Weir", + "url": "https://github.com/ross-weir" + }, + { + "name": "Ryuichi Okumura", + "url": "https://github.com/okuryu" + }, + { + "name": "Saint Gabriel", + "url": "https://github.com/chineduG" + }, + { + "name": "Sampson Gao", + "url": "https://github.com/sampsongao" + }, + { + "name": "Sam Roberts", + "url": "https://github.com/sam-github" + }, + { + "name": "strager", + "url": "https://github.com/strager" + }, + { + "name": "Taylor Woll", + "url": "https://github.com/boingoing" + }, + { + "name": "Thomas Gentilhomme", + "url": "https://github.com/fraxken" + }, + { + "name": "Tim Rach", + "url": "https://github.com/timrach" + }, + { + "name": "Tobias Nießen", + "url": "https://github.com/tniessen" + }, + { + "name": "todoroff", + "url": "https://github.com/todoroff" + }, + { + "name": "Toyo Li", + "url": "https://github.com/toyobayashi" + }, + { + "name": "Tux3", + "url": "https://github.com/tux3" + }, + { + "name": "Vlad Velmisov", + "url": "https://github.com/Velmisov" + }, + { + "name": "Vladimir Morozov", + "url": "https://github.com/vmoroz" + + }, + { + "name": "WenheLI", + "url": "https://github.com/WenheLI" + }, + { + "name": "Xuguang Mei", + "url": "https://github.com/meixg" + }, + { + "name": "Yohei Kishimoto", + "url": "https://github.com/morokosi" + }, + { + "name": "Yulong Wang", + "url": "https://github.com/fs-eire" + }, + { + "name": "Ziqiu Zhao", + "url": "https://github.com/ZzqiZQute" + }, + { + "name": "Feng Yu", + "url": "https://github.com/F3n67u" + }, + { + "name": "wanlu wang", + "url": "https://github.com/wanlu" + }, + { + "name": "Caleb Hearon", + "url": "https://github.com/chearon" + }, + { + "name": "Marx", + "url": "https://github.com/MarxJiao" + }, + { + "name": "Ömer AKGÜL", + "url": "https://github.com/tuhalf" + } + ], + "description": "Node.js API (Node-API)", + "devDependencies": { + "benchmark": "^2.1.4", + "bindings": "^1.5.0", + "clang-format": "^1.4.0", + "eslint": "^7.32.0", + "eslint-config-semistandard": "^16.0.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "fs-extra": "^11.1.1", + "path": "^0.12.7", + "pre-commit": "^1.2.2", + "safe-buffer": "^5.1.1" + }, + "directories": {}, + "gypfile": false, + "homepage": "https://github.com/nodejs/node-addon-api", + "keywords": [ + "n-api", + "napi", + "addon", + "native", + "bindings", + "c", + "c++", + "nan", + "node-addon-api" + ], + "license": "MIT", + "main": "index.js", + "name": "node-addon-api", + "readme": "README.md", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-addon-api.git" + }, + "files": [ + "*.{c,h,gyp,gypi}", + "package-support.json", + "tools/" + ], + "scripts": { + "prebenchmark": "node-gyp rebuild -C benchmark", + "benchmark": "node benchmark", + "pretest": "node-gyp rebuild -C test", + "test": "node test", + "test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js", + "predev": "node-gyp rebuild -C test --debug", + "dev": "node test", + "predev:incremental": "node-gyp configure build -C test --debug", + "dev:incremental": "node test", + "doc": "doxygen doc/Doxyfile", + "lint": "node tools/eslint-format && node tools/clang-format", + "lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix" + }, + "pre-commit": "lint", + "version": "7.1.1", + "support": true +} diff --git a/node_modules/node-addon-api/tools/README.md b/node_modules/node-addon-api/tools/README.md new file mode 100644 index 0000000..6b80e94 --- /dev/null +++ b/node_modules/node-addon-api/tools/README.md @@ -0,0 +1,73 @@ +# Tools + +## clang-format + +The clang-format checking tools is designed to check changed lines of code compared to given git-refs. + +## Migration Script + +The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required. + +### How To Use + +To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory. +``` +npm install node-addon-api +``` + +Then run the script passing your project directory +``` +node ./node_modules/node-addon-api/tools/conversion.js ./ +``` + +After finish, recompile and debug things that are missed by the script. + + +### Quick Fixes +Here is the list of things that can be fixed easily. + 1. Change your methods' return value to void if it doesn't return value to JavaScript. + 2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`. + 3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value); + + +### Major Reconstructions +The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN. + +So if you use Nan::ObjectWrap in your module, you will need to execute the following steps. + + 1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as +``` +[ClassName](const Napi::CallbackInfo& info); +``` +and define it as +``` +[ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){ + ... +} +``` +This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object. + + 2. Move your original constructor code into the new constructor. Delete your original constructor. + 3. In your class initialization function, associate native methods in the following way. +``` +Napi::FunctionReference constructor; + +void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) { + Napi::HandleScope scope(env); + Napi::Function ctor = DefineClass(env, "Canvas", { + InstanceMethod<&[ClassName]::Func1>("Func1"), + InstanceMethod<&[ClassName]::Func2>("Func2"), + InstanceAccessor<&[ClassName]::ValueGetter>("Value"), + StaticMethod<&[ClassName]::StaticMethod>("MethodName"), + InstanceValue("Value", Napi::[Type]::New(env, value)), + }); + + constructor = Napi::Persistent(ctor); + constructor .SuppressDestruct(); + exports.Set("[ClassName]", ctor); +} +``` + 4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance. + + +If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it. diff --git a/node_modules/node-addon-api/tools/check-napi.js b/node_modules/node-addon-api/tools/check-napi.js new file mode 100644 index 0000000..9199af3 --- /dev/null +++ b/node_modules/node-addon-api/tools/check-napi.js @@ -0,0 +1,99 @@ +'use strict'; +// Descend into a directory structure and, for each file matching *.node, output +// based on the imports found in the file whether it's an N-API module or not. + +const fs = require('fs'); +const path = require('path'); + +// Read the output of the command, break it into lines, and use the reducer to +// decide whether the file is an N-API module or not. +function checkFile (file, command, argv, reducer) { + const child = require('child_process').spawn(command, argv, { + stdio: ['inherit', 'pipe', 'inherit'] + }); + let leftover = ''; + let isNapi; + child.stdout.on('data', (chunk) => { + if (isNapi === undefined) { + chunk = (leftover + chunk.toString()).split(/[\r\n]+/); + leftover = chunk.pop(); + isNapi = chunk.reduce(reducer, isNapi); + if (isNapi !== undefined) { + child.kill(); + } + } + }); + child.on('close', (code, signal) => { + if ((code === null && signal !== null) || (code !== 0)) { + console.log( + command + ' exited with code: ' + code + ' and signal: ' + signal); + } else { + // Green if it's a N-API module, red otherwise. + console.log( + '\x1b[' + (isNapi ? '42' : '41') + 'm' + + (isNapi ? ' N-API' : 'Not N-API') + + '\x1b[0m: ' + file); + } + }); +} + +// Use nm -a to list symbols. +function checkFileUNIX (file) { + checkFile(file, 'nm', ['-a', file], (soFar, line) => { + if (soFar === undefined) { + line = line.match(/([0-9a-f]*)? ([a-zA-Z]) (.*$)/); + if (line[2] === 'U') { + if (/^napi/.test(line[3])) { + soFar = true; + } + } + } + return soFar; + }); +} + +// Use dumpbin /imports to list symbols. +function checkFileWin32 (file) { + checkFile(file, 'dumpbin', ['/imports', file], (soFar, line) => { + if (soFar === undefined) { + line = line.match(/([0-9a-f]*)? +([a-zA-Z0-9]) (.*$)/); + if (line && /^napi/.test(line[line.length - 1])) { + soFar = true; + } + } + return soFar; + }); +} + +// Descend into a directory structure and pass each file ending in '.node' to +// one of the above checks, depending on the OS. +function recurse (top) { + fs.readdir(top, (error, items) => { + if (error) { + throw new Error('error reading directory ' + top + ': ' + error); + } + items.forEach((item) => { + item = path.join(top, item); + fs.stat(item, ((item) => (error, stats) => { + if (error) { + throw new Error('error about ' + item + ': ' + error); + } + if (stats.isDirectory()) { + recurse(item); + } else if (/[.]node$/.test(item) && + // Explicitly ignore files called 'nothing.node' because they are + // artefacts of node-addon-api having identified a version of + // Node.js that ships with a correct implementation of N-API. + path.basename(item) !== 'nothing.node') { + process.platform === 'win32' + ? checkFileWin32(item) + : checkFileUNIX(item); + } + })(item)); + }); + }); +} + +// Start with the directory given on the command line or the current directory +// if nothing was given. +recurse(process.argv.length > 3 ? process.argv[2] : '.'); diff --git a/node_modules/node-addon-api/tools/clang-format.js b/node_modules/node-addon-api/tools/clang-format.js new file mode 100644 index 0000000..e4bb4f5 --- /dev/null +++ b/node_modules/node-addon-api/tools/clang-format.js @@ -0,0 +1,71 @@ +#!/usr/bin/env node + +const spawn = require('child_process').spawnSync; +const path = require('path'); + +const filesToCheck = ['*.h', '*.cc']; +const FORMAT_START = process.env.FORMAT_START || 'main'; + +function main (args) { + let fix = false; + while (args.length > 0) { + switch (args[0]) { + case '-f': + case '--fix': + fix = true; + break; + default: + } + args.shift(); + } + + const clangFormatPath = path.dirname(require.resolve('clang-format')); + const binary = process.platform === 'win32' + ? 'node_modules\\.bin\\clang-format.cmd' + : 'node_modules/.bin/clang-format'; + const options = ['--binary=' + binary, '--style=file']; + if (fix) { + options.push(FORMAT_START); + } else { + options.push('--diff', FORMAT_START); + } + + const gitClangFormatPath = path.join(clangFormatPath, 'bin/git-clang-format'); + const result = spawn( + 'python', + [gitClangFormatPath, ...options, '--', ...filesToCheck], + { encoding: 'utf-8' } + ); + + if (result.stderr) { + console.error('Error running git-clang-format:', result.stderr); + return 2; + } + + const clangFormatOutput = result.stdout.trim(); + // Bail fast if in fix mode. + if (fix) { + console.log(clangFormatOutput); + return 0; + } + // Detect if there is any complains from clang-format + if ( + clangFormatOutput !== '' && + clangFormatOutput !== 'no modified files to format' && + clangFormatOutput !== 'clang-format did not modify any files' + ) { + console.error(clangFormatOutput); + const fixCmd = 'npm run lint:fix'; + console.error(` + ERROR: please run "${fixCmd}" to format changes in your commit + Note that when running the command locally, please keep your local + main branch and working branch up to date with nodejs/node-addon-api + to exclude un-related complains. + Or you can run "env FORMAT_START=upstream/main ${fixCmd}".`); + return 1; + } +} + +if (require.main === module) { + process.exitCode = main(process.argv.slice(2)); +} diff --git a/node_modules/node-addon-api/tools/conversion.js b/node_modules/node-addon-api/tools/conversion.js new file mode 100755 index 0000000..f89245a --- /dev/null +++ b/node_modules/node-addon-api/tools/conversion.js @@ -0,0 +1,301 @@ +#! /usr/bin/env node + +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +const args = process.argv.slice(2); +const dir = args[0]; +if (!dir) { + console.log('Usage: node ' + path.basename(__filename) + ' '); + process.exit(1); +} + +const NodeApiVersion = require('../package.json').version; + +const disable = args[1]; +let ConfigFileOperations; +if (disable !== '--disable' && dir !== '--disable') { + ConfigFileOperations = { + 'package.json': [ + [/([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'], + [/[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, ''] + ], + 'binding.gyp': [ + [/([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], + [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);\s+(\w+)\.Reset\((\1)\);\s+\1->SetClassName\((Nan::String::New|Nan::New<(v8::)*String>)\("(.+?)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$6", {'], + [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], + [/Nan::New\(([\w\d:]+)\)->GetFunction\(\)/g, 'Napi::Function::New(env, $1)'], + [/Nan::New\(([\w\d:]+)\)->GetFunction()/g, 'Napi::Function::New(env, $1);'], + [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], + [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], + + // FunctionTemplate to FunctionReference + [/Nan::Persistent<(v8::)*FunctionTemplate>/g, 'Napi::FunctionReference'], + [/Nan::Persistent<(v8::)*Function>/g, 'Napi::FunctionReference'], + [/v8::Local/g, 'Napi::FunctionReference'], + [/Local/g, 'Napi::FunctionReference'], + [/v8::FunctionTemplate/g, 'Napi::FunctionReference'], + [/FunctionTemplate/g, 'Napi::FunctionReference'], + + [/([ ]*)Nan::SetPrototypeMethod\(\w+, "(\w+)", (\w+)\);/g, '$1InstanceMethod("$2", &$3),'], + [/([ ]*)(?:\w+\.Reset\(\w+\);\s+)?\(target\)\.Set\("(\w+)",\s*Nan::GetFunction\((\w+)\)\);/gm, + '});\n\n' + + '$1constructor = Napi::Persistent($3);\n' + + '$1constructor.SuppressDestruct();\n' + + '$1target.Set("$2", $3);'], + + // TODO: Other attribute combinations + [/static_cast\(ReadOnly\s*\|\s*DontDelete\)/gm, + 'static_cast(napi_enumerable | napi_configurable)'], + + [/([\w\d:<>]+?)::Cast\((.+?)\)/g, '$2.As<$1>()'], + + [/\*Nan::Utf8String\(([^)]+)\)/g, '$1->As().Utf8Value().c_str()'], + [/Nan::Utf8String +(\w+)\(([^)]+)\)/g, 'std::string $1 = $2.As()'], + [/Nan::Utf8String/g, 'std::string'], + + [/v8::String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], + [/String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], + [/\.length\(\)/g, '.Length()'], + + [/Nan::MakeCallback\(([^,]+),[\s\\]+([^,]+),/gm, '$2.MakeCallback($1,'], + + [/class\s+(\w+)\s*:\s*public\s+Nan::ObjectWrap/g, 'class $1 : public Napi::ObjectWrap<$1>'], + [/(\w+)\(([^)]*)\)\s*:\s*Nan::ObjectWrap\(\)\s*(,)?/gm, '$1($2) : Napi::ObjectWrap<$1>()$3'], + + // HandleOKCallback to OnOK + [/HandleOKCallback/g, 'OnOK'], + // HandleErrorCallback to OnError + [/HandleErrorCallback/g, 'OnError'], + + // ex. .As() to .As() + [/\.As\(\)/g, '.As()'], + [/\.As<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As()'], + + // ex. Nan::New(info[0]) to Napi::Number::New(info[0]) + [/Nan::New<(v8::)*Integer>\((.+?)\)/g, 'Napi::Number::New(env, $2)'], + [/Nan::New\(([0-9.]+)\)/g, 'Napi::Number::New(env, $1)'], + [/Nan::New<(v8::)*String>\("(.+?)"\)/g, 'Napi::String::New(env, "$2")'], + [/Nan::New\("(.+?)"\)/g, 'Napi::String::New(env, "$1")'], + [/Nan::New<(v8::)*(.+?)>\(\)/g, 'Napi::$2::New(env)'], + [/Nan::New<(.+?)>\(\)/g, 'Napi::$1::New(env)'], + [/Nan::New<(v8::)*(.+?)>\(/g, 'Napi::$2::New(env, '], + [/Nan::New<(.+?)>\(/g, 'Napi::$1::New(env, '], + [/Nan::NewBuffer\(/g, 'Napi::Buffer::New(env, '], + // TODO: Properly handle this + [/Nan::New\(/g, 'Napi::New(env, '], + + [/\.IsInt32\(\)/g, '.IsNumber()'], + [/->IsInt32\(\)/g, '.IsNumber()'], + + [/(.+?)->BooleanValue\(\)/g, '$1.As().Value()'], + [/(.+?)->Int32Value\(\)/g, '$1.As().Int32Value()'], + [/(.+?)->Uint32Value\(\)/g, '$1.As().Uint32Value()'], + [/(.+?)->IntegerValue\(\)/g, '$1.As().Int64Value()'], + [/(.+?)->NumberValue\(\)/g, '$1.As().DoubleValue()'], + + // ex. Nan::To(info[0]) to info[0].Value() + [/Nan::To\((.+?)\)/g, '$2.To()'], + [/Nan::To<(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To()'], + // ex. Nan::To(info[0]) to info[0].As().Value() + [/Nan::To\((.+?)\)/g, '$1.As().Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Uint32Value() + [/Nan::To\((.+?)\)/g, '$1.As().Uint32Value()'], + // ex. Nan::To(info[0]) to info[0].As().Int64Value() + [/Nan::To\((.+?)\)/g, '$1.As().Int64Value()'], + // ex. Nan::To(info[0]) to info[0].As().FloatValue() + [/Nan::To\((.+?)\)/g, '$1.As().FloatValue()'], + // ex. Nan::To(info[0]) to info[0].As().DoubleValue() + [/Nan::To\((.+?)\)/g, '$1.As().DoubleValue()'], + + [/Nan::New\((\w+)\)->HasInstance\((\w+)\)/g, '$2.InstanceOf($1.Value())'], + + [/Nan::Has\(([^,]+),\s*/gm, '($1).Has('], + [/\.Has\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Has($1)'], + [/\.Has\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Has($1)'], + + [/Nan::Get\(([^,]+),\s*/gm, '($1).Get('], + [/\.Get\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Get($1)'], + [/\.Get\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Get($1)'], + + [/Nan::Set\(([^,]+),\s*/gm, '($1).Set('], + [/\.Set\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\s*,/gm, '.Set($1,'], + [/\.Set\([\s|\\]*Nan::New\(([^)]+)\)\s*,/gm, '.Set($1,'], + + // ex. node::Buffer::HasInstance(info[0]) to info[0].IsBuffer() + [/node::Buffer::HasInstance\((.+?)\)/g, '$1.IsBuffer()'], + // ex. node::Buffer::Length(info[0]) to info[0].Length() + [/node::Buffer::Length\((.+?)\)/g, '$1.As>().Length()'], + // ex. node::Buffer::Data(info[0]) to info[0].Data() + [/node::Buffer::Data\((.+?)\)/g, '$1.As>().Data()'], + [/Nan::CopyBuffer\(/g, 'Napi::Buffer::Copy(env, '], + + // Nan::AsyncQueueWorker(worker) + [/Nan::AsyncQueueWorker\((.+)\);/g, '$1.Queue();'], + [/Nan::(Undefined|Null|True|False)\(\)/g, 'env.$1()'], + + // Nan::ThrowError(error) to Napi::Error::New(env, error).ThrowAsJavaScriptException() + [/([ ]*)return Nan::Throw(\w*?)Error\((.+?)\);/g, '$1Napi::$2Error::New(env, $3).ThrowAsJavaScriptException();\n$1return env.Null();'], + [/Nan::Throw(\w*?)Error\((.+?)\);\n(\s*)return;/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n$3return env.Null();'], + [/Nan::Throw(\w*?)Error\((.+?)\);/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n'], + // Nan::RangeError(error) to Napi::RangeError::New(env, error) + [/Nan::(\w*?)Error\((.+)\)/g, 'Napi::$1Error::New(env, $2)'], + + [/Nan::Set\((.+?),\n* *(.+?),\n* *(.+?),\n* *(.+?)\)/g, '$1.Set($2, $3, $4)'], + + [/Nan::(Escapable)?HandleScope\s+(\w+)\s*;/g, 'Napi::$1HandleScope $2(env);'], + [/Nan::(Escapable)?HandleScope/g, 'Napi::$1HandleScope'], + [/Nan::ForceSet\(([^,]+), ?/g, '$1->DefineProperty('], + [/\.ForceSet\(Napi::String::New\(env, "(\w+)"\),\s*?/g, '.DefineProperty("$1", '], + // [ /Nan::GetPropertyNames\(([^,]+)\)/, '$1->GetPropertyNames()' ], + [/Nan::Equals\(([^,]+),/g, '$1.StrictEquals('], + + [/(.+)->Set\(/g, '$1.Set('], + + [/Nan::Callback/g, 'Napi::FunctionReference'], + + [/Nan::Persistent/g, 'Napi::ObjectReference'], + [/Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target/g, 'Napi::Env& env, Napi::Object& target'], + + [/(\w+)\*\s+(\w+)\s*=\s*Nan::ObjectWrap::Unwrap<\w+>\(info\.This\(\)\);/g, '$1* $2 = this;'], + [/Nan::ObjectWrap::Unwrap<(\w+)>\((.*)\);/g, '$2.Unwrap<$1>();'], + + [/Nan::NAN_METHOD_RETURN_TYPE/g, 'void'], + [/NAN_INLINE/g, 'inline'], + + [/Nan::NAN_METHOD_ARGS_TYPE/g, 'const Napi::CallbackInfo&'], + [/NAN_METHOD\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/static\s*NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], + [/static\s*NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], + [/NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], + [/void Init\((v8::)*Local<(v8::)*Object> exports\)/g, 'Napi::Object Init(Napi::Env env, Napi::Object exports)'], + [/NAN_MODULE_INIT\(([\w\d:]+?)\);/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports);'], + [/NAN_MODULE_INIT\(([\w\d:]+?)\)/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports)'], + + [/::(Init(?:ialize)?)\(target\)/g, '::$1(env, target, module)'], + [/constructor_template/g, 'constructor'], + + [/Nan::FunctionCallbackInfo<(v8::)?Value>[ ]*& [ ]*info\)[ ]*{\n*([ ]*)/gm, 'Napi::CallbackInfo& info) {\n$2Napi::Env env = info.Env();\n$2'], + [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&\s*info\);/g, 'Napi::CallbackInfo& info);'], + [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&/g, 'Napi::CallbackInfo&'], + + [/Buffer::HasInstance\(([^)]+)\)/g, '$1.IsBuffer()'], + + [/info\[(\d+)\]->/g, 'info[$1].'], + [/info\[([\w\d]+)\]->/g, 'info[$1].'], + [/info\.This\(\)->/g, 'info.This().'], + [/->Is(Object|String|Int32|Number)\(\)/g, '.Is$1()'], + [/info.GetReturnValue\(\).SetUndefined\(\)/g, 'return env.Undefined()'], + [/info\.GetReturnValue\(\)\.Set\(((\n|.)+?)\);/g, 'return $1;'], + + // ex. Local to Napi::Value + [/v8::Local/g, 'Napi::$1'], + [/Local<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1'], + + // Declare an env in helper functions that take a Napi::Value + [/(\w+)\(Napi::Value (\w+)(,\s*[^()]+)?\)\s*{\n*([ ]*)/gm, '$1(Napi::Value $2$3) {\n$4Napi::Env env = $2.Env();\n$4'], + + // delete #include and/or + [/#include +(<|")(?:node|nan).h("|>)/g, '#include $1napi.h$2\n#include $1uv.h$2'], + // NODE_MODULE to NODE_API_MODULE + [/NODE_MODULE/g, 'NODE_API_MODULE'], + [/Nan::/g, 'Napi::'], + [/nan.h/g, 'napi.h'], + + // delete .FromJust() + [/\.FromJust\(\)/g, ''], + // delete .ToLocalCheck() + [/\.ToLocalChecked\(\)/g, ''], + [/^.*->SetInternalFieldCount\(.*$/gm, ''], + + // replace using node; and/or using v8; to using Napi; + [/using (node|v8);/g, 'using Napi;'], + [/using namespace (node|Nan|v8);/g, 'using namespace Napi;'], + // delete using v8::Local; + [/using v8::Local;\n/g, ''], + // replace using v8::XXX; with using Napi::XXX + [/using v8::([A-Za-z]+);/g, 'using Napi::$1;'] + +]; + +const paths = listFiles(dir); +paths.forEach(function (dirEntry) { + const filename = dirEntry.split('\\').pop().split('/').pop(); + + // Check whether the file is a source file or a config file + // then execute function accordingly + const sourcePattern = /.+\.h|.+\.cc|.+\.cpp/; + if (sourcePattern.test(filename)) { + convertFile(dirEntry, SourceFileOperations); + } else if (ConfigFileOperations[filename] != null) { + convertFile(dirEntry, ConfigFileOperations[filename]); + } +}); + +function listFiles (dir, filelist) { + const files = fs.readdirSync(dir); + filelist = filelist || []; + files.forEach(function (file) { + if (file === 'node_modules') { + return; + } + + if (fs.statSync(path.join(dir, file)).isDirectory()) { + filelist = listFiles(path.join(dir, file), filelist); + } else { + filelist.push(path.join(dir, file)); + } + }); + return filelist; +} + +function convert (content, operations) { + for (let i = 0; i < operations.length; i++) { + const operation = operations[i]; + content = content.replace(operation[0], operation[1]); + } + return content; +} + +function convertFile (fileName, operations) { + fs.readFile(fileName, 'utf-8', function (err, file) { + if (err) throw err; + + file = convert(file, operations); + + fs.writeFile(fileName, file, function (err) { + if (err) throw err; + }); + }); +} diff --git a/node_modules/node-addon-api/tools/eslint-format.js b/node_modules/node-addon-api/tools/eslint-format.js new file mode 100644 index 0000000..6923ab7 --- /dev/null +++ b/node_modules/node-addon-api/tools/eslint-format.js @@ -0,0 +1,79 @@ +#!/usr/bin/env node + +const spawn = require('child_process').spawnSync; + +const filesToCheck = '*.js'; +const FORMAT_START = process.env.FORMAT_START || 'main'; +const IS_WIN = process.platform === 'win32'; +const ESLINT_PATH = IS_WIN ? 'node_modules\\.bin\\eslint.cmd' : 'node_modules/.bin/eslint'; + +function main (args) { + let fix = false; + while (args.length > 0) { + switch (args[0]) { + case '-f': + case '--fix': + fix = true; + break; + default: + } + args.shift(); + } + + // Check js files that change on unstaged file + const fileUnStaged = spawn( + 'git', + ['diff', '--name-only', '--diff-filter=d', FORMAT_START, filesToCheck], + { + encoding: 'utf-8' + } + ); + + // Check js files that change on staged file + const fileStaged = spawn( + 'git', + ['diff', '--name-only', '--cached', '--diff-filter=d', FORMAT_START, filesToCheck], + { + encoding: 'utf-8' + } + ); + + const options = [ + ...fileStaged.stdout.split('\n').filter((f) => f !== ''), + ...fileUnStaged.stdout.split('\n').filter((f) => f !== '') + ]; + + if (fix) { + options.push('--fix'); + } + + const result = spawn(ESLINT_PATH, [...options], { + encoding: 'utf-8' + }); + + if (result.error && result.error.errno === 'ENOENT') { + console.error('Eslint not found! Eslint is supposed to be found at ', ESLINT_PATH); + return 2; + } + + if (result.status === 1) { + console.error('Eslint error:', result.stdout); + const fixCmd = 'npm run lint:fix'; + console.error(`ERROR: please run "${fixCmd}" to format changes in your commit + Note that when running the command locally, please keep your local + main branch and working branch up to date with nodejs/node-addon-api + to exclude un-related complains. + Or you can run "env FORMAT_START=upstream/main ${fixCmd}". + Also fix JS files by yourself if necessary.`); + return 1; + } + + if (result.stderr) { + console.error('Error running eslint:', result.stderr); + return 2; + } +} + +if (require.main === module) { + process.exitCode = main(process.argv.slice(2)); +} diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE new file mode 100644 index 0000000..46c9b95 --- /dev/null +++ b/node_modules/picocolors/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md new file mode 100644 index 0000000..8e47aa8 --- /dev/null +++ b/node_modules/picocolors/README.md @@ -0,0 +1,21 @@ +# picocolors + +The tiniest and the fastest library for terminal output formatting with ANSI colors. + +```javascript +import pc from "picocolors" + +console.log( + pc.green(`How are ${pc.italic(`you`)} doing?`) +) +``` + +- **No dependencies.** +- **14 times** smaller and **2 times** faster than chalk. +- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. +- Node.js v6+ & browsers support. Support for both CJS and ESM projects. +- TypeScript type declarations included. +- [`NO_COLOR`](https://no-color.org/) friendly. + +## Docs +Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json new file mode 100644 index 0000000..372d4b6 --- /dev/null +++ b/node_modules/picocolors/package.json @@ -0,0 +1,25 @@ +{ + "name": "picocolors", + "version": "1.1.1", + "main": "./picocolors.js", + "types": "./picocolors.d.ts", + "browser": { + "./picocolors.js": "./picocolors.browser.js" + }, + "sideEffects": false, + "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", + "files": [ + "picocolors.*", + "types.d.ts" + ], + "keywords": [ + "terminal", + "colors", + "formatting", + "cli", + "console" + ], + "author": "Alexey Raspopov", + "repository": "alexeyraspopov/picocolors", + "license": "ISC" +} diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js new file mode 100644 index 0000000..9dcf637 --- /dev/null +++ b/node_modules/picocolors/picocolors.browser.js @@ -0,0 +1,4 @@ +var x=String; +var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}}; +module.exports=create(); +module.exports.createColors = create; diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts new file mode 100644 index 0000000..94e146a --- /dev/null +++ b/node_modules/picocolors/picocolors.d.ts @@ -0,0 +1,5 @@ +import { Colors } from "./types" + +declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } + +export = picocolors diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js new file mode 100644 index 0000000..e32df85 --- /dev/null +++ b/node_modules/picocolors/picocolors.js @@ -0,0 +1,75 @@ +let p = process || {}, argv = p.argv || [], env = p.env || {} +let isColorSupported = + !(!!env.NO_COLOR || argv.includes("--no-color")) && + (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI) + +let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length) + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + } + +let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0 + do { + result += string.substring(cursor, index) + replace + cursor = index + close.length + index = string.indexOf(close, cursor) + } while (~index) + return result + string.substring(cursor) +} + +let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } +} + +module.exports = createColors() +module.exports.createColors = createColors diff --git a/node_modules/picocolors/types.d.ts b/node_modules/picocolors/types.d.ts new file mode 100644 index 0000000..cd1aec4 --- /dev/null +++ b/node_modules/picocolors/types.d.ts @@ -0,0 +1,51 @@ +export type Formatter = (input: string | number | null | undefined) => string + +export interface Colors { + isColorSupported: boolean + + reset: Formatter + bold: Formatter + dim: Formatter + italic: Formatter + underline: Formatter + inverse: Formatter + hidden: Formatter + strikethrough: Formatter + + black: Formatter + red: Formatter + green: Formatter + yellow: Formatter + blue: Formatter + magenta: Formatter + cyan: Formatter + white: Formatter + gray: Formatter + + bgBlack: Formatter + bgRed: Formatter + bgGreen: Formatter + bgYellow: Formatter + bgBlue: Formatter + bgMagenta: Formatter + bgCyan: Formatter + bgWhite: Formatter + + blackBright: Formatter + redBright: Formatter + greenBright: Formatter + yellowBright: Formatter + blueBright: Formatter + magentaBright: Formatter + cyanBright: Formatter + whiteBright: Formatter + + bgBlackBright: Formatter + bgRedBright: Formatter + bgGreenBright: Formatter + bgYellowBright: Formatter + bgBlueBright: Formatter + bgMagentaBright: Formatter + bgCyanBright: Formatter + bgWhiteBright: Formatter +} diff --git a/node_modules/tailwindcss/LICENSE b/node_modules/tailwindcss/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/tailwindcss/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/tailwindcss/README.md b/node_modules/tailwindcss/README.md new file mode 100644 index 0000000..7d21bd8 --- /dev/null +++ b/node_modules/tailwindcss/README.md @@ -0,0 +1,36 @@ +

+ + + + + Tailwind CSS + + +

+ +

+ A utility-first CSS framework for rapidly building custom user interfaces. +

+ +

+ Build Status + Total Downloads + Latest Release + License +

+ +--- + +## Documentation + +For full documentation, visit [tailwindcss.com](https://tailwindcss.com). + +## Community + +For help, discussion about best practices, or feature ideas: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +## Contributing + +If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/next/.github/CONTRIBUTING.md) **before submitting a pull request**. diff --git a/node_modules/tailwindcss/dist/chunk-CT46QCH7.mjs b/node_modules/tailwindcss/dist/chunk-CT46QCH7.mjs new file mode 100644 index 0000000..26e2803 --- /dev/null +++ b/node_modules/tailwindcss/dist/chunk-CT46QCH7.mjs @@ -0,0 +1,38 @@ +import{a as Xt,b as j,c as H,d as er,e as P,f as Ct,g as ie,h as et,i as rr}from"./chunk-GFBUASX3.mjs";import{a as tr}from"./chunk-HTB5LLOP.mjs";var ir="4.1.18";function tt(t){let r=[0];for(let n=0;n0;){let u=(a|0)>>1,f=s+u;r[f]<=n?(s=f+1,a=a-u-1):a=u}s-=1;let p=n-r[s];return{line:s+1,column:p}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let a=r[n],p=r[n+1]??a;return Math.min(Math.max(a+s,0),p)}return{find:i,findOffset:e}}var Fe=92,rt=47,it=42,nr=34,ar=39,Yi=58,nt=59,le=10,at=13,We=32,Be=9,or=123,$t=125,Vt=40,lr=41,Gi=91,qi=93,sr=45,St=64,Zi=33,se=class t extends Error{loc;constructor(r,i){if(i){let e=i[0],n=tt(e.code).find(i[1]);r=`${e.file}:${n.line}:${n.column+1}: ${r}`}super(r),this.name="CssSyntaxError",this.loc=i,Error.captureStackTrace&&Error.captureStackTrace(this,t)}};function $e(t,r){let i=r?.from?{file:r.from,code:t}:null;t[0]==="\uFEFF"&&(t=" "+t.slice(1));let e=[],n=[],s=[],a=null,p=null,u="",f="",m=0,d;for(let c=0;c0&&t[A]===h[h.length-1]&&(h=h.slice(0,-1));let $=Tt(u,x);if(!$)throw new se("Invalid custom property, expected a value",i?[i,y,c]:null);i&&($.src=[i,y,c],$.dst=[i,y,c]),a?a.nodes.push($):e.push($),u=""}else if(w===nt&&u.charCodeAt(0)===St)p=Ye(u),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a?a.nodes.push(p):e.push(p),u="",p=null;else if(w===nt&&f[f.length-1]!==")"){let h=Tt(u);if(!h){if(u.length===0)continue;throw new se(`Invalid declaration: \`${u.trim()}\``,i?[i,m,c]:null)}i&&(h.src=[i,m,c],h.dst=[i,m,c]),a?a.nodes.push(h):e.push(h),u=""}else if(w===or&&f[f.length-1]!==")")f+="}",p=J(u.trim()),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a&&a.nodes.push(p),s.push(a),a=p,u="",p=null;else if(w===$t&&f[f.length-1]!==")"){if(f==="")throw new se("Missing opening {",i?[i,c,c]:null);if(f=f.slice(0,-1),u.length>0)if(u.charCodeAt(0)===St)p=Ye(u),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a?a.nodes.push(p):e.push(p),u="",p=null;else{let y=u.indexOf(":");if(a){let x=Tt(u,y);if(!x)throw new se(`Invalid declaration: \`${u.trim()}\``,i?[i,m,c]:null);i&&(x.src=[i,m,c],x.dst=[i,m,c]),a.nodes.push(x)}}let h=s.pop()??null;h===null&&a&&e.push(a),a=h,u="",p=null}else if(w===Vt)f+=")",u+="(";else if(w===lr){if(f[f.length-1]!==")")throw new se("Missing opening (",i?[i,c,c]:null);f=f.slice(0,-1),u+=")"}else{if(u.length===0&&(w===We||w===le||w===Be))continue;u===""&&(m=c),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===St){let c=Ye(u);i&&(c.src=[i,m,t.length],c.dst=[i,m,t.length]),e.push(c)}if(f.length>0&&a){if(a.kind==="rule")throw new se(`Missing closing } at ${a.selector}`,a.src?[a.src[0],a.src[1],a.src[1]]:null);if(a.kind==="at-rule")throw new se(`Missing closing } at ${a.name} ${a.params}`,a.src?[a.src[0],a.src[1],a.src[1]]:null)}return n.length>0?n.concat(e):e}function Ye(t,r=[]){let i=t,e="";for(let n=5;n=1&&n<=31||n===127||e===0&&n>=48&&n<=57||e===1&&n>=48&&n<=57&&a===45){s+="\\"+n.toString(16)+" ";continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=r.charAt(e);continue}s+="\\"+r.charAt(e)}return s}function Se(t){return t.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,r=>r.length>2?String.fromCodePoint(Number.parseInt(r.slice(1).trim(),16)):r[1])}var cr=new Map([["--font",["--font-weight","--font-size"]],["--inset",["--inset-shadow","--inset-ring"]],["--text",["--text-color","--text-decoration-color","--text-decoration-thickness","--text-indent","--text-shadow","--text-underline-offset"]],["--grid-column",["--grid-column-start","--grid-column-end"]],["--grid-row",["--grid-row-start","--grid-row-end"]]]);function fr(t,r){return(cr.get(r)??[]).some(i=>t===i||t.startsWith(`${i}-`))}var lt=class{constructor(r=new Map,i=new Set([])){this.values=r;this.keyframes=i}prefix=null;get size(){return this.values.size}add(r,i,e=0,n){if(r.endsWith("-*")){if(i!=="initial")throw new Error(`Invalid theme value \`${i}\` for namespace \`${r}\``);r==="--*"?this.values.clear():this.clearNamespace(r.slice(0,-2),0)}if(e&4){let s=this.values.get(r);if(s&&!(s.options&4))return}i==="initial"?this.values.delete(r):this.values.set(r,{value:i,options:e,src:n})}keysInNamespaces(r){let i=[];for(let e of r){let n=`${e}-`;for(let s of this.values.keys())s.startsWith(n)&&s.indexOf("--",2)===-1&&(fr(s,e)||i.push(s.slice(n.length)))}return i}get(r){for(let i of r){let e=this.values.get(i);if(e)return e.value}return null}hasDefault(r){return(this.getOptions(r)&4)===4}getOptions(r){return r=Se(this.#r(r)),this.values.get(r)?.options??0}entries(){return this.prefix?Array.from(this.values,r=>(r[0]=this.prefixKey(r[0]),r)):this.values.entries()}prefixKey(r){return this.prefix?`--${this.prefix}-${r.slice(2)}`:r}#r(r){return this.prefix?`--${r.slice(3+this.prefix.length)}`:r}clearNamespace(r,i){let e=cr.get(r)??[];e:for(let n of this.values.keys())if(n.startsWith(r)){if(i!==0&&(this.getOptions(n)&i)!==i)continue;for(let s of e)if(n.startsWith(s))continue e;this.values.delete(n)}}#e(r,i){for(let e of i){let n=r!==null?`${e}-${r}`:e;if(!this.values.has(n))if(r!==null&&r.includes(".")){if(n=`${e}-${r.replaceAll(".","_")}`,!this.values.has(n))continue}else continue;if(!fr(n,e))return n}return null}#t(r){let i=this.values.get(r);if(!i)return null;let e=null;return i.options&2&&(e=i.value),`var(${ye(this.prefixKey(r))}${e?`, ${e}`:""})`}markUsedVariable(r){let i=Se(this.#r(r)),e=this.values.get(i);if(!e)return!1;let n=e.options&16;return e.options|=16,!n}resolve(r,i,e=0){let n=this.#e(r,i);if(!n)return null;let s=this.values.get(n);return(e|s.options)&1?s.value:this.#t(n)}resolveValue(r,i){let e=this.#e(r,i);return e?this.values.get(e).value:null}resolveWith(r,i,e=[]){let n=this.#e(r,i);if(!n)return null;let s={};for(let p of e){let u=`${n}${p}`,f=this.values.get(u);f&&(f.options&1?s[p]=f.value:s[p]=this.#t(u))}let a=this.values.get(n);return a.options&1?[a.value,s]:[this.#t(n),s]}namespace(r){let i=new Map,e=`${r}-`;for(let[n,s]of this.values)n===r?i.set(null,s.value):n.startsWith(`${e}-`)?i.set(n.slice(r.length),s.value):n.startsWith(e)&&i.set(n.slice(e.length),s.value);return i}addKeyframes(r){this.keyframes.add(r)}getKeyframes(){return Array.from(this.keyframes)}};var K=class extends Map{constructor(i){super();this.factory=i}get(i){let e=super.get(i);return e===void 0&&(e=this.factory(i,this),this.set(i,e)),e}};function ne(t){return{kind:"word",value:t}}function Hi(t,r){return{kind:"function",value:t,nodes:r}}function Ji(t){return{kind:"separator",value:t}}function Z(t){let r="";for(let i of t)switch(i.kind){case"word":case"separator":{r+=i.value;break}case"function":r+=i.value+"("+Z(i.nodes)+")"}return r}var pr=92,Qi=41,dr=58,mr=44,Xi=34,gr=61,hr=62,vr=60,wr=10,en=40,tn=39,rn=47,yr=32,kr=9;function B(t){t=t.replaceAll(`\r +`,` +`);let r=[],i=[],e=null,n="",s;for(let a=0;a0){let f=ne(n);e?e.nodes.push(f):r.push(f),n=""}let u=ne(t[a]);e?e.nodes.push(u):r.push(u);break}case dr:case mr:case gr:case hr:case vr:case wr:case yr:case kr:{if(n.length>0){let d=ne(n);e?e.nodes.push(d):r.push(d),n=""}let u=a,f=a+1;for(;f0){let f=ne(n);u?.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(p)}}return n.length>0&&r.push(ne(n)),r}var Et=(a=>(a[a.Continue=0]="Continue",a[a.Skip=1]="Skip",a[a.Stop=2]="Stop",a[a.Replace=3]="Replace",a[a.ReplaceSkip=4]="ReplaceSkip",a[a.ReplaceStop=5]="ReplaceStop",a))(Et||{}),E={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:t=>({kind:3,nodes:Array.isArray(t)?t:[t]}),ReplaceSkip:t=>({kind:4,nodes:Array.isArray(t)?t:[t]}),ReplaceStop:t=>({kind:5,nodes:Array.isArray(t)?t:[t]})};function I(t,r){typeof r=="function"?br(t,r):br(t,r.enter,r.exit)}function br(t,r=()=>E.Continue,i=()=>E.Continue){let e=[[t,0,null]],n={parent:null,depth:0,path(){let s=[];for(let a=1;a0;){let s=e.length-1,a=e[s],p=a[0],u=a[1],f=a[2];if(u>=p.length){e.pop();continue}if(n.parent=f,n.depth=s,u>=0){let w=p[u],h=r(w,n)??E.Continue;switch(h.kind){case 0:{w.nodes&&w.nodes.length>0&&e.push([w.nodes,0,w]),a[1]=~u;continue}case 2:return;case 1:{a[1]=~u;continue}case 3:{p.splice(u,1,...h.nodes);continue}case 5:{p.splice(u,1,...h.nodes);return}case 4:{p.splice(u,1,...h.nodes),a[1]+=h.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Et[h.kind]??`Unknown(${h.kind})`}\` in enter.`)}}let m=~u,d=p[m],c=i(d,n)??E.Continue;switch(c.kind){case 0:a[1]=m+1;continue;case 2:return;case 3:{p.splice(m,1,...c.nodes),a[1]=m+c.nodes.length;continue}case 5:{p.splice(m,1,...c.nodes);return}case 4:{p.splice(m,1,...c.nodes),a[1]=m+c.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Et[c.kind]??`Unknown(${c.kind})`}\` in exit.`)}}}function st(t){let r=[];return I(B(t),i=>{if(!(i.kind!=="function"||i.value!=="var"))return I(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||r.push(e.value)}),E.Skip}),r}var nn=64;function G(t,r=[]){return{kind:"rule",selector:t,nodes:r}}function F(t,r="",i=[]){return{kind:"at-rule",name:t,params:r,nodes:i}}function J(t,r=[]){return t.charCodeAt(0)===nn?Ye(t,r):G(t,r)}function o(t,r,i=!1){return{kind:"declaration",property:t,value:r,important:i}}function ot(t){return{kind:"comment",value:t}}function ce(t,r){return{kind:"context",context:t,nodes:r}}function W(t){return{kind:"at-root",nodes:t}}function ee(t){switch(t.kind){case"rule":return{kind:t.kind,selector:t.selector,nodes:t.nodes.map(ee),src:t.src,dst:t.dst};case"at-rule":return{kind:t.kind,name:t.name,params:t.params,nodes:t.nodes.map(ee),src:t.src,dst:t.dst};case"at-root":return{kind:t.kind,nodes:t.nodes.map(ee),src:t.src,dst:t.dst};case"context":return{kind:t.kind,context:{...t.context},nodes:t.nodes.map(ee),src:t.src,dst:t.dst};case"declaration":return{kind:t.kind,property:t.property,value:t.value,important:t.important,src:t.src,dst:t.dst};case"comment":return{kind:t.kind,value:t.value,src:t.src,dst:t.dst};default:throw new Error(`Unknown node kind: ${t.kind}`)}}function qe(t){return{depth:t.depth,get context(){let r={};for(let i of t.path())i.kind==="context"&&Object.assign(r,i.context);return Object.defineProperty(this,"context",{value:r}),r},get parent(){let r=this.path().pop()??null;return Object.defineProperty(this,"parent",{value:r}),r},path(){return t.path().filter(r=>r.kind!=="context")}}}function Te(t,r,i=3){let e=[],n=new Set,s=new K(()=>new Set),a=new K(()=>new Set),p=new Set,u=new Set,f=[],m=[],d=new K(()=>new Set);function c(h,y,x={},$=0){if(h.kind==="declaration"){if(h.property==="--tw-sort"||h.value===void 0||h.value===null)return;if(x.theme&&h.property[0]==="-"&&h.property[1]==="-"){if(h.value==="initial"){h.value=void 0;return}x.keyframes||s.get(y).add(h)}if(h.value.includes("var("))if(x.theme&&h.property[0]==="-"&&h.property[1]==="-")for(let A of st(h.value))d.get(A).add(h.property);else r.trackUsedVariables(h.value);if(h.property==="animation")for(let A of xr(h.value))u.add(A);i&2&&h.value.includes("color-mix(")&&!x.keyframes&&a.get(y).add(h),y.push(h)}else if(h.kind==="rule"){let A=[];for(let N of h.nodes)c(N,A,x,$+1);let k={},U=new Set;for(let N of A){if(N.kind!=="declaration")continue;let O=`${N.property}:${N.value}:${N.important}`;k[O]??=[],k[O].push(N)}for(let N in k)for(let O=0;O0&&(A=A.filter(N=>!U.has(N))),A.length===0)return;h.selector==="&"?y.push(...A):y.push({...h,nodes:A})}else if(h.kind==="at-rule"&&h.name==="@property"&&$===0){if(n.has(h.params))return;if(i&1){let k=h.params,U=null,N=!1;for(let L of h.nodes)L.kind==="declaration"&&(L.property==="initial-value"?U=L.value:L.property==="inherits"&&(N=L.value==="true"));let O=o(k,U??"initial");O.src=h.src,N?f.push(O):m.push(O)}n.add(h.params);let A={...h,nodes:[]};for(let k of h.nodes)c(k,A.nodes,x,$+1);y.push(A)}else if(h.kind==="at-rule"){h.name==="@keyframes"&&(x={...x,keyframes:!0});let A={...h,nodes:[]};for(let k of h.nodes)c(k,A.nodes,x,$+1);h.name==="@keyframes"&&x.theme&&p.add(A),(A.nodes.length>0||A.name==="@layer"||A.name==="@charset"||A.name==="@custom-media"||A.name==="@namespace"||A.name==="@import")&&y.push(A)}else if(h.kind==="at-root")for(let A of h.nodes){let k=[];c(A,k,x,0);for(let U of k)e.push(U)}else if(h.kind==="context"){if(h.context.reference)return;for(let A of h.nodes)c(A,y,{...x,...h.context},$)}else h.kind==="comment"&&y.push(h)}let w=[];for(let h of t)c(h,w,{},0);e:for(let[h,y]of s)for(let x of y){if(Ar(x.property,r.theme,d)){if(x.property.startsWith(r.theme.prefixKey("--animate-")))for(let k of xr(x.value))u.add(k);continue}let A=h.indexOf(x);if(h.splice(A,1),h.length===0){let k=an(w,U=>U.kind==="rule"&&U.nodes===h);if(!k||k.length===0)continue e;k.unshift({kind:"at-root",nodes:w});do{let U=k.pop();if(!U)break;let N=k[k.length-1];if(!N||N.kind!=="at-root"&&N.kind!=="at-rule")break;let O=N.nodes.indexOf(U);if(O===-1)break;N.nodes.splice(O,1)}while(!0);continue e}}for(let h of p)if(!u.has(h.params)){let y=e.indexOf(h);e.splice(y,1)}if(w=w.concat(e),i&2)for(let[h,y]of a)for(let x of y){let $=h.indexOf(x);if($===-1||x.value==null)continue;let A=B(x.value),k=!1;if(I(A,O=>{if(O.kind!=="function"||O.value!=="color-mix")return;let L=!1,_=!1;if(I(O.nodes,z=>{if(z.kind=="word"&&z.value.toLowerCase()==="currentcolor"){_=!0,k=!0;return}let Y=z,q=null,ae=new Set;do{if(Y.kind!=="function"||Y.value!=="var")return;let oe=Y.nodes[0];if(!oe||oe.kind!=="word")return;let l=oe.value;if(ae.has(l)){L=!0;return}if(ae.add(l),k=!0,q=r.theme.resolveValue(null,[oe.value]),!q){L=!0;return}if(q.toLowerCase()==="currentcolor"){_=!0;return}q.startsWith("var(")?Y=B(q)[0]:Y=null}while(Y);return E.Replace({kind:"word",value:q})}),L||_){let z=O.nodes.findIndex(q=>q.kind==="separator"&&q.value.trim().includes(","));if(z===-1)return;let Y=O.nodes.length>z?O.nodes[z+1]:null;return Y?E.Replace(Y):void 0}else if(k){let z=O.nodes[2];z.kind==="word"&&(z.value==="oklab"||z.value==="oklch"||z.value==="lab"||z.value==="lch")&&(z.value="srgb")}}),!k)continue;let U={...x,value:Z(A)},N=J("@supports (color: color-mix(in lab, red, red))",[x]);N.src=x.src,h.splice($,1,U,N)}if(i&1){let h=[];if(f.length>0){let y=J(":root, :host",f);y.src=f[0].src,h.push(y)}if(m.length>0){let y=J("*, ::before, ::after, ::backdrop",m);y.src=m[0].src,h.push(y)}if(h.length>0){let y=w.findIndex(A=>!(A.kind==="comment"||A.kind==="at-rule"&&(A.name==="@charset"||A.name==="@import"))),x=F("@layer","properties",[]);x.src=h[0].src,w.splice(y<0?w.length:y,0,x);let $=J("@layer properties",[F("@supports","((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))",h)]);$.src=h[0].src,$.nodes[0].src=h[0].src,w.push($)}}return w}function re(t,r){let i=0,e={file:null,code:""};function n(a,p=0){let u="",f=" ".repeat(p);if(a.kind==="declaration"){if(u+=`${f}${a.property}: ${a.value}${a.important?" !important":""}; +`,r){i+=f.length;let m=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let d=i;i+=2,a.dst=[e,m,d]}}else if(a.kind==="rule"){if(u+=`${f}${a.selector} { +`,r){i+=f.length;let m=i;i+=a.selector.length,i+=1;let d=i;a.dst=[e,m,d],i+=2}for(let m of a.nodes)u+=n(m,p+1);u+=`${f}} +`,r&&(i+=f.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let m=`${f}${a.name} ${a.params}; +`;if(r){i+=f.length;let d=i;i+=a.name.length,i+=1,i+=a.params.length;let c=i;i+=2,a.dst=[e,d,c]}return m}if(u+=`${f}${a.name}${a.params?` ${a.params} `:" "}{ +`,r){i+=f.length;let m=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let d=i;a.dst=[e,m,d],i+=2}for(let m of a.nodes)u+=n(m,p+1);u+=`${f}} +`,r&&(i+=f.length,i+=2)}else if(a.kind==="comment"){if(u+=`${f}/*${a.value}*/ +`,r){i+=f.length;let m=i;i+=2+a.value.length+2;let d=i;a.dst=[e,m,d],i+=1}}else if(a.kind==="context"||a.kind==="at-root")return"";return u}let s="";for(let a of t)s+=n(a,0);return e.code=s,s}function an(t,r){let i=[];return I(t,(e,n)=>{if(r(e))return i=n.path(),i.push(e),E.Stop}),i}function Ar(t,r,i,e=new Set){if(e.has(t)||(e.add(t),r.getOptions(t)&24))return!0;{let s=i.get(t)??[];for(let a of s)if(Ar(a,r,i,e))return!0}return!1}function xr(t){return t.split(/[\s,]+/)}function ke(t){if(t.indexOf("(")===-1)return Ie(t);let r=B(t);return Ot(r),t=Z(r),t=Xt(t),t}function Ie(t,r=!1){let i="";for(let e=0;e0&&n===Pt[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var ln=58,Cr=45,$r=97,Sr=122,Dt=/^[a-zA-Z0-9_.%-]+$/;function Tr(t){switch(t.kind){case"arbitrary":return{kind:t.kind,property:t.property,value:t.value,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null,variants:t.variants.map(_e),important:t.important,raw:t.raw};case"static":return{kind:t.kind,root:t.root,variants:t.variants.map(_e),important:t.important,raw:t.raw};case"functional":return{kind:t.kind,root:t.root,value:t.value?t.value.kind==="arbitrary"?{kind:t.value.kind,dataType:t.value.dataType,value:t.value.value}:{kind:t.value.kind,value:t.value.value,fraction:t.value.fraction}:null,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null,variants:t.variants.map(_e),important:t.important,raw:t.raw};default:throw new Error("Unknown candidate kind")}}function _e(t){switch(t.kind){case"arbitrary":return{kind:t.kind,selector:t.selector,relative:t.relative};case"static":return{kind:t.kind,root:t.root};case"functional":return{kind:t.kind,root:t.root,value:t.value?{kind:t.value.kind,value:t.value.value}:null,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null};case"compound":return{kind:t.kind,root:t.root,variant:_e(t.variant),modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null};default:throw new Error("Unknown variant kind")}}function*Vr(t,r){let i=j(t,":");if(r.theme.prefix){if(i.length===1||i[0]!==r.theme.prefix)return null;i.shift()}let e=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let c=r.parseVariant(i[d]);if(c===null)return;n.push(c)}let s=!1;e[e.length-1]==="!"?(s=!0,e=e.slice(0,-1)):e[0]==="!"&&(s=!0,e=e.slice(1)),r.utilities.has(e,"static")&&!e.includes("[")&&(yield{kind:"static",root:e,variants:n,important:s,raw:t});let[a,p=null,u]=j(e,"/");if(u)return;let f=p===null?null:It(p);if(p!==null&&f===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let d=a.charCodeAt(1);if(d!==Cr&&!(d>=$r&&d<=Sr))return;a=a.slice(1,-1);let c=a.indexOf(":");if(c===-1||c===0||c===a.length-1)return;let w=a.slice(0,c),h=ke(a.slice(c+1));if(!he(h))return;yield{kind:"arbitrary",property:w,value:h,modifier:f,variants:n,important:s,raw:t};return}let m;if(a[a.length-1]==="]"){let d=a.indexOf("-[");if(d===-1)return;let c=a.slice(0,d);if(!r.utilities.has(c,"functional"))return;let w=a.slice(d+1);m=[[c,w]]}else if(a[a.length-1]===")"){let d=a.indexOf("-(");if(d===-1)return;let c=a.slice(0,d);if(!r.utilities.has(c,"functional"))return;let w=a.slice(d+2,-1),h=j(w,":"),y=null;if(h.length===2&&(y=h[0],w=h[1]),w[0]!=="-"||w[1]!=="-"||!he(w))return;m=[[c,y===null?`[var(${w})]`:`[${y}:var(${w})]`]]}else m=Er(a,d=>r.utilities.has(d,"functional"));for(let[d,c]of m){let w={kind:"functional",root:d,modifier:f,value:null,variants:n,important:s,raw:t};if(c===null){yield w;continue}{let h=c.indexOf("[");if(h!==-1){if(c[c.length-1]!=="]")return;let x=ke(c.slice(h+1,-1));if(!he(x))continue;let $=null;for(let A=0;A=$r&&k<=Sr))break}if(x.length===0||x.trim().length===0||$==="")continue;w.value={kind:"arbitrary",dataType:$||null,value:x}}else{let x=p===null||w.modifier?.kind==="arbitrary"?null:`${c}/${p}`;if(!Dt.test(c))continue;w.value={kind:"named",value:c,fraction:x}}}yield w}}function It(t){if(t[0]==="["&&t[t.length-1]==="]"){let r=ke(t.slice(1,-1));return!he(r)||r.length===0||r.trim().length===0?null:{kind:"arbitrary",value:r}}return t[0]==="("&&t[t.length-1]===")"?(t=t.slice(1,-1),t[0]!=="-"||t[1]!=="-"||!he(t)?null:(t=`var(${t})`,{kind:"arbitrary",value:ke(t)})):Dt.test(t)?{kind:"named",value:t}:null}function Nr(t,r){if(t[0]==="["&&t[t.length-1]==="]"){if(t[1]==="@"&&t.includes("&"))return null;let i=ke(t.slice(1,-1));if(!he(i)||i.length===0||i.trim().length===0)return null;let e=i[0]===">"||i[0]==="+"||i[0]==="~";return!e&&i[0]!=="@"&&!i.includes("&")&&(i=`&:is(${i})`),{kind:"arbitrary",selector:i,relative:e}}{let[i,e=null,n]=j(t,"/");if(n)return null;let s=Er(i,a=>r.variants.has(a));for(let[a,p]of s)switch(r.variants.kind(a)){case"static":return p!==null||e!==null?null:{kind:"static",root:a};case"functional":{let u=e===null?null:It(e);if(e!==null&&u===null)return null;if(p===null)return{kind:"functional",root:a,modifier:u,value:null};if(p[p.length-1]==="]"){if(p[0]!=="[")continue;let f=ke(p.slice(1,-1));return!he(f)||f.length===0||f.trim().length===0?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:f}}}if(p[p.length-1]===")"){if(p[0]!=="(")continue;let f=ke(p.slice(1,-1));return!he(f)||f.length===0||f.trim().length===0||f[0]!=="-"||f[1]!=="-"?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:`var(${f})`}}}if(!Dt.test(p))continue;return{kind:"functional",root:a,modifier:u,value:{kind:"named",value:p}}}case"compound":{if(p===null)return null;e&&(a==="not"||a==="has"||a==="in")&&(p=`${p}/${e}`,e=null);let u=r.parseVariant(p);if(u===null||!r.variants.compoundsWith(a,u))return null;let f=e===null?null:It(e);return e!==null&&f===null?null:{kind:"compound",root:a,modifier:f,variant:u}}}}return null}function*Er(t,r){r(t)&&(yield[t,null]);let i=t.lastIndexOf("-");for(;i>0;){let e=t.slice(0,i);if(r(e)){let n=[e,t.slice(i+1)];if(n[1]===""||n[0]==="@"&&r("@")&&t[i]==="-")break;yield n}i=t.lastIndexOf("-",i-1)}t[0]==="@"&&r("@")&&(yield["@",t.slice(1)])}function Rr(t,r){let i=[];for(let n of r.variants)i.unshift(ut(n));t.theme.prefix&&i.unshift(t.theme.prefix);let e="";if(r.kind==="static"&&(e+=r.root),r.kind==="functional"&&(e+=r.root,r.value))if(r.value.kind==="arbitrary"){if(r.value!==null){let n=Kt(r.value.value),s=n?r.value.value.slice(4,-1):r.value.value,[a,p]=n?["(",")"]:["[","]"];r.value.dataType?e+=`-${a}${r.value.dataType}:${be(s)}${p}`:e+=`-${a}${be(s)}${p}`}}else r.value.kind==="named"&&(e+=`-${r.value.value}`);return r.kind==="arbitrary"&&(e+=`[${r.property}:${be(r.value)}]`),(r.kind==="arbitrary"||r.kind==="functional")&&(e+=He(r.modifier)),r.important&&(e+="!"),i.push(e),i.join(":")}function He(t){if(t===null)return"";let r=Kt(t.value),i=r?t.value.slice(4,-1):t.value,[e,n]=r?["(",")"]:["[","]"];return t.kind==="arbitrary"?`/${e}${be(i)}${n}`:t.kind==="named"?`/${t.value}`:""}function ut(t){if(t.kind==="static")return t.root;if(t.kind==="arbitrary")return`[${be(fn(t.selector))}]`;let r="";if(t.kind==="functional"){r+=t.root;let i=t.root!=="@";if(t.value)if(t.value.kind==="arbitrary"){let e=Kt(t.value.value),n=e?t.value.value.slice(4,-1):t.value.value,[s,a]=e?["(",")"]:["[","]"];r+=`${i?"-":""}${s}${be(n)}${a}`}else t.value.kind==="named"&&(r+=`${i?"-":""}${t.value.value}`)}return t.kind==="compound"&&(r+=t.root,r+="-",r+=ut(t.variant)),(t.kind==="functional"||t.kind==="compound")&&(r+=He(t.modifier)),r}var sn=new K(t=>{let r=B(t),i=new Set;return I(r,(e,n)=>{let s=n.parent===null?r:n.parent.nodes??[];if(e.kind==="word"&&(e.value==="+"||e.value==="-"||e.value==="*"||e.value==="/")){let a=s.indexOf(e)??-1;if(a===-1)return;let p=s[a-1];if(p?.kind!=="separator"||p.value!==" ")return;let u=s[a+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(p),i.add(u)}else e.kind==="separator"&&e.value.length>0&&e.value.trim()===""?(s[0]===e||s[s.length-1]===e)&&i.add(e):e.kind==="separator"&&e.value.trim()===","&&(e.value=",")}),i.size>0&&I(r,e=>{if(i.has(e))return i.delete(e),E.ReplaceSkip([])}),_t(r),Z(r)});function be(t){return sn.get(t)}var un=new K(t=>{let r=B(t);return r.length===3&&r[0].kind==="word"&&r[0].value==="&"&&r[1].kind==="separator"&&r[1].value===":"&&r[2].kind==="function"&&r[2].value==="is"?Z(r[2].nodes):t});function fn(t){return un.get(t)}function _t(t){for(let r of t)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=Ze(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=Ze(r.value);for(let i=0;i{let r=B(t);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function Kt(t){return cn.get(t)}function pn(t){throw new Error(`Unexpected value: ${t}`)}function Ze(t){return t.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function Ve(t,r,i){if(t===r)return 0;let e=t.indexOf("("),n=r.indexOf("("),s=e===-1?t.replace(/[\d.]+/g,""):t.slice(0,e),a=n===-1?r.replace(/[\d.]+/g,""):r.slice(0,n),p=(s===a?0:s{e=e.trim();let n=j(e," ").filter(f=>f.trim()!==""),s=null,a=null,p=null;for(let f of n)dn.has(f)||(Or.test(f)?(a===null?a=f:p===null&&(p=f),Or.lastIndex=0):s===null&&(s=f));if(a===null||p===null)return e;let u=r(s??"currentcolor");return s!==null?e.replace(s,u):`${e} ${u}`}).join(", ")}var gn=/^-?[a-z][a-zA-Z0-9/%._-]*$/,hn=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,ct=["0","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96"],Ut=class{utilities=new K(()=>[]);completions=new Map;static(r,i){this.utilities.get(r).push({kind:"static",compileFn:i})}functional(r,i,e){this.utilities.get(r).push({kind:"functional",compileFn:i,options:e})}has(r,i){return this.utilities.has(r)&&this.utilities.get(r).some(e=>e.kind===i)}get(r){return this.utilities.has(r)?this.utilities.get(r):[]}getCompletions(r){return this.has(r,"static")?this.completions.get(r)?.()??[{supportsNegative:!1,values:[],modifiers:[]}]:this.completions.get(r)?.()??[]}suggest(r,i){let e=this.completions.get(r);e?this.completions.set(r,()=>[...e?.(),...i?.()]):this.completions.set(r,i)}keys(r){let i=[];for(let[e,n]of this.utilities.entries())for(let s of n)if(s.kind===r){i.push(e);break}return i}};function S(t,r,i){return F("@property",t,[o("syntax",i?`"${i}"`:'"*"'),o("inherits","false"),...r?[o("initial-value",r)]:[]])}function Q(t,r){if(r===null)return t;let i=Number(r);return Number.isNaN(i)||(r=`${i*100}%`),r==="100%"?t:`color-mix(in oklab, ${t} ${r}, transparent)`}function Ir(t,r){let i=Number(r);return Number.isNaN(i)||(r=`${i*100}%`),`oklab(from ${t} l a b / ${r})`}function X(t,r,i){if(!r)return t;if(r.kind==="arbitrary")return Q(t,r.value);let e=i.resolve(r.value,["--opacity"]);return e?Q(t,e):et(r.value)?Q(t,`${r.value}%`):null}function te(t,r,i){let e=null;switch(t.value.value){case"inherit":{e="inherit";break}case"transparent":{e="transparent";break}case"current":{e="currentcolor";break}default:{e=r.resolve(t.value.value,i);break}}return e?X(e,t.modifier,r):null}var _r=/(\d+)_(\d+)/g;function Dr(t){let r=new Ut;function i(l,g){function*v(b){for(let T of t.keysInNamespaces(b))yield T.replace(_r,(D,V,R)=>`${V}.${R}`)}let C=["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"];r.suggest(l,()=>{let b=[];for(let T of g()){if(typeof T=="string"){b.push({values:[T],modifiers:[]});continue}let D=[...T.values??[],...v(T.valueThemeKeys??[])],V=[...T.modifiers??[],...v(T.modifierThemeKeys??[])];T.supportsFractions&&D.push(...C),T.hasDefaultValue&&D.unshift(null),b.push({supportsNegative:T.supportsNegative,values:D,modifiers:V})}return b})}function e(l,g){r.static(l,()=>g.map(v=>typeof v=="function"?v():o(v[0],v[1])))}function n(l,g){function v({negative:C}){return b=>{let T=null,D=null;if(b.value)if(b.value.kind==="arbitrary"){if(b.modifier)return;T=b.value.value,D=b.value.dataType}else{if(T=t.resolve(b.value.fraction??b.value.value,g.themeKeys??[]),T===null&&g.supportsFractions&&b.value.fraction){let[V,R]=j(b.value.fraction,"/");if(!P(V)||!P(R))return;T=`calc(${b.value.fraction} * 100%)`}if(T===null&&C&&g.handleNegativeBareValue){if(T=g.handleNegativeBareValue(b.value),!T?.includes("/")&&b.modifier)return;if(T!==null)return g.handle(T,null)}if(T===null&&g.handleBareValue&&(T=g.handleBareValue(b.value),!T?.includes("/")&&b.modifier))return;if(T===null&&!C&&g.staticValues&&!b.modifier){let V=g.staticValues[b.value.value];if(V)return V.map(ee)}}else{if(b.modifier)return;T=g.defaultValue!==void 0?g.defaultValue:t.resolve(null,g.themeKeys??[])}if(T!==null)return g.handle(C?`calc(${T} * -1)`:T,D)}}if(g.supportsNegative&&r.functional(`-${l}`,v({negative:!0})),r.functional(l,v({negative:!1})),i(l,()=>[{supportsNegative:g.supportsNegative,valueThemeKeys:g.themeKeys??[],hasDefaultValue:g.defaultValue!==void 0&&g.defaultValue!==null,supportsFractions:g.supportsFractions}]),g.staticValues&&Object.keys(g.staticValues).length>0){let C=Object.keys(g.staticValues);i(l,()=>[{values:C}])}}function s(l,g){r.functional(l,v=>{if(!v.value)return;let C=null;if(v.value.kind==="arbitrary"?(C=v.value.value,C=X(C,v.modifier,t)):C=te(v,t,g.themeKeys),C!==null)return g.handle(C)}),i(l,()=>[{values:["current","inherit","transparent"],valueThemeKeys:g.themeKeys,modifiers:Array.from({length:21},(v,C)=>`${C*5}`)}])}function a(l,g,v,{supportsNegative:C=!1,supportsFractions:b=!1,staticValues:T}={}){C&&r.static(`-${l}-px`,()=>v("-1px")),r.static(`${l}-px`,()=>v("1px")),n(l,{themeKeys:g,supportsFractions:b,supportsNegative:C,defaultValue:null,handleBareValue:({value:D})=>{let V=t.resolve(null,["--spacing"]);return!V||!ie(D)?null:`calc(${V} * ${D})`},handleNegativeBareValue:({value:D})=>{let V=t.resolve(null,["--spacing"]);return!V||!ie(D)?null:`calc(${V} * -${D})`},handle:v,staticValues:T}),i(l,()=>[{values:t.get(["--spacing"])?ct:[],supportsNegative:C,supportsFractions:b,valueThemeKeys:g}])}e("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip-path","inset(50%)"],["white-space","nowrap"],["border-width","0"]]),e("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip-path","none"],["white-space","normal"]]),e("pointer-events-none",[["pointer-events","none"]]),e("pointer-events-auto",[["pointer-events","auto"]]),e("visible",[["visibility","visible"]]),e("invisible",[["visibility","hidden"]]),e("collapse",[["visibility","collapse"]]),e("static",[["position","static"]]),e("fixed",[["position","fixed"]]),e("absolute",[["position","absolute"]]),e("relative",[["position","relative"]]),e("sticky",[["position","sticky"]]);for(let[l,g]of[["inset","inset"],["inset-x","inset-inline"],["inset-y","inset-block"],["start","inset-inline-start"],["end","inset-inline-end"],["top","top"],["right","right"],["bottom","bottom"],["left","left"]])e(`${l}-auto`,[[g,"auto"]]),e(`${l}-full`,[[g,"100%"]]),e(`-${l}-full`,[[g,"-100%"]]),a(l,["--inset","--spacing"],v=>[o(g,v)],{supportsNegative:!0,supportsFractions:!0});e("isolate",[["isolation","isolate"]]),e("isolation-auto",[["isolation","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--z-index"],handle:l=>[o("z-index",l)],staticValues:{auto:[o("z-index","auto")]}}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),n("order",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--order"],handle:l=>[o("order",l)],staticValues:{first:[o("order","-9999")],last:[o("order","9999")]}}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:["--order"]}]),n("col",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-column"],handle:l=>[o("grid-column",l)],staticValues:{auto:[o("grid-column","auto")]}}),n("col-span",{handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("grid-column",`span ${l} / span ${l}`)],staticValues:{full:[o("grid-column","1 / -1")]}}),n("col-start",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-column-start"],handle:l=>[o("grid-column-start",l)],staticValues:{auto:[o("grid-column-start","auto")]}}),n("col-end",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-column-end"],handle:l=>[o("grid-column-end",l)],staticValues:{auto:[o("grid-column-end","auto")]}}),i("col-span",()=>[{values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-column-end"]}]),n("row",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-row"],handle:l=>[o("grid-row",l)],staticValues:{auto:[o("grid-row","auto")]}}),n("row-span",{themeKeys:[],handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("grid-row",`span ${l} / span ${l}`)],staticValues:{full:[o("grid-row","1 / -1")]}}),n("row-start",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-row-start"],handle:l=>[o("grid-row-start",l)],staticValues:{auto:[o("grid-row-start","auto")]}}),n("row-end",{supportsNegative:!0,handleBareValue:({value:l})=>P(l)?l:null,themeKeys:["--grid-row-end"],handle:l=>[o("grid-row-end",l)],staticValues:{auto:[o("grid-row-end","auto")]}}),i("row-span",()=>[{values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-row-end"]}]),e("float-start",[["float","inline-start"]]),e("float-end",[["float","inline-end"]]),e("float-right",[["float","right"]]),e("float-left",[["float","left"]]),e("float-none",[["float","none"]]),e("clear-start",[["clear","inline-start"]]),e("clear-end",[["clear","inline-end"]]),e("clear-right",[["clear","right"]]),e("clear-left",[["clear","left"]]),e("clear-both",[["clear","both"]]),e("clear-none",[["clear","none"]]);for(let[l,g]of[["m","margin"],["mx","margin-inline"],["my","margin-block"],["ms","margin-inline-start"],["me","margin-inline-end"],["mt","margin-top"],["mr","margin-right"],["mb","margin-bottom"],["ml","margin-left"]])e(`${l}-auto`,[[g,"auto"]]),a(l,["--margin","--spacing"],v=>[o(g,v)],{supportsNegative:!0});e("box-border",[["box-sizing","border-box"]]),e("box-content",[["box-sizing","content-box"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("overflow","hidden"),o("display","-webkit-box"),o("-webkit-box-orient","vertical"),o("-webkit-line-clamp",l)],staticValues:{none:[o("overflow","visible"),o("display","block"),o("-webkit-box-orient","horizontal"),o("-webkit-line-clamp","unset")]}}),i("line-clamp",()=>[{values:["1","2","3","4","5","6"],valueThemeKeys:["--line-clamp"]}]),e("block",[["display","block"]]),e("inline-block",[["display","inline-block"]]),e("inline",[["display","inline"]]),e("hidden",[["display","none"]]),e("inline-flex",[["display","inline-flex"]]),e("table",[["display","table"]]),e("inline-table",[["display","inline-table"]]),e("table-caption",[["display","table-caption"]]),e("table-cell",[["display","table-cell"]]),e("table-column",[["display","table-column"]]),e("table-column-group",[["display","table-column-group"]]),e("table-footer-group",[["display","table-footer-group"]]),e("table-header-group",[["display","table-header-group"]]),e("table-row-group",[["display","table-row-group"]]),e("table-row",[["display","table-row"]]),e("flow-root",[["display","flow-root"]]),e("flex",[["display","flex"]]),e("grid",[["display","grid"]]),e("inline-grid",[["display","inline-grid"]]),e("contents",[["display","contents"]]),e("list-item",[["display","list-item"]]),e("field-sizing-content",[["field-sizing","content"]]),e("field-sizing-fixed",[["field-sizing","fixed"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:l})=>{if(l===null)return null;let[g,v]=j(l,"/");return!P(g)||!P(v)?null:l},handle:l=>[o("aspect-ratio",l)],staticValues:{auto:[o("aspect-ratio","auto")],square:[o("aspect-ratio","1 / 1")]}});for(let[l,g]of[["full","100%"],["svw","100svw"],["lvw","100lvw"],["dvw","100dvw"],["svh","100svh"],["lvh","100lvh"],["dvh","100dvh"],["min","min-content"],["max","max-content"],["fit","fit-content"]])e(`size-${l}`,[["--tw-sort","size"],["width",g],["height",g]]),e(`w-${l}`,[["width",g]]),e(`h-${l}`,[["height",g]]),e(`min-w-${l}`,[["min-width",g]]),e(`min-h-${l}`,[["min-height",g]]),e(`max-w-${l}`,[["max-width",g]]),e(`max-h-${l}`,[["max-height",g]]);e("size-auto",[["--tw-sort","size"],["width","auto"],["height","auto"]]),e("w-auto",[["width","auto"]]),e("h-auto",[["height","auto"]]),e("min-w-auto",[["min-width","auto"]]),e("min-h-auto",[["min-height","auto"]]),e("h-lh",[["height","1lh"]]),e("min-h-lh",[["min-height","1lh"]]),e("max-h-lh",[["max-height","1lh"]]),e("w-screen",[["width","100vw"]]),e("min-w-screen",[["min-width","100vw"]]),e("max-w-screen",[["max-width","100vw"]]),e("h-screen",[["height","100vh"]]),e("min-h-screen",[["min-height","100vh"]]),e("max-h-screen",[["max-height","100vh"]]),e("max-w-none",[["max-width","none"]]),e("max-h-none",[["max-height","none"]]),a("size",["--size","--spacing"],l=>[o("--tw-sort","size"),o("width",l),o("height",l)],{supportsFractions:!0});for(let[l,g,v]of[["w",["--width","--spacing","--container"],"width"],["min-w",["--min-width","--spacing","--container"],"min-width"],["max-w",["--max-width","--spacing","--container"],"max-width"],["h",["--height","--spacing"],"height"],["min-h",["--min-height","--height","--spacing"],"min-height"],["max-h",["--max-height","--height","--spacing"],"max-height"]])a(l,g,C=>[o(v,C)],{supportsFractions:!0});r.static("container",()=>{let l=[...t.namespace("--breakpoint").values()];l.sort((v,C)=>Ve(v,C,"asc"));let g=[o("--tw-sort","--tw-container-component"),o("width","100%")];for(let v of l)g.push(F("@media",`(width >= ${v})`,[o("max-width",v)]));return g}),e("flex-auto",[["flex","auto"]]),e("flex-initial",[["flex","0 auto"]]),e("flex-none",[["flex","none"]]),r.functional("flex",l=>{if(l.value){if(l.value.kind==="arbitrary")return l.modifier?void 0:[o("flex",l.value.value)];if(l.value.fraction){let[g,v]=j(l.value.fraction,"/");return!P(g)||!P(v)?void 0:[o("flex",`calc(${l.value.fraction} * 100%)`)]}if(P(l.value.value))return l.modifier?void 0:[o("flex",l.value.value)]}}),i("flex",()=>[{supportsFractions:!0},{values:Array.from({length:12},(l,g)=>`${g+1}`)}]),n("shrink",{defaultValue:"1",handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("flex-shrink",l)]}),n("grow",{defaultValue:"1",handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("flex-grow",l)]}),i("shrink",()=>[{values:["0"],valueThemeKeys:[],hasDefaultValue:!0}]),i("grow",()=>[{values:["0"],valueThemeKeys:[],hasDefaultValue:!0}]),e("basis-auto",[["flex-basis","auto"]]),e("basis-full",[["flex-basis","100%"]]),a("basis",["--flex-basis","--spacing","--container"],l=>[o("flex-basis",l)],{supportsFractions:!0}),e("table-auto",[["table-layout","auto"]]),e("table-fixed",[["table-layout","fixed"]]),e("caption-top",[["caption-side","top"]]),e("caption-bottom",[["caption-side","bottom"]]),e("border-collapse",[["border-collapse","collapse"]]),e("border-separate",[["border-collapse","separate"]]);let p=()=>W([S("--tw-border-spacing-x","0",""),S("--tw-border-spacing-y","0","")]);a("border-spacing",["--border-spacing","--spacing"],l=>[p(),o("--tw-border-spacing-x",l),o("--tw-border-spacing-y",l),o("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-x",["--border-spacing","--spacing"],l=>[p(),o("--tw-border-spacing-x",l),o("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-y",["--border-spacing","--spacing"],l=>[p(),o("--tw-border-spacing-y",l),o("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),n("origin",{themeKeys:["--transform-origin"],handle:l=>[o("transform-origin",l)],staticValues:{center:[o("transform-origin","center")],top:[o("transform-origin","top")],"top-right":[o("transform-origin","100% 0")],right:[o("transform-origin","100%")],"bottom-right":[o("transform-origin","100% 100%")],bottom:[o("transform-origin","bottom")],"bottom-left":[o("transform-origin","0 100%")],left:[o("transform-origin","0")],"top-left":[o("transform-origin","0 0")]}}),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:l=>[o("perspective-origin",l)],staticValues:{center:[o("perspective-origin","center")],top:[o("perspective-origin","top")],"top-right":[o("perspective-origin","100% 0")],right:[o("perspective-origin","100%")],"bottom-right":[o("perspective-origin","100% 100%")],bottom:[o("perspective-origin","bottom")],"bottom-left":[o("perspective-origin","0 100%")],left:[o("perspective-origin","0")],"top-left":[o("perspective-origin","0 0")]}}),n("perspective",{themeKeys:["--perspective"],handle:l=>[o("perspective",l)],staticValues:{none:[o("perspective","none")]}});let u=()=>W([S("--tw-translate-x","0"),S("--tw-translate-y","0"),S("--tw-translate-z","0")]);e("translate-none",[["translate","none"]]),e("-translate-full",[u,["--tw-translate-x","-100%"],["--tw-translate-y","-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e("translate-full",[u,["--tw-translate-x","100%"],["--tw-translate-y","100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a("translate",["--translate","--spacing"],l=>[u(),o("--tw-translate-x",l),o("--tw-translate-y",l),o("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let l of["x","y"])e(`-translate-${l}-full`,[u,[`--tw-translate-${l}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e(`translate-${l}-full`,[u,[`--tw-translate-${l}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a(`translate-${l}`,["--translate","--spacing"],g=>[u(),o(`--tw-translate-${l}`,g),o("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});a("translate-z",["--translate","--spacing"],l=>[u(),o("--tw-translate-z",l),o("translate","var(--tw-translate-x) var(--tw-translate-y) var(--tw-translate-z)")],{supportsNegative:!0}),e("translate-3d",[u,["translate","var(--tw-translate-x) var(--tw-translate-y) var(--tw-translate-z)"]]);let f=()=>W([S("--tw-scale-x","1"),S("--tw-scale-y","1"),S("--tw-scale-z","1")]);e("scale-none",[["scale","none"]]);function m({negative:l}){return g=>{if(!g.value||g.modifier)return;let v;return g.value.kind==="arbitrary"?(v=g.value.value,v=l?`calc(${v} * -1)`:v,[o("scale",v)]):(v=t.resolve(g.value.value,["--scale"]),!v&&P(g.value.value)&&(v=`${g.value.value}%`),v?(v=l?`calc(${v} * -1)`:v,[f(),o("--tw-scale-x",v),o("--tw-scale-y",v),o("--tw-scale-z",v),o("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}r.functional("-scale",m({negative:!0})),r.functional("scale",m({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let l of["x","y","z"])n(`scale-${l}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:g})=>P(g)?`${g}%`:null,handle:g=>[f(),o(`--tw-scale-${l}`,g),o("scale",`var(--tw-scale-x) var(--tw-scale-y)${l==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${l}`,()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);e("scale-3d",[f,["scale","var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z)"]]),e("rotate-none",[["rotate","none"]]);function d({negative:l}){return g=>{if(!g.value||g.modifier)return;let v;if(g.value.kind==="arbitrary"){v=g.value.value;let C=g.value.dataType??H(v,["angle","vector"]);if(C==="vector")return[o("rotate",`${v} var(--tw-rotate)`)];if(C!=="angle")return[o("rotate",l?`calc(${v} * -1)`:v)]}else if(v=t.resolve(g.value.value,["--rotate"]),!v&&P(g.value.value)&&(v=`${g.value.value}deg`),!v)return;return[o("rotate",l?`calc(${v} * -1)`:v)]}}r.functional("-rotate",d({negative:!0})),r.functional("rotate",d({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let l=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),g=()=>W([S("--tw-rotate-x"),S("--tw-rotate-y"),S("--tw-rotate-z"),S("--tw-skew-x"),S("--tw-skew-y")]);for(let v of["x","y","z"])n(`rotate-${v}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:C})=>P(C)?`${C}deg`:null,handle:C=>[g(),o(`--tw-rotate-${v}`,`rotate${v.toUpperCase()}(${C})`),o("transform",l)]}),i(`rotate-${v}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>P(v)?`${v}deg`:null,handle:v=>[g(),o("--tw-skew-x",`skewX(${v})`),o("--tw-skew-y",`skewY(${v})`),o("transform",l)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>P(v)?`${v}deg`:null,handle:v=>[g(),o("--tw-skew-x",`skewX(${v})`),o("transform",l)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>P(v)?`${v}deg`:null,handle:v=>[g(),o("--tw-skew-y",`skewY(${v})`),o("transform",l)]}),i("skew",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),i("skew-x",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),i("skew-y",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),r.functional("transform",v=>{if(v.modifier)return;let C=null;if(v.value?v.value.kind==="arbitrary"&&(C=v.value.value):C=l,C!==null)return[g(),o("transform",C)]}),i("transform",()=>[{hasDefaultValue:!0}]),e("transform-cpu",[["transform",l]]),e("transform-gpu",[["transform",`translateZ(0) ${l}`]]),e("transform-none",[["transform","none"]])}e("transform-flat",[["transform-style","flat"]]),e("transform-3d",[["transform-style","preserve-3d"]]),e("transform-content",[["transform-box","content-box"]]),e("transform-border",[["transform-box","border-box"]]),e("transform-fill",[["transform-box","fill-box"]]),e("transform-stroke",[["transform-box","stroke-box"]]),e("transform-view",[["transform-box","view-box"]]),e("backface-visible",[["backface-visibility","visible"]]),e("backface-hidden",[["backface-visibility","hidden"]]);for(let l of["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out"])e(`cursor-${l}`,[["cursor",l]]);n("cursor",{themeKeys:["--cursor"],handle:l=>[o("cursor",l)]});for(let l of["auto","none","manipulation"])e(`touch-${l}`,[["touch-action",l]]);let c=()=>W([S("--tw-pan-x"),S("--tw-pan-y"),S("--tw-pinch-zoom")]);for(let l of["x","left","right"])e(`touch-pan-${l}`,[c,["--tw-pan-x",`pan-${l}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let l of["y","up","down"])e(`touch-pan-${l}`,[c,["--tw-pan-y",`pan-${l}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);e("touch-pinch-zoom",[c,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let l of["none","text","all","auto"])e(`select-${l}`,[["-webkit-user-select",l],["user-select",l]]);e("resize-none",[["resize","none"]]),e("resize-x",[["resize","horizontal"]]),e("resize-y",[["resize","vertical"]]),e("resize",[["resize","both"]]),e("snap-none",[["scroll-snap-type","none"]]);let w=()=>W([S("--tw-scroll-snap-strictness","proximity","*")]);for(let l of["x","y","both"])e(`snap-${l}`,[w,["scroll-snap-type",`${l} var(--tw-scroll-snap-strictness)`]]);e("snap-mandatory",[w,["--tw-scroll-snap-strictness","mandatory"]]),e("snap-proximity",[w,["--tw-scroll-snap-strictness","proximity"]]),e("snap-align-none",[["scroll-snap-align","none"]]),e("snap-start",[["scroll-snap-align","start"]]),e("snap-end",[["scroll-snap-align","end"]]),e("snap-center",[["scroll-snap-align","center"]]),e("snap-normal",[["scroll-snap-stop","normal"]]),e("snap-always",[["scroll-snap-stop","always"]]);for(let[l,g]of[["scroll-m","scroll-margin"],["scroll-mx","scroll-margin-inline"],["scroll-my","scroll-margin-block"],["scroll-ms","scroll-margin-inline-start"],["scroll-me","scroll-margin-inline-end"],["scroll-mt","scroll-margin-top"],["scroll-mr","scroll-margin-right"],["scroll-mb","scroll-margin-bottom"],["scroll-ml","scroll-margin-left"]])a(l,["--scroll-margin","--spacing"],v=>[o(g,v)],{supportsNegative:!0});for(let[l,g]of[["scroll-p","scroll-padding"],["scroll-px","scroll-padding-inline"],["scroll-py","scroll-padding-block"],["scroll-ps","scroll-padding-inline-start"],["scroll-pe","scroll-padding-inline-end"],["scroll-pt","scroll-padding-top"],["scroll-pr","scroll-padding-right"],["scroll-pb","scroll-padding-bottom"],["scroll-pl","scroll-padding-left"]])a(l,["--scroll-padding","--spacing"],v=>[o(g,v)]);e("list-inside",[["list-style-position","inside"]]),e("list-outside",[["list-style-position","outside"]]),n("list",{themeKeys:["--list-style-type"],handle:l=>[o("list-style-type",l)],staticValues:{none:[o("list-style-type","none")],disc:[o("list-style-type","disc")],decimal:[o("list-style-type","decimal")]}}),n("list-image",{themeKeys:["--list-style-image"],handle:l=>[o("list-style-image",l)],staticValues:{none:[o("list-style-image","none")]}}),e("appearance-none",[["appearance","none"]]),e("appearance-auto",[["appearance","auto"]]),e("scheme-normal",[["color-scheme","normal"]]),e("scheme-dark",[["color-scheme","dark"]]),e("scheme-light",[["color-scheme","light"]]),e("scheme-light-dark",[["color-scheme","light dark"]]),e("scheme-only-dark",[["color-scheme","only dark"]]),e("scheme-only-light",[["color-scheme","only light"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:l})=>P(l)?l:null,handle:l=>[o("columns",l)],staticValues:{auto:[o("columns","auto")]}}),i("columns",()=>[{values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:["--columns","--container"]}]);for(let l of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-before-${l}`,[["break-before",l]]);for(let l of["auto","avoid","avoid-page","avoid-column"])e(`break-inside-${l}`,[["break-inside",l]]);for(let l of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-after-${l}`,[["break-after",l]]);e("grid-flow-row",[["grid-auto-flow","row"]]),e("grid-flow-col",[["grid-auto-flow","column"]]),e("grid-flow-dense",[["grid-auto-flow","dense"]]),e("grid-flow-row-dense",[["grid-auto-flow","row dense"]]),e("grid-flow-col-dense",[["grid-auto-flow","column dense"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:l=>[o("grid-auto-columns",l)],staticValues:{auto:[o("grid-auto-columns","auto")],min:[o("grid-auto-columns","min-content")],max:[o("grid-auto-columns","max-content")],fr:[o("grid-auto-columns","minmax(0, 1fr)")]}}),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:l=>[o("grid-auto-rows",l)],staticValues:{auto:[o("grid-auto-rows","auto")],min:[o("grid-auto-rows","min-content")],max:[o("grid-auto-rows","max-content")],fr:[o("grid-auto-rows","minmax(0, 1fr)")]}}),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:l})=>Ct(l)?`repeat(${l}, minmax(0, 1fr))`:null,handle:l=>[o("grid-template-columns",l)],staticValues:{none:[o("grid-template-columns","none")],subgrid:[o("grid-template-columns","subgrid")]}}),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:l})=>Ct(l)?`repeat(${l}, minmax(0, 1fr))`:null,handle:l=>[o("grid-template-rows",l)],staticValues:{none:[o("grid-template-rows","none")],subgrid:[o("grid-template-rows","subgrid")]}}),i("grid-cols",()=>[{values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(l,g)=>`${g+1}`),valueThemeKeys:["--grid-template-rows"]}]),e("flex-row",[["flex-direction","row"]]),e("flex-row-reverse",[["flex-direction","row-reverse"]]),e("flex-col",[["flex-direction","column"]]),e("flex-col-reverse",[["flex-direction","column-reverse"]]),e("flex-wrap",[["flex-wrap","wrap"]]),e("flex-nowrap",[["flex-wrap","nowrap"]]),e("flex-wrap-reverse",[["flex-wrap","wrap-reverse"]]),e("place-content-center",[["place-content","center"]]),e("place-content-start",[["place-content","start"]]),e("place-content-end",[["place-content","end"]]),e("place-content-center-safe",[["place-content","safe center"]]),e("place-content-end-safe",[["place-content","safe end"]]),e("place-content-between",[["place-content","space-between"]]),e("place-content-around",[["place-content","space-around"]]),e("place-content-evenly",[["place-content","space-evenly"]]),e("place-content-baseline",[["place-content","baseline"]]),e("place-content-stretch",[["place-content","stretch"]]),e("place-items-center",[["place-items","center"]]),e("place-items-start",[["place-items","start"]]),e("place-items-end",[["place-items","end"]]),e("place-items-center-safe",[["place-items","safe center"]]),e("place-items-end-safe",[["place-items","safe end"]]),e("place-items-baseline",[["place-items","baseline"]]),e("place-items-stretch",[["place-items","stretch"]]),e("content-normal",[["align-content","normal"]]),e("content-center",[["align-content","center"]]),e("content-start",[["align-content","flex-start"]]),e("content-end",[["align-content","flex-end"]]),e("content-center-safe",[["align-content","safe center"]]),e("content-end-safe",[["align-content","safe flex-end"]]),e("content-between",[["align-content","space-between"]]),e("content-around",[["align-content","space-around"]]),e("content-evenly",[["align-content","space-evenly"]]),e("content-baseline",[["align-content","baseline"]]),e("content-stretch",[["align-content","stretch"]]),e("items-center",[["align-items","center"]]),e("items-start",[["align-items","flex-start"]]),e("items-end",[["align-items","flex-end"]]),e("items-center-safe",[["align-items","safe center"]]),e("items-end-safe",[["align-items","safe flex-end"]]),e("items-baseline",[["align-items","baseline"]]),e("items-baseline-last",[["align-items","last baseline"]]),e("items-stretch",[["align-items","stretch"]]),e("justify-normal",[["justify-content","normal"]]),e("justify-center",[["justify-content","center"]]),e("justify-start",[["justify-content","flex-start"]]),e("justify-end",[["justify-content","flex-end"]]),e("justify-center-safe",[["justify-content","safe center"]]),e("justify-end-safe",[["justify-content","safe flex-end"]]),e("justify-between",[["justify-content","space-between"]]),e("justify-around",[["justify-content","space-around"]]),e("justify-evenly",[["justify-content","space-evenly"]]),e("justify-baseline",[["justify-content","baseline"]]),e("justify-stretch",[["justify-content","stretch"]]),e("justify-items-normal",[["justify-items","normal"]]),e("justify-items-center",[["justify-items","center"]]),e("justify-items-start",[["justify-items","start"]]),e("justify-items-end",[["justify-items","end"]]),e("justify-items-center-safe",[["justify-items","safe center"]]),e("justify-items-end-safe",[["justify-items","safe end"]]),e("justify-items-stretch",[["justify-items","stretch"]]),a("gap",["--gap","--spacing"],l=>[o("gap",l)]),a("gap-x",["--gap","--spacing"],l=>[o("column-gap",l)]),a("gap-y",["--gap","--spacing"],l=>[o("row-gap",l)]),a("space-x",["--space","--spacing"],l=>[W([S("--tw-space-x-reverse","0")]),G(":where(& > :not(:last-child))",[o("--tw-sort","row-gap"),o("--tw-space-x-reverse","0"),o("margin-inline-start",`calc(${l} * var(--tw-space-x-reverse))`),o("margin-inline-end",`calc(${l} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),a("space-y",["--space","--spacing"],l=>[W([S("--tw-space-y-reverse","0")]),G(":where(& > :not(:last-child))",[o("--tw-sort","column-gap"),o("--tw-space-y-reverse","0"),o("margin-block-start",`calc(${l} * var(--tw-space-y-reverse))`),o("margin-block-end",`calc(${l} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),e("space-x-reverse",[()=>W([S("--tw-space-x-reverse","0")]),()=>G(":where(& > :not(:last-child))",[o("--tw-sort","row-gap"),o("--tw-space-x-reverse","1")])]),e("space-y-reverse",[()=>W([S("--tw-space-y-reverse","0")]),()=>G(":where(& > :not(:last-child))",[o("--tw-sort","column-gap"),o("--tw-space-y-reverse","1")])]),e("accent-auto",[["accent-color","auto"]]),s("accent",{themeKeys:["--accent-color","--color"],handle:l=>[o("accent-color",l)]}),s("caret",{themeKeys:["--caret-color","--color"],handle:l=>[o("caret-color",l)]}),s("divide",{themeKeys:["--divide-color","--border-color","--color"],handle:l=>[G(":where(& > :not(:last-child))",[o("--tw-sort","divide-color"),o("border-color",l)])]}),e("place-self-auto",[["place-self","auto"]]),e("place-self-start",[["place-self","start"]]),e("place-self-end",[["place-self","end"]]),e("place-self-center",[["place-self","center"]]),e("place-self-end-safe",[["place-self","safe end"]]),e("place-self-center-safe",[["place-self","safe center"]]),e("place-self-stretch",[["place-self","stretch"]]),e("self-auto",[["align-self","auto"]]),e("self-start",[["align-self","flex-start"]]),e("self-end",[["align-self","flex-end"]]),e("self-center",[["align-self","center"]]),e("self-end-safe",[["align-self","safe flex-end"]]),e("self-center-safe",[["align-self","safe center"]]),e("self-stretch",[["align-self","stretch"]]),e("self-baseline",[["align-self","baseline"]]),e("self-baseline-last",[["align-self","last baseline"]]),e("justify-self-auto",[["justify-self","auto"]]),e("justify-self-start",[["justify-self","flex-start"]]),e("justify-self-end",[["justify-self","flex-end"]]),e("justify-self-center",[["justify-self","center"]]),e("justify-self-end-safe",[["justify-self","safe flex-end"]]),e("justify-self-center-safe",[["justify-self","safe center"]]),e("justify-self-stretch",[["justify-self","stretch"]]);for(let l of["auto","hidden","clip","visible","scroll"])e(`overflow-${l}`,[["overflow",l]]),e(`overflow-x-${l}`,[["overflow-x",l]]),e(`overflow-y-${l}`,[["overflow-y",l]]);for(let l of["auto","contain","none"])e(`overscroll-${l}`,[["overscroll-behavior",l]]),e(`overscroll-x-${l}`,[["overscroll-behavior-x",l]]),e(`overscroll-y-${l}`,[["overscroll-behavior-y",l]]);e("scroll-auto",[["scroll-behavior","auto"]]),e("scroll-smooth",[["scroll-behavior","smooth"]]),e("truncate",[["overflow","hidden"],["text-overflow","ellipsis"],["white-space","nowrap"]]),e("text-ellipsis",[["text-overflow","ellipsis"]]),e("text-clip",[["text-overflow","clip"]]),e("hyphens-none",[["-webkit-hyphens","none"],["hyphens","none"]]),e("hyphens-manual",[["-webkit-hyphens","manual"],["hyphens","manual"]]),e("hyphens-auto",[["-webkit-hyphens","auto"],["hyphens","auto"]]),e("whitespace-normal",[["white-space","normal"]]),e("whitespace-nowrap",[["white-space","nowrap"]]),e("whitespace-pre",[["white-space","pre"]]),e("whitespace-pre-line",[["white-space","pre-line"]]),e("whitespace-pre-wrap",[["white-space","pre-wrap"]]),e("whitespace-break-spaces",[["white-space","break-spaces"]]),e("text-wrap",[["text-wrap","wrap"]]),e("text-nowrap",[["text-wrap","nowrap"]]),e("text-balance",[["text-wrap","balance"]]),e("text-pretty",[["text-wrap","pretty"]]),e("break-normal",[["overflow-wrap","normal"],["word-break","normal"]]),e("break-all",[["word-break","break-all"]]),e("break-keep",[["word-break","keep-all"]]),e("wrap-anywhere",[["overflow-wrap","anywhere"]]),e("wrap-break-word",[["overflow-wrap","break-word"]]),e("wrap-normal",[["overflow-wrap","normal"]]);for(let[l,g]of[["rounded",["border-radius"]],["rounded-s",["border-start-start-radius","border-end-start-radius"]],["rounded-e",["border-start-end-radius","border-end-end-radius"]],["rounded-t",["border-top-left-radius","border-top-right-radius"]],["rounded-r",["border-top-right-radius","border-bottom-right-radius"]],["rounded-b",["border-bottom-right-radius","border-bottom-left-radius"]],["rounded-l",["border-top-left-radius","border-bottom-left-radius"]],["rounded-ss",["border-start-start-radius"]],["rounded-se",["border-start-end-radius"]],["rounded-ee",["border-end-end-radius"]],["rounded-es",["border-end-start-radius"]],["rounded-tl",["border-top-left-radius"]],["rounded-tr",["border-top-right-radius"]],["rounded-br",["border-bottom-right-radius"]],["rounded-bl",["border-bottom-left-radius"]]])n(l,{themeKeys:["--radius"],handle:v=>g.map(C=>o(C,v)),staticValues:{none:g.map(v=>o(v,"0")),full:g.map(v=>o(v,"calc(infinity * 1px)"))}});e("border-solid",[["--tw-border-style","solid"],["border-style","solid"]]),e("border-dashed",[["--tw-border-style","dashed"],["border-style","dashed"]]),e("border-dotted",[["--tw-border-style","dotted"],["border-style","dotted"]]),e("border-double",[["--tw-border-style","double"],["border-style","double"]]),e("border-hidden",[["--tw-border-style","hidden"],["border-style","hidden"]]),e("border-none",[["--tw-border-style","none"],["border-style","none"]]);{let g=function(v,C){r.functional(v,b=>{if(!b.value){if(b.modifier)return;let T=t.get(["--default-border-width"])??"1px",D=C.width(T);return D?[l(),...D]:void 0}if(b.value.kind==="arbitrary"){let T=b.value.value;switch(b.value.dataType??H(T,["color","line-width","length"])){case"line-width":case"length":{if(b.modifier)return;let V=C.width(T);return V?[l(),...V]:void 0}default:return T=X(T,b.modifier,t),T===null?void 0:C.color(T)}}{let T=te(b,t,["--border-color","--color"]);if(T)return C.color(T)}{if(b.modifier)return;let T=t.resolve(b.value.value,["--border-width"]);if(T){let D=C.width(T);return D?[l(),...D]:void 0}if(P(b.value.value)){let D=C.width(`${b.value.value}px`);return D?[l(),...D]:void 0}}}),i(v,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(b,T)=>`${T*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var _=g;let l=()=>W([S("--tw-border-style","solid")]);g("border",{width:v=>[o("border-style","var(--tw-border-style)"),o("border-width",v)],color:v=>[o("border-color",v)]}),g("border-x",{width:v=>[o("border-inline-style","var(--tw-border-style)"),o("border-inline-width",v)],color:v=>[o("border-inline-color",v)]}),g("border-y",{width:v=>[o("border-block-style","var(--tw-border-style)"),o("border-block-width",v)],color:v=>[o("border-block-color",v)]}),g("border-s",{width:v=>[o("border-inline-start-style","var(--tw-border-style)"),o("border-inline-start-width",v)],color:v=>[o("border-inline-start-color",v)]}),g("border-e",{width:v=>[o("border-inline-end-style","var(--tw-border-style)"),o("border-inline-end-width",v)],color:v=>[o("border-inline-end-color",v)]}),g("border-t",{width:v=>[o("border-top-style","var(--tw-border-style)"),o("border-top-width",v)],color:v=>[o("border-top-color",v)]}),g("border-r",{width:v=>[o("border-right-style","var(--tw-border-style)"),o("border-right-width",v)],color:v=>[o("border-right-color",v)]}),g("border-b",{width:v=>[o("border-bottom-style","var(--tw-border-style)"),o("border-bottom-width",v)],color:v=>[o("border-bottom-color",v)]}),g("border-l",{width:v=>[o("border-left-style","var(--tw-border-style)"),o("border-left-width",v)],color:v=>[o("border-left-color",v)]}),n("divide-x",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:v})=>P(v)?`${v}px`:null,handle:v=>[W([S("--tw-divide-x-reverse","0")]),G(":where(& > :not(:last-child))",[o("--tw-sort","divide-x-width"),l(),o("--tw-divide-x-reverse","0"),o("border-inline-style","var(--tw-border-style)"),o("border-inline-start-width",`calc(${v} * var(--tw-divide-x-reverse))`),o("border-inline-end-width",`calc(${v} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:v})=>P(v)?`${v}px`:null,handle:v=>[W([S("--tw-divide-y-reverse","0")]),G(":where(& > :not(:last-child))",[o("--tw-sort","divide-y-width"),l(),o("--tw-divide-y-reverse","0"),o("border-bottom-style","var(--tw-border-style)"),o("border-top-style","var(--tw-border-style)"),o("border-top-width",`calc(${v} * var(--tw-divide-y-reverse))`),o("border-bottom-width",`calc(${v} * calc(1 - var(--tw-divide-y-reverse)))`)])]}),i("divide-x",()=>[{values:["0","2","4","8"],valueThemeKeys:["--divide-width","--border-width"],hasDefaultValue:!0}]),i("divide-y",()=>[{values:["0","2","4","8"],valueThemeKeys:["--divide-width","--border-width"],hasDefaultValue:!0}]),e("divide-x-reverse",[()=>W([S("--tw-divide-x-reverse","0")]),()=>G(":where(& > :not(:last-child))",[o("--tw-divide-x-reverse","1")])]),e("divide-y-reverse",[()=>W([S("--tw-divide-y-reverse","0")]),()=>G(":where(& > :not(:last-child))",[o("--tw-divide-y-reverse","1")])]);for(let v of["solid","dashed","dotted","double","none"])e(`divide-${v}`,[()=>G(":where(& > :not(:last-child))",[o("--tw-sort","divide-style"),o("--tw-border-style",v),o("border-style",v)])])}e("bg-auto",[["background-size","auto"]]),e("bg-cover",[["background-size","cover"]]),e("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(l){if(l)return[o("background-size",l)]}}),e("bg-fixed",[["background-attachment","fixed"]]),e("bg-local",[["background-attachment","local"]]),e("bg-scroll",[["background-attachment","scroll"]]),e("bg-top",[["background-position","top"]]),e("bg-top-left",[["background-position","left top"]]),e("bg-top-right",[["background-position","right top"]]),e("bg-bottom",[["background-position","bottom"]]),e("bg-bottom-left",[["background-position","left bottom"]]),e("bg-bottom-right",[["background-position","right bottom"]]),e("bg-left",[["background-position","left"]]),e("bg-right",[["background-position","right"]]),e("bg-center",[["background-position","center"]]),n("bg-position",{handle(l){if(l)return[o("background-position",l)]}}),e("bg-repeat",[["background-repeat","repeat"]]),e("bg-no-repeat",[["background-repeat","no-repeat"]]),e("bg-repeat-x",[["background-repeat","repeat-x"]]),e("bg-repeat-y",[["background-repeat","repeat-y"]]),e("bg-repeat-round",[["background-repeat","round"]]),e("bg-repeat-space",[["background-repeat","space"]]),e("bg-none",[["background-image","none"]]);{let v=function(T){let D="in oklab";if(T?.kind==="named")switch(T.value){case"longer":case"shorter":case"increasing":case"decreasing":D=`in oklch ${T.value} hue`;break;default:D=`in ${T.value}`}else T?.kind==="arbitrary"&&(D=T.value);return D},C=function({negative:T}){return D=>{if(!D.value)return;if(D.value.kind==="arbitrary"){if(D.modifier)return;let M=D.value.value;switch(D.value.dataType??H(M,["angle"])){case"angle":return M=T?`calc(${M} * -1)`:`${M}`,[o("--tw-gradient-position",M),o("background-image",`linear-gradient(var(--tw-gradient-stops,${M}))`)];default:return T?void 0:[o("--tw-gradient-position",M),o("background-image",`linear-gradient(var(--tw-gradient-stops,${M}))`)]}}let V=D.value.value;if(!T&&g.has(V))V=g.get(V);else if(P(V))V=T?`calc(${V}deg * -1)`:`${V}deg`;else return;let R=v(D.modifier);return[o("--tw-gradient-position",`${V}`),J("@supports (background-image: linear-gradient(in lab, red, red))",[o("--tw-gradient-position",`${V} ${R}`)]),o("background-image","linear-gradient(var(--tw-gradient-stops))")]}},b=function({negative:T}){return D=>{if(D.value?.kind==="arbitrary"){if(D.modifier)return;let M=D.value.value;return[o("--tw-gradient-position",M),o("background-image",`conic-gradient(var(--tw-gradient-stops,${M}))`)]}let V=v(D.modifier);if(!D.value)return[o("--tw-gradient-position",V),o("background-image","conic-gradient(var(--tw-gradient-stops))")];let R=D.value.value;if(P(R))return R=T?`calc(${R}deg * -1)`:`${R}deg`,[o("--tw-gradient-position",`from ${R} ${V}`),o("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var z=v,Y=C,q=b;let l=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],g=new Map([["to-t","to top"],["to-tr","to top right"],["to-r","to right"],["to-br","to bottom right"],["to-b","to bottom"],["to-bl","to bottom left"],["to-l","to left"],["to-tl","to top left"]]);r.functional("-bg-linear",C({negative:!0})),r.functional("bg-linear",C({negative:!1})),i("bg-linear",()=>[{values:[...g.keys()],modifiers:l},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:l}]),r.functional("-bg-conic",b({negative:!0})),r.functional("bg-conic",b({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:l},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:l}]),r.functional("bg-radial",T=>{if(!T.value){let D=v(T.modifier);return[o("--tw-gradient-position",D),o("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(T.value.kind==="arbitrary"){if(T.modifier)return;let D=T.value.value;return[o("--tw-gradient-position",D),o("background-image",`radial-gradient(var(--tw-gradient-stops,${D}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:l}])}r.functional("bg",l=>{if(l.value){if(l.value.kind==="arbitrary"){let g=l.value.value;switch(l.value.dataType??H(g,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return l.modifier?void 0:[o("background-position",g)];case"bg-size":case"length":case"size":return l.modifier?void 0:[o("background-size",g)];case"image":case"url":return l.modifier?void 0:[o("background-image",g)];default:return g=X(g,l.modifier,t),g===null?void 0:[o("background-color",g)]}}{let g=te(l,t,["--background-color","--color"]);if(g)return[o("background-color",g)]}{if(l.modifier)return;let g=t.resolve(l.value.value,["--background-image"]);if(g)return[o("background-image",g)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let h=()=>W([S("--tw-gradient-position"),S("--tw-gradient-from","#0000",""),S("--tw-gradient-via","#0000",""),S("--tw-gradient-to","#0000",""),S("--tw-gradient-stops"),S("--tw-gradient-via-stops"),S("--tw-gradient-from-position","0%",""),S("--tw-gradient-via-position","50%",""),S("--tw-gradient-to-position","100%","")]);function y(l,g){r.functional(l,v=>{if(v.value){if(v.value.kind==="arbitrary"){let C=v.value.value;switch(v.value.dataType??H(C,["color","length","percentage"])){case"length":case"percentage":return v.modifier?void 0:g.position(C);default:return C=X(C,v.modifier,t),C===null?void 0:g.color(C)}}{let C=te(v,t,["--background-color","--color"]);if(C)return g.color(C)}{if(v.modifier)return;let C=t.resolve(v.value.value,["--gradient-color-stop-positions"]);if(C)return g.position(C);if(v.value.value[v.value.value.length-1]==="%"&&P(v.value.value.slice(0,-1)))return g.position(v.value.value)}}}),i(l,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)},{values:Array.from({length:21},(v,C)=>`${C*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}y("from",{color:l=>[h(),o("--tw-sort","--tw-gradient-from"),o("--tw-gradient-from",l),o("--tw-gradient-stops","var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))")],position:l=>[h(),o("--tw-gradient-from-position",l)]}),e("via-none",[["--tw-gradient-via-stops","initial"]]),y("via",{color:l=>[h(),o("--tw-sort","--tw-gradient-via"),o("--tw-gradient-via",l),o("--tw-gradient-via-stops","var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position)"),o("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:l=>[h(),o("--tw-gradient-via-position",l)]}),y("to",{color:l=>[h(),o("--tw-sort","--tw-gradient-to"),o("--tw-gradient-to",l),o("--tw-gradient-stops","var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))")],position:l=>[h(),o("--tw-gradient-to-position",l)]}),e("mask-none",[["mask-image","none"]]),r.functional("mask",l=>{if(!l.value||l.modifier||l.value.kind!=="arbitrary")return;let g=l.value.value;switch(l.value.dataType??H(g,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return l.modifier?void 0:[o("mask-position",g)];case"bg-size":case"length":case"size":return[o("mask-size",g)];case"image":case"url":default:return[o("mask-image",g)]}}),e("mask-add",[["mask-composite","add"]]),e("mask-subtract",[["mask-composite","subtract"]]),e("mask-intersect",[["mask-composite","intersect"]]),e("mask-exclude",[["mask-composite","exclude"]]),e("mask-alpha",[["mask-mode","alpha"]]),e("mask-luminance",[["mask-mode","luminance"]]),e("mask-match",[["mask-mode","match-source"]]),e("mask-type-alpha",[["mask-type","alpha"]]),e("mask-type-luminance",[["mask-type","luminance"]]),e("mask-auto",[["mask-size","auto"]]),e("mask-cover",[["mask-size","cover"]]),e("mask-contain",[["mask-size","contain"]]),n("mask-size",{handle(l){if(l)return[o("mask-size",l)]}}),e("mask-top",[["mask-position","top"]]),e("mask-top-left",[["mask-position","left top"]]),e("mask-top-right",[["mask-position","right top"]]),e("mask-bottom",[["mask-position","bottom"]]),e("mask-bottom-left",[["mask-position","left bottom"]]),e("mask-bottom-right",[["mask-position","right bottom"]]),e("mask-left",[["mask-position","left"]]),e("mask-right",[["mask-position","right"]]),e("mask-center",[["mask-position","center"]]),n("mask-position",{handle(l){if(l)return[o("mask-position",l)]}}),e("mask-repeat",[["mask-repeat","repeat"]]),e("mask-no-repeat",[["mask-repeat","no-repeat"]]),e("mask-repeat-x",[["mask-repeat","repeat-x"]]),e("mask-repeat-y",[["mask-repeat","repeat-y"]]),e("mask-repeat-round",[["mask-repeat","round"]]),e("mask-repeat-space",[["mask-repeat","space"]]),e("mask-clip-border",[["mask-clip","border-box"]]),e("mask-clip-padding",[["mask-clip","padding-box"]]),e("mask-clip-content",[["mask-clip","content-box"]]),e("mask-clip-fill",[["mask-clip","fill-box"]]),e("mask-clip-stroke",[["mask-clip","stroke-box"]]),e("mask-clip-view",[["mask-clip","view-box"]]),e("mask-no-clip",[["mask-clip","no-clip"]]),e("mask-origin-border",[["mask-origin","border-box"]]),e("mask-origin-padding",[["mask-origin","padding-box"]]),e("mask-origin-content",[["mask-origin","content-box"]]),e("mask-origin-fill",[["mask-origin","fill-box"]]),e("mask-origin-stroke",[["mask-origin","stroke-box"]]),e("mask-origin-view",[["mask-origin","view-box"]]);let x=()=>W([S("--tw-mask-linear","linear-gradient(#fff, #fff)"),S("--tw-mask-radial","linear-gradient(#fff, #fff)"),S("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function $(l,g){r.functional(l,v=>{if(v.value){if(v.value.kind==="arbitrary"){let C=v.value.value;switch(v.value.dataType??H(C,["length","percentage","color"])){case"color":return C=X(C,v.modifier,t),C===null?void 0:g.color(C);case"percentage":return v.modifier||!P(C.slice(0,-1))?void 0:g.position(C);default:return v.modifier?void 0:g.position(C)}}{let C=te(v,t,["--background-color","--color"]);if(C)return g.color(C)}{if(v.modifier)return;let C=H(v.value.value,["number","percentage"]);if(!C)return;switch(C){case"number":{let b=t.resolve(null,["--spacing"]);return!b||!ie(v.value.value)?void 0:g.position(`calc(${b} * ${v.value.value})`)}case"percentage":return P(v.value.value.slice(0,-1))?g.position(v.value.value):void 0;default:return}}}}),i(l,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)},{values:Array.from({length:21},(v,C)=>`${C*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(l,()=>[{values:Array.from({length:21},(v,C)=>`${C*5}%`)},{values:t.get(["--spacing"])?ct:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)}])}let A=()=>W([S("--tw-mask-left","linear-gradient(#fff, #fff)"),S("--tw-mask-right","linear-gradient(#fff, #fff)"),S("--tw-mask-bottom","linear-gradient(#fff, #fff)"),S("--tw-mask-top","linear-gradient(#fff, #fff)")]);function k(l,g,v){$(l,{color(C){let b=[x(),A(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let T of["top","right","bottom","left"])v[T]&&(b.push(o(`--tw-mask-${T}`,`linear-gradient(to ${T}, var(--tw-mask-${T}-from-color) var(--tw-mask-${T}-from-position), var(--tw-mask-${T}-to-color) var(--tw-mask-${T}-to-position))`)),b.push(W([S(`--tw-mask-${T}-from-position`,"0%"),S(`--tw-mask-${T}-to-position`,"100%"),S(`--tw-mask-${T}-from-color`,"black"),S(`--tw-mask-${T}-to-color`,"transparent")])),b.push(o(`--tw-mask-${T}-${g}-color`,C)));return b},position(C){let b=[x(),A(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let T of["top","right","bottom","left"])v[T]&&(b.push(o(`--tw-mask-${T}`,`linear-gradient(to ${T}, var(--tw-mask-${T}-from-color) var(--tw-mask-${T}-from-position), var(--tw-mask-${T}-to-color) var(--tw-mask-${T}-to-position))`)),b.push(W([S(`--tw-mask-${T}-from-position`,"0%"),S(`--tw-mask-${T}-to-position`,"100%"),S(`--tw-mask-${T}-from-color`,"black"),S(`--tw-mask-${T}-to-color`,"transparent")])),b.push(o(`--tw-mask-${T}-${g}-position`,C)));return b}})}k("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),k("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),k("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),k("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),k("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),k("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),k("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),k("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),k("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),k("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),k("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),k("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let U=()=>W([S("--tw-mask-linear-position","0deg"),S("--tw-mask-linear-from-position","0%"),S("--tw-mask-linear-to-position","100%"),S("--tw-mask-linear-from-color","black"),S("--tw-mask-linear-to-color","transparent")]);n("mask-linear",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(l){return P(l.value)?`calc(1deg * ${l.value})`:null},handleNegativeBareValue(l){return P(l.value)?`calc(1deg * -${l.value})`:null},handle:l=>[x(),U(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),o("--tw-mask-linear-position",l)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),$("mask-linear-from",{color:l=>[x(),U(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),o("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),o("--tw-mask-linear-from-color",l)],position:l=>[x(),U(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),o("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),o("--tw-mask-linear-from-position",l)]}),$("mask-linear-to",{color:l=>[x(),U(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),o("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),o("--tw-mask-linear-to-color",l)],position:l=>[x(),U(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),o("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),o("--tw-mask-linear-to-position",l)]});let N=()=>W([S("--tw-mask-radial-from-position","0%"),S("--tw-mask-radial-to-position","100%"),S("--tw-mask-radial-from-color","black"),S("--tw-mask-radial-to-color","transparent"),S("--tw-mask-radial-shape","ellipse"),S("--tw-mask-radial-size","farthest-corner"),S("--tw-mask-radial-position","center")]);e("mask-circle",[["--tw-mask-radial-shape","circle"]]),e("mask-ellipse",[["--tw-mask-radial-shape","ellipse"]]),e("mask-radial-closest-side",[["--tw-mask-radial-size","closest-side"]]),e("mask-radial-farthest-side",[["--tw-mask-radial-size","farthest-side"]]),e("mask-radial-closest-corner",[["--tw-mask-radial-size","closest-corner"]]),e("mask-radial-farthest-corner",[["--tw-mask-radial-size","farthest-corner"]]),e("mask-radial-at-top",[["--tw-mask-radial-position","top"]]),e("mask-radial-at-top-left",[["--tw-mask-radial-position","top left"]]),e("mask-radial-at-top-right",[["--tw-mask-radial-position","top right"]]),e("mask-radial-at-bottom",[["--tw-mask-radial-position","bottom"]]),e("mask-radial-at-bottom-left",[["--tw-mask-radial-position","bottom left"]]),e("mask-radial-at-bottom-right",[["--tw-mask-radial-position","bottom right"]]),e("mask-radial-at-left",[["--tw-mask-radial-position","left"]]),e("mask-radial-at-right",[["--tw-mask-radial-position","right"]]),e("mask-radial-at-center",[["--tw-mask-radial-position","center"]]),n("mask-radial-at",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:l=>[o("--tw-mask-radial-position",l)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:l=>[x(),N(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),o("--tw-mask-radial-size",l)]}),$("mask-radial-from",{color:l=>[x(),N(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),o("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),o("--tw-mask-radial-from-color",l)],position:l=>[x(),N(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),o("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),o("--tw-mask-radial-from-position",l)]}),$("mask-radial-to",{color:l=>[x(),N(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),o("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),o("--tw-mask-radial-to-color",l)],position:l=>[x(),N(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),o("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),o("--tw-mask-radial-to-position",l)]});let O=()=>W([S("--tw-mask-conic-position","0deg"),S("--tw-mask-conic-from-position","0%"),S("--tw-mask-conic-to-position","100%"),S("--tw-mask-conic-from-color","black"),S("--tw-mask-conic-to-color","transparent")]);n("mask-conic",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(l){return P(l.value)?`calc(1deg * ${l.value})`:null},handleNegativeBareValue(l){return P(l.value)?`calc(1deg * -${l.value})`:null},handle:l=>[x(),O(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),o("--tw-mask-conic-position",l)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),$("mask-conic-from",{color:l=>[x(),O(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),o("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),o("--tw-mask-conic-from-color",l)],position:l=>[x(),O(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),o("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),o("--tw-mask-conic-from-position",l)]}),$("mask-conic-to",{color:l=>[x(),O(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),o("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),o("--tw-mask-conic-to-color",l)],position:l=>[x(),O(),o("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),o("mask-composite","intersect"),o("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),o("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),o("--tw-mask-conic-to-position",l)]}),e("box-decoration-slice",[["-webkit-box-decoration-break","slice"],["box-decoration-break","slice"]]),e("box-decoration-clone",[["-webkit-box-decoration-break","clone"],["box-decoration-break","clone"]]),e("bg-clip-text",[["background-clip","text"]]),e("bg-clip-border",[["background-clip","border-box"]]),e("bg-clip-padding",[["background-clip","padding-box"]]),e("bg-clip-content",[["background-clip","content-box"]]),e("bg-origin-border",[["background-origin","border-box"]]),e("bg-origin-padding",[["background-origin","padding-box"]]),e("bg-origin-content",[["background-origin","content-box"]]);for(let l of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])e(`bg-blend-${l}`,[["background-blend-mode",l]]),e(`mix-blend-${l}`,[["mix-blend-mode",l]]);e("mix-blend-plus-darker",[["mix-blend-mode","plus-darker"]]),e("mix-blend-plus-lighter",[["mix-blend-mode","plus-lighter"]]),e("fill-none",[["fill","none"]]),r.functional("fill",l=>{if(!l.value)return;if(l.value.kind==="arbitrary"){let v=X(l.value.value,l.modifier,t);return v===null?void 0:[o("fill",v)]}let g=te(l,t,["--fill","--color"]);if(g)return[o("fill",g)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)}]),e("stroke-none",[["stroke","none"]]),r.functional("stroke",l=>{if(l.value){if(l.value.kind==="arbitrary"){let g=l.value.value;switch(l.value.dataType??H(g,["color","number","length","percentage"])){case"number":case"length":case"percentage":return l.modifier?void 0:[o("stroke-width",g)];default:return g=X(l.value.value,l.modifier,t),g===null?void 0:[o("stroke",g)]}}{let g=te(l,t,["--stroke","--color"]);if(g)return[o("stroke",g)]}{let g=t.resolve(l.value.value,["--stroke-width"]);if(g)return[o("stroke-width",g)];if(P(l.value.value))return[o("stroke-width",l.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:["0","1","2","3"],valueThemeKeys:["--stroke-width"]}]),e("object-contain",[["object-fit","contain"]]),e("object-cover",[["object-fit","cover"]]),e("object-fill",[["object-fit","fill"]]),e("object-none",[["object-fit","none"]]),e("object-scale-down",[["object-fit","scale-down"]]),n("object",{themeKeys:["--object-position"],handle:l=>[o("object-position",l)],staticValues:{top:[o("object-position","top")],"top-left":[o("object-position","left top")],"top-right":[o("object-position","right top")],bottom:[o("object-position","bottom")],"bottom-left":[o("object-position","left bottom")],"bottom-right":[o("object-position","right bottom")],left:[o("object-position","left")],right:[o("object-position","right")],center:[o("object-position","center")]}});for(let[l,g]of[["p","padding"],["px","padding-inline"],["py","padding-block"],["ps","padding-inline-start"],["pe","padding-inline-end"],["pt","padding-top"],["pr","padding-right"],["pb","padding-bottom"],["pl","padding-left"]])a(l,["--padding","--spacing"],v=>[o(g,v)]);e("text-left",[["text-align","left"]]),e("text-center",[["text-align","center"]]),e("text-right",[["text-align","right"]]),e("text-justify",[["text-align","justify"]]),e("text-start",[["text-align","start"]]),e("text-end",[["text-align","end"]]),a("indent",["--text-indent","--spacing"],l=>[o("text-indent",l)],{supportsNegative:!0}),e("align-baseline",[["vertical-align","baseline"]]),e("align-top",[["vertical-align","top"]]),e("align-middle",[["vertical-align","middle"]]),e("align-bottom",[["vertical-align","bottom"]]),e("align-text-top",[["vertical-align","text-top"]]),e("align-text-bottom",[["vertical-align","text-bottom"]]),e("align-sub",[["vertical-align","sub"]]),e("align-super",[["vertical-align","super"]]),n("align",{themeKeys:[],handle:l=>[o("vertical-align",l)]}),r.functional("font",l=>{if(!(!l.value||l.modifier)){if(l.value.kind==="arbitrary"){let g=l.value.value;switch(l.value.dataType??H(g,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[o("font-family",g)];default:return[W([S("--tw-font-weight")]),o("--tw-font-weight",g),o("font-weight",g)]}}{let g=t.resolveWith(l.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(g){let[v,C={}]=g;return[o("font-family",v),o("font-feature-settings",C["--font-feature-settings"]),o("font-variation-settings",C["--font-variation-settings"])]}}{let g=t.resolve(l.value.value,["--font-weight"]);if(g)return[W([S("--tw-font-weight")]),o("--tw-font-weight",g),o("font-weight",g)]}}}),i("font",()=>[{values:[],valueThemeKeys:["--font"]},{values:[],valueThemeKeys:["--font-weight"]}]),e("uppercase",[["text-transform","uppercase"]]),e("lowercase",[["text-transform","lowercase"]]),e("capitalize",[["text-transform","capitalize"]]),e("normal-case",[["text-transform","none"]]),e("italic",[["font-style","italic"]]),e("not-italic",[["font-style","normal"]]),e("underline",[["text-decoration-line","underline"]]),e("overline",[["text-decoration-line","overline"]]),e("line-through",[["text-decoration-line","line-through"]]),e("no-underline",[["text-decoration-line","none"]]),e("font-stretch-normal",[["font-stretch","normal"]]),e("font-stretch-ultra-condensed",[["font-stretch","ultra-condensed"]]),e("font-stretch-extra-condensed",[["font-stretch","extra-condensed"]]),e("font-stretch-condensed",[["font-stretch","condensed"]]),e("font-stretch-semi-condensed",[["font-stretch","semi-condensed"]]),e("font-stretch-semi-expanded",[["font-stretch","semi-expanded"]]),e("font-stretch-expanded",[["font-stretch","expanded"]]),e("font-stretch-extra-expanded",[["font-stretch","extra-expanded"]]),e("font-stretch-ultra-expanded",[["font-stretch","ultra-expanded"]]),n("font-stretch",{handleBareValue:({value:l})=>{if(!l.endsWith("%"))return null;let g=Number(l.slice(0,-1));return!P(g)||Number.isNaN(g)||g<50||g>200?null:l},handle:l=>[o("font-stretch",l)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),s("placeholder",{themeKeys:["--background-color","--color"],handle:l=>[G("&::placeholder",[o("--tw-sort","placeholder-color"),o("color",l)])]}),e("decoration-solid",[["text-decoration-style","solid"]]),e("decoration-double",[["text-decoration-style","double"]]),e("decoration-dotted",[["text-decoration-style","dotted"]]),e("decoration-dashed",[["text-decoration-style","dashed"]]),e("decoration-wavy",[["text-decoration-style","wavy"]]),e("decoration-auto",[["text-decoration-thickness","auto"]]),e("decoration-from-font",[["text-decoration-thickness","from-font"]]),r.functional("decoration",l=>{if(l.value){if(l.value.kind==="arbitrary"){let g=l.value.value;switch(l.value.dataType??H(g,["color","length","percentage"])){case"length":case"percentage":return l.modifier?void 0:[o("text-decoration-thickness",g)];default:return g=X(g,l.modifier,t),g===null?void 0:[o("text-decoration-color",g)]}}{let g=t.resolve(l.value.value,["--text-decoration-thickness"]);if(g)return l.modifier?void 0:[o("text-decoration-thickness",g)];if(P(l.value.value))return l.modifier?void 0:[o("text-decoration-thickness",`${l.value.value}px`)]}{let g=te(l,t,["--text-decoration-color","--color"]);if(g)return[o("text-decoration-color",g)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),n("animate",{themeKeys:["--animate"],handle:l=>[o("animation",l)],staticValues:{none:[o("animation","none")]}});{let l=["var(--tw-blur,)","var(--tw-brightness,)","var(--tw-contrast,)","var(--tw-grayscale,)","var(--tw-hue-rotate,)","var(--tw-invert,)","var(--tw-saturate,)","var(--tw-sepia,)","var(--tw-drop-shadow,)"].join(" "),g=["var(--tw-backdrop-blur,)","var(--tw-backdrop-brightness,)","var(--tw-backdrop-contrast,)","var(--tw-backdrop-grayscale,)","var(--tw-backdrop-hue-rotate,)","var(--tw-backdrop-invert,)","var(--tw-backdrop-opacity,)","var(--tw-backdrop-saturate,)","var(--tw-backdrop-sepia,)"].join(" "),v=()=>W([S("--tw-blur"),S("--tw-brightness"),S("--tw-contrast"),S("--tw-grayscale"),S("--tw-hue-rotate"),S("--tw-invert"),S("--tw-opacity"),S("--tw-saturate"),S("--tw-sepia"),S("--tw-drop-shadow"),S("--tw-drop-shadow-color"),S("--tw-drop-shadow-alpha","100%",""),S("--tw-drop-shadow-size")]),C=()=>W([S("--tw-backdrop-blur"),S("--tw-backdrop-brightness"),S("--tw-backdrop-contrast"),S("--tw-backdrop-grayscale"),S("--tw-backdrop-hue-rotate"),S("--tw-backdrop-invert"),S("--tw-backdrop-opacity"),S("--tw-backdrop-saturate"),S("--tw-backdrop-sepia")]);r.functional("filter",b=>{if(!b.modifier){if(b.value===null)return[v(),o("filter",l)];if(b.value.kind==="arbitrary")return[o("filter",b.value.value)];switch(b.value.value){case"none":return[o("filter","none")]}}}),r.functional("backdrop-filter",b=>{if(!b.modifier){if(b.value===null)return[C(),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)];if(b.value.kind==="arbitrary")return[o("-webkit-backdrop-filter",b.value.value),o("backdrop-filter",b.value.value)];switch(b.value.value){case"none":return[o("-webkit-backdrop-filter","none"),o("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:b=>[v(),o("--tw-blur",`blur(${b})`),o("filter",l)],staticValues:{none:[v(),o("--tw-blur"," "),o("filter",l)]}}),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:b=>[C(),o("--tw-backdrop-blur",`blur(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)],staticValues:{none:[C(),o("--tw-backdrop-blur"," "),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}}),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[v(),o("--tw-brightness",`brightness(${b})`),o("filter",l)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[C(),o("--tw-backdrop-brightness",`brightness(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("brightness",()=>[{values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--brightness"]}]),i("backdrop-brightness",()=>[{values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--backdrop-brightness","--brightness"]}]),n("contrast",{themeKeys:["--contrast"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[v(),o("--tw-contrast",`contrast(${b})`),o("filter",l)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[C(),o("--tw-backdrop-contrast",`contrast(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("contrast",()=>[{values:["0","50","75","100","125","150","200"],valueThemeKeys:["--contrast"]}]),i("backdrop-contrast",()=>[{values:["0","50","75","100","125","150","200"],valueThemeKeys:["--backdrop-contrast","--contrast"]}]),n("grayscale",{themeKeys:["--grayscale"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),o("--tw-grayscale",`grayscale(${b})`),o("filter",l)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),o("--tw-backdrop-grayscale",`grayscale(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("grayscale",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--grayscale"],hasDefaultValue:!0}]),i("backdrop-grayscale",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--backdrop-grayscale","--grayscale"],hasDefaultValue:!0}]),n("hue-rotate",{supportsNegative:!0,themeKeys:["--hue-rotate"],handleBareValue:({value:b})=>P(b)?`${b}deg`:null,handle:b=>[v(),o("--tw-hue-rotate",`hue-rotate(${b})`),o("filter",l)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:b})=>P(b)?`${b}deg`:null,handle:b=>[C(),o("--tw-backdrop-hue-rotate",`hue-rotate(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("hue-rotate",()=>[{values:["0","15","30","60","90","180"],valueThemeKeys:["--hue-rotate"]}]),i("backdrop-hue-rotate",()=>[{values:["0","15","30","60","90","180"],valueThemeKeys:["--backdrop-hue-rotate","--hue-rotate"]}]),n("invert",{themeKeys:["--invert"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),o("--tw-invert",`invert(${b})`),o("filter",l)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),o("--tw-backdrop-invert",`invert(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("invert",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--invert"],hasDefaultValue:!0}]),i("backdrop-invert",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--backdrop-invert","--invert"],hasDefaultValue:!0}]),n("saturate",{themeKeys:["--saturate"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[v(),o("--tw-saturate",`saturate(${b})`),o("filter",l)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,handle:b=>[C(),o("--tw-backdrop-saturate",`saturate(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("saturate",()=>[{values:["0","50","100","150","200"],valueThemeKeys:["--saturate"]}]),i("backdrop-saturate",()=>[{values:["0","50","100","150","200"],valueThemeKeys:["--backdrop-saturate","--saturate"]}]),n("sepia",{themeKeys:["--sepia"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),o("--tw-sepia",`sepia(${b})`),o("filter",l)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:b})=>P(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),o("--tw-backdrop-sepia",`sepia(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("sepia",()=>[{values:["0","50","100"],valueThemeKeys:["--sepia"],hasDefaultValue:!0}]),i("backdrop-sepia",()=>[{values:["0","50","100"],valueThemeKeys:["--backdrop-sepia","--sepia"],hasDefaultValue:!0}]),e("drop-shadow-none",[v,["--tw-drop-shadow"," "],["filter",l]]),r.functional("drop-shadow",b=>{let T;if(b.modifier&&(b.modifier.kind==="arbitrary"?T=b.modifier.value:P(b.modifier.value)&&(T=`${b.modifier.value}%`)),!b.value){let D=t.get(["--drop-shadow"]),V=t.resolve(null,["--drop-shadow"]);return D===null||V===null?void 0:[v(),o("--tw-drop-shadow-alpha",T),...ft("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),o("--tw-drop-shadow",j(V,",").map(R=>`drop-shadow(${R})`).join(" ")),o("filter",l)]}if(b.value.kind==="arbitrary"){let D=b.value.value;switch(b.value.dataType??H(D,["color"])){case"color":return D=X(D,b.modifier,t),D===null?void 0:[v(),o("--tw-drop-shadow-color",Q(D,"var(--tw-drop-shadow-alpha)")),o("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return b.modifier&&!T?void 0:[v(),o("--tw-drop-shadow-alpha",T),...ft("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),o("--tw-drop-shadow","var(--tw-drop-shadow-size)"),o("filter",l)]}}{let D=t.get([`--drop-shadow-${b.value.value}`]),V=t.resolve(b.value.value,["--drop-shadow"]);if(D&&V)return b.modifier&&!T?void 0:T?[v(),o("--tw-drop-shadow-alpha",T),...ft("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),o("--tw-drop-shadow","var(--tw-drop-shadow-size)"),o("filter",l)]:[v(),o("--tw-drop-shadow-alpha",T),...ft("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),o("--tw-drop-shadow",j(V,",").map(R=>`drop-shadow(${R})`).join(" ")),o("filter",l)]}{let D=te(b,t,["--drop-shadow-color","--color"]);if(D)return D==="inherit"?[v(),o("--tw-drop-shadow-color","inherit"),o("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[v(),o("--tw-drop-shadow-color",Q(D,"var(--tw-drop-shadow-alpha)")),o("--tw-drop-shadow","var(--tw-drop-shadow-size)")]}}),i("drop-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--drop-shadow-color","--color"],modifiers:Array.from({length:21},(b,T)=>`${T*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:b})=>et(b)?`${b}%`:null,handle:b=>[C(),o("--tw-backdrop-opacity",`opacity(${b})`),o("-webkit-backdrop-filter",g),o("backdrop-filter",g)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(b,T)=>`${T*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let l=`var(--tw-ease, ${t.resolve(null,["--default-transition-timing-function"])??"ease"})`,g=`var(--tw-duration, ${t.resolve(null,["--default-transition-duration"])??"0s"})`;n("transition",{defaultValue:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:v=>[o("transition-property",v),o("transition-timing-function",l),o("transition-duration",g)],staticValues:{none:[o("transition-property","none")],all:[o("transition-property","all"),o("transition-timing-function",l),o("transition-duration",g)],colors:[o("transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"),o("transition-timing-function",l),o("transition-duration",g)],opacity:[o("transition-property","opacity"),o("transition-timing-function",l),o("transition-duration",g)],shadow:[o("transition-property","box-shadow"),o("transition-timing-function",l),o("transition-duration",g)],transform:[o("transition-property","transform, translate, scale, rotate"),o("transition-timing-function",l),o("transition-duration",g)]}}),e("transition-discrete",[["transition-behavior","allow-discrete"]]),e("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:v})=>P(v)?`${v}ms`:null,themeKeys:["--transition-delay"],handle:v=>[o("transition-delay",v)]});{let v=()=>W([S("--tw-duration")]);e("duration-initial",[v,["--tw-duration","initial"]]),r.functional("duration",C=>{if(C.modifier||!C.value)return;let b=null;if(C.value.kind==="arbitrary"?b=C.value.value:(b=t.resolve(C.value.fraction??C.value.value,["--transition-duration"]),b===null&&P(C.value.value)&&(b=`${C.value.value}ms`)),b!==null)return[v(),o("--tw-duration",b),o("transition-duration",b)]})}i("delay",()=>[{values:["75","100","150","200","300","500","700","1000"],valueThemeKeys:["--transition-delay"]}]),i("duration",()=>[{values:["75","100","150","200","300","500","700","1000"],valueThemeKeys:["--transition-duration"]}])}{let l=()=>W([S("--tw-ease")]);n("ease",{themeKeys:["--ease"],handle:g=>[l(),o("--tw-ease",g),o("transition-timing-function",g)],staticValues:{initial:[l(),o("--tw-ease","initial")],linear:[l(),o("--tw-ease","linear"),o("transition-timing-function","linear")]}})}e("will-change-auto",[["will-change","auto"]]),e("will-change-scroll",[["will-change","scroll-position"]]),e("will-change-contents",[["will-change","contents"]]),e("will-change-transform",[["will-change","transform"]]),n("will-change",{themeKeys:[],handle:l=>[o("will-change",l)]}),e("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:["--content"],handle:l=>[W([S("--tw-content",'""')]),o("--tw-content",l),o("content","var(--tw-content)")]});{let l="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",g=()=>W([S("--tw-contain-size"),S("--tw-contain-layout"),S("--tw-contain-paint"),S("--tw-contain-style")]);e("contain-none",[["contain","none"]]),e("contain-content",[["contain","content"]]),e("contain-strict",[["contain","strict"]]),e("contain-size",[g,["--tw-contain-size","size"],["contain",l]]),e("contain-inline-size",[g,["--tw-contain-size","inline-size"],["contain",l]]),e("contain-layout",[g,["--tw-contain-layout","layout"],["contain",l]]),e("contain-paint",[g,["--tw-contain-paint","paint"],["contain",l]]),e("contain-style",[g,["--tw-contain-style","style"],["contain",l]]),n("contain",{themeKeys:[],handle:v=>[o("contain",v)]})}e("forced-color-adjust-none",[["forced-color-adjust","none"]]),e("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),a("leading",["--leading","--spacing"],l=>[W([S("--tw-leading")]),o("--tw-leading",l),o("line-height",l)],{staticValues:{none:[W([S("--tw-leading")]),o("--tw-leading","1"),o("line-height","1")]}}),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:l=>[W([S("--tw-tracking")]),o("--tw-tracking",l),o("letter-spacing",l)]}),e("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),e("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let l="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",g=()=>W([S("--tw-ordinal"),S("--tw-slashed-zero"),S("--tw-numeric-figure"),S("--tw-numeric-spacing"),S("--tw-numeric-fraction")]);e("normal-nums",[["font-variant-numeric","normal"]]),e("ordinal",[g,["--tw-ordinal","ordinal"],["font-variant-numeric",l]]),e("slashed-zero",[g,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",l]]),e("lining-nums",[g,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",l]]),e("oldstyle-nums",[g,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",l]]),e("proportional-nums",[g,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",l]]),e("tabular-nums",[g,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",l]]),e("diagonal-fractions",[g,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",l]]),e("stacked-fractions",[g,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",l]])}{let l=()=>W([S("--tw-outline-style","solid")]);r.static("outline-hidden",()=>[o("--tw-outline-style","none"),o("outline-style","none"),F("@media","(forced-colors: active)",[o("outline","2px solid transparent"),o("outline-offset","2px")])]),e("outline-none",[["--tw-outline-style","none"],["outline-style","none"]]),e("outline-solid",[["--tw-outline-style","solid"],["outline-style","solid"]]),e("outline-dashed",[["--tw-outline-style","dashed"],["outline-style","dashed"]]),e("outline-dotted",[["--tw-outline-style","dotted"],["outline-style","dotted"]]),e("outline-double",[["--tw-outline-style","double"],["outline-style","double"]]),r.functional("outline",g=>{if(g.value===null){if(g.modifier)return;let v=t.get(["--default-outline-width"])??"1px";return[l(),o("outline-style","var(--tw-outline-style)"),o("outline-width",v)]}if(g.value.kind==="arbitrary"){let v=g.value.value;switch(g.value.dataType??H(v,["color","length","number","percentage"])){case"length":case"number":case"percentage":return g.modifier?void 0:[l(),o("outline-style","var(--tw-outline-style)"),o("outline-width",v)];default:return v=X(v,g.modifier,t),v===null?void 0:[o("outline-color",v)]}}{let v=te(g,t,["--outline-color","--color"]);if(v)return[o("outline-color",v)]}{if(g.modifier)return;let v=t.resolve(g.value.value,["--outline-width"]);if(v)return[l(),o("outline-style","var(--tw-outline-style)"),o("outline-width",v)];if(P(g.value.value))return[l(),o("outline-style","var(--tw-outline-style)"),o("outline-width",`${g.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(g,v)=>`${v*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:g})=>P(g)?`${g}px`:null,handle:g=>[o("outline-offset",g)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:l})=>et(l)?`${l}%`:null,handle:l=>[o("opacity",l)]}),i("opacity",()=>[{values:Array.from({length:21},(l,g)=>`${g*5}`),valueThemeKeys:["--opacity"]}]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:l})=>P(l)?`${l}px`:null,handle:l=>[o("text-underline-offset",l)],staticValues:{auto:[o("text-underline-offset","auto")]}}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),r.functional("text",l=>{if(l.value){if(l.value.kind==="arbitrary"){let g=l.value.value;switch(l.value.dataType??H(g,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(l.modifier){let C=l.modifier.kind==="arbitrary"?l.modifier.value:t.resolve(l.modifier.value,["--leading"]);if(!C&&ie(l.modifier.value)){let b=t.resolve(null,["--spacing"]);if(!b)return null;C=`calc(${b} * ${l.modifier.value})`}return!C&&l.modifier.value==="none"&&(C="1"),C?[o("font-size",g),o("line-height",C)]:null}return[o("font-size",g)]}default:return g=X(g,l.modifier,t),g===null?void 0:[o("color",g)]}}{let g=te(l,t,["--text-color","--color"]);if(g)return[o("color",g)]}{let g=t.resolveWith(l.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(g){let[v,C={}]=Array.isArray(g)?g:[g];if(l.modifier){let b=l.modifier.kind==="arbitrary"?l.modifier.value:t.resolve(l.modifier.value,["--leading"]);if(!b&&ie(l.modifier.value)){let D=t.resolve(null,["--spacing"]);if(!D)return null;b=`calc(${D} * ${l.modifier.value})`}if(!b&&l.modifier.value==="none"&&(b="1"),!b)return null;let T=[o("font-size",v)];return b&&T.push(o("line-height",b)),T}return typeof C=="string"?[o("font-size",v),o("line-height",C)]:[o("font-size",v),o("line-height",C["--line-height"]?`var(--tw-leading, ${C["--line-height"]})`:void 0),o("letter-spacing",C["--letter-spacing"]?`var(--tw-tracking, ${C["--letter-spacing"]})`:void 0),o("font-weight",C["--font-weight"]?`var(--tw-font-weight, ${C["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let L=()=>W([S("--tw-text-shadow-color"),S("--tw-text-shadow-alpha","100%","")]);e("text-shadow-initial",[L,["--tw-text-shadow-color","initial"]]),r.functional("text-shadow",l=>{let g;if(l.modifier&&(l.modifier.kind==="arbitrary"?g=l.modifier.value:P(l.modifier.value)&&(g=`${l.modifier.value}%`)),!l.value){let v=t.get(["--text-shadow"]);return v===null?void 0:[L(),o("--tw-text-shadow-alpha",g),...ve("text-shadow",v,g,C=>`var(--tw-text-shadow-color, ${C})`)]}if(l.value.kind==="arbitrary"){let v=l.value.value;switch(l.value.dataType??H(v,["color"])){case"color":return v=X(v,l.modifier,t),v===null?void 0:[L(),o("--tw-text-shadow-color",Q(v,"var(--tw-text-shadow-alpha)"))];default:return[L(),o("--tw-text-shadow-alpha",g),...ve("text-shadow",v,g,b=>`var(--tw-text-shadow-color, ${b})`)]}}switch(l.value.value){case"none":return l.modifier?void 0:[L(),o("text-shadow","none")];case"inherit":return l.modifier?void 0:[L(),o("--tw-text-shadow-color","inherit")]}{let v=t.get([`--text-shadow-${l.value.value}`]);if(v)return[L(),o("--tw-text-shadow-alpha",g),...ve("text-shadow",v,g,C=>`var(--tw-text-shadow-color, ${C})`)]}{let v=te(l,t,["--text-shadow-color","--color"]);if(v)return[L(),o("--tw-text-shadow-color",Q(v,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`),hasDefaultValue:t.get(["--text-shadow"])!==null}]);{let b=function(V){return`var(--tw-ring-inset,) 0 0 0 calc(${V} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${C})`},T=function(V){return`inset 0 0 0 ${V} var(--tw-inset-ring-color, currentcolor)`};var ae=b,oe=T;let l=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),g="0 0 #0000",v=()=>W([S("--tw-shadow",g),S("--tw-shadow-color"),S("--tw-shadow-alpha","100%",""),S("--tw-inset-shadow",g),S("--tw-inset-shadow-color"),S("--tw-inset-shadow-alpha","100%",""),S("--tw-ring-color"),S("--tw-ring-shadow",g),S("--tw-inset-ring-color"),S("--tw-inset-ring-shadow",g),S("--tw-ring-inset"),S("--tw-ring-offset-width","0px",""),S("--tw-ring-offset-color","#fff"),S("--tw-ring-offset-shadow",g)]);e("shadow-initial",[v,["--tw-shadow-color","initial"]]),r.functional("shadow",V=>{let R;if(V.modifier&&(V.modifier.kind==="arbitrary"?R=V.modifier.value:P(V.modifier.value)&&(R=`${V.modifier.value}%`)),!V.value){let M=t.get(["--shadow"]);return M===null?void 0:[v(),o("--tw-shadow-alpha",R),...ve("--tw-shadow",M,R,fe=>`var(--tw-shadow-color, ${fe})`),o("box-shadow",l)]}if(V.value.kind==="arbitrary"){let M=V.value.value;switch(V.value.dataType??H(M,["color"])){case"color":return M=X(M,V.modifier,t),M===null?void 0:[v(),o("--tw-shadow-color",Q(M,"var(--tw-shadow-alpha)"))];default:return[v(),o("--tw-shadow-alpha",R),...ve("--tw-shadow",M,R,At=>`var(--tw-shadow-color, ${At})`),o("box-shadow",l)]}}switch(V.value.value){case"none":return V.modifier?void 0:[v(),o("--tw-shadow",g),o("box-shadow",l)];case"inherit":return V.modifier?void 0:[v(),o("--tw-shadow-color","inherit")]}{let M=t.get([`--shadow-${V.value.value}`]);if(M)return[v(),o("--tw-shadow-alpha",R),...ve("--tw-shadow",M,R,fe=>`var(--tw-shadow-color, ${fe})`),o("box-shadow",l)]}{let M=te(V,t,["--box-shadow-color","--color"]);if(M)return[v(),o("--tw-shadow-color",Q(M,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`),hasDefaultValue:t.get(["--shadow"])!==null}]),e("inset-shadow-initial",[v,["--tw-inset-shadow-color","initial"]]),r.functional("inset-shadow",V=>{let R;if(V.modifier&&(V.modifier.kind==="arbitrary"?R=V.modifier.value:P(V.modifier.value)&&(R=`${V.modifier.value}%`)),!V.value){let M=t.get(["--inset-shadow"]);return M===null?void 0:[v(),o("--tw-inset-shadow-alpha",R),...ve("--tw-inset-shadow",M,R,fe=>`var(--tw-inset-shadow-color, ${fe})`),o("box-shadow",l)]}if(V.value.kind==="arbitrary"){let M=V.value.value;switch(V.value.dataType??H(M,["color"])){case"color":return M=X(M,V.modifier,t),M===null?void 0:[v(),o("--tw-inset-shadow-color",Q(M,"var(--tw-inset-shadow-alpha)"))];default:return[v(),o("--tw-inset-shadow-alpha",R),...ve("--tw-inset-shadow",M,R,At=>`var(--tw-inset-shadow-color, ${At})`,"inset "),o("box-shadow",l)]}}switch(V.value.value){case"none":return V.modifier?void 0:[v(),o("--tw-inset-shadow",g),o("box-shadow",l)];case"inherit":return V.modifier?void 0:[v(),o("--tw-inset-shadow-color","inherit")]}{let M=t.get([`--inset-shadow-${V.value.value}`]);if(M)return[v(),o("--tw-inset-shadow-alpha",R),...ve("--tw-inset-shadow",M,R,fe=>`var(--tw-inset-shadow-color, ${fe})`),o("box-shadow",l)]}{let M=te(V,t,["--box-shadow-color","--color"]);if(M)return[v(),o("--tw-inset-shadow-color",Q(M,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`),hasDefaultValue:t.get(["--inset-shadow"])!==null}]),e("ring-inset",[v,["--tw-ring-inset","inset"]]);let C=t.get(["--default-ring-color"])??"currentcolor";r.functional("ring",V=>{if(!V.value){if(V.modifier)return;let R=t.get(["--default-ring-width"])??"1px";return[v(),o("--tw-ring-shadow",b(R)),o("box-shadow",l)]}if(V.value.kind==="arbitrary"){let R=V.value.value;switch(V.value.dataType??H(R,["color","length"])){case"length":return V.modifier?void 0:[v(),o("--tw-ring-shadow",b(R)),o("box-shadow",l)];default:return R=X(R,V.modifier,t),R===null?void 0:[o("--tw-ring-color",R)]}}{let R=te(V,t,["--ring-color","--color"]);if(R)return[o("--tw-ring-color",R)]}{if(V.modifier)return;let R=t.resolve(V.value.value,["--ring-width"]);if(R===null&&P(V.value.value)&&(R=`${V.value.value}px`),R)return[v(),o("--tw-ring-shadow",b(R)),o("box-shadow",l)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),r.functional("inset-ring",V=>{if(!V.value)return V.modifier?void 0:[v(),o("--tw-inset-ring-shadow",T("1px")),o("box-shadow",l)];if(V.value.kind==="arbitrary"){let R=V.value.value;switch(V.value.dataType??H(R,["color","length"])){case"length":return V.modifier?void 0:[v(),o("--tw-inset-ring-shadow",T(R)),o("box-shadow",l)];default:return R=X(R,V.modifier,t),R===null?void 0:[o("--tw-inset-ring-color",R)]}}{let R=te(V,t,["--ring-color","--color"]);if(R)return[o("--tw-inset-ring-color",R)]}{if(V.modifier)return;let R=t.resolve(V.value.value,["--ring-width"]);if(R===null&&P(V.value.value)&&(R=`${V.value.value}px`),R)return[v(),o("--tw-inset-ring-shadow",T(R)),o("box-shadow",l)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,R)=>`${R*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let D="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";r.functional("ring-offset",V=>{if(V.value){if(V.value.kind==="arbitrary"){let R=V.value.value;switch(V.value.dataType??H(R,["color","length"])){case"length":return V.modifier?void 0:[o("--tw-ring-offset-width",R),o("--tw-ring-offset-shadow",D)];default:return R=X(R,V.modifier,t),R===null?void 0:[o("--tw-ring-offset-color",R)]}}{let R=t.resolve(V.value.value,["--ring-offset-width"]);if(R)return V.modifier?void 0:[o("--tw-ring-offset-width",R),o("--tw-ring-offset-shadow",D)];if(P(V.value.value))return V.modifier?void 0:[o("--tw-ring-offset-width",`${V.value.value}px`),o("--tw-ring-offset-shadow",D)]}{let R=te(V,t,["--ring-offset-color","--color"]);if(R)return[o("--tw-ring-offset-color",R)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(l,g)=>`${g*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),r.functional("@container",l=>{let g=null;if(l.value===null?g="inline-size":l.value.kind==="arbitrary"?g=l.value.value:l.value.kind==="named"&&l.value.value==="normal"?g="normal":!1,g!==null)return l.modifier?[o("container-type",g),o("container-name",l.modifier.value)]:[o("container-type",g)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),r}var Lt=["number","integer","ratio","percentage"];function Kr(t){let r=t.params;return hn.test(r)?i=>{let e={"--value":{usedSpacingInteger:!1,usedSpacingNumber:!1,themeKeys:new Set,literals:new Set},"--modifier":{usedSpacingInteger:!1,usedSpacingNumber:!1,themeKeys:new Set,literals:new Set}};I(t.nodes,n=>{if(n.kind!=="declaration"||!n.value||!n.value.includes("--value(")&&!n.value.includes("--modifier("))return;let s=B(n.value);I(s,a=>{if(a.kind!=="function")return;if(a.value==="--spacing"&&!(e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return I(a.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let f=u.value;for(let m of u.nodes)if(m.kind==="word"){if(m.value==="integer")e[f].usedSpacingInteger||=!0;else if(m.value==="number"&&(e[f].usedSpacingNumber||=!0,e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return E.Stop}}),E.Continue;if(a.value!=="--value"&&a.value!=="--modifier")return;let p=j(Z(a.nodes),",");for(let[u,f]of p.entries())f=f.replace(/\\\*/g,"*"),f=f.replace(/--(.*?)\s--(.*?)/g,"--$1-*--$2"),f=f.replace(/\s+/g,""),f=f.replace(/(-\*){2,}/g,"-*"),f[0]==="-"&&f[1]==="-"&&!f.includes("-*")&&(f+="-*"),p[u]=f;a.nodes=B(p.join(","));for(let u of a.nodes)if(u.kind==="word"&&(u.value[0]==='"'||u.value[0]==="'")&&u.value[0]===u.value[u.value.length-1]){let f=u.value.slice(1,-1);e[a.value].literals.add(f)}else if(u.kind==="word"&&u.value[0]==="-"&&u.value[1]==="-"){let f=u.value.replace(/-\*.*$/g,"");e[a.value].themeKeys.add(f)}else if(u.kind==="word"&&!(u.value[0]==="["&&u.value[u.value.length-1]==="]")&&!Lt.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${Lt.map(y=>`"${y}"`).join(", ")}. +`);let f=u.value,m=structuredClone(a),d="\xB6";I(m.nodes,y=>{if(y.kind==="word"&&y.value===f)return E.ReplaceSkip({kind:"word",value:d})});let c="^".repeat(Z([u]).length),w=Z([m]).indexOf(d),h=["```css",Z([a])," ".repeat(w)+c,"```"].join(` +`);console.warn(h)}}),n.value=Z(s)}),i.utilities.functional(r.slice(0,-2),n=>{let s=ee(t),a=n.value,p=n.modifier;if(a===null)return;let u=!1,f=!1,m=!1,d=!1,c=new Map,w=!1;if(I([s],(h,y)=>{let x=y.parent;if(x?.kind!=="rule"&&x?.kind!=="at-rule"||h.kind!=="declaration"||!h.value)return;let $=!1,A=B(h.value);if(I(A,k=>{if(k.kind==="function"){if(k.value==="--value"){u=!0;let U=Pr(a,k,i);return U?(f=!0,U.ratio?w=!0:c.set(h,x),E.ReplaceSkip(U.nodes)):(u||=!1,$=!0,E.Stop)}else if(k.value==="--modifier"){if(p===null)return $=!0,E.Stop;m=!0;let U=Pr(p,k,i);return U?(d=!0,E.ReplaceSkip(U.nodes)):(m||=!1,$=!0,E.Stop)}}}),$)return E.ReplaceSkip([]);h.value=Z(A)}),u&&!f||m&&!d||w&&d||p&&!w&&!d)return null;if(w)for(let[h,y]of c){let x=y.nodes.indexOf(h);x!==-1&&y.nodes.splice(x,1)}return s.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:p,usedSpacingNumber:u,usedSpacingInteger:f,themeKeys:m}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let d of p)a.push(d);if(u)a.push(...ct);else if(f)for(let d of ct)P(d)&&a.push(d);for(let d of i.theme.keysInNamespaces(m))a.push(d.replace(_r,(c,w,h)=>`${w}.${h}`))}return[{values:n,modifiers:s}]})}:gn.test(r)?i=>{i.utilities.static(r,()=>t.nodes.map(ee))}:null}function Pr(t,r,i){for(let e of r.nodes){if(t.kind==="named"&&e.kind==="word"&&(e.value[0]==="'"||e.value[0]==='"')&&e.value[e.value.length-1]===e.value[0]&&e.value.slice(1,-1)===t.value)return{nodes:B(t.value)};if(t.kind==="named"&&e.kind==="word"&&e.value[0]==="-"&&e.value[1]==="-"){let n=e.value;if(n.endsWith("-*")){n=n.slice(0,-2);let s=i.theme.resolve(t.value,[n]);if(s)return{nodes:B(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],p=i.theme.resolveWith(t.value,a,s);if(p){let[,u={}]=p;{let f=u[s.pop()];if(f)return{nodes:B(f)}}}}}else if(t.kind==="named"&&e.kind==="word"){if(!Lt.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in t?t.fraction:t.value;if(!n)continue;let s=H(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[a,p]=j(n,"/");if(!P(a)||!P(p))continue}else{if(s==="number"&&!ie(n))continue;if(s==="percentage"&&!P(n.slice(0,-1)))continue}return{nodes:B(n),ratio:s==="ratio"}}else if(t.kind==="arbitrary"&&e.kind==="word"&&e.value[0]==="["&&e.value[e.value.length-1]==="]"){let n=e.value.slice(1,-1);if(n==="*")return{nodes:B(t.value)};if("dataType"in t&&t.dataType&&t.dataType!==n)continue;if("dataType"in t&&t.dataType)return{nodes:B(t.value)};if(H(t.value,[n])!==null)return{nodes:B(t.value)}}}}function ve(t,r,i,e,n=""){let s=!1,a=Je(r,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Ir(u,i))));function p(u){return n?j(u,",").map(f=>n+f).join(","):u}return s?[o(t,p(Je(r,e))),J("@supports (color: lab(from red l a b))",[o(t,p(a))])]:[o(t,p(a))]}function ft(t,r,i,e,n=""){let s=!1,a=j(r,",").map(p=>Je(p,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Ir(u,i))))).map(p=>`drop-shadow(${p})`).join(" ");return s?[o(t,n+j(r,",").map(p=>`drop-shadow(${Je(p,e)})`).join(" ")),J("@supports (color: lab(from red l a b))",[o(t,n+a)])]:[o(t,n+a)]}var jt={"--alpha":vn,"--spacing":wn,"--theme":yn,theme:kn};function vn(t,r,i,...e){let[n,s]=j(i,"/").map(a=>a.trim());if(!n||!s)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);if(e.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);return Q(n,s)}function wn(t,r,i,...e){if(!i)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(e.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${e.length+1}.`);let n=t.theme.resolve(null,["--spacing"]);if(!n)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${n} * ${i})`}function yn(t,r,i,...e){if(!i.startsWith("--"))throw new Error("The --theme(\u2026) function can only be used with CSS variables from your theme.");let n=!1;i.endsWith(" inline")&&(n=!0,i=i.slice(0,-7)),r.kind==="at-rule"&&(n=!0);let s=t.resolveThemeValue(i,n);if(!s){if(e.length>0)return e.join(", ");throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the variable name is correct or provide a fallback value to silence this error.`)}if(e.length===0)return s;let a=e.join(", ");if(a==="initial")return s;if(s==="initial")return a;if(s.startsWith("var(")||s.startsWith("theme(")||s.startsWith("--theme(")){let p=B(s);return xn(p,a),Z(p)}return s}function kn(t,r,i,...e){i=bn(i);let n=t.resolveThemeValue(i);if(!n&&e.length>0)return e.join(", ");if(!n)throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the path is correct or provide a fallback value to silence this error.`);return n}var Ur=new RegExp(Object.keys(jt).map(t=>`${t}\\(`).join("|"));function De(t,r){let i=0;return I(t,e=>{if(e.kind==="declaration"&&e.value&&Ur.test(e.value)){i|=8,e.value=Lr(e.value,e,r);return}e.kind==="at-rule"&&(e.name==="@media"||e.name==="@custom-media"||e.name==="@container"||e.name==="@supports")&&Ur.test(e.params)&&(i|=8,e.params=Lr(e.params,e,r))}),i}function Lr(t,r,i){let e=B(t);return I(e,n=>{if(n.kind==="function"&&n.value in jt){let s=j(Z(n.nodes).trim(),",").map(p=>p.trim()),a=jt[n.value](i,r,...s);return E.Replace(B(a))}}),Z(e)}function bn(t){if(t[0]!=="'"&&t[0]!=='"')return t;let r="",i=t[0];for(let e=1;e{if(i.kind==="function"&&!(i.value!=="var"&&i.value!=="theme"&&i.value!=="--theme"))if(i.nodes.length===1)i.nodes.push({kind:"word",value:`, ${r}`});else{let e=i.nodes[i.nodes.length-1];e.kind==="word"&&e.value==="initial"&&(e.value=r)}})}function pt(t,r){let i=t.length,e=r.length,n=i=48&&a<=57&&p>=48&&p<=57){let u=s,f=s+1,m=s,d=s+1;for(a=t.charCodeAt(f);a>=48&&a<=57;)a=t.charCodeAt(++f);for(p=r.charCodeAt(d);p>=48&&p<=57;)p=r.charCodeAt(++d);let c=t.slice(u,f),w=r.slice(m,d),h=Number(c)-Number(w);if(h)return h;if(cw)return 1;continue}if(a!==p)return a-p}return t.length-r.length}function jr(t){if(t[0]!=="["||t[t.length-1]!=="]")return null;let r=1,i=r,e=t.length-1;for(;Ue(t.charCodeAt(r));)r++;{for(i=r;r=65&&m<=90)&&!(m>=97&&m<=122)&&!(m>=48&&m<=57)&&!(m===45||m===95))break}if(i===r)return null}let n=t.slice(i,r);for(;Ue(t.charCodeAt(r));)r++;if(r===e)return{attribute:n,operator:null,quote:null,value:null,sensitivity:null};let s=null,a=t.charCodeAt(r);if(a===61)s="=",r++;else if((a===126||a===124||a===94||a===36||a===42)&&t.charCodeAt(r+1)===61)s=t[r]+"=",r+=2;else return null;for(;Ue(t.charCodeAt(r));)r++;if(r===e)return null;let p="",u=null;if(a=t.charCodeAt(r),a===39||a===34){u=t[r],r++,i=r;for(let m=r;m/g,"1")),e[0]==="opacity"&&(typeof n=="number"||typeof n=="string")){let a=typeof n=="string"?parseFloat(n):n;a>=0&&a<=1&&(n=a*100+"%")}let s=je(e);s&&t.theme.add(`--${s}`,""+n,7)}if(Object.hasOwn(r,"fontFamily")){let e=5;{let n=Le(r.fontFamily.sans);n&&t.theme.hasDefault("--font-sans")&&(t.theme.add("--default-font-family",n,e),t.theme.add("--default-font-feature-settings",Le(r.fontFamily.sans,"fontFeatureSettings")??"normal",e),t.theme.add("--default-font-variation-settings",Le(r.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let n=Le(r.fontFamily.mono);n&&t.theme.hasDefault("--font-mono")&&(t.theme.add("--default-mono-font-family",n,e),t.theme.add("--default-mono-font-feature-settings",Le(r.fontFamily.mono,"fontFeatureSettings")??"normal",e),t.theme.add("--default-mono-font-variation-settings",Le(r.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return r}function Cn(t){let r=[];return Mr(t,[],(i,e)=>{if(Vn(i))return r.push([e,i]),1;if(Nn(i)){r.push([e,i[0]]);for(let n of Reflect.ownKeys(i[1]))r.push([[...e,`-${n}`],i[1][n]]);return 1}if(Array.isArray(i)&&i.every(n=>typeof n=="string"))return e[0]==="fontSize"?(r.push([e,i[0]]),i.length>=2&&r.push([[...e,"-line-height"],i[1]])):r.push([e,i.join(", ")]),1}),r}var $n={borderWidth:"border-width",outlineWidth:"outline-width",ringColor:"ring-color",ringWidth:"ring-width",transitionDuration:"transition-duration",transitionTimingFunction:"transition-timing-function"},Sn={animation:"animate",aspectRatio:"aspect",borderRadius:"radius",boxShadow:"shadow",colors:"color",containers:"container",fontFamily:"font",fontSize:"text",letterSpacing:"tracking",lineHeight:"leading",maxWidth:"container",screens:"breakpoint",transitionTimingFunction:"ease"},Tn=/^[a-zA-Z0-9-_%/\.]+$/;function je(t){let r=$n[t[0]];if(r&&t[1]==="DEFAULT")return`default-${r}`;if(t[0]==="container")return null;for(let e of t)if(!Tn.test(e))return null;let i=Sn[t[0]];return i&&(t=t.slice(),t[0]=i),t.map((e,n,s)=>e==="1"&&n!==s.length-1?"":e).map((e,n)=>(e=e.replaceAll(".","_"),(n===0||e.startsWith("-")||e==="lineHeight")&&(e=e.replace(/([a-z])([A-Z])/g,(a,p,u)=>`${p}-${u.toLowerCase()}`)),e)).filter((e,n)=>e!=="DEFAULT"||n!==t.length-1).join("-")}function Vn(t){return typeof t=="number"||typeof t=="string"}function Nn(t){if(!Array.isArray(t)||t.length!==2||typeof t[0]!="string"&&typeof t[0]!="number"||t[1]===void 0||t[1]===null||typeof t[1]!="object")return!1;for(let r of Reflect.ownKeys(t[1]))if(typeof r!="string"||typeof t[1][r]!="string"&&typeof t[1][r]!="number")return!1;return!0}function Mr(t,r=[],i){for(let e of Reflect.ownKeys(t)){let n=t[e];if(n==null)continue;let s=[...r,e],a=i(n,s)??0;if(a!==1){if(a===2)return 2;if(!(!Array.isArray(n)&&typeof n!="object")&&Mr(n,s,i)===2)return 2}}}var En=/^(?[-+]?(?:\d*\.)?\d+)(?[a-z]+|%)?$/i,Ne=new K(t=>{let r=En.exec(t);if(!r)return null;let i=r.groups?.value;if(i===void 0)return null;let e=Number(i);if(Number.isNaN(e))return null;let n=r.groups?.unit;return n===void 0?[e,null]:[e,n]});function dt(t,r=null){let i=!1,e=B(t);return I(e,{exit(n){if(n.kind==="word"&&n.value!=="0"){let s=Rn(n.value,r);return s===null||s===n.value?void 0:(i=!0,E.ReplaceSkip(ne(s)))}else if(n.kind==="function"&&(n.value==="calc"||n.value==="")){if(n.nodes.length!==5)return;let s=Ne.get(n.nodes[0].value),a=n.nodes[2].value,p=Ne.get(n.nodes[4].value);if(a==="*"&&(s?.[0]===0&&s?.[1]===null||p?.[0]===0&&p?.[1]===null))return i=!0,E.ReplaceSkip(ne("0"));if(s===null||p===null)return;switch(a){case"*":{if(s[1]===p[1]||s[1]===null&&p[1]!==null||s[1]!==null&&p[1]===null)return i=!0,E.ReplaceSkip(ne(`${s[0]*p[0]}${s[1]??""}`));break}case"+":{if(s[1]===p[1])return i=!0,E.ReplaceSkip(ne(`${s[0]+p[0]}${s[1]??""}`));break}case"-":{if(s[1]===p[1])return i=!0,E.ReplaceSkip(ne(`${s[0]-p[0]}${s[1]??""}`));break}case"/":{if(p[0]!==0&&(s[1]===null&&p[1]===null||s[1]!==null&&p[1]===null))return i=!0,E.ReplaceSkip(ne(`${s[0]/p[0]}${s[1]??""}`));break}}}}}),i?Z(e):t}function Rn(t,r=null){let i=Ne.get(t);if(i===null)return null;let[e,n]=i;if(n===null)return`${e}`;if(e===0&&er(t))return"0";switch(n.toLowerCase()){case"in":return`${e*96}px`;case"cm":return`${e*96/2.54}px`;case"mm":return`${e*96/2.54/10}px`;case"q":return`${e*96/2.54/10/4}px`;case"pc":return`${e*96/6}px`;case"pt":return`${e*96/72}px`;case"rem":return r!==null?`${e*r}px`:null;case"grad":return`${e*.9}deg`;case"rad":return`${e*180/Math.PI}deg`;case"turn":return`${e*360}deg`;case"ms":return`${e/1e3}s`;case"khz":return`${e*1e3}hz`;default:return`${e}${n}`}}function Fr(t,r="top",i="right",e="bottom",n="left"){return Gr(`${t}-${r}`,`${t}-${i}`,`${t}-${e}`,`${t}-${n}`)}function Gr(t="top",r="right",i="bottom",e="left"){return{1:[[t,0],[r,0],[i,0],[e,0]],2:[[t,0],[r,1],[i,0],[e,1]],3:[[t,0],[r,1],[i,2],[e,1]],4:[[t,0],[r,1],[i,2],[e,3]]}}function Ee(t,r){return{1:[[t,0],[r,0]],2:[[t,0],[r,1]]}}var Wr={inset:Gr(),margin:Fr("margin"),padding:Fr("padding"),gap:Ee("row-gap","column-gap")},Br={"inset-block":Ee("top","bottom"),"inset-inline":Ee("left","right"),"margin-block":Ee("margin-top","margin-bottom"),"margin-inline":Ee("margin-left","margin-right"),"padding-block":Ee("padding-top","padding-bottom"),"padding-inline":Ee("padding-left","padding-right")},Yr={"border-block":["border-bottom","border-top"],"border-block-color":["border-bottom-color","border-top-color"],"border-block-style":["border-bottom-style","border-top-style"],"border-block-width":["border-bottom-width","border-top-width"],"border-inline":["border-left","border-right"],"border-inline-color":["border-left-color","border-right-color"],"border-inline-style":["border-left-style","border-right-style"],"border-inline-width":["border-left-width","border-right-width"]};function qr(t,r){if(r&2){if(t.property in Br){let i=j(t.value," ");return Br[t.property][i.length]?.map(([e,n])=>o(e,i[n],t.important))}if(t.property in Yr)return Yr[t.property]?.map(i=>o(i,t.value,t.important))}if(t.property in Wr){let i=j(t.value," ");return Wr[t.property][i.length]?.map(([e,n])=>o(e,i[n],t.important))}return null}function On(t){return{kind:"combinator",value:t}}function Pn(t,r){return{kind:"function",value:t,nodes:r}}function xe(t){return{kind:"selector",value:t}}function In(t){return{kind:"separator",value:t}}function _n(t){return{kind:"value",value:t}}function pe(t){let r="";for(let i of t)switch(i.kind){case"combinator":case"selector":case"separator":case"value":{r+=i.value;break}case"function":r+=i.value+"("+pe(i.nodes)+")"}return r}var Zr=92,Dn=93,Hr=41,Kn=58,Jr=44,Un=34,Ln=46,Qr=62,Xr=10,jn=35,ei=91,ti=40,ri=43,zn=39,ii=32,ni=9,ai=126,Mn=38,Fn=42;function Re(t){t=t.replaceAll(`\r +`,` +`);let r=[],i=[],e=null,n="",s;for(let a=0;a0){let c=xe(n);e?e.nodes.push(c):r.push(c),n=""}let u=a,f=a+1;for(;f0){let f=xe(n);u.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Ln:case Kn:case jn:{if(n.length>0){let u=xe(n);e?e.nodes.push(u):r.push(u)}n=t[a];break}case ei:{if(n.length>0){let m=xe(n);e?e.nodes.push(m):r.push(m)}n="";let u=a,f=0;for(let m=a+1;m0){let u=xe(n);e?e.nodes.push(u):r.push(u),n=""}e?e.nodes.push(xe(t[a])):r.push(xe(t[a]));break}case Zr:{n+=t[a]+t[a+1],a+=1;break}default:n+=t[a]}}return n.length>0&&r.push(xe(n)),r}function ue(t,r){for(let i in t)delete t[i];return Object.assign(t,r)}function Oe(t){let r=[];for(let i of j(t,".")){if(!i.includes("[")){r.push(i);continue}let e=0;for(;;){let n=i.indexOf("[",e),s=i.indexOf("]",n);if(n===-1||s===-1)break;n>e&&r.push(i.slice(e,n)),r.push(i.slice(n+1,s)),e=s+1}e<=i.length-1&&r.push(i.slice(e))}return r}function zt(t,r){let i=t;return i.storage[ui]??=Wn(),i.storage[fi]??=Yn(i),i.storage[ci]??=Zn(),i.storage[pi]??=Jn(),i.storage[di]??=Xn(),i.storage[Ft]??=na(i),i.storage[ht]??=la(i,r),i.storage[de]??=ya(i),i.storage[Wt]??=ba(),i.storage[vt]??=xa(i),i.storage[Bt]??=Aa(i),i.storage[yt]??=Ca(i),i.storage[hi]??=$a(i),i}var ui=Symbol();function Wn(){return new K(t=>new K(r=>({rem:t,features:r})))}function Bn(t,r){let i=0;return r?.collapse&&(i|=1),r?.logicalToPhysical&&(i|=2),zt(t,r).storage[ui].get(r?.rem??null).get(i)}var fi=Symbol();function Yn(t){return new K(r=>new K(i=>({features:i,designSystem:t,signatureOptions:r})))}function Gn(t,r,i){let e=0;return i?.collapse&&(e|=1),zt(t).storage[fi].get(r).get(e)}function Mt(t,r,i){let e=Bn(t,i),n=Gn(t,e,i),s=zt(t),a=new Set,p=s.storage[ci].get(n);for(let u of r)a.add(p.get(u));return a.size<=1||!(n.features&1)?Array.from(a):qn(n,Array.from(a))}function qn(t,r){if(r.length<=1)return r;let i=t.designSystem,e=new K(p=>new K(u=>new Set)),n=t.designSystem.theme.prefix?`${t.designSystem.theme.prefix}:`:"";for(let p of r){let u=j(p,":"),f=u.pop(),m=f.endsWith("!");m&&(f=f.slice(0,-1));let d=u.length>0?`${u.join(":")}:`:"",c=m?"!":"";e.get(d).get(c).add(`${n}${f}`)}let s=new Set;for(let[p,u]of e.entries())for(let[f,m]of u.entries())for(let d of a(Array.from(m)))n&&d.startsWith(n)&&(d=d.slice(n.length)),s.add(`${p}${d}${f}`);return Array.from(s);function a(p){let u=t.signatureOptions,f=i.storage[vt].get(u),m=i.storage[Wt].get(u),d=p.map($=>f.get($));if(d.some($=>$.has("line-height"))){let $=i.theme.keysInNamespaces(["--text"]);if($.length>0){let A=new Set,k=new Set;for(let N of d)for(let O of N.get("line-height")){if(k.has(O))continue;k.add(O);let L=i.storage[ht]?.get(O)??null;if(L!==null)if(ie(L)){A.add(L);for(let _ of $)f.get(`text-${_}/${L}`)}else{A.add(O);for(let _ of $)f.get(`text-${_}/[${O}]`)}}let U=new Set;for(let N of d)for(let O of N.get("font-size"))if(!U.has(O)){U.add(O);for(let L of A)ie(L)?f.get(`text-[${O}]/${L}`):f.get(`text-[${O}]/[${L}]`)}}}let c=d.map($=>{let A=null;for(let k of $.keys()){let U=new Set;for(let N of m.get(k).values())for(let O of N)U.add(O);if(A===null?A=U:A=si(A,U),A.size===0)return A}return A}),w=new K($=>new Set([$]));for(let $=0;$$.split(",").map(Number));for(let $ of w.values()){let A=Array.from($).sort((k,U)=>k-U);h.get(A.join(","))}let y=new Set(p),x=new Set;for(let $ of h.values())for(let A of Ta($)){if(A.some(N=>x.has(p[N])))continue;let k=A.flatMap(N=>c[N]).reduce(si),U=i.storage[de].get(u).get(A.map(N=>p[N]).sort((N,O)=>N.localeCompare(O)).join(" "));for(let N of k)if(i.storage[de].get(u).get(N)===U){for(let L of A)x.add(p[L]);y.add(N);break}}for(let $ of x)y.delete($);return Array.from(y)}}var ci=Symbol();function Zn(){return new K(t=>{let r=t.designSystem,i=r.theme.prefix?`${r.theme.prefix}:`:"",e=r.storage[pi].get(t),n=r.storage[di].get(t);return new K((s,a)=>{for(let p of r.parseCandidate(s)){let u=p.variants.slice().reverse().flatMap(d=>e.get(d)),f=p.important;if(f||u.length>0){let c=a.get(r.printCandidate({...p,variants:[],important:!1}));return r.theme.prefix!==null&&u.length>0&&(c=c.slice(i.length)),u.length>0&&(c=`${u.map(w=>r.printVariant(w)).join(":")}:${c}`),f&&(c+="!"),r.theme.prefix!==null&&u.length>0&&(c=`${i}${c}`),c}let m=n.get(s);if(m!==s)return m}return s})})}var Hn=[ia,ha,va,da],pi=Symbol();function Jn(){return new K(t=>new K(r=>{let i=[r];for(let e of Hn)for(let n of i.splice(0)){let s=e(_e(n),t);if(Array.isArray(s)){i.push(...s);continue}else i.push(s)}return i}))}var Qn=[ta,ra,sa,fa,pa,ma,ga,wa],di=Symbol();function Xn(){return new K(t=>{let r=t.designSystem;return new K(i=>{for(let e of r.parseCandidate(i)){let n=Tr(e);for(let a of Qn)n=a(n,t);let s=r.printCandidate(n);if(i!==s)return s}return i})})}var ea=["t","tr","r","br","b","bl","l","tl"];function ta(t){if(t.kind==="static"&&t.root.startsWith("bg-gradient-to-")){let r=t.root.slice(15);return ea.includes(r)&&(t.root=`bg-linear-to-${r}`),t}return t}function ra(t,r){let i=r.designSystem.storage[Ft];if(t.kind==="arbitrary"){let[e,n]=i(t.value,t.modifier===null?1:0);e!==t.value&&(t.value=e,n!==null&&(t.modifier=n))}else if(t.kind==="functional"&&t.value?.kind==="arbitrary"){let[e,n]=i(t.value.value,t.modifier===null?1:0);e!==t.value.value&&(t.value.value=e,n!==null&&(t.modifier=n))}return t}function ia(t,r){let i=r.designSystem.storage[Ft],e=wt(t);for(let[n]of e)if(n.kind==="arbitrary"){let[s]=i(n.selector,2);s!==n.selector&&(n.selector=s)}else if(n.kind==="functional"&&n.value?.kind==="arbitrary"){let[s]=i(n.value.value,2);s!==n.value.value&&(n.value.value=s)}return t}var Ft=Symbol();function na(t){return r(t);function r(i){function e(p,u=0){let f=B(p);if(u&2)return[mt(f,a),null];let m=0,d=0;if(I(f,h=>{h.kind==="function"&&h.value==="theme"&&(m+=1,I(h.nodes,y=>y.kind==="separator"&&y.value.includes(",")?E.Stop:y.kind==="word"&&y.value==="/"?(d+=1,E.Stop):E.Skip))}),m===0)return[p,null];if(d===0)return[mt(f,s),null];if(d>1)return[mt(f,a),null];let c=null;return[mt(f,(h,y)=>{let x=j(h,"/").map($=>$.trim());if(x.length>2)return null;if(f.length===1&&x.length===2&&u&1){let[$,A]=x;if(/^\d+%$/.test(A))c={kind:"named",value:A.slice(0,-1)};else if(/^0?\.\d+$/.test(A)){let k=Number(A)*100;c={kind:Number.isInteger(k)?"named":"arbitrary",value:k.toString()}}else c={kind:"arbitrary",value:A};h=$}return s(h,y)||a(h,y)}),c]}function n(p,u=!0){let f=`--${je(Oe(p))}`;return i.theme.get([f])?u&&i.theme.prefix?`--${i.theme.prefix}-${f.slice(2)}`:f:null}function s(p,u){let f=n(p);if(f)return u?`var(${f}, ${u})`:`var(${f})`;let m=Oe(p);if(m[0]==="spacing"&&i.theme.get(["--spacing"])){let d=m[1];return ie(d)?`--spacing(${d})`:null}return null}function a(p,u){let f=j(p,"/").map(c=>c.trim());p=f.shift();let m=n(p,!1);if(!m)return null;let d=f.length>0?`/${f.join("/")}`:"";return u?`--theme(${m}${d}, ${u})`:`--theme(${m}${d})`}return e}}function mt(t,r){return I(t,(i,e)=>{if(i.kind==="function"&&i.value==="theme"){if(i.nodes.length<1)return;i.nodes[0].kind==="separator"&&i.nodes[0].value.trim()===""&&i.nodes.shift();let n=i.nodes[0];if(n.kind!=="word")return;let s=n.value,a=1;for(let f=a;f0?r(s,Z(p)):r(s);if(u===null)return;if(e.parent){let f=e.parent.nodes.indexOf(i)-1;for(;f!==-1;){let m=e.parent.nodes[f];if(m.kind==="separator"&&m.value.trim()===""){f-=1;continue}/^[-+*/]$/.test(m.value.trim())&&(u=`(${u})`);break}}return E.Replace(B(u))}}),Z(t)}function aa(t){if(t[0]!=="'"&&t[0]!=='"')return t;let r="",i=t[0];for(let e=1;e{if(n===0)return null;let p=Ne.get(dt(a,r?.rem??null));if(!p)return null;let[u,f]=p;return f!==s?null:u/n})}function sa(t,r){if(t.kind!=="arbitrary"&&!(t.kind==="functional"&&t.value?.kind==="arbitrary"))return t;let i=r.designSystem,e=i.storage[Bt].get(r.signatureOptions),n=i.storage[de].get(r.signatureOptions),s=i.printCandidate(t),a=n.get(s);if(typeof a!="string")return t;for(let u of p(a,t)){let f=i.printCandidate(u);if(n.get(f)===a&&ua(i,t,u))return u}return t;function*p(u,f){let m=e.get(u);if(!(m.length>1)){if(m.length===0&&f.modifier){let d={...f,modifier:null},c=n.get(i.printCandidate(d));if(typeof c=="string")for(let w of p(c,d))yield Object.assign({},w,{modifier:f.modifier})}if(m.length===1)for(let d of we(i,m[0]))yield d;else if(m.length===0){let d=f.kind==="arbitrary"?f.value:f.value?.value??null;if(d===null)return;if(r.signatureOptions.rem!==null&&f.kind==="functional"&&f.value?.kind==="arbitrary"){let h=i.storage[ht]?.get(d)??null;h!==null&&ie(h)&&(yield Object.assign({},f,{value:{kind:"named",value:h,fraction:null}}))}let c=i.storage[ht]?.get(d)??null,w="";c!==null&&c<0&&(w="-",c=Math.abs(c));for(let h of Array.from(i.utilities.keys("functional")).sort((y,x)=>+(y[0]==="-")-+(x[0]==="-"))){w&&(h=`${w}${h}`);for(let y of we(i,`${h}-${d}`))yield y;if(f.modifier)for(let y of we(i,`${h}-${d}${f.modifier}`))yield y;if(c!==null){for(let y of we(i,`${h}-${c}`))yield y;if(f.modifier)for(let y of we(i,`${h}-${c}${He(f.modifier)}`))yield y}for(let y of we(i,`${h}-[${d}]`))yield y;if(f.modifier)for(let y of we(i,`${h}-[${d}]${He(f.modifier)}`))yield y}}}}}function ua(t,r,i){let e=null;if(r.kind==="functional"&&r.value?.kind==="arbitrary"&&r.value.value.includes("var(--")?e=r.value.value:r.kind==="arbitrary"&&r.value.includes("var(--")&&(e=r.value),e===null)return!0;let n=t.candidatesToCss([t.printCandidate(i)]).join(` +`),s=!0;return I(B(e),a=>{if(a.kind==="function"&&a.value==="var"){let p=a.nodes[0].value;if(!new RegExp(`var\\(${p}[,)]\\s*`,"g").test(n)||n.includes(`${p}:`))return s=!1,E.Stop}}),s}function fa(t,r){if(t.kind!=="functional"||t.value?.kind!=="named")return t;let i=r.designSystem,e=i.storage[Bt].get(r.signatureOptions),n=i.storage[de].get(r.signatureOptions),s=i.printCandidate(t),a=n.get(s);if(typeof a!="string")return t;for(let u of p(a,t)){let f=i.printCandidate(u);if(n.get(f)===a)return u}return t;function*p(u,f){let m=e.get(u);if(!(m.length>1)){if(m.length===0&&f.modifier){let d={...f,modifier:null},c=n.get(i.printCandidate(d));if(typeof c=="string")for(let w of p(c,d))yield Object.assign({},w,{modifier:f.modifier})}if(m.length===1)for(let d of we(i,m[0]))yield d}}}var ca=new Map([["order-none","order-0"],["break-words","wrap-break-word"]]);function pa(t,r){let i=r.designSystem,e=i.storage[de].get(r.signatureOptions),n=oa(i,t),s=ca.get(n)??null;if(s===null)return t;let a=e.get(n);if(typeof a!="string")return t;let p=e.get(s);if(typeof p!="string"||a!==p)return t;let[u]=we(i,s);return u}function da(t,r){let i=r.designSystem,e=i.storage[yt],n=i.storage[hi],s=wt(t);for(let[a]of s){if(a.kind==="compound")continue;let p=i.printVariant(a),u=e.get(p);if(typeof u!="string")continue;let f=n.get(u);if(f.length!==1)continue;let m=f[0],d=i.parseVariant(m);d!==null&&ue(a,d)}return t}function ma(t,r){let i=r.designSystem,e=i.storage[de].get(r.signatureOptions);if(t.kind==="functional"&&t.value?.kind==="arbitrary"&&t.value.dataType!==null){let n=i.printCandidate({...t,value:{...t.value,dataType:null}});e.get(i.printCandidate(t))===e.get(n)&&(t.value.dataType=null)}return t}function ga(t,r){if(t.kind!=="functional"||t.value?.kind!=="arbitrary")return t;let i=r.designSystem,e=i.storage[de].get(r.signatureOptions),n=e.get(i.printCandidate(t));if(n===null)return t;for(let s of mi(t))if(e.get(i.printCandidate({...t,value:s}))===n)return t.value=s,t;return t}function ha(t){let r=wt(t);for(let[i]of r)if(i.kind==="functional"&&i.root==="data"&&i.value?.kind==="arbitrary"&&!i.value.value.includes("="))i.value={kind:"named",value:i.value.value};else if(i.kind==="functional"&&i.root==="aria"&&i.value?.kind==="arbitrary"&&(i.value.value.endsWith("=true")||i.value.value.endsWith('="true"')||i.value.value.endsWith("='true'"))){let[e,n]=j(i.value.value,"=");if(e[e.length-1]==="~"||e[e.length-1]==="|"||e[e.length-1]==="^"||e[e.length-1]==="$"||e[e.length-1]==="*")continue;i.value={kind:"named",value:i.value.value.slice(0,i.value.value.indexOf("="))}}else i.kind==="functional"&&i.root==="supports"&&i.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(i.value.value)&&(i.value={kind:"named",value:i.value.value});return t}function*mi(t,r=t.value?.value??"",i=new Set){if(i.has(r))return;if(i.add(r),yield{kind:"named",value:r,fraction:null},r.endsWith("%")&&ie(r.slice(0,-1))&&(yield{kind:"named",value:r.slice(0,-1),fraction:null}),r.includes("/")){let[s,a]=r.split("/");P(s)&&P(a)&&(yield{kind:"named",value:s,fraction:`${s}/${a}`})}let e=new Set;for(let s of r.matchAll(/(\d+\/\d+)|(\d+\.?\d+)/g))e.add(s[0].trim());let n=Array.from(e).sort((s,a)=>s.length-a.length);for(let s of n)yield*mi(t,s,i)}function li(t){return!t.some(r=>r.kind==="separator"&&r.value.trim()===",")}function gt(t){let r=t.value.trim();return t.kind==="selector"&&r[0]==="["&&r[r.length-1]==="]"}function va(t,r){let i=[t],e=r.designSystem,n=e.storage[yt],s=wt(t);for(let[a,p]of s)if(a.kind==="compound"&&(a.root==="has"||a.root==="not"||a.root==="in")&&a.modifier!==null&&"modifier"in a.variant&&(a.variant.modifier=a.modifier,a.modifier=null),a.kind==="arbitrary"){if(a.relative)continue;let u=Re(a.selector.trim());if(!li(u))continue;if(p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&u[2].value==="*"){ue(a,e.parseVariant("*"));continue}if(p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="*"){ue(a,e.parseVariant("**"));continue}if(p===null&&u.length===3&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="&"){u.pop(),u.pop(),ue(a,e.parseVariant(`in-[${pe(u)}]`));continue}if(p===null&&u[0].kind==="selector"&&(u[0].value==="@media"||u[0].value==="@supports")){let c=n.get(e.printVariant(a)),w=B(pe(u)),h=!1;if(I(w,y=>{if(y.kind==="word"&&y.value==="not")return h=!0,E.Replace([])}),w=B(Z(w)),I(w,y=>{y.kind==="separator"&&y.value!==" "&&y.value.trim()===""&&(y.value=" ")}),h){let y=e.parseVariant(`not-[${Z(w)}]`);if(y===null)continue;let x=n.get(e.printVariant(y));if(c===x){ue(a,y);continue}}}let f=null;p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value.trim()==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&(gt(u[2])||u[2].value[0]===":")&&(u=[u[2]],f=e.parseVariant("*")),p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value.trim()==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&(gt(u[2])||u[2].value[0]===":")&&(u=[u[2]],f=e.parseVariant("**"));let m=u.filter(c=>!(c.kind==="selector"&&c.value.trim()==="&"));if(m.length!==1)continue;let d=m[0];if(d.kind==="function"&&d.value===":is"){if(!li(d.nodes)||d.nodes.length!==1||!gt(d.nodes[0]))continue;d=d.nodes[0]}if(d.kind==="function"&&d.value[0]===":"||d.kind==="selector"&&d.value[0]===":"){let c=d,w=!1;if(c.kind==="function"&&c.value===":not"){if(w=!0,c.nodes.length!==1||c.nodes[0].kind!=="selector"&&c.nodes[0].kind!=="function"||c.nodes[0].value[0]!==":")continue;c=c.nodes[0]}let h=(x=>{if(x===":nth-child"&&c.kind==="function"&&c.nodes.length===1&&c.nodes[0].kind==="value"&&c.nodes[0].value==="odd")return w?(w=!1,"even"):"odd";if(x===":nth-child"&&c.kind==="function"&&c.nodes.length===1&&c.nodes[0].kind==="value"&&c.nodes[0].value==="even")return w?(w=!1,"odd"):"even";for(let[$,A]of[[":nth-child","nth"],[":nth-last-child","nth-last"],[":nth-of-type","nth-of-type"],[":nth-last-of-type","nth-of-last-type"]])if(x===$&&c.kind==="function"&&c.nodes.length===1)return c.nodes.length===1&&c.nodes[0].kind==="value"&&P(c.nodes[0].value)?`${A}-${c.nodes[0].value}`:`${A}-[${pe(c.nodes)}]`;if(w){let $=n.get(e.printVariant(a)),A=n.get(`not-[${x}]`);if($===A)return`[&${x}]`}return null})(c.value);if(h===null){if(f)return ue(a,{kind:"arbitrary",selector:d.value,relative:!1}),[f,a];continue}w&&(h=`not-${h}`);let y=e.parseVariant(h);if(y===null)continue;ue(a,y)}else if(gt(d)){let c=jr(d.value);if(c===null)continue;if(c.attribute.startsWith("data-")){let w=c.attribute.slice(5);ue(a,{kind:"functional",root:"data",modifier:null,value:c.value===null?{kind:"named",value:w}:{kind:"arbitrary",value:`${w}${c.operator}${c.quote??""}${c.value}${c.quote??""}${c.sensitivity?` ${c.sensitivity}`:""}`}})}else if(c.attribute.startsWith("aria-")){let w=c.attribute.slice(5);ue(a,{kind:"functional",root:"aria",modifier:null,value:c.value===null?{kind:"arbitrary",value:w}:c.operator==="="&&c.value==="true"&&c.sensitivity===null?{kind:"named",value:w}:{kind:"arbitrary",value:`${c.attribute}${c.operator}${c.quote??""}${c.value}${c.quote??""}${c.sensitivity?` ${c.sensitivity}`:""}`}})}else ue(a,{kind:"arbitrary",selector:d.value,relative:!1})}if(f)return[f,a]}return i}function wa(t,r){if(t.kind!=="functional"&&t.kind!=="arbitrary"||t.modifier===null)return t;let i=r.designSystem,e=i.storage[de].get(r.signatureOptions),n=e.get(i.printCandidate(t)),s=t.modifier;if(n===e.get(i.printCandidate({...t,modifier:null})))return t.modifier=null,t;{let a={kind:"named",value:s.value.endsWith("%")?s.value.includes(".")?`${Number(s.value.slice(0,-1))}`:s.value.slice(0,-1):s.value,fraction:null};if(n===e.get(i.printCandidate({...t,modifier:a})))return t.modifier=a,t}{let a={kind:"named",value:`${parseFloat(s.value)*100}`,fraction:null};if(n===e.get(i.printCandidate({...t,modifier:a})))return t.modifier=a,t}return t}var de=Symbol();function ya(t){return new K(r=>new K(i=>{try{i=t.theme.prefix&&!i.startsWith(t.theme.prefix)?`${t.theme.prefix}:${i}`:i;let e=[G(".x",[F("@apply",i)])];return Sa(t,()=>{for(let s of t.parseCandidate(i))t.compileAstNodes(s,1);Ae(e,t)}),gi(t,e,r),re(e)}catch{return Symbol()}}))}function gi(t,r,i){let{rem:e}=i;return I(r,{enter(n,s){if(n.kind==="declaration"){if(n.value===void 0||n.property==="--tw-sort")return E.Replace([]);if(n.property.startsWith("--tw-")&&(s.parent?.nodes??[]).some(a=>a.kind==="declaration"&&n.value===a.value&&n.important===a.important&&!a.property.startsWith("--tw-")))return E.Replace([]);if(i.features&1){let a=qr(n,i.features);if(a)return E.Replace(a)}n.value.includes("var(")&&(n.value=ka(n.value,t)),n.value=dt(n.value,e),n.value=be(n.value)}else{if(n.kind==="context"||n.kind==="at-root")return E.Replace(n.nodes);if(n.kind==="comment")return E.Replace([]);if(n.kind==="at-rule"&&n.name==="@property")return E.Replace([])}},exit(n){if(n.kind==="rule"||n.kind==="at-rule"){if(n.nodes.length>1){let s=new Set;for(let a=n.nodes.length-1;a>=0;a--){let p=n.nodes[a];p.kind==="declaration"&&p.value!==void 0&&(s.has(p.property)&&n.nodes.splice(a,1),s.add(p.property))}}n.nodes.sort((s,a)=>s.kind!=="declaration"||a.kind!=="declaration"?0:s.property.localeCompare(a.property))}}}),r}function ka(t,r){let i=!1,e=B(t),n=new Set;return I(e,s=>{if(s.kind!=="function"||s.value!=="var"||s.nodes.length!==1&&s.nodes.length<3)return;let a=s.nodes[0].value;r.theme.prefix&&a.startsWith(`--${r.theme.prefix}-`)&&(a=a.slice(`--${r.theme.prefix}-`.length));let p=r.resolveThemeValue(a);if(!n.has(a)&&(n.add(a),p!==void 0&&(s.nodes.length===1&&(i=!0,s.nodes.push(...B(`,${p}`))),s.nodes.length>=3))){let u=Z(s.nodes),f=`${s.nodes[0].value},${p}`;if(u===f)return i=!0,E.Replace(B(p))}}),i?Z(e):t}var Wt=Symbol();function ba(){return new K(t=>new K(r=>new K(i=>new Set)))}var vt=Symbol();function xa(t){return new K(r=>new K(i=>{let e=new K(s=>new Set);t.theme.prefix&&!i.startsWith(t.theme.prefix)&&(i=`${t.theme.prefix}:${i}`);let n=t.parseCandidate(i);return n.length===0||I(gi(t,t.compileAstNodes(n[0]).map(s=>ee(s.node)),r),s=>{s.kind==="declaration"&&(e.get(s.property).add(s.value),t.storage[Wt].get(r).get(s.property).get(s.value).add(i))}),e}))}var Bt=Symbol();function Aa(t){return new K(r=>{let i=t.storage[de].get(r),e=new K(()=>[]);for(let[n,s]of t.getClassList()){let a=i.get(n);if(typeof a=="string"){if(n[0]==="-"&&n.endsWith("-0")){let p=i.get(n.slice(1));if(typeof p=="string"&&a===p)continue}e.get(a).push(n),t.storage[vt].get(r).get(n);for(let p of s.modifiers){if(ie(p))continue;let u=`${n}/${p}`,f=i.get(u);typeof f=="string"&&(e.get(f).push(u),t.storage[vt].get(r).get(u))}}}return e})}var yt=Symbol();function Ca(t){return new K(r=>{try{r=t.theme.prefix&&!r.startsWith(t.theme.prefix)?`${t.theme.prefix}:${r}`:r;let i=[G(".x",[F("@apply",`${r}:flex`)])];return Ae(i,t),I(i,n=>{if(n.kind==="at-rule"&&n.params.includes(" "))n.params=n.params.replaceAll(" ","");else if(n.kind==="rule"){let s=Re(n.selector),a=!1;I(s,p=>{if(p.kind==="separator"&&p.value!==" ")p.value=p.value.trim(),a=!0;else if(p.kind==="function"&&p.value===":is"){if(p.nodes.length===1)return a=!0,E.Replace(p.nodes);if(p.nodes.length===2&&p.nodes[0].kind==="selector"&&p.nodes[0].value==="*"&&p.nodes[1].kind==="selector"&&p.nodes[1].value[0]===":")return a=!0,E.Replace(p.nodes[1])}else p.kind==="function"&&p.value[0]===":"&&p.nodes[0]?.kind==="selector"&&p.nodes[0]?.value[0]===":"&&(a=!0,p.nodes.unshift({kind:"selector",value:"*"}))}),a&&(n.selector=pe(s))}}),re(i)}catch{return Symbol()}})}var hi=Symbol();function $a(t){let r=t.storage[yt],i=new K(()=>[]);for(let[e,n]of t.variants.entries())if(n.kind==="static"){let s=r.get(e);if(typeof s!="string")continue;i.get(s).push(e)}return i}function Sa(t,r){let i=t.theme.values.get,e=new Set;t.theme.values.get=n=>{let s=i.call(t.theme.values,n);return s===void 0||s.options&1&&(e.add(s),s.options&=-2),s};try{return r()}finally{t.theme.values.get=i;for(let n of e)n.options|=1}}function*Ta(t){let r=t.length,i=1n<=2;e--){let n=(1n<>BigInt(u)&1n&&s.push(t[u]);yield s;let a=n&-n,p=n+a;n=((p^n)>>2n)/a|p}}}function si(t,r){if(typeof t.intersection=="function")return t.intersection(r);if(t.size===0||r.size===0)return new Set;let i=new Set(t);for(let e of r)i.has(e)||i.delete(e);return i}var Na=/^\d+\/\d+$/;function vi(t){let r=new K(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of t.utilities.keys("static")){if(t.utilities.getCompletions(n).length===0)continue;let a=r.get(n);a.fraction=!1,a.modifiers=[]}for(let n of t.utilities.keys("functional")){let s=t.utilities.getCompletions(n);for(let a of s)for(let p of a.values){let u=p!==null&&Na.test(p),f=p===null?n:`${n}-${p}`,m=r.get(f);if(m.utility=n,m.fraction||=u,m.modifiers.push(...a.modifiers),a.supportsNegative){let d=r.get(`-${f}`);d.utility=`-${n}`,d.fraction||=u,d.modifiers.push(...a.modifiers)}m.modifiers=Array.from(new Set(m.modifiers))}}if(r.size===0)return[];let i=Array.from(r.values());return i.sort((n,s)=>pt(n.name,s.name)),Ea(i)}function Ea(t){let r=[],i=null,e=new Map,n=new K(()=>[]);for(let a of t){let{utility:p,fraction:u}=a;i||(i={utility:p,items:[]},e.set(p,i)),p!==i.utility&&(r.push(i),i={utility:p,items:[]},e.set(p,i)),u?n.get(p).push(a):i.items.push(a)}i&&r[r.length-1]!==i&&r.push(i);for(let[a,p]of n){let u=e.get(a);u&&u.items.push(...p)}let s=[];for(let a of r)for(let p of a.items)s.push([p.name,{modifiers:p.modifiers}]);return s}function wi(t){let r=[];for(let[e,n]of t.variants.entries()){let p=function({value:u,modifier:f}={}){let m=e;u&&(m+=s?`-${u}`:u),f&&(m+=`/${f}`);let d=t.parseVariant(m);if(!d)return[];let c=G(".__placeholder__",[]);if(ze(c,d,t.variants)===null)return[];let w=[];return I(c.nodes,{exit(h,y){if(h.kind!=="rule"&&h.kind!=="at-rule"||h.nodes.length>0)return;let x=y.path();x.push(h),x.sort((k,U)=>{let N=k.kind==="at-rule",O=U.kind==="at-rule";return N&&!O?-1:!N&&O?1:0});let $=x.flatMap(k=>k.kind==="rule"?k.selector==="&"?[]:[k.selector]:k.kind==="at-rule"?[`${k.name} ${k.params}`]:[]),A="";for(let k=$.length-1;k>=0;k--)A=A===""?$[k]:`${$[k]} { ${A} }`;w.push(A)}}),w};var i=p;if(n.kind==="arbitrary")continue;let s=e!=="@",a=t.variants.getCompletions(e);switch(n.kind){case"static":{r.push({name:e,values:a,isArbitrary:!1,hasDash:s,selectors:p});break}case"functional":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:p});break}case"compound":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:p});break}}}return r}function yi(t,r){let{astNodes:i,nodeSorting:e}=Ce(Array.from(r),t),n=new Map(r.map(a=>[a,null])),s=0n;for(let a of i){let p=e.get(a)?.candidate;p&&n.set(p,n.get(p)??s++)}return r.map(a=>[a,n.get(a)??null])}var kt=/^@?[a-z0-9][a-zA-Z0-9_-]*(?{a.kind==="rule"?n.push(a.selector):a.kind==="at-rule"&&a.name==="@variant"?s=!0:a.kind==="at-rule"&&a.name!=="@slot"&&n.push(`${a.name} ${a.params}`)}),this.static(r,a=>{let p=i.map(ee);s&&Qe(p,e),Gt(p,a.nodes),a.nodes=p},{compounds:Pe(n)})}functional(r,i,{compounds:e,order:n}={}){this.set(r,{kind:"functional",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}compound(r,i,e,{compounds:n,order:s}={}){this.set(r,{kind:"compound",applyFn:e,compoundsWith:i,compounds:n??2,order:s})}group(r,i){this.groupOrder=this.nextOrder(),i&&this.compareFns.set(this.groupOrder,i),r(),this.groupOrder=null}has(r){return this.variants.has(r)}get(r){return this.variants.get(r)}kind(r){return this.variants.get(r)?.kind}compoundsWith(r,i){let e=this.variants.get(r),n=typeof i=="string"?this.variants.get(i):i.kind==="arbitrary"?{compounds:Pe([i.selector])}:this.variants.get(i.root);return!(!e||!n||e.kind!=="compound"||n.compounds===0||e.compoundsWith===0||(e.compoundsWith&n.compounds)===0)}suggest(r,i){this.completions.set(r,i)}getCompletions(r){return this.completions.get(r)?.()??[]}compare(r,i){if(r===i)return 0;if(r===null)return-1;if(i===null)return 1;if(r.kind==="arbitrary"&&i.kind==="arbitrary")return r.selector{c.nodes=m.map(w=>J(w,c.nodes))},{compounds:d})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function e(f,m){return m.map(d=>{d=d.trim();let c=j(d," ");return c[0]==="not"?c.slice(1).join(" "):f==="@container"?c[0][0]==="("?`not ${d}`:c[1]==="not"?`${c[0]} ${c.slice(2).join(" ")}`:`${c[0]} not ${c.slice(1).join(" ")}`:`not ${d}`})}let n=["@media","@supports","@container"];function s(f){for(let m of n){if(m!==f.name)continue;let d=j(f.params,",");return d.length>1?null:(d=e(f.name,d),F(f.name,d.join(", ")))}return null}function a(f){return f.includes("::")?null:`&:not(${j(f,",").map(d=>(d=d.replaceAll("&","*"),d)).join(", ")})`}r.compound("not",3,(f,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative||m.modifier)return null;let d=!1;if(I([f],(c,w)=>{if(c.kind!=="rule"&&c.kind!=="at-rule")return E.Continue;if(c.nodes.length>0)return E.Continue;let h=[],y=[],x=w.path();x.push(c);for(let A of x)A.kind==="at-rule"?h.push(A):A.kind==="rule"&&y.push(A);if(h.length>1)return E.Stop;if(y.length>1)return E.Stop;let $=[];for(let A of y){let k=a(A.selector);if(!k)return d=!1,E.Stop;$.push(G(k,[]))}for(let A of h){let k=s(A);if(!k)return d=!1,E.Stop;$.push(k)}return Object.assign(f,G("&",$)),d=!0,E.Skip}),f.kind==="rule"&&f.selector==="&"&&f.nodes.length===1&&Object.assign(f,f.nodes[0]),!d)return null}),r.suggest("not",()=>Array.from(r.keys()).filter(f=>r.compoundsWith("not",f))),r.compound("group",2,(f,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative)return null;let d=m.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}group\\/${m.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}group)`,c=!1;if(I([f],(w,h)=>{if(w.kind!=="rule")return E.Continue;for(let x of h.path())if(x.kind==="rule")return c=!1,E.Stop;let y=w.selector.replaceAll("&",d);j(y,",").length>1&&(y=`:is(${y})`),w.selector=`&:is(${y} *)`,c=!0}),!c)return null}),r.suggest("group",()=>Array.from(r.keys()).filter(f=>r.compoundsWith("group",f))),r.compound("peer",2,(f,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative)return null;let d=m.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}peer\\/${m.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}peer)`,c=!1;if(I([f],(w,h)=>{if(w.kind!=="rule")return E.Continue;for(let x of h.path())if(x.kind==="rule")return c=!1,E.Stop;let y=w.selector.replaceAll("&",d);j(y,",").length>1&&(y=`:is(${y})`),w.selector=`&:is(${y} ~ *)`,c=!0}),!c)return null}),r.suggest("peer",()=>Array.from(r.keys()).filter(f=>r.compoundsWith("peer",f))),i("first-letter",["&::first-letter"]),i("first-line",["&::first-line"]),i("marker",["& *::marker","&::marker","& *::-webkit-details-marker","&::-webkit-details-marker"]),i("selection",["& *::selection","&::selection"]),i("file",["&::file-selector-button"]),i("placeholder",["&::placeholder"]),i("backdrop",["&::backdrop"]),i("details-content",["&::details-content"]);{let f=function(){return W([F("@property","--tw-content",[o("syntax",'"*"'),o("initial-value",'""'),o("inherits","false")])])};var p=f;r.static("before",m=>{m.nodes=[G("&::before",[f(),o("content","var(--tw-content)"),...m.nodes])]},{compounds:0}),r.static("after",m=>{m.nodes=[G("&::after",[f(),o("content","var(--tw-content)"),...m.nodes])]},{compounds:0})}i("first",["&:first-child"]),i("last",["&:last-child"]),i("only",["&:only-child"]),i("odd",["&:nth-child(odd)"]),i("even",["&:nth-child(even)"]),i("first-of-type",["&:first-of-type"]),i("last-of-type",["&:last-of-type"]),i("only-of-type",["&:only-of-type"]),i("visited",["&:visited"]),i("target",["&:target"]),i("open",["&:is([open], :popover-open, :open)"]),i("default",["&:default"]),i("checked",["&:checked"]),i("indeterminate",["&:indeterminate"]),i("placeholder-shown",["&:placeholder-shown"]),i("autofill",["&:autofill"]),i("optional",["&:optional"]),i("required",["&:required"]),i("valid",["&:valid"]),i("invalid",["&:invalid"]),i("user-valid",["&:user-valid"]),i("user-invalid",["&:user-invalid"]),i("in-range",["&:in-range"]),i("out-of-range",["&:out-of-range"]),i("read-only",["&:read-only"]),i("empty",["&:empty"]),i("focus-within",["&:focus-within"]),r.static("hover",f=>{f.nodes=[G("&:hover",[F("@media","(hover: hover)",f.nodes)])]}),i("focus",["&:focus"]),i("focus-visible",["&:focus-visible"]),i("active",["&:active"]),i("enabled",["&:enabled"]),i("disabled",["&:disabled"]),i("inert",["&:is([inert], [inert] *)"]),r.compound("in",2,(f,m)=>{if(m.modifier)return null;let d=!1;if(I([f],(c,w)=>{if(c.kind!=="rule")return E.Continue;for(let h of w.path())if(h.kind==="rule")return d=!1,E.Stop;c.selector=`:where(${c.selector.replaceAll("&","*")}) &`,d=!0}),!d)return null}),r.suggest("in",()=>Array.from(r.keys()).filter(f=>r.compoundsWith("in",f))),r.compound("has",2,(f,m)=>{if(m.modifier)return null;let d=!1;if(I([f],(c,w)=>{if(c.kind!=="rule")return E.Continue;for(let h of w.path())if(h.kind==="rule")return d=!1,E.Stop;c.selector=`&:has(${c.selector.replaceAll("&","*")})`,d=!0}),!d)return null}),r.suggest("has",()=>Array.from(r.keys()).filter(f=>r.compoundsWith("has",f))),r.functional("aria",(f,m)=>{if(!m.value||m.modifier)return null;m.value.kind==="arbitrary"?f.nodes=[G(`&[aria-${ki(m.value.value)}]`,f.nodes)]:f.nodes=[G(`&[aria-${m.value.value}="true"]`,f.nodes)]}),r.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),r.functional("data",(f,m)=>{if(!m.value||m.modifier)return null;f.nodes=[G(`&[data-${ki(m.value.value)}]`,f.nodes)]}),r.functional("nth",(f,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!P(m.value.value))return null;f.nodes=[G(`&:nth-child(${m.value.value})`,f.nodes)]}),r.functional("nth-last",(f,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!P(m.value.value))return null;f.nodes=[G(`&:nth-last-child(${m.value.value})`,f.nodes)]}),r.functional("nth-of-type",(f,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!P(m.value.value))return null;f.nodes=[G(`&:nth-of-type(${m.value.value})`,f.nodes)]}),r.functional("nth-last-of-type",(f,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!P(m.value.value))return null;f.nodes=[G(`&:nth-last-of-type(${m.value.value})`,f.nodes)]}),r.functional("supports",(f,m)=>{if(!m.value||m.modifier)return null;let d=m.value.value;if(d===null)return null;if(/^[\w-]*\s*\(/.test(d)){let c=d.replace(/\b(and|or|not)\b/g," $1 ");f.nodes=[F("@supports",c,f.nodes)];return}d.includes(":")||(d=`${d}: var(--tw)`),(d[0]!=="("||d[d.length-1]!==")")&&(d=`(${d})`),f.nodes=[F("@supports",d,f.nodes)]},{compounds:1}),i("motion-safe",["@media (prefers-reduced-motion: no-preference)"]),i("motion-reduce",["@media (prefers-reduced-motion: reduce)"]),i("contrast-more",["@media (prefers-contrast: more)"]),i("contrast-less",["@media (prefers-contrast: less)"]);{let f=function(m,d,c,w){if(m===d)return 0;let h=w.get(m);if(h===null)return c==="asc"?-1:1;let y=w.get(d);return y===null?c==="asc"?1:-1:Ve(h,y,c)};var u=f;{let m=t.namespace("--breakpoint"),d=new K(c=>{switch(c.kind){case"static":return t.resolveValue(c.root,["--breakpoint"])??null;case"functional":{if(!c.value||c.modifier)return null;let w=null;return c.value.kind==="arbitrary"?w=c.value.value:c.value.kind==="named"&&(w=t.resolveValue(c.value.value,["--breakpoint"])),!w||w.includes("var(")?null:w}case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("max",(c,w)=>{if(w.modifier)return null;let h=d.get(w);if(h===null)return null;c.nodes=[F("@media",`(width < ${h})`,c.nodes)]},{compounds:1})},(c,w)=>f(c,w,"desc",d)),r.suggest("max",()=>Array.from(m.keys()).filter(c=>c!==null)),r.group(()=>{for(let[c,w]of t.namespace("--breakpoint"))c!==null&&r.static(c,h=>{h.nodes=[F("@media",`(width >= ${w})`,h.nodes)]},{compounds:1});r.functional("min",(c,w)=>{if(w.modifier)return null;let h=d.get(w);if(h===null)return null;c.nodes=[F("@media",`(width >= ${h})`,c.nodes)]},{compounds:1})},(c,w)=>f(c,w,"asc",d)),r.suggest("min",()=>Array.from(m.keys()).filter(c=>c!==null))}{let m=t.namespace("--container"),d=new K(c=>{switch(c.kind){case"functional":{if(c.value===null)return null;let w=null;return c.value.kind==="arbitrary"?w=c.value.value:c.value.kind==="named"&&(w=t.resolveValue(c.value.value,["--container"])),!w||w.includes("var(")?null:w}case"static":case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("@max",(c,w)=>{let h=d.get(w);if(h===null)return null;c.nodes=[F("@container",w.modifier?`${w.modifier.value} (width < ${h})`:`(width < ${h})`,c.nodes)]},{compounds:1})},(c,w)=>f(c,w,"desc",d)),r.suggest("@max",()=>Array.from(m.keys()).filter(c=>c!==null)),r.group(()=>{r.functional("@",(c,w)=>{let h=d.get(w);if(h===null)return null;c.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${h})`:`(width >= ${h})`,c.nodes)]},{compounds:1}),r.functional("@min",(c,w)=>{let h=d.get(w);if(h===null)return null;c.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${h})`:`(width >= ${h})`,c.nodes)]},{compounds:1})},(c,w)=>f(c,w,"asc",d)),r.suggest("@min",()=>Array.from(m.keys()).filter(c=>c!==null)),r.suggest("@",()=>Array.from(m.keys()).filter(c=>c!==null))}}return i("portrait",["@media (orientation: portrait)"]),i("landscape",["@media (orientation: landscape)"]),i("ltr",['&:where(:dir(ltr), [dir="ltr"], [dir="ltr"] *)']),i("rtl",['&:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *)']),i("dark",["@media (prefers-color-scheme: dark)"]),i("starting",["@starting-style"]),i("print",["@media print"]),i("forced-colors",["@media (forced-colors: active)"]),i("inverted-colors",["@media (inverted-colors: inverted)"]),i("pointer-none",["@media (pointer: none)"]),i("pointer-coarse",["@media (pointer: coarse)"]),i("pointer-fine",["@media (pointer: fine)"]),i("any-pointer-none",["@media (any-pointer: none)"]),i("any-pointer-coarse",["@media (any-pointer: coarse)"]),i("any-pointer-fine",["@media (any-pointer: fine)"]),i("noscript",["@media (scripting: none)"]),r}function ki(t){if(t.includes("=")){let[r,...i]=j(t,"="),e=i.join("=").trim();if(e[0]==="'"||e[0]==='"')return t;if(e.length>1){let n=e[e.length-1];if(e[e.length-2]===" "&&(n==="i"||n==="I"||n==="s"||n==="S"))return`${r}="${e.slice(0,-2)}" ${n}`}return`${r}="${e}"`}return t}function Gt(t,r){I(t,i=>{if(i.kind==="at-rule"&&i.name==="@slot")return E.Replace(r);if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,W([F(i.name,i.params,i.nodes)])),E.Skip})}function Qe(t,r){let i=0;return I(t,e=>{if(e.kind!=="at-rule"||e.name!=="@variant")return;let n=G("&",e.nodes),s=e.params,a=r.parseVariant(s);if(a===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${s}`);if(ze(n,a,r.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${s}`);return i|=32,E.Replace(n)}),i}function xi(t,r){let i=Dr(t),e=bi(t),n=new K(d=>Nr(d,m)),s=new K(d=>Array.from(Vr(d,m))),a=new K(d=>new K(c=>{let w=Ai(c,m,d);try{De(w.map(({node:h})=>h),m),Qe(w.map(({node:h})=>h),m)}catch{return[]}return w})),p=new K(d=>{for(let c of st(d))t.markUsedVariable(c)});function u(d){let c=[];for(let w of d){let h=!0,{astNodes:y}=Ce([w],m,{onInvalidCandidate(){h=!1}});r&&I(y,x=>(x.src??=r,E.Continue)),y=Te(y,m,0),c.push(h?y:[])}return c}function f(d){return u(d).map(c=>c.length>0?re(c):null)}let m={theme:t,utilities:i,variants:e,invalidCandidates:new Set,important:!1,candidatesToCss:f,candidatesToAst:u,getClassOrder(d){return yi(this,d)},getClassList(){return vi(this)},getVariants(){return wi(this)},parseCandidate(d){return s.get(d)},parseVariant(d){return n.get(d)},compileAstNodes(d,c=1){return a.get(c).get(d)},printCandidate(d){return Rr(m,d)},printVariant(d){return ut(d)},getVariantOrder(){let d=Array.from(n.values());d.sort((y,x)=>this.variants.compare(y,x));let c=new Map,w,h=0;for(let y of d)y!==null&&(w!==void 0&&this.variants.compare(w,y)!==0&&h++,c.set(y,h),w=y);return c},resolveThemeValue(d,c=!0){let w=d.lastIndexOf("/"),h=null;w!==-1&&(h=d.slice(w+1).trim(),d=d.slice(0,w).trim());let y=t.resolve(null,[d],c?1:0)??void 0;return h&&y?Q(y,h):y},trackUsedVariables(d){p.get(d)},canonicalizeCandidates(d,c){return Mt(this,d,c)},storage:{}};return m}var qt=["container-type","pointer-events","visibility","position","inset","inset-inline","inset-block","inset-inline-start","inset-inline-end","top","right","bottom","left","isolation","z-index","order","grid-column","grid-column-start","grid-column-end","grid-row","grid-row-start","grid-row-end","float","clear","--tw-container-component","margin","margin-inline","margin-block","margin-inline-start","margin-inline-end","margin-top","margin-right","margin-bottom","margin-left","box-sizing","display","field-sizing","aspect-ratio","height","max-height","min-height","width","max-width","min-width","flex","flex-shrink","flex-grow","flex-basis","table-layout","caption-side","border-collapse","border-spacing","transform-origin","translate","--tw-translate-x","--tw-translate-y","--tw-translate-z","scale","--tw-scale-x","--tw-scale-y","--tw-scale-z","rotate","--tw-rotate-x","--tw-rotate-y","--tw-rotate-z","--tw-skew-x","--tw-skew-y","transform","animation","cursor","touch-action","--tw-pan-x","--tw-pan-y","--tw-pinch-zoom","resize","scroll-snap-type","--tw-scroll-snap-strictness","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-margin-inline","scroll-margin-block","scroll-margin-inline-start","scroll-margin-inline-end","scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left","scroll-padding","scroll-padding-inline","scroll-padding-block","scroll-padding-inline-start","scroll-padding-inline-end","scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left","list-style-position","list-style-type","list-style-image","appearance","columns","break-before","break-inside","break-after","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-template-columns","grid-template-rows","flex-direction","flex-wrap","place-content","place-items","align-content","align-items","justify-content","justify-items","gap","column-gap","row-gap","--tw-space-x-reverse","--tw-space-y-reverse","divide-x-width","divide-y-width","--tw-divide-y-reverse","divide-style","divide-color","place-self","align-self","justify-self","overflow","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-behavior","border-radius","border-start-radius","border-end-radius","border-top-radius","border-right-radius","border-bottom-radius","border-left-radius","border-start-start-radius","border-start-end-radius","border-end-end-radius","border-end-start-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-width","border-inline-width","border-block-width","border-inline-start-width","border-inline-end-width","border-top-width","border-right-width","border-bottom-width","border-left-width","border-style","border-inline-style","border-block-style","border-inline-start-style","border-inline-end-style","border-top-style","border-right-style","border-bottom-style","border-left-style","border-color","border-inline-color","border-block-color","border-inline-start-color","border-inline-end-color","border-top-color","border-right-color","border-bottom-color","border-left-color","background-color","background-image","--tw-gradient-position","--tw-gradient-stops","--tw-gradient-via-stops","--tw-gradient-from","--tw-gradient-from-position","--tw-gradient-via","--tw-gradient-via-position","--tw-gradient-to","--tw-gradient-to-position","mask-image","--tw-mask-top","--tw-mask-top-from-color","--tw-mask-top-from-position","--tw-mask-top-to-color","--tw-mask-top-to-position","--tw-mask-right","--tw-mask-right-from-color","--tw-mask-right-from-position","--tw-mask-right-to-color","--tw-mask-right-to-position","--tw-mask-bottom","--tw-mask-bottom-from-color","--tw-mask-bottom-from-position","--tw-mask-bottom-to-color","--tw-mask-bottom-to-position","--tw-mask-left","--tw-mask-left-from-color","--tw-mask-left-from-position","--tw-mask-left-to-color","--tw-mask-left-to-position","--tw-mask-linear","--tw-mask-linear-position","--tw-mask-linear-from-color","--tw-mask-linear-from-position","--tw-mask-linear-to-color","--tw-mask-linear-to-position","--tw-mask-radial","--tw-mask-radial-shape","--tw-mask-radial-size","--tw-mask-radial-position","--tw-mask-radial-from-color","--tw-mask-radial-from-position","--tw-mask-radial-to-color","--tw-mask-radial-to-position","--tw-mask-conic","--tw-mask-conic-position","--tw-mask-conic-from-color","--tw-mask-conic-from-position","--tw-mask-conic-to-color","--tw-mask-conic-to-position","box-decoration-break","background-size","background-attachment","background-clip","background-position","background-repeat","background-origin","mask-composite","mask-mode","mask-type","mask-size","mask-clip","mask-position","mask-repeat","mask-origin","fill","stroke","stroke-width","object-fit","object-position","padding","padding-inline","padding-block","padding-inline-start","padding-inline-end","padding-top","padding-right","padding-bottom","padding-left","text-align","text-indent","vertical-align","font-family","font-size","line-height","font-weight","letter-spacing","text-wrap","overflow-wrap","word-break","text-overflow","hyphens","white-space","color","text-transform","font-style","font-stretch","font-variant-numeric","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","-webkit-font-smoothing","placeholder-color","caret-color","accent-color","color-scheme","opacity","background-blend-mode","mix-blend-mode","box-shadow","--tw-shadow","--tw-shadow-color","--tw-ring-shadow","--tw-ring-color","--tw-inset-shadow","--tw-inset-shadow-color","--tw-inset-ring-shadow","--tw-inset-ring-color","--tw-ring-offset-width","--tw-ring-offset-color","outline","outline-width","outline-offset","outline-color","--tw-blur","--tw-brightness","--tw-contrast","--tw-drop-shadow","--tw-grayscale","--tw-hue-rotate","--tw-invert","--tw-saturate","--tw-sepia","filter","--tw-backdrop-blur","--tw-backdrop-brightness","--tw-backdrop-contrast","--tw-backdrop-grayscale","--tw-backdrop-hue-rotate","--tw-backdrop-invert","--tw-backdrop-opacity","--tw-backdrop-saturate","--tw-backdrop-sepia","backdrop-filter","transition-property","transition-behavior","transition-delay","transition-duration","transition-timing-function","will-change","contain","content","forced-color-adjust"];function Ce(t,r,{onInvalidCandidate:i,respectImportant:e}={}){let n=new Map,s=[],a=new Map;for(let f of t){if(r.invalidCandidates.has(f)){i?.(f);continue}let m=r.parseCandidate(f);if(m.length===0){i?.(f);continue}a.set(f,m)}let p=0;(e??!0)&&(p|=1);let u=r.getVariantOrder();for(let[f,m]of a){let d=!1;for(let c of m){let w=r.compileAstNodes(c,p);if(w.length!==0){d=!0;for(let{node:h,propertySort:y}of w){let x=0n;for(let $ of c.variants)x|=1n<{let d=n.get(f),c=n.get(m);if(d.variants-c.variants!==0n)return Number(d.variants-c.variants);let w=0;for(;w1)return null;for(let u of a.nodes)if(u.kind!=="rule"&&u.kind!=="at-rule"||n(u,r)===null)return null;I(a.nodes,u=>{if((u.kind==="rule"||u.kind==="at-rule")&&u.nodes.length<=0)return u.nodes=t.nodes,E.Skip}),t.nodes=a.nodes;return}if(n(t,r)===null)return null}function Ci(t){let r=t.options?.types??[];return r.length>1&&r.includes("any")}function Ra(t,r){if(t.kind==="arbitrary"){let a=t.value;return t.modifier&&(a=X(a,t.modifier,r.theme)),a===null?[]:[[o(t.property,a)]]}let i=r.utilities.get(t.root)??[],e=[],n=i.filter(a=>!Ci(a));for(let a of n){if(a.kind!==t.kind)continue;let p=a.compileFn(t);if(p!==void 0){if(p===null)return e;e.push(p)}}if(e.length>0)return e;let s=i.filter(a=>Ci(a));for(let a of s){if(a.kind!==t.kind)continue;let p=a.compileFn(t);if(p!==void 0){if(p===null)return e;e.push(p)}}return e}function $i(t){for(let r of t)r.kind!=="at-root"&&(r.kind==="declaration"?r.important=!0:(r.kind==="rule"||r.kind==="at-rule")&&$i(r.nodes))}function Oa(t){let r=new Set,i=0,e=t.slice(),n=!1;for(;e.length>0;){let s=e.shift();if(s.kind==="declaration"){if(s.value===void 0||(i++,n))continue;if(s.property==="--tw-sort"){let p=qt.indexOf(s.value??"");if(p!==-1){r.add(p),n=!0;continue}}let a=qt.indexOf(s.property);a!==-1&&r.add(a)}else if(s.kind==="rule"||s.kind==="at-rule")for(let a of s.nodes)e.push(a)}return{order:Array.from(r).sort((s,a)=>s-a),count:i}}function Ae(t,r){let i=0,e=J("&",t),n=new Set,s=new K(()=>new Set),a=new K(()=>new Set);I([e],(d,c)=>{if(d.kind==="at-rule"){if(d.name==="@keyframes")return I(d.nodes,w=>{if(w.kind==="at-rule"&&w.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),E.Skip;if(d.name==="@utility"){let w=d.params.replace(/-\*$/,"");a.get(w).add(d),I(d.nodes,h=>{if(!(h.kind!=="at-rule"||h.name!=="@apply")){n.add(d);for(let y of Si(h,r))s.get(d).add(y)}});return}if(d.name==="@apply"){if(c.parent===null)return;i|=1,n.add(c.parent);for(let w of Si(d,r))for(let h of c.path())n.has(h)&&s.get(h).add(w)}}});let p=new Set,u=[],f=new Set;function m(d,c=[]){if(!p.has(d)){if(f.has(d)){let w=c[(c.indexOf(d)+1)%c.length];throw d.kind==="at-rule"&&d.name==="@utility"&&w.kind==="at-rule"&&w.name==="@utility"&&I(d.nodes,h=>{if(h.kind!=="at-rule"||h.name!=="@apply")return;let y=h.params.split(/\s+/g);for(let x of y)for(let $ of r.parseCandidate(x))switch($.kind){case"arbitrary":break;case"static":case"functional":if(w.params.replace(/-\*$/,"")===$.root)throw new Error(`You cannot \`@apply\` the \`${x}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${re([d])} +Relies on: + +${re([w])}`)}f.add(d);for(let w of s.get(d))for(let h of a.get(w))c.push(d),m(h,c),c.pop();p.add(d),f.delete(d),u.push(d)}}for(let d of n)m(d);for(let d of u)"nodes"in d&&I(d.nodes,c=>{if(c.kind!=="at-rule"||c.name!=="@apply")return;let w=c.params.split(/(\s+)/g),h={},y=0;for(let[x,$]of w.entries())x%2===0&&(h[$]=y),y+=$.length;{let x=Object.keys(h),$=Ce(x,r,{respectImportant:!1,onInvalidCandidate:N=>{if(r.theme.prefix&&!N.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${N}\`. Did you mean \`${r.theme.prefix}:${N}\`?`);if(r.invalidCandidates.has(N))throw new Error(`Cannot apply utility class \`${N}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let O=j(N,":");if(O.length>1){let L=O.pop();if(r.candidatesToCss([L])[0]){let _=r.candidatesToCss(O.map(Y=>`${Y}:[--tw-variant-check:1]`)),z=O.filter((Y,q)=>_[q]===null);if(z.length>0){if(z.length===1)throw new Error(`Cannot apply utility class \`${N}\` because the ${z.map(Y=>`\`${Y}\``)} variant does not exist.`);{let Y=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${N}\` because the ${Y.format(z.map(q=>`\`${q}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${N}\`. Are you using CSS modules or similar and missing \`@reference\`? https://tailwindcss.com/docs/functions-and-directives#reference-directive`):new Error(`Cannot apply unknown utility class \`${N}\``)}}),A=c.src,k=$.astNodes.map(N=>{let O=$.nodeSorting.get(N)?.candidate,L=O?h[O]:void 0;if(N=ee(N),!A||!O||L===void 0)return I([N],z=>{z.src=A}),N;let _=[A[0],A[1],A[2]];return _[1]+=7+L,_[2]=_[1]+O.length,I([N],z=>{z.src=_}),N}),U=[];for(let N of k)if(N.kind==="rule")for(let O of N.nodes)U.push(O);else U.push(N);return E.Replace(U)}});return i}function*Si(t,r){for(let i of t.params.split(/\s+/g))for(let e of r.parseCandidate(i))switch(e.kind){case"arbitrary":break;case"static":case"functional":yield e.root;break;default:}}async function Zt(t,r,i,e=0,n=!1){let s=0,a=[];return I(t,p=>{if(p.kind==="at-rule"&&(p.name==="@import"||p.name==="@reference")){let u=Pa(B(p.params));if(u===null)return;p.name==="@reference"&&(u.media="reference"),s|=2;let{uri:f,layer:m,media:d,supports:c}=u;if(f.startsWith("data:")||f.startsWith("http://")||f.startsWith("https://"))return;let w=ce({},[]);return a.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${f}\` in \`${r}\`)`);let h=await i(f,r),y=$e(h.content,{from:n?h.path:void 0});await Zt(y,h.base,i,e+1,n),w.nodes=Ia(p,[ce({base:h.base},y)],m,d,c)})()),E.ReplaceSkip(w)}}),a.length>0&&await Promise.all(a),s}function Pa(t){let r,i=null,e=null,n=null;for(let s=0;s{let f=Oe(n),[m,d]=_a(t.theme,f),c=i(Ti(r()??{},f)??null);if(typeof c=="string"&&(c=c.replace("","1")),typeof m!="object")return typeof d!="object"&&d&4?c??m:m;if(c!==null&&typeof c=="object"&&!Array.isArray(c)){let w=Xe({},[c],(h,y)=>y);if(m===null&&Object.hasOwn(c,"__CSS_VALUES__")){let h={};for(let y in c.__CSS_VALUES__)h[y]=c[y],delete w[y];m=h}for(let h in m)h!=="__CSS_VALUES__"&&(c?.__CSS_VALUES__?.[h]&4&&Ti(w,h.split("-"))!==void 0||(w[Se(h)]=m[h]));return w}if(Array.isArray(m)&&Array.isArray(d)&&Array.isArray(c)){let w=m[0],h=m[1];d[0]&4&&(w=c[0]??w);for(let y of Object.keys(h))d[1][y]&4&&(h[y]=c[1][y]??h[y]);return[w,h]}return m??c})();return p&&typeof u=="string"&&(u=Q(u,p)),u??s}}function _a(t,r){if(r.length===1&&r[0].startsWith("--"))return[t.get([r[0]]),t.getOptions(r[0])];let i=je(r),e=new Map,n=new K(()=>new Map),s=t.namespace(`--${i}`);if(s.size===0)return[null,0];let a=new Map;for(let[m,d]of s){if(!m||!m.includes("--")){e.set(m,d),a.set(m,t.getOptions(m?`--${i}-${m}`:`--${i}`));continue}let c=m.indexOf("--"),w=m.slice(0,c),h=m.slice(c+2);h=h.replace(/-([a-z])/g,(y,x)=>x.toUpperCase()),n.get(w===""?null:w).set(h,[d,t.getOptions(`--${i}${m}`)])}let p=t.getOptions(`--${i}`);for(let[m,d]of n){let c=e.get(m);if(typeof c!="string")continue;let w={},h={};for(let[y,[x,$]]of d)w[y]=x,h[y]=$;e.set(m,[c,w]),a.set(m,[p,h])}let u={},f={};for(let[m,d]of e)Vi(u,[m??"DEFAULT"],d);for(let[m,d]of a)Vi(f,[m??"DEFAULT"],d);return r[r.length-1]==="DEFAULT"?[u?.DEFAULT??null,f.DEFAULT??0]:"DEFAULT"in u&&Object.keys(u).length===1?[u.DEFAULT,f.DEFAULT??0]:(u.__CSS_VALUES__=f,[u,f])}function Ti(t,r){for(let i=0;i{m.src=s}),r.push(f)},addVariant(p,u){if(!kt.test(p))throw new Error(`\`addVariant('${p}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes, or underscore characters and start with a lowercase letter or number.`);if(typeof u=="string"){if(u.includes(":merge("))return}else if(Array.isArray(u)){if(u.some(m=>m.includes(":merge(")))return}else if(typeof u=="object"){let m=function(d,c){return Object.entries(d).some(([w,h])=>w.includes(c)||typeof h=="object"&&m(h,c))};var f=m;if(m(u,":merge("))return}typeof u=="string"||Array.isArray(u)?t.variants.static(p,m=>{m.nodes=Ei(u,m.nodes)},{compounds:Pe(typeof u=="string"?[u]:u)}):typeof u=="object"&&t.variants.fromAst(p,me(u),t)},matchVariant(p,u,f){function m(c,w,h){let y=u(c,{modifier:w?.value??null});return Ei(y,h)}try{let c=u("a",{modifier:null});if(typeof c=="string"&&c.includes(":merge("))return;if(Array.isArray(c)&&c.some(w=>w.includes(":merge(")))return}catch{}let d=Object.keys(f?.values??{});t.variants.group(()=>{t.variants.functional(p,(c,w)=>{if(!w.value){if(f?.values&&"DEFAULT"in f.values){c.nodes=m(f.values.DEFAULT,w.modifier,c.nodes);return}return null}if(w.value.kind==="arbitrary")c.nodes=m(w.value.value,w.modifier,c.nodes);else if(w.value.kind==="named"&&f?.values){let h=f.values[w.value.value];if(typeof h!="string")return null;c.nodes=m(h,w.modifier,c.nodes)}else return null})},(c,w)=>{if(c.kind!=="functional"||w.kind!=="functional")return 0;let h=c.value?c.value.value:"DEFAULT",y=w.value?w.value.value:"DEFAULT",x=f?.values?.[h]??h,$=f?.values?.[y]??y;if(f&&typeof f.sort=="function")return f.sort({value:x,modifier:c.modifier?.value??null},{value:$,modifier:w.modifier?.value??null});let A=d.indexOf(h),k=d.indexOf(y);return A=A===-1?d.length:A,k=k===-1?d.length:k,A!==k?A-k:x<$?-1:1}),t.variants.suggest(p,()=>Object.keys(f?.values??{}).filter(c=>c!=="DEFAULT"))},addUtilities(p){p=Array.isArray(p)?p:[p];let u=p.flatMap(m=>Object.entries(m));u=u.flatMap(([m,d])=>j(m,",").map(c=>[c.trim(),d]));let f=new K(()=>[]);for(let[m,d]of u){if(m.startsWith("@keyframes ")){if(!n){let h=J(m,me(d));I([h],y=>{y.src=s}),r.push(h)}continue}let c=Re(m),w=!1;if(I(c,h=>{if(h.kind==="selector"&&h.value[0]==="."&&Ni.test(h.value.slice(1))){let y=h.value;h.value="&";let x=pe(c),$=y.slice(1),A=x==="&"?me(d):[J(x,me(d))];f.get($).push(...A),w=!0,h.value=y;return}if(h.kind==="function"&&h.value===":not")return E.Skip}),!w)throw new Error(`\`addUtilities({ '${m}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[m,d]of f)t.theme.prefix&&I(d,c=>{if(c.kind==="rule"){let w=Re(c.selector);I(w,h=>{h.kind==="selector"&&h.value[0]==="."&&(h.value=`.${t.theme.prefix}\\:${h.value.slice(1)}`)}),c.selector=pe(w)}}),t.utilities.static(m,c=>{let w=d.map(ee);return Ri(w,m,c.raw),e.current|=Ae(w,t),w})},matchUtilities(p,u){let f=u?.type?Array.isArray(u?.type)?u.type:[u.type]:["any"];for(let[d,c]of Object.entries(p)){let w=function({negative:h}){return y=>{if(y.value?.kind==="arbitrary"&&f.length>0&&!f.includes("any")&&(y.value.dataType&&!f.includes(y.value.dataType)||!y.value.dataType&&!H(y.value.value,f)))return;let x=f.includes("color"),$=null,A=!1;{let N=u?.values??{};x&&(N=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},N)),y.value?y.value.kind==="arbitrary"?$=y.value.value:y.value.fraction&&N[y.value.fraction]?($=N[y.value.fraction],A=!0):N[y.value.value]?$=N[y.value.value]:N.__BARE_VALUE__&&($=N.__BARE_VALUE__(y.value)??null,A=(y.value.fraction!==null&&$?.includes("/"))??!1):$=N.DEFAULT??null}if($===null)return;let k;{let N=u?.modifiers??null;y.modifier?N==="any"||y.modifier.kind==="arbitrary"?k=y.modifier.value:N?.[y.modifier.value]?k=N[y.modifier.value]:x&&!Number.isNaN(Number(y.modifier.value))?k=`${y.modifier.value}%`:k=null:k=null}if(y.modifier&&k===null&&!A)return y.value?.kind==="arbitrary"?null:void 0;x&&k!==null&&($=Q($,k)),h&&($=`calc(${$} * -1)`);let U=me(c($,{modifier:k}));return Ri(U,d,y.raw),e.current|=Ae(U,t),U}};var m=w;if(!Ni.test(d))throw new Error(`\`matchUtilities({ '${d}' : \u2026 })\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter, eg. \`scrollbar\`.`);u?.supportsNegativeValues&&t.utilities.functional(`-${d}`,w({negative:!0}),{types:f}),t.utilities.functional(d,w({negative:!1}),{types:f}),t.utilities.suggest(d,()=>{let h=u?.values??{},y=new Set(Object.keys(h));y.delete("__BARE_VALUE__"),y.delete("__CSS_VALUES__"),y.has("DEFAULT")&&(y.delete("DEFAULT"),y.add(null));let x=u?.modifiers??{},$=x==="any"?[]:Object.keys(x);return[{supportsNegative:u?.supportsNegativeValues??!1,values:Array.from(y),modifiers:$}]})}},addComponents(p,u){this.addUtilities(p,u)},matchComponents(p,u){this.matchUtilities(p,u)},theme:bt(t,()=>i.theme??{},p=>p),prefix(p){return p},config(p,u){let f=i;if(!p)return f;let m=Oe(p);for(let d=0;dObject.entries(e));for(let[e,n]of i)if(n!=null&&n!==!1)if(typeof n!="object"){if(!e.startsWith("--")){if(n==="@slot"){r.push(J(e,[F("@slot")]));continue}e=e.replace(/([A-Z])/g,"-$1").toLowerCase()}r.push(o(e,String(n)))}else if(Array.isArray(n))for(let s of n)typeof s=="string"?r.push(o(e,s)):r.push(J(e,me(s)));else r.push(J(e,me(n)));return r}function Ei(t,r){return(typeof t=="string"?[t]:t).flatMap(e=>{if(e.trim().endsWith("}")){let n=e.replace("}","{@slot}}"),s=$e(n);return Gt(s,r),s}else return J(e,r)})}function Ri(t,r,i){I(t,e=>{if(e.kind==="rule"){let n=Re(e.selector);I(n,s=>{s.kind==="selector"&&s.value===`.${r}`&&(s.value=`.${ye(i)}`)}),e.selector=pe(n)}})}function Oi(t,r){for(let i of Da(r))t.theme.addKeyframes(i)}function Da(t){let r=[];if("keyframes"in t.theme)for(let[i,e]of Object.entries(t.theme.keyframes))r.push(F("@keyframes",i,me(e)));return r}function Pi(t){return{theme:{...rr,colors:({theme:r})=>r("color",{}),extend:{fontSize:({theme:r})=>({...r("text",{})}),boxShadow:({theme:r})=>({...r("shadow",{})}),animation:({theme:r})=>({...r("animate",{})}),aspectRatio:({theme:r})=>({...r("aspect",{})}),borderRadius:({theme:r})=>({...r("radius",{})}),screens:({theme:r})=>({...r("breakpoint",{})}),letterSpacing:({theme:r})=>({...r("tracking",{})}),lineHeight:({theme:r})=>({...r("leading",{})}),transitionDuration:{DEFAULT:t.get(["--default-transition-duration"])??null},transitionTimingFunction:{DEFAULT:t.get(["--default-transition-timing-function"])??null},maxWidth:({theme:r})=>({...r("container",{})})}}}}var Ka={blocklist:[],future:{},experimental:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function Qt(t,r){let i={design:t,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(Ka)};for(let n of r)Jt(i,n);for(let n of i.configs)"darkMode"in n&&n.darkMode!==void 0&&(i.result.darkMode=n.darkMode??null),"prefix"in n&&n.prefix!==void 0&&(i.result.prefix=n.prefix??""),"blocklist"in n&&n.blocklist!==void 0&&(i.result.blocklist=n.blocklist??[]),"important"in n&&n.important!==void 0&&(i.result.important=n.important??!1);let e=La(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:e}}function Ua(t,r){if(Array.isArray(t)&&Me(t[0]))return t.concat(r);if(Array.isArray(r)&&Me(r[0])&&Me(t))return[t,...r];if(Array.isArray(r))return r}function Jt(t,{config:r,base:i,path:e,reference:n,src:s}){let a=[];for(let f of r.plugins??[])"__isOptionsFunction"in f?a.push({...f(),reference:n,src:s}):"handler"in f?a.push({...f,reference:n,src:s}):a.push({handler:f,reference:n,src:s});if(Array.isArray(r.presets)&&r.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let f of r.presets??[])Jt(t,{path:e,base:i,config:f,reference:n,src:s});for(let f of a)t.plugins.push(f),f.config&&Jt(t,{path:e,base:i,config:f.config,reference:!!f.reference,src:f.src??s});let p=r.content??[],u=Array.isArray(p)?p:p.files;for(let f of u)t.content.files.push(typeof f=="object"?f:{base:i,pattern:f});t.configs.push(r)}function La(t){let r=new Set,i=bt(t.design,()=>t.theme,n),e=Object.assign(i,{theme:i,colors:tr});function n(s){return typeof s=="function"?s(e)??null:s??null}for(let s of t.configs){let a=s.theme??{},p=a.extend??{};for(let u in a)u!=="extend"&&r.add(u);Object.assign(t.theme,a);for(let u in p)t.extend[u]??=[],t.extend[u].push(p[u])}delete t.theme.extend;for(let s in t.extend){let a=[t.theme[s],...t.extend[s]];t.theme[s]=()=>{let p=a.map(n);return Xe({},p,Ua)}}for(let s in t.theme)t.theme[s]=n(t.theme[s]);if(t.theme.screens&&typeof t.theme.screens=="object")for(let s of Object.keys(t.theme.screens)){let a=t.theme.screens[s];a&&typeof a=="object"&&("raw"in a||"max"in a||"min"in a&&(t.theme.screens[s]=a.min))}return r}function Ii(t,r){let i=t.theme.container||{};if(typeof i!="object"||i===null)return;let e=ja(i,r);e.length!==0&&r.utilities.static("container",()=>e.map(ee))}function ja({center:t,padding:r,screens:i},e){let n=[],s=null;if(t&&n.push(o("margin-inline","auto")),(typeof r=="string"||typeof r=="object"&&r!==null&&"DEFAULT"in r)&&n.push(o("padding-inline",typeof r=="string"?r:r.DEFAULT)),typeof i=="object"&&i!==null){s=new Map;let a=Array.from(e.theme.namespace("--breakpoint").entries());if(a.sort((p,u)=>Ve(p[1],u[1],"asc")),a.length>0){let[p]=a[0];n.push(F("@media",`(width >= --theme(--breakpoint-${p}))`,[o("max-width","none")]))}for(let[p,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;s.set(p,F("@media",`(width >= ${u})`,[o("max-width",u)]))}}if(typeof r=="object"&&r!==null){let a=Object.entries(r).filter(([p])=>p!=="DEFAULT").map(([p,u])=>[p,e.theme.resolveValue(p,["--breakpoint"]),u]).filter(Boolean);a.sort((p,u)=>Ve(p[1],u[1],"asc"));for(let[p,,u]of a)if(s&&s.has(p))s.get(p).nodes.push(o("padding-inline",u));else{if(s)continue;n.push(F("@media",`(width >= theme(--breakpoint-${p}))`,[o("padding-inline",u)]))}}if(s)for(let[,a]of s)n.push(a);return n}function _i({addVariant:t,config:r}){let i=r("darkMode",null),[e,n=".dark"]=Array.isArray(i)?i:[i];if(e==="variant"){let s;if(Array.isArray(n)||typeof n=="function"?s=n:typeof n=="string"&&(s=[n]),Array.isArray(s))for(let a of s)a===".dark"?(e=!1,console.warn('When using `variant` for `darkMode`, you must provide a selector.\nExample: `darkMode: ["variant", ".your-selector &"]`')):a.includes("&")||(e=!1,console.warn('When using `variant` for `darkMode`, your selector must contain `&`.\nExample `darkMode: ["variant", ".your-selector &"]`'));n=s}e===null||(e==="selector"?t("dark",`&:where(${n}, ${n} *)`):e==="media"?t("dark","@media (prefers-color-scheme: dark)"):e==="variant"?t("dark",n):e==="class"&&t("dark",`&:is(${n} *)`))}function Di(t){for(let[r,i]of[["t","top"],["tr","top right"],["r","right"],["br","bottom right"],["b","bottom"],["bl","bottom left"],["l","left"],["tl","top left"]])t.utilities.suggest(`bg-gradient-to-${r}`,()=>[]),t.utilities.static(`bg-gradient-to-${r}`,()=>[o("--tw-gradient-position",`to ${i} in oklab`),o("background-image","linear-gradient(var(--tw-gradient-stops))")]);t.utilities.suggest("bg-left-top",()=>[]),t.utilities.static("bg-left-top",()=>[o("background-position","left top")]),t.utilities.suggest("bg-right-top",()=>[]),t.utilities.static("bg-right-top",()=>[o("background-position","right top")]),t.utilities.suggest("bg-left-bottom",()=>[]),t.utilities.static("bg-left-bottom",()=>[o("background-position","left bottom")]),t.utilities.suggest("bg-right-bottom",()=>[]),t.utilities.static("bg-right-bottom",()=>[o("background-position","right bottom")]),t.utilities.suggest("object-left-top",()=>[]),t.utilities.static("object-left-top",()=>[o("object-position","left top")]),t.utilities.suggest("object-right-top",()=>[]),t.utilities.static("object-right-top",()=>[o("object-position","right top")]),t.utilities.suggest("object-left-bottom",()=>[]),t.utilities.static("object-left-bottom",()=>[o("object-position","left bottom")]),t.utilities.suggest("object-right-bottom",()=>[]),t.utilities.static("object-right-bottom",()=>[o("object-position","right bottom")]),t.utilities.suggest("max-w-screen",()=>[]),t.utilities.functional("max-w-screen",r=>{if(!r.value||r.value.kind==="arbitrary")return;let i=t.theme.resolve(r.value.value,["--breakpoint"]);if(i)return[o("max-width",i)]}),t.utilities.suggest("overflow-ellipsis",()=>[]),t.utilities.static("overflow-ellipsis",()=>[o("text-overflow","ellipsis")]),t.utilities.suggest("decoration-slice",()=>[]),t.utilities.static("decoration-slice",()=>[o("-webkit-box-decoration-break","slice"),o("box-decoration-break","slice")]),t.utilities.suggest("decoration-clone",()=>[]),t.utilities.static("decoration-clone",()=>[o("-webkit-box-decoration-break","clone"),o("box-decoration-break","clone")]),t.utilities.suggest("flex-shrink",()=>[]),t.utilities.functional("flex-shrink",r=>{if(!r.modifier){if(!r.value)return[o("flex-shrink","1")];if(r.value.kind==="arbitrary")return[o("flex-shrink",r.value.value)];if(P(r.value.value))return[o("flex-shrink",r.value.value)]}}),t.utilities.suggest("flex-grow",()=>[]),t.utilities.functional("flex-grow",r=>{if(!r.modifier){if(!r.value)return[o("flex-grow","1")];if(r.value.kind==="arbitrary")return[o("flex-grow",r.value.value)];if(P(r.value.value))return[o("flex-grow",r.value.value)]}}),t.utilities.suggest("order-none",()=>[]),t.utilities.static("order-none",()=>[o("order","0")]),t.utilities.suggest("break-words",()=>[]),t.utilities.static("break-words",()=>[o("overflow-wrap","break-word")])}function Ki(t,r){let i=t.theme.screens||{},e=r.variants.get("min")?.order??0,n=[];for(let[a,p]of Object.entries(i)){let c=function(w){r.variants.static(a,h=>{h.nodes=[F("@media",d,h.nodes)]},{order:w})};var s=c;let u=r.variants.get(a),f=r.theme.resolveValue(a,["--breakpoint"]);if(u&&f&&!r.theme.hasDefault(`--breakpoint-${a}`))continue;let m=!0;typeof p=="string"&&(m=!1);let d=za(p);m?n.push(c):c(e)}if(n.length!==0){for(let[,a]of r.variants.variants)a.order>e&&(a.order+=n.length);r.variants.compareFns=new Map(Array.from(r.variants.compareFns).map(([a,p])=>(a>e&&(a+=n.length),[a,p])));for(let[a,p]of n.entries())p(e+a+1)}}function za(t){return(Array.isArray(t)?t:[t]).map(i=>typeof i=="string"?{min:i}:i&&typeof i=="object"?i:null).map(i=>{if(i===null)return null;if("raw"in i)return i.raw;let e="";return i.max!==void 0&&(e+=`${i.max} >= `),e+="width",i.min!==void 0&&(e+=` >= ${i.min}`),`(${e})`}).filter(Boolean).join(", ")}function Ui(t,r){let i=t.theme.aria||{},e=t.theme.supports||{},n=t.theme.data||{};if(Object.keys(i).length>0){let s=r.variants.get("aria"),a=s?.applyFn,p=s?.compounds;r.variants.functional("aria",(u,f)=>{let m=f.value;return m&&m.kind==="named"&&m.value in i?a?.(u,{...f,value:{kind:"arbitrary",value:i[m.value]}}):a?.(u,f)},{compounds:p})}if(Object.keys(e).length>0){let s=r.variants.get("supports"),a=s?.applyFn,p=s?.compounds;r.variants.functional("supports",(u,f)=>{let m=f.value;return m&&m.kind==="named"&&m.value in e?a?.(u,{...f,value:{kind:"arbitrary",value:e[m.value]}}):a?.(u,f)},{compounds:p})}if(Object.keys(n).length>0){let s=r.variants.get("data"),a=s?.applyFn,p=s?.compounds;r.variants.functional("data",(u,f)=>{let m=f.value;return m&&m.kind==="named"&&m.value in n?a?.(u,{...f,value:{kind:"arbitrary",value:n[m.value]}}):a?.(u,f)},{compounds:p})}}var Ma=/^[a-z]+$/;async function ji({designSystem:t,base:r,ast:i,loadModule:e,sources:n}){let s=0,a=[],p=[];I(i,(d,c)=>{if(d.kind!=="at-rule")return;let w=qe(c);if(d.name==="@plugin"){if(w.parent!==null)throw new Error("`@plugin` cannot be nested.");let h=d.params.slice(1,-1);if(h.length===0)throw new Error("`@plugin` must have a path.");let y={};for(let x of d.nodes??[]){if(x.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${re([x])} + +\`@plugin\` options must be a flat list of declarations.`);if(x.value===void 0)continue;let $=x.value,A=j($,",").map(k=>{if(k=k.trim(),k==="null")return null;if(k==="true")return!0;if(k==="false")return!1;if(Number.isNaN(Number(k))){if(k[0]==='"'&&k[k.length-1]==='"'||k[0]==="'"&&k[k.length-1]==="'")return k.slice(1,-1);if(k[0]==="{"&&k[k.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${re([x]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(k);return k});y[x.property]=A.length===1?A[0]:A}return a.push([{id:h,base:w.context.base,reference:!!w.context.reference,src:d.src},Object.keys(y).length>0?y:null]),s|=4,E.Replace([])}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(w.parent!==null)throw new Error("`@config` cannot be nested.");return p.push({id:d.params.slice(1,-1),base:w.context.base,reference:!!w.context.reference,src:d.src}),s|=4,E.Replace([])}}),Di(t);let u=t.resolveThemeValue;if(t.resolveThemeValue=function(c,w){return c.startsWith("--")?u(c,w):(s|=Li({designSystem:t,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),t.resolveThemeValue(c,w))},!a.length&&!p.length)return 0;let[f,m]=await Promise.all([Promise.all(p.map(async({id:d,base:c,reference:w,src:h})=>{let y=await e(d,c,"config");return{path:d,base:y.base,config:y.module,reference:w,src:h}})),Promise.all(a.map(async([{id:d,base:c,reference:w,src:h},y])=>{let x=await e(d,c,"plugin");return{path:d,base:x.base,plugin:x.module,options:y,reference:w,src:h}}))]);return s|=Li({designSystem:t,base:r,ast:i,sources:n,configs:f,pluginDetails:m}),s}function Li({designSystem:t,base:r,ast:i,sources:e,configs:n,pluginDetails:s}){let a=0,u=[...s.map(y=>{if(!y.options)return{config:{plugins:[y.plugin]},base:y.base,reference:y.reference,src:y.src};if("__isOptionsFunction"in y.plugin)return{config:{plugins:[y.plugin(y.options)]},base:y.base,reference:y.reference,src:y.src};throw new Error(`The plugin "${y.path}" does not accept options`)}),...n],{resolvedConfig:f}=Qt(t,[{config:Pi(t.theme),base:r,reference:!0,src:void 0},...u,{config:{plugins:[_i]},base:r,reference:!0,src:void 0}]),{resolvedConfig:m,replacedThemeKeys:d}=Qt(t,u),c={designSystem:t,ast:i,resolvedConfig:f,featuresRef:{set current(y){a|=y}}},w=Ht({...c,referenceMode:!1,src:void 0}),h=t.resolveThemeValue;t.resolveThemeValue=function(x,$){if(x[0]==="-"&&x[1]==="-")return h(x,$);let A=w.theme(x,void 0);if(Array.isArray(A)&&A.length===2)return A[0];if(Array.isArray(A))return A.join(", ");if(typeof A=="object"&&A!==null&&"DEFAULT"in A)return A.DEFAULT;if(typeof A=="string")return A};for(let{handler:y,reference:x,src:$}of f.plugins){let A=Ht({...c,referenceMode:x??!1,src:$});y(A)}if(zr(t,m,d),Oi(t,m),Ui(m,t),Ki(m,t),Ii(m,t),!t.theme.prefix&&f.prefix){if(f.prefix.endsWith("-")&&(f.prefix=f.prefix.slice(0,-1),console.warn(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only and is written as a variant before all utilities. We have fixed up the prefix for you. Remove the trailing \`-\` to silence this warning.`)),!Ma.test(f.prefix))throw new Error(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);t.theme.prefix=f.prefix}if(!t.important&&f.important===!0&&(t.important=!0),typeof f.important=="string"){let y=f.important;I(i,(x,$)=>{if(x.kind!=="at-rule"||x.name!=="@tailwind"||x.params!=="utilities")return;let A=qe($);return A.parent?.kind==="rule"&&A.parent.selector===y?E.Stop:E.ReplaceStop(G(y,[x]))})}for(let y of f.blocklist)t.invalidCandidates.add(y);for(let y of f.content.files){if("raw"in y)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry: + +${JSON.stringify(y,null,2)} + +This feature is not currently supported.`);let x=!1;y.pattern[0]=="!"&&(x=!0,y.pattern=y.pattern.slice(1)),e.push({...y,negated:x})}return a}function zi({ast:t}){let r=new K(n=>tt(n.code)),i=new K(n=>({url:n.file,content:n.code,ignore:!1})),e={file:null,sources:[],mappings:[]};I(t,n=>{if(!n.src||!n.dst)return;let s=i.get(n.src[0]);if(!s.content)return;let a=r.get(n.src[0]),p=r.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),f=0;for(let c of u.split(` +`)){if(c.trim()!==""){let w=a.find(n.src[1]+f),h=p.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:h})}f+=c.length,f+=1}let m=a.find(n.src[2]),d=p.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...m},generatedPosition:d})});for(let n of r.keys())e.sources.push(i.get(n));return e.mappings.sort((n,s)=>n.generatedPosition.line-s.generatedPosition.line||n.generatedPosition.column-s.generatedPosition.column||(n.originalPosition?.line??0)-(s.originalPosition?.line??0)||(n.originalPosition?.column??0)-(s.originalPosition?.column??0)),e}var Mi=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function xt(t){let r=t.indexOf("{");if(r===-1)return[t];let i=[],e=t.slice(0,r),n=t.slice(r),s=0,a=n.lastIndexOf("}");for(let d=0;dxt(d));let m=xt(u);for(let d of m)for(let c of f)i.push(e+c+d);return i}function Fa(t){return Mi.test(t)}function Wa(t){let r=t.match(Mi);if(!r)return[t];let[,i,e,n]=r,s=n?parseInt(n,10):void 0,a=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(e)){let p=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=p<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let f=p0&&(s=-s);for(let m=p;f?m<=u:m>=u;m+=s)a.push(m.toString())}return a}function Fi(t,r){let i=new Set,e=new Set,n=[];function s(a,p=[]){if(t.has(a)&&!i.has(a)){e.has(a)&&r.onCircularDependency?.(p,a),e.add(a);for(let u of t.get(a)??[])p.push(a),s(u,p),p.pop();i.add(a),e.delete(a),n.push(a)}}for(let a of t.keys())s(a);return n}var Ba=/^[a-z]+$/,Rt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(Rt||{});function Ya(){throw new Error("No `loadModule` function provided to `compile`")}function Ga(){throw new Error("No `loadStylesheet` function provided to `compile`")}function qa(t){let r=0,i=null;for(let e of j(t," "))e==="reference"?r|=2:e==="inline"?r|=1:e==="default"?r|=4:e==="static"?r|=8:e.startsWith("prefix(")&&e.endsWith(")")&&(i=e.slice(7,-1));return[r,i]}var Ke=(u=>(u[u.None=0]="None",u[u.AtApply=1]="AtApply",u[u.AtImport=2]="AtImport",u[u.JsPluginCompat=4]="JsPluginCompat",u[u.ThemeFunction=8]="ThemeFunction",u[u.Utilities=16]="Utilities",u[u.Variants=32]="Variants",u[u.AtTheme=64]="AtTheme",u))(Ke||{});async function Wi(t,{base:r="",from:i,loadModule:e=Ya,loadStylesheet:n=Ga}={}){let s=0;t=[ce({base:r},t)],s|=await Zt(t,r,n,0,i!==void 0);let a=null,p=new lt,u=new Map,f=new Map,m=[],d=null,c=null,w=[],h=[],y=[],x=[],$=null;I(t,(k,U)=>{if(k.kind!=="at-rule")return;let N=qe(U);if(k.name==="@tailwind"&&(k.params==="utilities"||k.params.startsWith("utilities"))){if(c!==null)return E.Replace([]);if(N.context.reference)return E.Replace([]);let O=j(k.params," ");for(let L of O)if(L.startsWith("source(")){let _=L.slice(7,-1);if(_==="none"){$=_;continue}if(_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");$={base:N.context.sourceBase??N.context.base,pattern:_.slice(1,-1)}}c=k,s|=16}if(k.name==="@utility"){if(N.parent!==null)throw new Error("`@utility` cannot be nested.");if(k.nodes.length===0)throw new Error(`\`@utility ${k.params}\` is empty. Utilities should include at least one property.`);let O=Kr(k);if(O===null){if(!k.params.endsWith("-*")){if(k.params.endsWith("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. A functional utility must end in \`-*\`.`);if(k.params.includes("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. The dynamic portion marked by \`-*\` must appear once at the end.`)}throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`)}m.push(O)}if(k.name==="@source"){if(k.nodes.length>0)throw new Error("`@source` cannot have a body.");if(N.parent!==null)throw new Error("`@source` cannot be nested.");let O=!1,L=!1,_=k.params;if(_[0]==="n"&&_.startsWith("not ")&&(O=!0,_=_.slice(4)),_[0]==="i"&&_.startsWith("inline(")&&(L=!0,_=_.slice(7,-1)),_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`@source` paths must be quoted.");let z=_.slice(1,-1);if(L){let Y=O?x:y,q=j(z," ");for(let ae of q)for(let oe of xt(ae))Y.push(oe)}else h.push({base:N.context.base,pattern:z,negated:O});return E.ReplaceSkip([])}if(k.name==="@variant"&&(N.parent===null?k.nodes.length===0?k.name="@custom-variant":(I(k.nodes,O=>{if(O.kind==="at-rule"&&O.name==="@slot")return k.name="@custom-variant",E.Stop}),k.name==="@variant"&&w.push(k)):w.push(k)),k.name==="@custom-variant"){if(N.parent!==null)throw new Error("`@custom-variant` cannot be nested.");let[O,L]=j(k.params," ");if(!kt.test(O))throw new Error(`\`@custom-variant ${O}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes, or underscore characters and start with a lowercase letter or number.`);if(k.nodes.length>0&&L)throw new Error(`\`@custom-variant ${O}\` cannot have both a selector and a body.`);if(k.nodes.length===0){if(!L)throw new Error(`\`@custom-variant ${O}\` has no selector or body.`);let _=j(L.slice(1,-1),",");if(_.length===0||_.some(q=>q.trim()===""))throw new Error(`\`@custom-variant ${O} (${_.join(",")})\` selector is invalid.`);let z=[],Y=[];for(let q of _)q=q.trim(),q[0]==="@"?z.push(q):Y.push(q);u.set(O,q=>{q.variants.static(O,ae=>{let oe=[];Y.length>0&&oe.push(G(Y.join(", "),ae.nodes));for(let l of z)oe.push(J(l,ae.nodes));ae.nodes=oe},{compounds:Pe([...Y,...z])})}),f.set(O,new Set)}else{let _=new Set;I(k.nodes,z=>{z.kind==="at-rule"&&z.name==="@variant"&&_.add(z.params)}),u.set(O,z=>{z.variants.fromAst(O,k.nodes,z)}),f.set(O,_)}return E.ReplaceSkip([])}if(k.name==="@media"){let O=j(k.params," "),L=[];for(let _ of O)if(_.startsWith("source(")){let z=_.slice(7,-1);I(k.nodes,Y=>{if(Y.kind==="at-rule"&&Y.name==="@tailwind"&&Y.params==="utilities")return Y.params+=` source(${z})`,E.ReplaceStop([ce({sourceBase:N.context.base},[Y])])})}else if(_.startsWith("theme(")){let z=_.slice(6,-1),Y=z.includes("reference");I(k.nodes,q=>{if(q.kind!=="context"){if(q.kind!=="at-rule"){if(Y)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return E.Continue}if(q.name==="@theme")return q.params+=" "+z,E.Skip}})}else if(_.startsWith("prefix(")){let z=_.slice(7,-1);I(k.nodes,Y=>{if(Y.kind==="at-rule"&&Y.name==="@theme")return Y.params+=` prefix(${z})`,E.Skip})}else _==="important"?a=!0:_==="reference"?k.nodes=[ce({reference:!0},k.nodes)]:L.push(_);if(L.length>0)k.params=L.join(" ");else if(O.length>0)return E.Replace(k.nodes);return E.Continue}if(k.name==="@theme"){let[O,L]=qa(k.params);if(s|=64,N.context.reference&&(O|=2),L){if(!Ba.test(L))throw new Error(`The prefix "${L}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);p.prefix=L}return I(k.nodes,_=>{if(_.kind==="at-rule"&&_.name==="@keyframes")return p.addKeyframes(_),E.Skip;if(_.kind==="comment")return;if(_.kind==="declaration"&&_.property.startsWith("--")){p.add(Se(_.property),_.value??"",O,_.src);return}let z=re([F(k.name,k.params,[_])]).split(` +`).map((Y,q,ae)=>`${q===0||q>=ae.length-2?" ":">"} ${Y}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${z}`)}),d?E.ReplaceSkip([]):(d=G(":root, :host",[]),d.src=k.src,E.ReplaceSkip(d))}});let A=xi(p,c?.src);if(a&&(A.important=a),x.length>0)for(let k of x)A.invalidCandidates.add(k);s|=await ji({designSystem:A,base:r,ast:t,loadModule:e,sources:h});for(let k of u.keys())A.variants.static(k,()=>{});for(let k of Fi(f,{onCircularDependency(U,N){let O=re(U.map((L,_)=>F("@custom-variant",L,[F("@variant",U[_+1]??N,[])]))).replaceAll(";"," { \u2026 }").replace(`@custom-variant ${N} {`,`@custom-variant ${N} { /* \u2190 */`);throw new Error(`Circular dependency detected in custom variants: + +${O}`)}}))u.get(k)?.(A);for(let k of m)k(A);if(d){let k=[];for(let[N,O]of A.theme.entries()){if(O.options&2)continue;let L=o(ye(N),O.value);L.src=O.src,k.push(L)}let U=A.theme.getKeyframes();for(let N of U)t.push(ce({theme:!0},[W([N])]));d.nodes=[ce({theme:!0},k)]}if(s|=Qe(t,A),s|=De(t,A),s|=Ae(t,A),c){let k=c;k.kind="context",k.context={}}return I(t,k=>{if(k.kind==="at-rule")return k.name==="@utility"?E.Replace([]):E.Skip}),{designSystem:A,ast:t,sources:h,root:$,utilitiesNode:c,features:s,inlineCandidates:y}}async function Za(t,r={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:a,features:p,inlineCandidates:u}=await Wi(t,r);e.unshift(ot(`! tailwindcss v${ir} | MIT License | https://tailwindcss.com `));function f(h){i.invalidCandidates.add(h)}let m=new Set,d=null,c=0,w=!1;for(let h of u)i.invalidCandidates.has(h)||(m.add(h),w=!0);return{sources:n,root:s,features:p,build(h){if(p===0)return t;if(!a)return d??=Te(e,i,r.polyfills),d;let y=w,x=!1;w=!1;let $=m.size;for(let k of h)if(!i.invalidCandidates.has(k))if(k[0]==="-"&&k[1]==="-"){let U=i.theme.markUsedVariable(k);y||=U,x||=U}else m.add(k),y||=m.size!==$;if(!y)return d??=Te(e,i,r.polyfills),d;let A=Ce(m,i,{onInvalidCandidate:f}).astNodes;return r.from&&I(A,k=>{k.src??=a.src}),!x&&c===A.length?(d??=Te(e,i,r.polyfills),d):(c=A.length,a.nodes=A,d=Te(e,i,r.polyfills),d)}}}async function rf(t,r={}){let i=$e(t,{from:r.from}),e=await Za(i,r),n=i,s=t;return{...e,build(a){let p=e.build(a);return p===n||(s=re(p,!!r.from),n=p),s},buildSourceMap(){return zi({ast:n})}}}async function nf(t,r={}){return(await Wi($e(t,{from:r.from}),r)).designSystem}function Ha(){throw new Error("It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.")}export{Rt as a,Ke as b,Za as c,rf as d,nf as e,Ha as f}; diff --git a/node_modules/tailwindcss/dist/chunk-GFBUASX3.mjs b/node_modules/tailwindcss/dist/chunk-GFBUASX3.mjs new file mode 100644 index 0000000..f20977b --- /dev/null +++ b/node_modules/tailwindcss/dist/chunk-GFBUASX3.mjs @@ -0,0 +1 @@ +import{a as k}from"./chunk-HTB5LLOP.mjs";var _=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","transparent","currentcolor","canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext","accentcolor","accentcolortext"]),U=/^(rgba?|hsla?|hwb|color|(ok)?(lab|lch)|light-dark|color-mix)\(/i;function S(e){return e.charCodeAt(0)===35||U.test(e)||_.has(e.toLowerCase())}var A=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"];function b(e){return e.indexOf("(")!==-1&&A.some(t=>e.includes(`${t}(`))}function oe(e){if(!A.some(n=>e.includes(n)))return e;let t="",r=[],s=null,m=null;for(let n=0;n=48&&a<=57||s!==null&&(a===37||a>=97&&a<=122||a>=65&&a<=90)?s=n:(m=s,s=null),a===40){t+=e[n];let i=n;for(let p=n-1;p>=0;p--){let c=e.charCodeAt(p);if(c>=48&&c<=57)i=p;else if(c>=97&&c<=122)i=p;else break}let o=e.slice(i,n);if(A.includes(o)){r.unshift(!0);continue}else if(r[0]&&o===""){r.unshift(!0);continue}r.unshift(!1);continue}else if(a===41)t+=e[n],r.shift();else if(a===44&&r[0]){t+=", ";continue}else{if(a===32&&r[0]&&t.charCodeAt(t.length-1)===32)continue;if((a===43||a===42||a===47||a===45)&&r[0]){let i=t.trimEnd(),o=i.charCodeAt(i.length-1),p=i.charCodeAt(i.length-2),c=e.charCodeAt(n+1);if((o===101||o===69)&&p>=48&&p<=57){t+=e[n];continue}else if(o===43||o===42||o===47||o===45){t+=e[n];continue}else if(o===40||o===44){t+=e[n];continue}else e.charCodeAt(n-1)===32?t+=`${e[n]} `:o>=48&&o<=57||c>=48&&c<=57||o===41||c===40||c===43||c===42||c===47||c===45||m!==null&&m===n-1?t+=` ${e[n]} `:t+=e[n]}else t+=e[n]}}return t}var E=new Uint8Array(256);function d(e,t){let r=0,s=[],m=0,n=e.length,a=t.charCodeAt(0);for(let i=0;i0&&o===E[r-1]&&r--;break}}return s.push(e.slice(m)),s}var P={color:S,length:y,percentage:C,ratio:G,number:v,integer:u,url:R,position:K,"bg-size":Y,"line-width":T,image:F,"family-name":M,"generic-name":H,"absolute-size":$,"relative-size":W,angle:X,vector:te};function me(e,t){if(e.startsWith("var("))return null;for(let r of t)if(P[r]?.(e))return r;return null}var z=/^url\(.*\)$/;function R(e){return z.test(e)}function T(e){return d(e," ").every(t=>y(t)||v(t)||t==="thin"||t==="medium"||t==="thick")}var D=/^(?:element|image|cross-fade|image-set)\(/,I=/^(repeating-)?(conic|linear|radial)-gradient\(/;function F(e){let t=0;for(let r of d(e,","))if(!r.startsWith("var(")){if(R(r)){t+=1;continue}if(I.test(r)){t+=1;continue}if(D.test(r)){t+=1;continue}return!1}return t>0}function H(e){return e==="serif"||e==="sans-serif"||e==="monospace"||e==="cursive"||e==="fantasy"||e==="system-ui"||e==="ui-serif"||e==="ui-sans-serif"||e==="ui-monospace"||e==="ui-rounded"||e==="math"||e==="emoji"||e==="fangsong"}function M(e){let t=0;for(let r of d(e,",")){let s=r.charCodeAt(0);if(s>=48&&s<=57)return!1;r.startsWith("var(")||(t+=1)}return t>0}function $(e){return e==="xx-small"||e==="x-small"||e==="small"||e==="medium"||e==="large"||e==="x-large"||e==="xx-large"||e==="xxx-large"}function W(e){return e==="larger"||e==="smaller"}var x=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,B=new RegExp(`^${x.source}$`);function v(e){return B.test(e)||b(e)}var q=new RegExp(`^${x.source}%$`);function C(e){return q.test(e)||b(e)}var V=new RegExp(`^${x.source}s*/s*${x.source}$`);function G(e){return V.test(e)||b(e)}var Z=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],j=new RegExp(`^${x.source}(${Z.join("|")})$`);function y(e){return j.test(e)||b(e)}function K(e){let t=0;for(let r of d(e," ")){if(r==="center"||r==="top"||r==="right"||r==="bottom"||r==="left"){t+=1;continue}if(!r.startsWith("var(")){if(y(r)||C(r)){t+=1;continue}return!1}}return t>0}function Y(e){let t=0;for(let r of d(e,",")){if(r==="cover"||r==="contain"){t+=1;continue}let s=d(r," ");if(s.length!==1&&s.length!==2)return!1;if(s.every(m=>m==="auto"||y(m)||C(m))){t+=1;continue}}return t>0}var Q=["deg","rad","grad","turn"],J=new RegExp(`^${x.source}(${Q.join("|")})$`);function X(e){return J.test(e)}var ee=new RegExp(`^${x.source} +${x.source} +${x.source}$`);function te(e){return ee.test(e)}function u(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===String(e)}function pe(e){let t=Number(e);return Number.isInteger(t)&&t>0&&String(t)===String(e)}function ge(e){return N(e,.25)}function ue(e){return N(e,.25)}function N(e,t){let r=Number(e);return r>=0&&r%t===0&&String(r)===String(e)}function h(e){return{__BARE_VALUE__:e}}var g=h(e=>{if(u(e.value))return e.value}),l=h(e=>{if(u(e.value))return`${e.value}%`}),f=h(e=>{if(u(e.value))return`${e.value}px`}),O=h(e=>{if(u(e.value))return`${e.value}ms`}),w=h(e=>{if(u(e.value))return`${e.value}deg`}),re=h(e=>{if(e.fraction===null)return;let[t,r]=d(e.fraction,"/");if(!(!u(t)||!u(r)))return e.fraction}),L=h(e=>{if(u(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),be={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",...re},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...l}),backdropContrast:({theme:e})=>({...e("contrast"),...l}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...l}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...w}),backdropInvert:({theme:e})=>({...e("invert"),...l}),backdropOpacity:({theme:e})=>({...e("opacity"),...l}),backdropSaturate:({theme:e})=>({...e("saturate"),...l}),backdropSepia:({theme:e})=>({...e("sepia"),...l}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...f},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...l},caretColor:({theme:e})=>e("colors"),colors:()=>({...k}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...g},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...l},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),...f}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...g},flexShrink:{0:"0",DEFAULT:"1",...g},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...l},grayscale:{0:"0",DEFAULT:"100%",...l},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...g},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...g},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...g},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...g},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...L},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...L},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...w},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...l},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...g},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...l},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...g},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...w},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...l},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...l},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...l},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...w},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...g},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...f},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...O},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...O},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...g}};export{oe as a,d as b,me as c,y as d,u as e,pe as f,ge as g,ue as h,be as i}; diff --git a/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs b/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs new file mode 100644 index 0000000..8a95483 --- /dev/null +++ b/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs @@ -0,0 +1 @@ +var l={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};export{l as a}; diff --git a/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts b/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts new file mode 100644 index 0000000..8f187dc --- /dev/null +++ b/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts @@ -0,0 +1,295 @@ +declare const _default: { + inherit: string; + current: string; + transparent: string; + black: string; + white: string; + slate: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + gray: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + zinc: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + neutral: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + stone: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + red: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + orange: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + amber: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + yellow: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + lime: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + green: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + emerald: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + teal: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + cyan: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + sky: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + blue: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + indigo: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + violet: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + purple: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + fuchsia: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + pink: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + rose: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; +}; + +export { _default as _ }; diff --git a/node_modules/tailwindcss/dist/colors.d.mts b/node_modules/tailwindcss/dist/colors.d.mts new file mode 100644 index 0000000..5ea4701 --- /dev/null +++ b/node_modules/tailwindcss/dist/colors.d.mts @@ -0,0 +1,295 @@ +declare const _default: { + inherit: string; + current: string; + transparent: string; + black: string; + white: string; + slate: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + gray: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + zinc: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + neutral: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + stone: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + red: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + orange: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + amber: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + yellow: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + lime: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + green: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + emerald: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + teal: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + cyan: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + sky: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + blue: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + indigo: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + violet: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + purple: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + fuchsia: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + pink: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + rose: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; +}; + +export { _default as default }; diff --git a/node_modules/tailwindcss/dist/colors.d.ts b/node_modules/tailwindcss/dist/colors.d.ts new file mode 100644 index 0000000..e9d15d3 --- /dev/null +++ b/node_modules/tailwindcss/dist/colors.d.ts @@ -0,0 +1,5 @@ +import { _ as _default } from './colors-b_6i0Oi7.js'; + + + +export { _default as default }; diff --git a/node_modules/tailwindcss/dist/colors.js b/node_modules/tailwindcss/dist/colors.js new file mode 100644 index 0000000..409c0d5 --- /dev/null +++ b/node_modules/tailwindcss/dist/colors.js @@ -0,0 +1 @@ +"use strict";var l={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};module.exports=l; diff --git a/node_modules/tailwindcss/dist/colors.mjs b/node_modules/tailwindcss/dist/colors.mjs new file mode 100644 index 0000000..9d20fbc --- /dev/null +++ b/node_modules/tailwindcss/dist/colors.mjs @@ -0,0 +1 @@ +import{a}from"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/node_modules/tailwindcss/dist/default-theme.d.mts b/node_modules/tailwindcss/dist/default-theme.d.mts new file mode 100644 index 0000000..1b80d8a --- /dev/null +++ b/node_modules/tailwindcss/dist/default-theme.d.mts @@ -0,0 +1,1147 @@ +import { P as PluginUtils, N as NamedUtilityValue } from './resolve-config-QUZ9b-Gn.mjs'; +import './colors.mjs'; + +declare const _default: { + accentColor: ({ theme }: PluginUtils) => any; + animation: { + none: string; + spin: string; + ping: string; + pulse: string; + bounce: string; + }; + aria: { + busy: string; + checked: string; + disabled: string; + expanded: string; + hidden: string; + pressed: string; + readonly: string; + required: string; + selected: string; + }; + aspectRatio: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + square: string; + video: string; + }; + backdropBlur: ({ theme }: PluginUtils) => any; + backdropBrightness: ({ theme }: PluginUtils) => any; + backdropContrast: ({ theme }: PluginUtils) => any; + backdropGrayscale: ({ theme }: PluginUtils) => any; + backdropHueRotate: ({ theme }: PluginUtils) => any; + backdropInvert: ({ theme }: PluginUtils) => any; + backdropOpacity: ({ theme }: PluginUtils) => any; + backdropSaturate: ({ theme }: PluginUtils) => any; + backdropSepia: ({ theme }: PluginUtils) => any; + backgroundColor: ({ theme }: PluginUtils) => any; + backgroundImage: { + none: string; + 'gradient-to-t': string; + 'gradient-to-tr': string; + 'gradient-to-r': string; + 'gradient-to-br': string; + 'gradient-to-b': string; + 'gradient-to-bl': string; + 'gradient-to-l': string; + 'gradient-to-tl': string; + }; + backgroundOpacity: ({ theme }: PluginUtils) => any; + backgroundPosition: { + bottom: string; + center: string; + left: string; + 'left-bottom': string; + 'left-top': string; + right: string; + 'right-bottom': string; + 'right-top': string; + top: string; + }; + backgroundSize: { + auto: string; + cover: string; + contain: string; + }; + blur: { + 0: string; + none: string; + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + }; + borderColor: ({ theme }: PluginUtils) => any; + borderOpacity: ({ theme }: PluginUtils) => any; + borderRadius: { + none: string; + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + full: string; + }; + borderSpacing: ({ theme }: PluginUtils) => any; + borderWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 2: string; + 4: string; + 8: string; + }; + boxShadow: { + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + inner: string; + none: string; + }; + boxShadowColor: ({ theme }: PluginUtils) => any; + brightness: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 90: string; + 95: string; + 100: string; + 105: string; + 110: string; + 125: string; + 150: string; + 200: string; + }; + caretColor: ({ theme }: PluginUtils) => any; + colors: () => { + inherit: string; + current: string; + transparent: string; + black: string; + white: string; + slate: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + gray: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + zinc: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + neutral: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + stone: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + red: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + orange: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + amber: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + yellow: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + lime: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + green: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + emerald: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + teal: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + cyan: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + sky: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + blue: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + indigo: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + violet: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + purple: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + fuchsia: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + pink: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + rose: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + }; + columns: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + '3xs': string; + '2xs': string; + xs: string; + sm: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + '4xl': string; + '5xl': string; + '6xl': string; + '7xl': string; + }; + container: {}; + content: { + none: string; + }; + contrast: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 100: string; + 125: string; + 150: string; + 200: string; + }; + cursor: { + auto: string; + default: string; + pointer: string; + wait: string; + text: string; + move: string; + help: string; + 'not-allowed': string; + none: string; + 'context-menu': string; + progress: string; + cell: string; + crosshair: string; + 'vertical-text': string; + alias: string; + copy: string; + 'no-drop': string; + grab: string; + grabbing: string; + 'all-scroll': string; + 'col-resize': string; + 'row-resize': string; + 'n-resize': string; + 'e-resize': string; + 's-resize': string; + 'w-resize': string; + 'ne-resize': string; + 'nw-resize': string; + 'se-resize': string; + 'sw-resize': string; + 'ew-resize': string; + 'ns-resize': string; + 'nesw-resize': string; + 'nwse-resize': string; + 'zoom-in': string; + 'zoom-out': string; + }; + divideColor: ({ theme }: PluginUtils) => any; + divideOpacity: ({ theme }: PluginUtils) => any; + divideWidth: ({ theme }: PluginUtils) => any; + dropShadow: { + sm: string; + DEFAULT: string[]; + md: string[]; + lg: string[]; + xl: string[]; + '2xl': string; + none: string; + }; + fill: ({ theme }: PluginUtils) => any; + flex: { + 1: string; + auto: string; + initial: string; + none: string; + }; + flexBasis: ({ theme }: PluginUtils) => any; + flexGrow: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + flexShrink: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + fontFamily: { + sans: string[]; + serif: string[]; + mono: string[]; + }; + fontSize: { + xs: (string | { + lineHeight: string; + })[]; + sm: (string | { + lineHeight: string; + })[]; + base: (string | { + lineHeight: string; + })[]; + lg: (string | { + lineHeight: string; + })[]; + xl: (string | { + lineHeight: string; + })[]; + '2xl': (string | { + lineHeight: string; + })[]; + '3xl': (string | { + lineHeight: string; + })[]; + '4xl': (string | { + lineHeight: string; + })[]; + '5xl': (string | { + lineHeight: string; + })[]; + '6xl': (string | { + lineHeight: string; + })[]; + '7xl': (string | { + lineHeight: string; + })[]; + '8xl': (string | { + lineHeight: string; + })[]; + '9xl': (string | { + lineHeight: string; + })[]; + }; + fontWeight: { + thin: string; + extralight: string; + light: string; + normal: string; + medium: string; + semibold: string; + bold: string; + extrabold: string; + black: string; + }; + gap: ({ theme }: PluginUtils) => any; + gradientColorStops: ({ theme }: PluginUtils) => any; + gradientColorStopPositions: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + '0%': string; + '5%': string; + '10%': string; + '15%': string; + '20%': string; + '25%': string; + '30%': string; + '35%': string; + '40%': string; + '45%': string; + '50%': string; + '55%': string; + '60%': string; + '65%': string; + '70%': string; + '75%': string; + '80%': string; + '85%': string; + '90%': string; + '95%': string; + '100%': string; + }; + grayscale: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + gridAutoColumns: { + auto: string; + min: string; + max: string; + fr: string; + }; + gridAutoRows: { + auto: string; + min: string; + max: string; + fr: string; + }; + gridColumn: { + auto: string; + 'span-1': string; + 'span-2': string; + 'span-3': string; + 'span-4': string; + 'span-5': string; + 'span-6': string; + 'span-7': string; + 'span-8': string; + 'span-9': string; + 'span-10': string; + 'span-11': string; + 'span-12': string; + 'span-full': string; + }; + gridColumnEnd: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridColumnStart: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridRow: { + auto: string; + 'span-1': string; + 'span-2': string; + 'span-3': string; + 'span-4': string; + 'span-5': string; + 'span-6': string; + 'span-7': string; + 'span-8': string; + 'span-9': string; + 'span-10': string; + 'span-11': string; + 'span-12': string; + 'span-full': string; + }; + gridRowEnd: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridRowStart: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridTemplateColumns: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + none: string; + subgrid: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + gridTemplateRows: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + none: string; + subgrid: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + height: ({ theme }: PluginUtils) => any; + hueRotate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 15: string; + 30: string; + 60: string; + 90: string; + 180: string; + }; + inset: ({ theme }: PluginUtils) => any; + invert: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + keyframes: { + spin: { + to: { + transform: string; + }; + }; + ping: { + '75%, 100%': { + transform: string; + opacity: string; + }; + }; + pulse: { + '50%': { + opacity: string; + }; + }; + bounce: { + '0%, 100%': { + transform: string; + animationTimingFunction: string; + }; + '50%': { + transform: string; + animationTimingFunction: string; + }; + }; + }; + letterSpacing: { + tighter: string; + tight: string; + normal: string; + wide: string; + wider: string; + widest: string; + }; + lineHeight: { + none: string; + tight: string; + snug: string; + normal: string; + relaxed: string; + loose: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + }; + listStyleType: { + none: string; + disc: string; + decimal: string; + }; + listStyleImage: { + none: string; + }; + margin: ({ theme }: PluginUtils) => any; + lineClamp: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + }; + maxHeight: ({ theme }: PluginUtils) => any; + maxWidth: ({ theme }: PluginUtils) => any; + minHeight: ({ theme }: PluginUtils) => any; + minWidth: ({ theme }: PluginUtils) => any; + objectPosition: { + bottom: string; + center: string; + left: string; + 'left-bottom': string; + 'left-top': string; + right: string; + 'right-bottom': string; + 'right-top': string; + top: string; + }; + opacity: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 5: string; + 10: string; + 15: string; + 20: string; + 25: string; + 30: string; + 35: string; + 40: string; + 45: string; + 50: string; + 55: string; + 60: string; + 65: string; + 70: string; + 75: string; + 80: string; + 85: string; + 90: string; + 95: string; + 100: string; + }; + order: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + first: string; + last: string; + none: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + outlineColor: ({ theme }: PluginUtils) => any; + outlineOffset: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + outlineWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + padding: ({ theme }: PluginUtils) => any; + placeholderColor: ({ theme }: PluginUtils) => any; + placeholderOpacity: ({ theme }: PluginUtils) => any; + ringColor: ({ theme }: PluginUtils) => any; + ringOffsetColor: ({ theme }: PluginUtils) => any; + ringOffsetWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + ringOpacity: ({ theme }: PluginUtils) => any; + ringWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + rotate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 3: string; + 6: string; + 12: string; + 45: string; + 90: string; + 180: string; + }; + saturate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 100: string; + 150: string; + 200: string; + }; + scale: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 90: string; + 95: string; + 100: string; + 105: string; + 110: string; + 125: string; + 150: string; + }; + screens: { + sm: string; + md: string; + lg: string; + xl: string; + '2xl': string; + }; + scrollMargin: ({ theme }: PluginUtils) => any; + scrollPadding: ({ theme }: PluginUtils) => any; + sepia: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + skew: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 3: string; + 6: string; + 12: string; + }; + space: ({ theme }: PluginUtils) => any; + spacing: { + px: string; + 0: string; + 0.5: string; + 1: string; + 1.5: string; + 2: string; + 2.5: string; + 3: string; + 3.5: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 14: string; + 16: string; + 20: string; + 24: string; + 28: string; + 32: string; + 36: string; + 40: string; + 44: string; + 48: string; + 52: string; + 56: string; + 60: string; + 64: string; + 72: string; + 80: string; + 96: string; + }; + stroke: ({ theme }: PluginUtils) => any; + strokeWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + }; + supports: {}; + data: {}; + textColor: ({ theme }: PluginUtils) => any; + textDecorationColor: ({ theme }: PluginUtils) => any; + textDecorationThickness: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 'from-font': string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + textIndent: ({ theme }: PluginUtils) => any; + textOpacity: ({ theme }: PluginUtils) => any; + textUnderlineOffset: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + transformOrigin: { + center: string; + top: string; + 'top-right': string; + right: string; + 'bottom-right': string; + bottom: string; + 'bottom-left': string; + left: string; + 'top-left': string; + }; + transitionDelay: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 75: string; + 100: string; + 150: string; + 200: string; + 300: string; + 500: string; + 700: string; + 1000: string; + }; + transitionDuration: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 75: string; + 100: string; + 150: string; + 200: string; + 300: string; + 500: string; + 700: string; + 1000: string; + }; + transitionProperty: { + none: string; + all: string; + DEFAULT: string; + colors: string; + opacity: string; + shadow: string; + transform: string; + }; + transitionTimingFunction: { + DEFAULT: string; + linear: string; + in: string; + out: string; + 'in-out': string; + }; + translate: ({ theme }: PluginUtils) => any; + size: ({ theme }: PluginUtils) => any; + width: ({ theme }: PluginUtils) => any; + willChange: { + auto: string; + scroll: string; + contents: string; + transform: string; + }; + zIndex: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 0: string; + 10: string; + 20: string; + 30: string; + 40: string; + 50: string; + }; +}; + +export { _default as default }; diff --git a/node_modules/tailwindcss/dist/default-theme.d.ts b/node_modules/tailwindcss/dist/default-theme.d.ts new file mode 100644 index 0000000..6d36e26 --- /dev/null +++ b/node_modules/tailwindcss/dist/default-theme.d.ts @@ -0,0 +1,1147 @@ +import { P as PluginUtils, N as NamedUtilityValue } from './resolve-config-BIFUA2FY.js'; +import './colors-b_6i0Oi7.js'; + +declare const _default: { + accentColor: ({ theme }: PluginUtils) => any; + animation: { + none: string; + spin: string; + ping: string; + pulse: string; + bounce: string; + }; + aria: { + busy: string; + checked: string; + disabled: string; + expanded: string; + hidden: string; + pressed: string; + readonly: string; + required: string; + selected: string; + }; + aspectRatio: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + square: string; + video: string; + }; + backdropBlur: ({ theme }: PluginUtils) => any; + backdropBrightness: ({ theme }: PluginUtils) => any; + backdropContrast: ({ theme }: PluginUtils) => any; + backdropGrayscale: ({ theme }: PluginUtils) => any; + backdropHueRotate: ({ theme }: PluginUtils) => any; + backdropInvert: ({ theme }: PluginUtils) => any; + backdropOpacity: ({ theme }: PluginUtils) => any; + backdropSaturate: ({ theme }: PluginUtils) => any; + backdropSepia: ({ theme }: PluginUtils) => any; + backgroundColor: ({ theme }: PluginUtils) => any; + backgroundImage: { + none: string; + 'gradient-to-t': string; + 'gradient-to-tr': string; + 'gradient-to-r': string; + 'gradient-to-br': string; + 'gradient-to-b': string; + 'gradient-to-bl': string; + 'gradient-to-l': string; + 'gradient-to-tl': string; + }; + backgroundOpacity: ({ theme }: PluginUtils) => any; + backgroundPosition: { + bottom: string; + center: string; + left: string; + 'left-bottom': string; + 'left-top': string; + right: string; + 'right-bottom': string; + 'right-top': string; + top: string; + }; + backgroundSize: { + auto: string; + cover: string; + contain: string; + }; + blur: { + 0: string; + none: string; + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + }; + borderColor: ({ theme }: PluginUtils) => any; + borderOpacity: ({ theme }: PluginUtils) => any; + borderRadius: { + none: string; + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + full: string; + }; + borderSpacing: ({ theme }: PluginUtils) => any; + borderWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 2: string; + 4: string; + 8: string; + }; + boxShadow: { + sm: string; + DEFAULT: string; + md: string; + lg: string; + xl: string; + '2xl': string; + inner: string; + none: string; + }; + boxShadowColor: ({ theme }: PluginUtils) => any; + brightness: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 90: string; + 95: string; + 100: string; + 105: string; + 110: string; + 125: string; + 150: string; + 200: string; + }; + caretColor: ({ theme }: PluginUtils) => any; + colors: () => { + inherit: string; + current: string; + transparent: string; + black: string; + white: string; + slate: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + gray: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + zinc: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + neutral: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + stone: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + red: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + orange: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + amber: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + yellow: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + lime: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + green: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + emerald: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + teal: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + cyan: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + sky: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + blue: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + indigo: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + violet: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + purple: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + fuchsia: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + pink: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + rose: { + '50': string; + '100': string; + '200': string; + '300': string; + '400': string; + '500': string; + '600': string; + '700': string; + '800': string; + '900': string; + '950': string; + }; + }; + columns: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + '3xs': string; + '2xs': string; + xs: string; + sm: string; + md: string; + lg: string; + xl: string; + '2xl': string; + '3xl': string; + '4xl': string; + '5xl': string; + '6xl': string; + '7xl': string; + }; + container: {}; + content: { + none: string; + }; + contrast: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 100: string; + 125: string; + 150: string; + 200: string; + }; + cursor: { + auto: string; + default: string; + pointer: string; + wait: string; + text: string; + move: string; + help: string; + 'not-allowed': string; + none: string; + 'context-menu': string; + progress: string; + cell: string; + crosshair: string; + 'vertical-text': string; + alias: string; + copy: string; + 'no-drop': string; + grab: string; + grabbing: string; + 'all-scroll': string; + 'col-resize': string; + 'row-resize': string; + 'n-resize': string; + 'e-resize': string; + 's-resize': string; + 'w-resize': string; + 'ne-resize': string; + 'nw-resize': string; + 'se-resize': string; + 'sw-resize': string; + 'ew-resize': string; + 'ns-resize': string; + 'nesw-resize': string; + 'nwse-resize': string; + 'zoom-in': string; + 'zoom-out': string; + }; + divideColor: ({ theme }: PluginUtils) => any; + divideOpacity: ({ theme }: PluginUtils) => any; + divideWidth: ({ theme }: PluginUtils) => any; + dropShadow: { + sm: string; + DEFAULT: string[]; + md: string[]; + lg: string[]; + xl: string[]; + '2xl': string; + none: string; + }; + fill: ({ theme }: PluginUtils) => any; + flex: { + 1: string; + auto: string; + initial: string; + none: string; + }; + flexBasis: ({ theme }: PluginUtils) => any; + flexGrow: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + flexShrink: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + fontFamily: { + sans: string[]; + serif: string[]; + mono: string[]; + }; + fontSize: { + xs: (string | { + lineHeight: string; + })[]; + sm: (string | { + lineHeight: string; + })[]; + base: (string | { + lineHeight: string; + })[]; + lg: (string | { + lineHeight: string; + })[]; + xl: (string | { + lineHeight: string; + })[]; + '2xl': (string | { + lineHeight: string; + })[]; + '3xl': (string | { + lineHeight: string; + })[]; + '4xl': (string | { + lineHeight: string; + })[]; + '5xl': (string | { + lineHeight: string; + })[]; + '6xl': (string | { + lineHeight: string; + })[]; + '7xl': (string | { + lineHeight: string; + })[]; + '8xl': (string | { + lineHeight: string; + })[]; + '9xl': (string | { + lineHeight: string; + })[]; + }; + fontWeight: { + thin: string; + extralight: string; + light: string; + normal: string; + medium: string; + semibold: string; + bold: string; + extrabold: string; + black: string; + }; + gap: ({ theme }: PluginUtils) => any; + gradientColorStops: ({ theme }: PluginUtils) => any; + gradientColorStopPositions: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + '0%': string; + '5%': string; + '10%': string; + '15%': string; + '20%': string; + '25%': string; + '30%': string; + '35%': string; + '40%': string; + '45%': string; + '50%': string; + '55%': string; + '60%': string; + '65%': string; + '70%': string; + '75%': string; + '80%': string; + '85%': string; + '90%': string; + '95%': string; + '100%': string; + }; + grayscale: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + gridAutoColumns: { + auto: string; + min: string; + max: string; + fr: string; + }; + gridAutoRows: { + auto: string; + min: string; + max: string; + fr: string; + }; + gridColumn: { + auto: string; + 'span-1': string; + 'span-2': string; + 'span-3': string; + 'span-4': string; + 'span-5': string; + 'span-6': string; + 'span-7': string; + 'span-8': string; + 'span-9': string; + 'span-10': string; + 'span-11': string; + 'span-12': string; + 'span-full': string; + }; + gridColumnEnd: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridColumnStart: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridRow: { + auto: string; + 'span-1': string; + 'span-2': string; + 'span-3': string; + 'span-4': string; + 'span-5': string; + 'span-6': string; + 'span-7': string; + 'span-8': string; + 'span-9': string; + 'span-10': string; + 'span-11': string; + 'span-12': string; + 'span-full': string; + }; + gridRowEnd: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridRowStart: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + }; + gridTemplateColumns: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + none: string; + subgrid: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + gridTemplateRows: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + none: string; + subgrid: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + height: ({ theme }: PluginUtils) => any; + hueRotate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 15: string; + 30: string; + 60: string; + 90: string; + 180: string; + }; + inset: ({ theme }: PluginUtils) => any; + invert: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + keyframes: { + spin: { + to: { + transform: string; + }; + }; + ping: { + '75%, 100%': { + transform: string; + opacity: string; + }; + }; + pulse: { + '50%': { + opacity: string; + }; + }; + bounce: { + '0%, 100%': { + transform: string; + animationTimingFunction: string; + }; + '50%': { + transform: string; + animationTimingFunction: string; + }; + }; + }; + letterSpacing: { + tighter: string; + tight: string; + normal: string; + wide: string; + wider: string; + widest: string; + }; + lineHeight: { + none: string; + tight: string; + snug: string; + normal: string; + relaxed: string; + loose: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + }; + listStyleType: { + none: string; + disc: string; + decimal: string; + }; + listStyleImage: { + none: string; + }; + margin: ({ theme }: PluginUtils) => any; + lineClamp: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + }; + maxHeight: ({ theme }: PluginUtils) => any; + maxWidth: ({ theme }: PluginUtils) => any; + minHeight: ({ theme }: PluginUtils) => any; + minWidth: ({ theme }: PluginUtils) => any; + objectPosition: { + bottom: string; + center: string; + left: string; + 'left-bottom': string; + 'left-top': string; + right: string; + 'right-bottom': string; + 'right-top': string; + top: string; + }; + opacity: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 5: string; + 10: string; + 15: string; + 20: string; + 25: string; + 30: string; + 35: string; + 40: string; + 45: string; + 50: string; + 55: string; + 60: string; + 65: string; + 70: string; + 75: string; + 80: string; + 85: string; + 90: string; + 95: string; + 100: string; + }; + order: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + first: string; + last: string; + none: string; + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + }; + outlineColor: ({ theme }: PluginUtils) => any; + outlineOffset: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + outlineWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + padding: ({ theme }: PluginUtils) => any; + placeholderColor: ({ theme }: PluginUtils) => any; + placeholderOpacity: ({ theme }: PluginUtils) => any; + ringColor: ({ theme }: PluginUtils) => any; + ringOffsetColor: ({ theme }: PluginUtils) => any; + ringOffsetWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + ringOpacity: ({ theme }: PluginUtils) => any; + ringWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + rotate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 3: string; + 6: string; + 12: string; + 45: string; + 90: string; + 180: string; + }; + saturate: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 100: string; + 150: string; + 200: string; + }; + scale: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 50: string; + 75: string; + 90: string; + 95: string; + 100: string; + 105: string; + 110: string; + 125: string; + 150: string; + }; + screens: { + sm: string; + md: string; + lg: string; + xl: string; + '2xl': string; + }; + scrollMargin: ({ theme }: PluginUtils) => any; + scrollPadding: ({ theme }: PluginUtils) => any; + sepia: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + DEFAULT: string; + }; + skew: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + 3: string; + 6: string; + 12: string; + }; + space: ({ theme }: PluginUtils) => any; + spacing: { + px: string; + 0: string; + 0.5: string; + 1: string; + 1.5: string; + 2: string; + 2.5: string; + 3: string; + 3.5: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 14: string; + 16: string; + 20: string; + 24: string; + 28: string; + 32: string; + 36: string; + 40: string; + 44: string; + 48: string; + 52: string; + 56: string; + 60: string; + 64: string; + 72: string; + 80: string; + 96: string; + }; + stroke: ({ theme }: PluginUtils) => any; + strokeWidth: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 1: string; + 2: string; + }; + supports: {}; + data: {}; + textColor: ({ theme }: PluginUtils) => any; + textDecorationColor: ({ theme }: PluginUtils) => any; + textDecorationThickness: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 'from-font': string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + textIndent: ({ theme }: PluginUtils) => any; + textOpacity: ({ theme }: PluginUtils) => any; + textUnderlineOffset: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 0: string; + 1: string; + 2: string; + 4: string; + 8: string; + }; + transformOrigin: { + center: string; + top: string; + 'top-right': string; + right: string; + 'bottom-right': string; + bottom: string; + 'bottom-left': string; + left: string; + 'top-left': string; + }; + transitionDelay: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + 0: string; + 75: string; + 100: string; + 150: string; + 200: string; + 300: string; + 500: string; + 700: string; + 1000: string; + }; + transitionDuration: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + DEFAULT: string; + 0: string; + 75: string; + 100: string; + 150: string; + 200: string; + 300: string; + 500: string; + 700: string; + 1000: string; + }; + transitionProperty: { + none: string; + all: string; + DEFAULT: string; + colors: string; + opacity: string; + shadow: string; + transform: string; + }; + transitionTimingFunction: { + DEFAULT: string; + linear: string; + in: string; + out: string; + 'in-out': string; + }; + translate: ({ theme }: PluginUtils) => any; + size: ({ theme }: PluginUtils) => any; + width: ({ theme }: PluginUtils) => any; + willChange: { + auto: string; + scroll: string; + contents: string; + transform: string; + }; + zIndex: { + __BARE_VALUE__: (value: NamedUtilityValue) => string | undefined; + auto: string; + 0: string; + 10: string; + 20: string; + 30: string; + 40: string; + 50: string; + }; +}; + +export { _default as default }; diff --git a/node_modules/tailwindcss/dist/default-theme.js b/node_modules/tailwindcss/dist/default-theme.js new file mode 100644 index 0000000..48982db --- /dev/null +++ b/node_modules/tailwindcss/dist/default-theme.js @@ -0,0 +1 @@ +"use strict";var m=new Uint8Array(256);function d(e,c){let t=0,g=[],u=0,k=e.length,w=c.charCodeAt(0);for(let n=0;n0&&h===m[t-1]&&t--;break}}return g.push(e.slice(u)),g}var l=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,z=new RegExp(`^${l.source}$`);var T=new RegExp(`^${l.source}%$`);var D=new RegExp(`^${l.source}s*/s*${l.source}$`);var A=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],I=new RegExp(`^${l.source}(${A.join("|")})$`);var C=["deg","rad","grad","turn"],F=new RegExp(`^${l.source}(${C.join("|")})$`);var H=new RegExp(`^${l.source} +${l.source} +${l.source}$`);function i(e){let c=Number(e);return Number.isInteger(c)&&c>=0&&String(c)===String(e)}var f={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};function s(e){return{__BARE_VALUE__:e}}var r=s(e=>{if(i(e.value))return e.value}),o=s(e=>{if(i(e.value))return`${e.value}%`}),a=s(e=>{if(i(e.value))return`${e.value}px`}),b=s(e=>{if(i(e.value))return`${e.value}ms`}),p=s(e=>{if(i(e.value))return`${e.value}deg`}),S=s(e=>{if(e.fraction===null)return;let[c,t]=d(e.fraction,"/");if(!(!i(c)||!i(t)))return e.fraction}),E=s(e=>{if(i(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),y={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",...S},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...o}),backdropContrast:({theme:e})=>({...e("contrast"),...o}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...o}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...p}),backdropInvert:({theme:e})=>({...e("invert"),...o}),backdropOpacity:({theme:e})=>({...e("opacity"),...o}),backdropSaturate:({theme:e})=>({...e("saturate"),...o}),backdropSepia:({theme:e})=>({...e("sepia"),...o}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...a},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...o},caretColor:({theme:e})=>e("colors"),colors:()=>({...f}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...r},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...o},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),...a}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...r},flexShrink:{0:"0",DEFAULT:"1",...r},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...o},grayscale:{0:"0",DEFAULT:"100%",...o},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...r},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...r},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...r},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...r},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...E},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...E},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...p},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...o},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...r},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...o},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...r},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...p},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...o},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...o},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...o},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...p},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...r},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...a},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...b},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...b},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...r}};module.exports=y; diff --git a/node_modules/tailwindcss/dist/default-theme.mjs b/node_modules/tailwindcss/dist/default-theme.mjs new file mode 100644 index 0000000..61c61f6 --- /dev/null +++ b/node_modules/tailwindcss/dist/default-theme.mjs @@ -0,0 +1 @@ +import{i as a}from"./chunk-GFBUASX3.mjs";import"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/node_modules/tailwindcss/dist/flatten-color-palette.d.mts b/node_modules/tailwindcss/dist/flatten-color-palette.d.mts new file mode 100644 index 0000000..1151604 --- /dev/null +++ b/node_modules/tailwindcss/dist/flatten-color-palette.d.mts @@ -0,0 +1,6 @@ +type Colors = { + [key: string | number]: string | Colors; +}; +declare function flattenColorPalette(colors: Colors): Record; + +export { flattenColorPalette as default }; diff --git a/node_modules/tailwindcss/dist/flatten-color-palette.d.ts b/node_modules/tailwindcss/dist/flatten-color-palette.d.ts new file mode 100644 index 0000000..1151604 --- /dev/null +++ b/node_modules/tailwindcss/dist/flatten-color-palette.d.ts @@ -0,0 +1,6 @@ +type Colors = { + [key: string | number]: string | Colors; +}; +declare function flattenColorPalette(colors: Colors): Record; + +export { flattenColorPalette as default }; diff --git a/node_modules/tailwindcss/dist/flatten-color-palette.js b/node_modules/tailwindcss/dist/flatten-color-palette.js new file mode 100644 index 0000000..fa67f64 --- /dev/null +++ b/node_modules/tailwindcss/dist/flatten-color-palette.js @@ -0,0 +1,3 @@ +"use strict";function N(e){return{kind:"word",value:e}}function we(e,t){return{kind:"function",value:e,nodes:t}}function ye(e){return{kind:"separator",value:e}}function v(e){let t="";for(let i of e)switch(i.kind){case"word":case"separator":{t+=i.value;break}case"function":t+=i.value+"("+v(i.nodes)+")"}return t}var q=92,be=41,Z=58,Q=44,xe=34,J=61,X=62,ee=60,te=10,Ae=40,Ce=39,Se=47,re=32,ie=9;function g(e){e=e.replaceAll(`\r +`,` +`);let t=[],i=[],r=null,n="",a;for(let o=0;o0){let u=N(n);r?r.nodes.push(u):t.push(u),n=""}let s=N(e[o]);r?r.nodes.push(s):t.push(s);break}case Z:case Q:case J:case X:case ee:case te:case re:case ie:{if(n.length>0){let U=N(n);r?r.nodes.push(U):t.push(U),n=""}let s=o,u=o+1;for(;u0){let u=N(n);s?.nodes.push(u),n=""}i.length>0?r=i[i.length-1]:r=null;break}default:n+=String.fromCharCode(l)}}return n.length>0&&t.push(N(n)),t}var p=class extends Map{constructor(i){super();this.factory=i}get(i){let r=super.get(i);return r===void 0&&(r=this.factory(i,this),this.set(i,r)),r}};var ct=new Uint8Array(256);var L=new Uint8Array(256);function d(e,t){let i=0,r=[],n=0,a=e.length,o=t.charCodeAt(0);for(let l=0;l0&&s===L[i-1]&&i--;break}}return r.push(e.slice(n)),r}var j=(o=>(o[o.Continue=0]="Continue",o[o.Skip=1]="Skip",o[o.Stop=2]="Stop",o[o.Replace=3]="Replace",o[o.ReplaceSkip=4]="ReplaceSkip",o[o.ReplaceStop=5]="ReplaceStop",o))(j||{}),f={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function c(e,t){typeof t=="function"?ne(e,t):ne(e,t.enter,t.exit)}function ne(e,t=()=>f.Continue,i=()=>f.Continue){let r=[[e,0,null]],n={parent:null,depth:0,path(){let a=[];for(let o=1;o0;){let a=r.length-1,o=r[a],l=o[0],s=o[1],u=o[2];if(s>=l.length){r.pop();continue}if(n.parent=u,n.depth=a,s>=0){let O=l[s],C=t(O,n)??f.Continue;switch(C.kind){case 0:{O.nodes&&O.nodes.length>0&&r.push([O.nodes,0,O]),o[1]=~s;continue}case 2:return;case 1:{o[1]=~s;continue}case 3:{l.splice(s,1,...C.nodes);continue}case 5:{l.splice(s,1,...C.nodes);return}case 4:{l.splice(s,1,...C.nodes),o[1]+=C.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${j[C.kind]??`Unknown(${C.kind})`}\` in enter.`)}}let w=~s,U=l[w],b=i(U,n)??f.Continue;switch(b.kind){case 0:o[1]=w+1;continue;case 2:return;case 3:{l.splice(w,1,...b.nodes),o[1]=w+b.nodes.length;continue}case 5:{l.splice(w,1,...b.nodes);return}case 4:{l.splice(w,1,...b.nodes),o[1]=w+b.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${j[b.kind]??`Unknown(${b.kind})`}\` in exit.`)}}}var xt=new p(e=>{let t=g(e),i=new Set;return c(t,(r,n)=>{let a=n.parent===null?t:n.parent.nodes??[];if(r.kind==="word"&&(r.value==="+"||r.value==="-"||r.value==="*"||r.value==="/")){let o=a.indexOf(r)??-1;if(o===-1)return;let l=a[o-1];if(l?.kind!=="separator"||l.value!==" ")return;let s=a[o+1];if(s?.kind!=="separator"||s.value!==" ")return;i.add(l),i.add(s)}else r.kind==="separator"&&r.value.length>0&&r.value.trim()===""?(a[0]===r||a[a.length-1]===r)&&i.add(r):r.kind==="separator"&&r.value.trim()===","&&(r.value=",")}),i.size>0&&c(t,r=>{if(i.has(r))return i.delete(r),f.ReplaceSkip([])}),W(t),v(t)});var At=new p(e=>{let t=g(e);return t.length===3&&t[0].kind==="word"&&t[0].value==="&"&&t[1].kind==="separator"&&t[1].value===":"&&t[2].kind==="function"&&t[2].value==="is"?v(t[2].nodes):e});function W(e){for(let t of e)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=P(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=P(t.value);for(let i=0;i{let t=g(e);return t.length===1&&t[0].kind==="function"&&t[0].value==="var"});function $e(e){throw new Error(`Unexpected value: ${e}`)}function P(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var A=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,_t=new RegExp(`^${A.source}$`);var It=new RegExp(`^${A.source}%$`);var Dt=new RegExp(`^${A.source}s*/s*${A.source}$`);var Te=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],Ut=new RegExp(`^${A.source}(${Te.join("|")})$`);var Ee=["deg","rad","grad","turn"],Lt=new RegExp(`^${A.source}(${Ee.join("|")})$`);var Kt=new RegExp(`^${A.source} +${A.source} +${A.source}$`);function h(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===String(e)}function _(e,t){if(t===null)return e;let i=Number(t);return Number.isNaN(i)||(t=`${i*100}%`),t==="100%"?e:`color-mix(in oklab, ${e} ${t}, transparent)`}var Re={"--alpha":Oe,"--spacing":Pe,"--theme":_e,theme:Ie};function Oe(e,t,i,...r){let[n,a]=d(i,"/").map(o=>o.trim());if(!n||!a)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${a||"50%"})\``);if(r.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${a||"50%"})\``);return _(n,a)}function Pe(e,t,i,...r){if(!i)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(r.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${r.length+1}.`);let n=e.theme.resolve(null,["--spacing"]);if(!n)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${n} * ${i})`}function _e(e,t,i,...r){if(!i.startsWith("--"))throw new Error("The --theme(\u2026) function can only be used with CSS variables from your theme.");let n=!1;i.endsWith(" inline")&&(n=!0,i=i.slice(0,-7)),t.kind==="at-rule"&&(n=!0);let a=e.resolveThemeValue(i,n);if(!a){if(r.length>0)return r.join(", ");throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the variable name is correct or provide a fallback value to silence this error.`)}if(r.length===0)return a;let o=r.join(", ");if(o==="initial")return a;if(a==="initial")return o;if(a.startsWith("var(")||a.startsWith("theme(")||a.startsWith("--theme(")){let l=g(a);return Ue(l,o),v(l)}return a}function Ie(e,t,i,...r){i=De(i);let n=e.resolveThemeValue(i);if(!n&&r.length>0)return r.join(", ");if(!n)throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the path is correct or provide a fallback value to silence this error.`);return n}var lr=new RegExp(Object.keys(Re).map(e=>`${e}\\(`).join("|"));function De(e){if(e[0]!=="'"&&e[0]!=='"')return e;let t="",i=e[0];for(let r=1;r{if(i.kind==="function"&&!(i.value!=="var"&&i.value!=="theme"&&i.value!=="--theme"))if(i.nodes.length===1)i.nodes.push({kind:"word",value:`, ${t}`});else{let r=i.nodes[i.nodes.length-1];r.kind==="word"&&r.value==="initial"&&(r.value=t)}})}var Ke=/^(?[-+]?(?:\d*\.)?\d+)(?[a-z]+|%)?$/i,le=new p(e=>{let t=Ke.exec(e);if(!t)return null;let i=t.groups?.value;if(i===void 0)return null;let r=Number(i);if(Number.isNaN(r))return null;let n=t.groups?.unit;return n===void 0?[r,null]:[r,n]});function se(e,t="top",i="right",r="bottom",n="left"){return ue(`${e}-${t}`,`${e}-${i}`,`${e}-${r}`,`${e}-${n}`)}function ue(e="top",t="right",i="bottom",r="left"){return{1:[[e,0],[t,0],[i,0],[r,0]],2:[[e,0],[t,1],[i,0],[r,1]],3:[[e,0],[t,1],[i,2],[r,1]],4:[[e,0],[t,1],[i,2],[r,3]]}}function T(e,t){return{1:[[e,0],[t,0]],2:[[e,0],[t,1]]}}var xr={inset:ue(),margin:se("margin"),padding:se("padding"),gap:T("row-gap","column-gap")},Ar={"inset-block":T("top","bottom"),"inset-inline":T("left","right"),"margin-block":T("margin-top","margin-bottom"),"margin-inline":T("margin-left","margin-right"),"padding-block":T("padding-top","padding-bottom"),"padding-inline":T("padding-left","padding-right")};var Jr=Symbol();var Xr=Symbol();var ei=Symbol();var ti=Symbol();var ri=Symbol();var ii=Symbol();var ni=Symbol();var oi=Symbol();var ai=Symbol();var li=Symbol();var si=Symbol();var ui=Symbol();var fi=Symbol();var H={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};function E(e){return{__BARE_VALUE__:e}}var k=E(e=>{if(h(e.value))return e.value}),m=E(e=>{if(h(e.value))return`${e.value}%`}),$=E(e=>{if(h(e.value))return`${e.value}px`}),ve=E(e=>{if(h(e.value))return`${e.value}ms`}),M=E(e=>{if(h(e.value))return`${e.value}deg`}),it=E(e=>{if(e.fraction===null)return;let[t,i]=d(e.fraction,"/");if(!(!h(t)||!h(i)))return e.fraction}),ke=E(e=>{if(h(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),nt={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",...it},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...m}),backdropContrast:({theme:e})=>({...e("contrast"),...m}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...m}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...M}),backdropInvert:({theme:e})=>({...e("invert"),...m}),backdropOpacity:({theme:e})=>({...e("opacity"),...m}),backdropSaturate:({theme:e})=>({...e("saturate"),...m}),backdropSepia:({theme:e})=>({...e("sepia"),...m}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...$},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...m},caretColor:({theme:e})=>e("colors"),colors:()=>({...H}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...k},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...m},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),...$}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...k},flexShrink:{0:"0",DEFAULT:"1",...k},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...m},grayscale:{0:"0",DEFAULT:"100%",...m},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...k},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...k},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...k},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...k},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...ke},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...ke},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...M},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...m},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...k},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...m},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...k},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...M},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...m},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...m},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...m},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...M},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...k},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...$},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...ve},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...ve},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...k}};function F(e){let t={};for(let[i,r]of Object.entries(e??{}))if(i!=="__CSS_VALUES__")if(typeof r=="object"&&r!==null)for(let[n,a]of Object.entries(F(r)))t[`${i}${n==="DEFAULT"?"":`-${n}`}`]=a;else t[i]=r;if("__CSS_VALUES__"in e)for(let[i,r]of Object.entries(e.__CSS_VALUES__))(Number(r)&4)===0&&(t[i]=e[i]);return t}module.exports=F; diff --git a/node_modules/tailwindcss/dist/flatten-color-palette.mjs b/node_modules/tailwindcss/dist/flatten-color-palette.mjs new file mode 100644 index 0000000..a62fee3 --- /dev/null +++ b/node_modules/tailwindcss/dist/flatten-color-palette.mjs @@ -0,0 +1 @@ +import"./chunk-CT46QCH7.mjs";import"./chunk-GFBUASX3.mjs";import"./chunk-HTB5LLOP.mjs";function i(r){let n={};for(let[e,t]of Object.entries(r??{}))if(e!=="__CSS_VALUES__")if(typeof t=="object"&&t!==null)for(let[o,f]of Object.entries(i(t)))n[`${e}${o==="DEFAULT"?"":`-${o}`}`]=f;else n[e]=t;if("__CSS_VALUES__"in r)for(let[e,t]of Object.entries(r.__CSS_VALUES__))(Number(t)&4)===0&&(n[e]=r[e]);return n}export{i as default}; diff --git a/node_modules/tailwindcss/dist/lib.d.mts b/node_modules/tailwindcss/dist/lib.d.mts new file mode 100644 index 0000000..67540fe --- /dev/null +++ b/node_modules/tailwindcss/dist/lib.d.mts @@ -0,0 +1,378 @@ +import { S as SourceLocation, U as UserConfig, P as Plugin } from './types-CJYAW1ql.mjs'; +import { V as Variant, C as Candidate } from './resolve-config-QUZ9b-Gn.mjs'; +import './colors.mjs'; + +declare const enum ThemeOptions { + NONE = 0, + INLINE = 1, + REFERENCE = 2, + DEFAULT = 4, + STATIC = 8, + USED = 16 +} +declare class Theme { + #private; + private values; + private keyframes; + prefix: string | null; + constructor(values?: Map, keyframes?: Set); + get size(): number; + add(key: string, value: string, options?: ThemeOptions, src?: Declaration['src']): void; + keysInNamespaces(themeKeys: Iterable): string[]; + get(themeKeys: ThemeKey[]): string | null; + hasDefault(key: string): boolean; + getOptions(key: string): ThemeOptions; + entries(): IterableIterator<[string, { + value: string; + options: ThemeOptions; + src: Declaration["src"]; + }]> | [string, { + value: string; + options: ThemeOptions; + src: Declaration["src"]; + }][]; + prefixKey(key: string): string; + clearNamespace(namespace: string, clearOptions: ThemeOptions): void; + markUsedVariable(themeKey: string): boolean; + resolve(candidateValue: string | null, themeKeys: ThemeKey[], options?: ThemeOptions): string | null; + resolveValue(candidateValue: string | null, themeKeys: ThemeKey[]): string | null; + resolveWith(candidateValue: string, themeKeys: ThemeKey[], nestedKeys?: `--${string}`[]): [string, Record] | null; + namespace(namespace: string): Map; + addKeyframes(value: AtRule): void; + getKeyframes(): AtRule[]; +} +type ThemeKey = `--${string}`; + +type VariantFn = (rule: Rule, variant: Extract) => null | void; +type CompareFn = (a: Variant, z: Variant) => number; +declare const enum Compounds { + Never = 0, + AtRules = 1, + StyleRules = 2 +} +declare class Variants { + compareFns: Map; + variants: Map; + compoundsWith: Compounds; + compounds: Compounds; + }>; + private completions; + /** + * Registering a group of variants should result in the same sort number for + * all the variants. This is to ensure that the variants are applied in the + * correct order. + */ + private groupOrder; + /** + * Keep track of the last sort order instead of using the size of the map to + * avoid unnecessarily skipping order numbers. + */ + private lastOrder; + static(name: string, applyFn: VariantFn<'static'>, { compounds, order }?: { + compounds?: Compounds; + order?: number; + }): void; + fromAst(name: string, ast: AstNode[], designSystem: DesignSystem): void; + functional(name: string, applyFn: VariantFn<'functional'>, { compounds, order }?: { + compounds?: Compounds; + order?: number; + }): void; + compound(name: string, compoundsWith: Compounds, applyFn: VariantFn<'compound'>, { compounds, order }?: { + compounds?: Compounds; + order?: number; + }): void; + group(fn: () => void, compareFn?: CompareFn): void; + has(name: string): boolean; + get(name: string): { + kind: Variant["kind"]; + order: number; + applyFn: VariantFn; + compoundsWith: Compounds; + compounds: Compounds; + } | undefined; + kind(name: string): "arbitrary" | "static" | "functional" | "compound"; + compoundsWith(parent: string, child: string | Variant): boolean; + suggest(name: string, suggestions: () => string[]): void; + getCompletions(name: string): string[]; + compare(a: Variant | null, z: Variant | null): number; + keys(): IterableIterator; + entries(): IterableIterator<[string, { + kind: Variant["kind"]; + order: number; + applyFn: VariantFn; + compoundsWith: Compounds; + compounds: Compounds; + }]>; + private set; + private nextOrder; +} + +declare function compileAstNodes(candidate: Candidate, designSystem: DesignSystem, flags: CompileAstFlags): { + node: AstNode; + propertySort: { + order: number[]; + count: number; + }; +}[]; + +interface CanonicalizeOptions { + /** + * The root font size in pixels. If provided, `rem` values will be normalized + * to `px` values. + * + * E.g.: `mt-[16px]` with `rem: 16` will become `mt-4` (assuming `--spacing: 0.25rem`). + */ + rem?: number; + /** + * Whether to collapse multiple utilities into a single utility if possible. + * + * E.g.: `mt-2 mr-2 mb-2 ml-2` → `m-2` + */ + collapse?: boolean; + /** + * Whether to convert between logical and physical properties when collapsing + * utilities. + * + * E.g.: `mr-2 ml-2` → `mx-2` + */ + logicalToPhysical?: boolean; +} + +interface ClassMetadata { + modifiers: string[]; +} +type ClassEntry = [string, ClassMetadata]; +interface SelectorOptions { + modifier?: string; + value?: string; +} +interface VariantEntry { + name: string; + isArbitrary: boolean; + values: string[]; + hasDash: boolean; + selectors: (options: SelectorOptions) => string[]; +} + +type CompileFn = (value: Extract) => AstNode[] | undefined | null; +interface SuggestionGroup { + supportsNegative?: boolean; + values: (string | null)[]; + modifiers: string[]; +} +type UtilityOptions = { + types: string[]; +}; +type Utility = { + kind: 'static' | 'functional'; + compileFn: CompileFn; + options?: UtilityOptions; +}; +declare class Utilities { + private utilities; + private completions; + static(name: string, compileFn: CompileFn<'static'>): void; + functional(name: string, compileFn: CompileFn<'functional'>, options?: UtilityOptions): void; + has(name: string, kind: 'static' | 'functional'): boolean; + get(name: string): Utility[]; + getCompletions(name: string): SuggestionGroup[]; + suggest(name: string, groups: () => SuggestionGroup[]): void; + keys(kind: 'static' | 'functional'): string[]; +} + +declare const enum CompileAstFlags { + None = 0, + RespectImportant = 1 +} +type DesignSystem = { + theme: Theme; + utilities: Utilities; + variants: Variants; + invalidCandidates: Set; + important: boolean; + getClassOrder(classes: string[]): [string, bigint | null][]; + getClassList(): ClassEntry[]; + getVariants(): VariantEntry[]; + parseCandidate(candidate: string): Readonly[]; + parseVariant(variant: string): Readonly | null; + compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[]; + candidatesToCss(classes: string[]): (string | null)[]; + candidatesToAst(classes: string[]): AstNode[][]; + storage: Record; +}; + +type StyleRule = { + kind: 'rule'; + selector: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type AtRule = { + kind: 'at-rule'; + name: string; + params: string; + nodes: AstNode[]; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Declaration = { + kind: 'declaration'; + property: string; + value: string | undefined; + important: boolean; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Comment = { + kind: 'comment'; + value: string; + src?: SourceLocation; + dst?: SourceLocation; +}; +type Context = { + kind: 'context'; + context: Record; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type AtRoot = { + kind: 'at-root'; + nodes: AstNode[]; + src?: undefined; + dst?: undefined; +}; +type Rule = StyleRule | AtRule; +type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot; + +/** + * Line offset tables are the key to generating our source maps. They allow us + * to store indexes with our AST nodes and later convert them into positions as + * when given the source that the indexes refer to. + */ +/** + * A position in source code + * + * https://tc39.es/ecma426/#sec-position-record-type + */ +interface Position { + /** The line number, one-based */ + line: number; + /** The column/character number, one-based */ + column: number; +} + +interface OriginalPosition extends Position { + source: DecodedSource; +} +/** + * A "decoded" sourcemap + * + * @see https://tc39.es/ecma426/#decoded-source-map-record + */ +interface DecodedSourceMap { + file: string | null; + sources: DecodedSource[]; + mappings: DecodedMapping[]; +} +/** + * A "decoded" source + * + * @see https://tc39.es/ecma426/#decoded-source-record + */ +interface DecodedSource { + url: string | null; + content: string | null; + ignore: boolean; +} +/** + * A "decoded" mapping + * + * @see https://tc39.es/ecma426/#decoded-mapping-record + */ +interface DecodedMapping { + originalPosition: OriginalPosition | null; + generatedPosition: Position; + name: string | null; +} + +type Config = UserConfig; +declare const enum Polyfills { + None = 0, + AtProperty = 1, + ColorMix = 2, + All = 3 +} +type CompileOptions = { + base?: string; + from?: string; + polyfills?: Polyfills; + loadModule?: (id: string, base: string, resourceHint: 'plugin' | 'config') => Promise<{ + path: string; + base: string; + module: Plugin | Config; + }>; + loadStylesheet?: (id: string, base: string) => Promise<{ + path: string; + base: string; + content: string; + }>; +}; +type Root = null | 'none' | { + base: string; + pattern: string; +}; +declare const enum Features { + None = 0, + AtApply = 1, + AtImport = 2, + JsPluginCompat = 4, + ThemeFunction = 8, + Utilities = 16, + Variants = 32, + AtTheme = 64 +} +declare function compileAst(input: AstNode[], opts?: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: Root; + features: Features; + build(candidates: string[]): AstNode[]; +}>; + +declare function compile(css: string, opts?: CompileOptions): Promise<{ + sources: { + base: string; + pattern: string; + negated: boolean; + }[]; + root: Root; + features: Features; + build(candidates: string[]): string; + buildSourceMap(): DecodedSourceMap; +}>; +declare function __unstable__loadDesignSystem(css: string, opts?: CompileOptions): Promise; +declare function postcssPluginWarning(): void; + +export { type Config, type DecodedSourceMap, Features, Polyfills, __unstable__loadDesignSystem, compile, compileAst, postcssPluginWarning as default }; diff --git a/node_modules/tailwindcss/dist/lib.d.ts b/node_modules/tailwindcss/dist/lib.d.ts new file mode 100644 index 0000000..411ce06 --- /dev/null +++ b/node_modules/tailwindcss/dist/lib.d.ts @@ -0,0 +1,3 @@ +declare function postcssPluginWarning(): void; + +export { postcssPluginWarning as default }; diff --git a/node_modules/tailwindcss/dist/lib.js b/node_modules/tailwindcss/dist/lib.js new file mode 100644 index 0000000..9c957ec --- /dev/null +++ b/node_modules/tailwindcss/dist/lib.js @@ -0,0 +1,38 @@ +"use strict";var fn=Object.defineProperty;var pn=(e,r)=>{for(var i in r)fn(e,i,{get:r[i],enumerable:!0})};var It={};pn(It,{Features:()=>Pe,Polyfills:()=>ht,__unstable__loadDesignSystem:()=>Wa,compile:()=>Fa,compileAst:()=>cn,default:()=>lt});var dr="4.1.18";function st(e){let r=[0];for(let n=0;n0;){let u=(o|0)>>1,c=l+u;r[c]<=n?(l=c+1,o=o-u-1):o=u}l-=1;let f=n-r[l];return{line:l+1,column:f}}function t({line:n,column:l}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let o=r[n],f=r[n+1]??o;return Math.min(Math.max(o+l,0),f)}return{find:i,findOffset:t}}var He=92,ut=47,ct=42,mr=34,gr=39,mn=58,ft=59,se=10,pt=13,Ze=32,Qe=9,hr=123,Ut=125,zt=40,vr=41,gn=91,hn=93,kr=45,Lt=64,vn=33,ue=class e extends Error{loc;constructor(r,i){if(i){let t=i[0],n=st(t.code).find(i[1]);r=`${t.file}:${n.line}:${n.column+1}: ${r}`}super(r),this.name="CssSyntaxError",this.loc=i,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function Ne(e,r){let i=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let t=[],n=[],l=[],o=null,f=null,u="",c="",m=0,d;for(let p=0;p0&&e[A]===h[h.length-1]&&(h=h.slice(0,-1));let S=Kt(u,x);if(!S)throw new ue("Invalid custom property, expected a value",i?[i,w,p]:null);i&&(S.src=[i,w,p],S.dst=[i,w,p]),o?o.nodes.push(S):t.push(S),u=""}else if(k===ft&&u.charCodeAt(0)===Lt)f=Je(u),i&&(f.src=[i,m,p],f.dst=[i,m,p]),o?o.nodes.push(f):t.push(f),u="",f=null;else if(k===ft&&c[c.length-1]!==")"){let h=Kt(u);if(!h){if(u.length===0)continue;throw new ue(`Invalid declaration: \`${u.trim()}\``,i?[i,m,p]:null)}i&&(h.src=[i,m,p],h.dst=[i,m,p]),o?o.nodes.push(h):t.push(h),u=""}else if(k===hr&&c[c.length-1]!==")")c+="}",f=Z(u.trim()),i&&(f.src=[i,m,p],f.dst=[i,m,p]),o&&o.nodes.push(f),l.push(o),o=f,u="",f=null;else if(k===Ut&&c[c.length-1]!==")"){if(c==="")throw new ue("Missing opening {",i?[i,p,p]:null);if(c=c.slice(0,-1),u.length>0)if(u.charCodeAt(0)===Lt)f=Je(u),i&&(f.src=[i,m,p],f.dst=[i,m,p]),o?o.nodes.push(f):t.push(f),u="",f=null;else{let w=u.indexOf(":");if(o){let x=Kt(u,w);if(!x)throw new ue(`Invalid declaration: \`${u.trim()}\``,i?[i,m,p]:null);i&&(x.src=[i,m,p],x.dst=[i,m,p]),o.nodes.push(x)}}let h=l.pop()??null;h===null&&o&&t.push(o),o=h,u="",f=null}else if(k===zt)c+=")",u+="(";else if(k===vr){if(c[c.length-1]!==")")throw new ue("Missing opening (",i?[i,p,p]:null);c=c.slice(0,-1),u+=")"}else{if(u.length===0&&(k===Ze||k===se||k===Qe))continue;u===""&&(m=p),u+=String.fromCharCode(k)}}}if(u.charCodeAt(0)===Lt){let p=Je(u);i&&(p.src=[i,m,e.length],p.dst=[i,m,e.length]),t.push(p)}if(c.length>0&&o){if(o.kind==="rule")throw new ue(`Missing closing } at ${o.selector}`,o.src?[o.src[0],o.src[1],o.src[1]]:null);if(o.kind==="at-rule")throw new ue(`Missing closing } at ${o.name} ${o.params}`,o.src?[o.src[0],o.src[1],o.src[1]]:null)}return n.length>0?n.concat(t):t}function Je(e,r=[]){let i=e,t="";for(let n=5;n=1&&n<=31||n===127||t===0&&n>=48&&n<=57||t===1&&n>=48&&n<=57&&o===45){l+="\\"+n.toString(16)+" ";continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){l+=r.charAt(t);continue}l+="\\"+r.charAt(t)}return l}function Ve(e){return e.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,r=>r.length>2?String.fromCodePoint(Number.parseInt(r.slice(1).trim(),16)):r[1])}var br=new Map([["--font",["--font-weight","--font-size"]],["--inset",["--inset-shadow","--inset-ring"]],["--text",["--text-color","--text-decoration-color","--text-decoration-thickness","--text-indent","--text-shadow","--text-underline-offset"]],["--grid-column",["--grid-column-start","--grid-column-end"]],["--grid-row",["--grid-row-start","--grid-row-end"]]]);function yr(e,r){return(br.get(r)??[]).some(i=>e===i||e.startsWith(`${i}-`))}var mt=class{constructor(r=new Map,i=new Set([])){this.values=r;this.keyframes=i}prefix=null;get size(){return this.values.size}add(r,i,t=0,n){if(r.endsWith("-*")){if(i!=="initial")throw new Error(`Invalid theme value \`${i}\` for namespace \`${r}\``);r==="--*"?this.values.clear():this.clearNamespace(r.slice(0,-2),0)}if(t&4){let l=this.values.get(r);if(l&&!(l.options&4))return}i==="initial"?this.values.delete(r):this.values.set(r,{value:i,options:t,src:n})}keysInNamespaces(r){let i=[];for(let t of r){let n=`${t}-`;for(let l of this.values.keys())l.startsWith(n)&&l.indexOf("--",2)===-1&&(yr(l,t)||i.push(l.slice(n.length)))}return i}get(r){for(let i of r){let t=this.values.get(i);if(t)return t.value}return null}hasDefault(r){return(this.getOptions(r)&4)===4}getOptions(r){return r=Ve(this.#r(r)),this.values.get(r)?.options??0}entries(){return this.prefix?Array.from(this.values,r=>(r[0]=this.prefixKey(r[0]),r)):this.values.entries()}prefixKey(r){return this.prefix?`--${this.prefix}-${r.slice(2)}`:r}#r(r){return this.prefix?`--${r.slice(3+this.prefix.length)}`:r}clearNamespace(r,i){let t=br.get(r)??[];e:for(let n of this.values.keys())if(n.startsWith(r)){if(i!==0&&(this.getOptions(n)&i)!==i)continue;for(let l of t)if(n.startsWith(l))continue e;this.values.delete(n)}}#e(r,i){for(let t of i){let n=r!==null?`${t}-${r}`:t;if(!this.values.has(n))if(r!==null&&r.includes(".")){if(n=`${t}-${r.replaceAll(".","_")}`,!this.values.has(n))continue}else continue;if(!yr(n,t))return n}return null}#t(r){let i=this.values.get(r);if(!i)return null;let t=null;return i.options&2&&(t=i.value),`var(${xe(this.prefixKey(r))}${t?`, ${t}`:""})`}markUsedVariable(r){let i=Ve(this.#r(r)),t=this.values.get(i);if(!t)return!1;let n=t.options&16;return t.options|=16,!n}resolve(r,i,t=0){let n=this.#e(r,i);if(!n)return null;let l=this.values.get(n);return(t|l.options)&1?l.value:this.#t(n)}resolveValue(r,i){let t=this.#e(r,i);return t?this.values.get(t).value:null}resolveWith(r,i,t=[]){let n=this.#e(r,i);if(!n)return null;let l={};for(let f of t){let u=`${n}${f}`,c=this.values.get(u);c&&(c.options&1?l[f]=c.value:l[f]=this.#t(u))}let o=this.values.get(n);return o.options&1?[o.value,l]:[this.#t(n),l]}namespace(r){let i=new Map,t=`${r}-`;for(let[n,l]of this.values)n===r?i.set(null,l.value):n.startsWith(`${t}-`)?i.set(n.slice(r.length),l.value):n.startsWith(t)&&i.set(n.slice(t.length),l.value);return i}addKeyframes(r){this.keyframes.add(r)}getKeyframes(){return Array.from(this.keyframes)}};var U=class extends Map{constructor(i){super();this.factory=i}get(i){let t=super.get(i);return t===void 0&&(t=this.factory(i,this),this.set(i,t)),t}};function oe(e){return{kind:"word",value:e}}function kn(e,r){return{kind:"function",value:e,nodes:r}}function wn(e){return{kind:"separator",value:e}}function H(e){let r="";for(let i of e)switch(i.kind){case"word":case"separator":{r+=i.value;break}case"function":r+=i.value+"("+H(i.nodes)+")"}return r}var xr=92,yn=41,Ar=58,Cr=44,bn=34,Sr=61,$r=62,Tr=60,Er=10,xn=40,An=39,Cn=47,Nr=32,Vr=9;function B(e){e=e.replaceAll(`\r +`,` +`);let r=[],i=[],t=null,n="",l;for(let o=0;o0){let c=oe(n);t?t.nodes.push(c):r.push(c),n=""}let u=oe(e[o]);t?t.nodes.push(u):r.push(u);break}case Ar:case Cr:case Sr:case $r:case Tr:case Er:case Nr:case Vr:{if(n.length>0){let d=oe(n);t?t.nodes.push(d):r.push(d),n=""}let u=o,c=o+1;for(;c0){let c=oe(n);u?.nodes.push(c),n=""}i.length>0?t=i[i.length-1]:t=null;break}default:n+=String.fromCharCode(f)}}return n.length>0&&r.push(oe(n)),r}var jt=(o=>(o[o.Continue=0]="Continue",o[o.Skip=1]="Skip",o[o.Stop=2]="Stop",o[o.Replace=3]="Replace",o[o.ReplaceSkip=4]="ReplaceSkip",o[o.ReplaceStop=5]="ReplaceStop",o))(jt||{}),V={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function _(e,r){typeof r=="function"?Rr(e,r):Rr(e,r.enter,r.exit)}function Rr(e,r=()=>V.Continue,i=()=>V.Continue){let t=[[e,0,null]],n={parent:null,depth:0,path(){let l=[];for(let o=1;o0;){let l=t.length-1,o=t[l],f=o[0],u=o[1],c=o[2];if(u>=f.length){t.pop();continue}if(n.parent=c,n.depth=l,u>=0){let k=f[u],h=r(k,n)??V.Continue;switch(h.kind){case 0:{k.nodes&&k.nodes.length>0&&t.push([k.nodes,0,k]),o[1]=~u;continue}case 2:return;case 1:{o[1]=~u;continue}case 3:{f.splice(u,1,...h.nodes);continue}case 5:{f.splice(u,1,...h.nodes);return}case 4:{f.splice(u,1,...h.nodes),o[1]+=h.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${jt[h.kind]??`Unknown(${h.kind})`}\` in enter.`)}}let m=~u,d=f[m],p=i(d,n)??V.Continue;switch(p.kind){case 0:o[1]=m+1;continue;case 2:return;case 3:{f.splice(m,1,...p.nodes),o[1]=m+p.nodes.length;continue}case 5:{f.splice(m,1,...p.nodes);return}case 4:{f.splice(m,1,...p.nodes),o[1]=m+p.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${jt[p.kind]??`Unknown(${p.kind})`}\` in exit.`)}}}function gt(e){let r=[];return _(B(e),i=>{if(!(i.kind!=="function"||i.value!=="var"))return _(i.nodes,t=>{t.kind!=="word"||t.value[0]!=="-"||t.value[1]!=="-"||r.push(t.value)}),V.Skip}),r}var Sn=64;function q(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function F(e,r="",i=[]){return{kind:"at-rule",name:e,params:r,nodes:i}}function Z(e,r=[]){return e.charCodeAt(0)===Sn?Je(e,r):q(e,r)}function a(e,r,i=!1){return{kind:"declaration",property:e,value:r,important:i}}function dt(e){return{kind:"comment",value:e}}function de(e,r){return{kind:"context",context:e,nodes:r}}function W(e){return{kind:"at-root",nodes:e}}function ee(e){switch(e.kind){case"rule":return{kind:e.kind,selector:e.selector,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"at-rule":return{kind:e.kind,name:e.name,params:e.params,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"at-root":return{kind:e.kind,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"context":return{kind:e.kind,context:{...e.context},nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"declaration":return{kind:e.kind,property:e.property,value:e.value,important:e.important,src:e.src,dst:e.dst};case"comment":return{kind:e.kind,value:e.value,src:e.src,dst:e.dst};default:throw new Error(`Unknown node kind: ${e.kind}`)}}function et(e){return{depth:e.depth,get context(){let r={};for(let i of e.path())i.kind==="context"&&Object.assign(r,i.context);return Object.defineProperty(this,"context",{value:r}),r},get parent(){let r=this.path().pop()??null;return Object.defineProperty(this,"parent",{value:r}),r},path(){return e.path().filter(r=>r.kind!=="context")}}}function Re(e,r,i=3){let t=[],n=new Set,l=new U(()=>new Set),o=new U(()=>new Set),f=new Set,u=new Set,c=[],m=[],d=new U(()=>new Set);function p(h,w,x={},S=0){if(h.kind==="declaration"){if(h.property==="--tw-sort"||h.value===void 0||h.value===null)return;if(x.theme&&h.property[0]==="-"&&h.property[1]==="-"){if(h.value==="initial"){h.value=void 0;return}x.keyframes||l.get(w).add(h)}if(h.value.includes("var("))if(x.theme&&h.property[0]==="-"&&h.property[1]==="-")for(let A of gt(h.value))d.get(A).add(h.property);else r.trackUsedVariables(h.value);if(h.property==="animation")for(let A of Or(h.value))u.add(A);i&2&&h.value.includes("color-mix(")&&!x.keyframes&&o.get(w).add(h),w.push(h)}else if(h.kind==="rule"){let A=[];for(let N of h.nodes)p(N,A,x,S+1);let y={},K=new Set;for(let N of A){if(N.kind!=="declaration")continue;let P=`${N.property}:${N.value}:${N.important}`;y[P]??=[],y[P].push(N)}for(let N in y)for(let P=0;P0&&(A=A.filter(N=>!K.has(N))),A.length===0)return;h.selector==="&"?w.push(...A):w.push({...h,nodes:A})}else if(h.kind==="at-rule"&&h.name==="@property"&&S===0){if(n.has(h.params))return;if(i&1){let y=h.params,K=null,N=!1;for(let z of h.nodes)z.kind==="declaration"&&(z.property==="initial-value"?K=z.value:z.property==="inherits"&&(N=z.value==="true"));let P=a(y,K??"initial");P.src=h.src,N?c.push(P):m.push(P)}n.add(h.params);let A={...h,nodes:[]};for(let y of h.nodes)p(y,A.nodes,x,S+1);w.push(A)}else if(h.kind==="at-rule"){h.name==="@keyframes"&&(x={...x,keyframes:!0});let A={...h,nodes:[]};for(let y of h.nodes)p(y,A.nodes,x,S+1);h.name==="@keyframes"&&x.theme&&f.add(A),(A.nodes.length>0||A.name==="@layer"||A.name==="@charset"||A.name==="@custom-media"||A.name==="@namespace"||A.name==="@import")&&w.push(A)}else if(h.kind==="at-root")for(let A of h.nodes){let y=[];p(A,y,x,0);for(let K of y)t.push(K)}else if(h.kind==="context"){if(h.context.reference)return;for(let A of h.nodes)p(A,w,{...x,...h.context},S)}else h.kind==="comment"&&w.push(h)}let k=[];for(let h of e)p(h,k,{},0);e:for(let[h,w]of l)for(let x of w){if(Pr(x.property,r.theme,d)){if(x.property.startsWith(r.theme.prefixKey("--animate-")))for(let y of Or(x.value))u.add(y);continue}let A=h.indexOf(x);if(h.splice(A,1),h.length===0){let y=$n(k,K=>K.kind==="rule"&&K.nodes===h);if(!y||y.length===0)continue e;y.unshift({kind:"at-root",nodes:k});do{let K=y.pop();if(!K)break;let N=y[y.length-1];if(!N||N.kind!=="at-root"&&N.kind!=="at-rule")break;let P=N.nodes.indexOf(K);if(P===-1)break;N.nodes.splice(P,1)}while(!0);continue e}}for(let h of f)if(!u.has(h.params)){let w=t.indexOf(h);t.splice(w,1)}if(k=k.concat(t),i&2)for(let[h,w]of o)for(let x of w){let S=h.indexOf(x);if(S===-1||x.value==null)continue;let A=B(x.value),y=!1;if(_(A,P=>{if(P.kind!=="function"||P.value!=="color-mix")return;let z=!1,I=!1;if(_(P.nodes,M=>{if(M.kind=="word"&&M.value.toLowerCase()==="currentcolor"){I=!0,y=!0;return}let Y=M,G=null,ae=new Set;do{if(Y.kind!=="function"||Y.value!=="var")return;let le=Y.nodes[0];if(!le||le.kind!=="word")return;let s=le.value;if(ae.has(s)){z=!0;return}if(ae.add(s),y=!0,G=r.theme.resolveValue(null,[le.value]),!G){z=!0;return}if(G.toLowerCase()==="currentcolor"){I=!0;return}G.startsWith("var(")?Y=B(G)[0]:Y=null}while(Y);return V.Replace({kind:"word",value:G})}),z||I){let M=P.nodes.findIndex(G=>G.kind==="separator"&&G.value.trim().includes(","));if(M===-1)return;let Y=P.nodes.length>M?P.nodes[M+1]:null;return Y?V.Replace(Y):void 0}else if(y){let M=P.nodes[2];M.kind==="word"&&(M.value==="oklab"||M.value==="oklch"||M.value==="lab"||M.value==="lch")&&(M.value="srgb")}}),!y)continue;let K={...x,value:H(A)},N=Z("@supports (color: color-mix(in lab, red, red))",[x]);N.src=x.src,h.splice(S,1,K,N)}if(i&1){let h=[];if(c.length>0){let w=Z(":root, :host",c);w.src=c[0].src,h.push(w)}if(m.length>0){let w=Z("*, ::before, ::after, ::backdrop",m);w.src=m[0].src,h.push(w)}if(h.length>0){let w=k.findIndex(A=>!(A.kind==="comment"||A.kind==="at-rule"&&(A.name==="@charset"||A.name==="@import"))),x=F("@layer","properties",[]);x.src=h[0].src,k.splice(w<0?k.length:w,0,x);let S=Z("@layer properties",[F("@supports","((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))",h)]);S.src=h[0].src,S.nodes[0].src=h[0].src,k.push(S)}}return k}function ie(e,r){let i=0,t={file:null,code:""};function n(o,f=0){let u="",c=" ".repeat(f);if(o.kind==="declaration"){if(u+=`${c}${o.property}: ${o.value}${o.important?" !important":""}; +`,r){i+=c.length;let m=i;i+=o.property.length,i+=2,i+=o.value?.length??0,o.important&&(i+=11);let d=i;i+=2,o.dst=[t,m,d]}}else if(o.kind==="rule"){if(u+=`${c}${o.selector} { +`,r){i+=c.length;let m=i;i+=o.selector.length,i+=1;let d=i;o.dst=[t,m,d],i+=2}for(let m of o.nodes)u+=n(m,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(o.kind==="at-rule"){if(o.nodes.length===0){let m=`${c}${o.name} ${o.params}; +`;if(r){i+=c.length;let d=i;i+=o.name.length,i+=1,i+=o.params.length;let p=i;i+=2,o.dst=[t,d,p]}return m}if(u+=`${c}${o.name}${o.params?` ${o.params} `:" "}{ +`,r){i+=c.length;let m=i;i+=o.name.length,o.params&&(i+=1,i+=o.params.length),i+=1;let d=i;o.dst=[t,m,d],i+=2}for(let m of o.nodes)u+=n(m,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(o.kind==="comment"){if(u+=`${c}/*${o.value}*/ +`,r){i+=c.length;let m=i;i+=2+o.value.length+2;let d=i;o.dst=[t,m,d],i+=1}}else if(o.kind==="context"||o.kind==="at-root")return"";return u}let l="";for(let o of e)l+=n(o,0);return t.code=l,l}function $n(e,r){let i=[];return _(e,(t,n)=>{if(r(t))return i=n.path(),i.push(t),V.Stop}),i}function Pr(e,r,i,t=new Set){if(t.has(e)||(t.add(e),r.getOptions(e)&24))return!0;{let l=i.get(e)??[];for(let o of l)if(Pr(o,r,i,t))return!0}return!1}function Or(e){return e.split(/[\s,]+/)}var Ft=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"];function tt(e){return e.indexOf("(")!==-1&&Ft.some(r=>e.includes(`${r}(`))}function _r(e){if(!Ft.some(l=>e.includes(l)))return e;let r="",i=[],t=null,n=null;for(let l=0;l=48&&o<=57||t!==null&&(o===37||o>=97&&o<=122||o>=65&&o<=90)?t=l:(n=t,t=null),o===40){r+=e[l];let f=l;for(let c=l-1;c>=0;c--){let m=e.charCodeAt(c);if(m>=48&&m<=57)f=c;else if(m>=97&&m<=122)f=c;else break}let u=e.slice(f,l);if(Ft.includes(u)){i.unshift(!0);continue}else if(i[0]&&u===""){i.unshift(!0);continue}i.unshift(!1);continue}else if(o===41)r+=e[l],i.shift();else if(o===44&&i[0]){r+=", ";continue}else{if(o===32&&i[0]&&r.charCodeAt(r.length-1)===32)continue;if((o===43||o===42||o===47||o===45)&&i[0]){let f=r.trimEnd(),u=f.charCodeAt(f.length-1),c=f.charCodeAt(f.length-2),m=e.charCodeAt(l+1);if((u===101||u===69)&&c>=48&&c<=57){r+=e[l];continue}else if(u===43||u===42||u===47||u===45){r+=e[l];continue}else if(u===40||u===44){r+=e[l];continue}else e.charCodeAt(l-1)===32?r+=`${e[l]} `:u>=48&&u<=57||m>=48&&m<=57||u===41||m===40||m===43||m===42||m===47||m===45||n!==null&&n===l-1?r+=` ${e[l]} `:r+=e[l]}else r+=e[l]}}return r}function Ae(e){if(e.indexOf("(")===-1)return ze(e);let r=B(e);return Wt(r),e=H(r),e=_r(e),e}function ze(e,r=!1){let i="";for(let t=0;t0&&n===Bt[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var vt=new Uint8Array(256);function L(e,r){let i=0,t=[],n=0,l=e.length,o=r.charCodeAt(0);for(let f=0;f0&&u===vt[i-1]&&i--;break}}return t.push(e.slice(n)),t}var En=58,Ir=45,Dr=97,Ur=122,Gt=/^[a-zA-Z0-9_.%-]+$/;function Lr(e){switch(e.kind){case"arbitrary":return{kind:e.kind,property:e.property,value:e.value,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Me),important:e.important,raw:e.raw};case"static":return{kind:e.kind,root:e.root,variants:e.variants.map(Me),important:e.important,raw:e.raw};case"functional":return{kind:e.kind,root:e.root,value:e.value?e.value.kind==="arbitrary"?{kind:e.value.kind,dataType:e.value.dataType,value:e.value.value}:{kind:e.value.kind,value:e.value.value,fraction:e.value.fraction}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Me),important:e.important,raw:e.raw};default:throw new Error("Unknown candidate kind")}}function Me(e){switch(e.kind){case"arbitrary":return{kind:e.kind,selector:e.selector,relative:e.relative};case"static":return{kind:e.kind,root:e.root};case"functional":return{kind:e.kind,root:e.root,value:e.value?{kind:e.value.kind,value:e.value.value}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};case"compound":return{kind:e.kind,root:e.root,variant:Me(e.variant),modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};default:throw new Error("Unknown variant kind")}}function*Kr(e,r){let i=L(e,":");if(r.theme.prefix){if(i.length===1||i[0]!==r.theme.prefix)return null;i.shift()}let t=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let p=r.parseVariant(i[d]);if(p===null)return;n.push(p)}let l=!1;t[t.length-1]==="!"?(l=!0,t=t.slice(0,-1)):t[0]==="!"&&(l=!0,t=t.slice(1)),r.utilities.has(t,"static")&&!t.includes("[")&&(yield{kind:"static",root:t,variants:n,important:l,raw:e});let[o,f=null,u]=L(t,"/");if(u)return;let c=f===null?null:Yt(f);if(f!==null&&c===null)return;if(o[0]==="["){if(o[o.length-1]!=="]")return;let d=o.charCodeAt(1);if(d!==Ir&&!(d>=Dr&&d<=Ur))return;o=o.slice(1,-1);let p=o.indexOf(":");if(p===-1||p===0||p===o.length-1)return;let k=o.slice(0,p),h=Ae(o.slice(p+1));if(!ke(h))return;yield{kind:"arbitrary",property:k,value:h,modifier:c,variants:n,important:l,raw:e};return}let m;if(o[o.length-1]==="]"){let d=o.indexOf("-[");if(d===-1)return;let p=o.slice(0,d);if(!r.utilities.has(p,"functional"))return;let k=o.slice(d+1);m=[[p,k]]}else if(o[o.length-1]===")"){let d=o.indexOf("-(");if(d===-1)return;let p=o.slice(0,d);if(!r.utilities.has(p,"functional"))return;let k=o.slice(d+2,-1),h=L(k,":"),w=null;if(h.length===2&&(w=h[0],k=h[1]),k[0]!=="-"||k[1]!=="-"||!ke(k))return;m=[[p,w===null?`[var(${k})]`:`[${w}:var(${k})]`]]}else m=Mr(o,d=>r.utilities.has(d,"functional"));for(let[d,p]of m){let k={kind:"functional",root:d,modifier:c,value:null,variants:n,important:l,raw:e};if(p===null){yield k;continue}{let h=p.indexOf("[");if(h!==-1){if(p[p.length-1]!=="]")return;let x=Ae(p.slice(h+1,-1));if(!ke(x))continue;let S=null;for(let A=0;A=Dr&&y<=Ur))break}if(x.length===0||x.trim().length===0||S==="")continue;k.value={kind:"arbitrary",dataType:S||null,value:x}}else{let x=f===null||k.modifier?.kind==="arbitrary"?null:`${p}/${f}`;if(!Gt.test(p))continue;k.value={kind:"named",value:p,fraction:x}}}yield k}}function Yt(e){if(e[0]==="["&&e[e.length-1]==="]"){let r=Ae(e.slice(1,-1));return!ke(r)||r.length===0||r.trim().length===0?null:{kind:"arbitrary",value:r}}return e[0]==="("&&e[e.length-1]===")"?(e=e.slice(1,-1),e[0]!=="-"||e[1]!=="-"||!ke(e)?null:(e=`var(${e})`,{kind:"arbitrary",value:Ae(e)})):Gt.test(e)?{kind:"named",value:e}:null}function zr(e,r){if(e[0]==="["&&e[e.length-1]==="]"){if(e[1]==="@"&&e.includes("&"))return null;let i=Ae(e.slice(1,-1));if(!ke(i)||i.length===0||i.trim().length===0)return null;let t=i[0]===">"||i[0]==="+"||i[0]==="~";return!t&&i[0]!=="@"&&!i.includes("&")&&(i=`&:is(${i})`),{kind:"arbitrary",selector:i,relative:t}}{let[i,t=null,n]=L(e,"/");if(n)return null;let l=Mr(i,o=>r.variants.has(o));for(let[o,f]of l)switch(r.variants.kind(o)){case"static":return f!==null||t!==null?null:{kind:"static",root:o};case"functional":{let u=t===null?null:Yt(t);if(t!==null&&u===null)return null;if(f===null)return{kind:"functional",root:o,modifier:u,value:null};if(f[f.length-1]==="]"){if(f[0]!=="[")continue;let c=Ae(f.slice(1,-1));return!ke(c)||c.length===0||c.trim().length===0?null:{kind:"functional",root:o,modifier:u,value:{kind:"arbitrary",value:c}}}if(f[f.length-1]===")"){if(f[0]!=="(")continue;let c=Ae(f.slice(1,-1));return!ke(c)||c.length===0||c.trim().length===0||c[0]!=="-"||c[1]!=="-"?null:{kind:"functional",root:o,modifier:u,value:{kind:"arbitrary",value:`var(${c})`}}}if(!Gt.test(f))continue;return{kind:"functional",root:o,modifier:u,value:{kind:"named",value:f}}}case"compound":{if(f===null)return null;t&&(o==="not"||o==="has"||o==="in")&&(f=`${f}/${t}`,t=null);let u=r.parseVariant(f);if(u===null||!r.variants.compoundsWith(o,u))return null;let c=t===null?null:Yt(t);return t!==null&&c===null?null:{kind:"compound",root:o,modifier:c,variant:u}}}}return null}function*Mr(e,r){r(e)&&(yield[e,null]);let i=e.lastIndexOf("-");for(;i>0;){let t=e.slice(0,i);if(r(t)){let n=[t,e.slice(i+1)];if(n[1]===""||n[0]==="@"&&r("@")&&e[i]==="-")break;yield n}i=e.lastIndexOf("-",i-1)}e[0]==="@"&&r("@")&&(yield["@",e.slice(1)])}function jr(e,r){let i=[];for(let n of r.variants)i.unshift(kt(n));e.theme.prefix&&i.unshift(e.theme.prefix);let t="";if(r.kind==="static"&&(t+=r.root),r.kind==="functional"&&(t+=r.root,r.value))if(r.value.kind==="arbitrary"){if(r.value!==null){let n=Ht(r.value.value),l=n?r.value.value.slice(4,-1):r.value.value,[o,f]=n?["(",")"]:["[","]"];r.value.dataType?t+=`-${o}${r.value.dataType}:${Ce(l)}${f}`:t+=`-${o}${Ce(l)}${f}`}}else r.value.kind==="named"&&(t+=`-${r.value.value}`);return r.kind==="arbitrary"&&(t+=`[${r.property}:${Ce(r.value)}]`),(r.kind==="arbitrary"||r.kind==="functional")&&(t+=it(r.modifier)),r.important&&(t+="!"),i.push(t),i.join(":")}function it(e){if(e===null)return"";let r=Ht(e.value),i=r?e.value.slice(4,-1):e.value,[t,n]=r?["(",")"]:["[","]"];return e.kind==="arbitrary"?`/${t}${Ce(i)}${n}`:e.kind==="named"?`/${e.value}`:""}function kt(e){if(e.kind==="static")return e.root;if(e.kind==="arbitrary")return`[${Ce(Rn(e.selector))}]`;let r="";if(e.kind==="functional"){r+=e.root;let i=e.root!=="@";if(e.value)if(e.value.kind==="arbitrary"){let t=Ht(e.value.value),n=t?e.value.value.slice(4,-1):e.value.value,[l,o]=t?["(",")"]:["[","]"];r+=`${i?"-":""}${l}${Ce(n)}${o}`}else e.value.kind==="named"&&(r+=`${i?"-":""}${e.value.value}`)}return e.kind==="compound"&&(r+=e.root,r+="-",r+=kt(e.variant)),(e.kind==="functional"||e.kind==="compound")&&(r+=it(e.modifier)),r}var Nn=new U(e=>{let r=B(e),i=new Set;return _(r,(t,n)=>{let l=n.parent===null?r:n.parent.nodes??[];if(t.kind==="word"&&(t.value==="+"||t.value==="-"||t.value==="*"||t.value==="/")){let o=l.indexOf(t)??-1;if(o===-1)return;let f=l[o-1];if(f?.kind!=="separator"||f.value!==" ")return;let u=l[o+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(f),i.add(u)}else t.kind==="separator"&&t.value.length>0&&t.value.trim()===""?(l[0]===t||l[l.length-1]===t)&&i.add(t):t.kind==="separator"&&t.value.trim()===","&&(t.value=",")}),i.size>0&&_(r,t=>{if(i.has(t))return i.delete(t),V.ReplaceSkip([])}),qt(r),H(r)});function Ce(e){return Nn.get(e)}var Vn=new U(e=>{let r=B(e);return r.length===3&&r[0].kind==="word"&&r[0].value==="&"&&r[1].kind==="separator"&&r[1].value===":"&&r[2].kind==="function"&&r[2].value==="is"?H(r[2].nodes):e});function Rn(e){return Vn.get(e)}function qt(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=rt(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=rt(r.value);for(let i=0;i{let r=B(e);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function Ht(e){return On.get(e)}function Pn(e){throw new Error(`Unexpected value: ${e}`)}function rt(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function Oe(e,r,i){if(e===r)return 0;let t=e.indexOf("("),n=r.indexOf("("),l=t===-1?e.replace(/[\d.]+/g,""):e.slice(0,t),o=n===-1?r.replace(/[\d.]+/g,""):r.slice(0,n),f=(l===o?0:lje(r)||Br(r)||r==="thin"||r==="medium"||r==="thick")}var Kn=/^(?:element|image|cross-fade|image-set)\(/,zn=/^(repeating-)?(conic|linear|radial)-gradient\(/;function Mn(e){let r=0;for(let i of L(e,","))if(!i.startsWith("var(")){if(Wr(i)){r+=1;continue}if(zn.test(i)){r+=1;continue}if(Kn.test(i)){r+=1;continue}return!1}return r>0}function jn(e){return e==="serif"||e==="sans-serif"||e==="monospace"||e==="cursive"||e==="fantasy"||e==="system-ui"||e==="ui-serif"||e==="ui-sans-serif"||e==="ui-monospace"||e==="ui-rounded"||e==="math"||e==="emoji"||e==="fangsong"}function Fn(e){let r=0;for(let i of L(e,",")){let t=i.charCodeAt(0);if(t>=48&&t<=57)return!1;i.startsWith("var(")||(r+=1)}return r>0}function Wn(e){return e==="xx-small"||e==="x-small"||e==="small"||e==="medium"||e==="large"||e==="x-large"||e==="xx-large"||e==="xxx-large"}function Bn(e){return e==="larger"||e==="smaller"}var we=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,Yn=new RegExp(`^${we.source}$`);function Br(e){return Yn.test(e)||tt(e)}var qn=new RegExp(`^${we.source}%$`);function Zt(e){return qn.test(e)||tt(e)}var Gn=new RegExp(`^${we.source}s*/s*${we.source}$`);function Hn(e){return Gn.test(e)||tt(e)}var Zn=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],Qn=new RegExp(`^${we.source}(${Zn.join("|")})$`);function je(e){return Qn.test(e)||tt(e)}function Jn(e){let r=0;for(let i of L(e," ")){if(i==="center"||i==="top"||i==="right"||i==="bottom"||i==="left"){r+=1;continue}if(!i.startsWith("var(")){if(je(i)||Zt(i)){r+=1;continue}return!1}}return r>0}function Xn(e){let r=0;for(let i of L(e,",")){if(i==="cover"||i==="contain"){r+=1;continue}let t=L(i," ");if(t.length!==1&&t.length!==2)return!1;if(t.every(n=>n==="auto"||je(n)||Zt(n))){r+=1;continue}}return r>0}var eo=["deg","rad","grad","turn"],to=new RegExp(`^${we.source}(${eo.join("|")})$`);function ro(e){return to.test(e)}var io=new RegExp(`^${we.source} +${we.source} +${we.source}$`);function no(e){return io.test(e)}function O(e){let r=Number(e);return Number.isInteger(r)&&r>=0&&String(r)===String(e)}function Qt(e){let r=Number(e);return Number.isInteger(r)&&r>0&&String(r)===String(e)}function ne(e){return Yr(e,.25)}function wt(e){return Yr(e,.25)}function Yr(e,r){let i=Number(e);return i>=0&&i%r===0&&String(i)===String(e)}var oo=new Set(["inset","inherit","initial","revert","unset"]),qr=/^-?(\d+|\.\d+)(.*?)$/g;function nt(e,r){return L(e,",").map(t=>{t=t.trim();let n=L(t," ").filter(c=>c.trim()!==""),l=null,o=null,f=null;for(let c of n)oo.has(c)||(qr.test(c)?(o===null?o=c:f===null&&(f=c),qr.lastIndex=0):l===null&&(l=c));if(o===null||f===null)return t;let u=r(l??"currentcolor");return l!==null?t.replace(l,u):`${t} ${u}`}).join(", ")}var lo=/^-?[a-z][a-zA-Z0-9/%._-]*$/,so=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,bt=["0","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96"],Jt=class{utilities=new U(()=>[]);completions=new Map;static(r,i){this.utilities.get(r).push({kind:"static",compileFn:i})}functional(r,i,t){this.utilities.get(r).push({kind:"functional",compileFn:i,options:t})}has(r,i){return this.utilities.has(r)&&this.utilities.get(r).some(t=>t.kind===i)}get(r){return this.utilities.has(r)?this.utilities.get(r):[]}getCompletions(r){return this.has(r,"static")?this.completions.get(r)?.()??[{supportsNegative:!1,values:[],modifiers:[]}]:this.completions.get(r)?.()??[]}suggest(r,i){let t=this.completions.get(r);t?this.completions.set(r,()=>[...t?.(),...i?.()]):this.completions.set(r,i)}keys(r){let i=[];for(let[t,n]of this.utilities.entries())for(let l of n)if(l.kind===r){i.push(t);break}return i}};function $(e,r,i){return F("@property",e,[a("syntax",i?`"${i}"`:'"*"'),a("inherits","false"),...r?[a("initial-value",r)]:[]])}function J(e,r){if(r===null)return e;let i=Number(r);return Number.isNaN(i)||(r=`${i*100}%`),r==="100%"?e:`color-mix(in oklab, ${e} ${r}, transparent)`}function Hr(e,r){let i=Number(r);return Number.isNaN(i)||(r=`${i*100}%`),`oklab(from ${e} l a b / ${r})`}function X(e,r,i){if(!r)return e;if(r.kind==="arbitrary")return J(e,r.value);let t=i.resolve(r.value,["--opacity"]);return t?J(e,t):wt(r.value)?J(e,`${r.value}%`):null}function te(e,r,i){let t=null;switch(e.value.value){case"inherit":{t="inherit";break}case"transparent":{t="transparent";break}case"current":{t="currentcolor";break}default:{t=r.resolve(e.value.value,i);break}}return t?X(t,e.modifier,r):null}var Zr=/(\d+)_(\d+)/g;function Qr(e){let r=new Jt;function i(s,g){function*v(b){for(let T of e.keysInNamespaces(b))yield T.replace(Zr,(D,E,R)=>`${E}.${R}`)}let C=["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"];r.suggest(s,()=>{let b=[];for(let T of g()){if(typeof T=="string"){b.push({values:[T],modifiers:[]});continue}let D=[...T.values??[],...v(T.valueThemeKeys??[])],E=[...T.modifiers??[],...v(T.modifierThemeKeys??[])];T.supportsFractions&&D.push(...C),T.hasDefaultValue&&D.unshift(null),b.push({supportsNegative:T.supportsNegative,values:D,modifiers:E})}return b})}function t(s,g){r.static(s,()=>g.map(v=>typeof v=="function"?v():a(v[0],v[1])))}function n(s,g){function v({negative:C}){return b=>{let T=null,D=null;if(b.value)if(b.value.kind==="arbitrary"){if(b.modifier)return;T=b.value.value,D=b.value.dataType}else{if(T=e.resolve(b.value.fraction??b.value.value,g.themeKeys??[]),T===null&&g.supportsFractions&&b.value.fraction){let[E,R]=L(b.value.fraction,"/");if(!O(E)||!O(R))return;T=`calc(${b.value.fraction} * 100%)`}if(T===null&&C&&g.handleNegativeBareValue){if(T=g.handleNegativeBareValue(b.value),!T?.includes("/")&&b.modifier)return;if(T!==null)return g.handle(T,null)}if(T===null&&g.handleBareValue&&(T=g.handleBareValue(b.value),!T?.includes("/")&&b.modifier))return;if(T===null&&!C&&g.staticValues&&!b.modifier){let E=g.staticValues[b.value.value];if(E)return E.map(ee)}}else{if(b.modifier)return;T=g.defaultValue!==void 0?g.defaultValue:e.resolve(null,g.themeKeys??[])}if(T!==null)return g.handle(C?`calc(${T} * -1)`:T,D)}}if(g.supportsNegative&&r.functional(`-${s}`,v({negative:!0})),r.functional(s,v({negative:!1})),i(s,()=>[{supportsNegative:g.supportsNegative,valueThemeKeys:g.themeKeys??[],hasDefaultValue:g.defaultValue!==void 0&&g.defaultValue!==null,supportsFractions:g.supportsFractions}]),g.staticValues&&Object.keys(g.staticValues).length>0){let C=Object.keys(g.staticValues);i(s,()=>[{values:C}])}}function l(s,g){r.functional(s,v=>{if(!v.value)return;let C=null;if(v.value.kind==="arbitrary"?(C=v.value.value,C=X(C,v.modifier,e)):C=te(v,e,g.themeKeys),C!==null)return g.handle(C)}),i(s,()=>[{values:["current","inherit","transparent"],valueThemeKeys:g.themeKeys,modifiers:Array.from({length:21},(v,C)=>`${C*5}`)}])}function o(s,g,v,{supportsNegative:C=!1,supportsFractions:b=!1,staticValues:T}={}){C&&r.static(`-${s}-px`,()=>v("-1px")),r.static(`${s}-px`,()=>v("1px")),n(s,{themeKeys:g,supportsFractions:b,supportsNegative:C,defaultValue:null,handleBareValue:({value:D})=>{let E=e.resolve(null,["--spacing"]);return!E||!ne(D)?null:`calc(${E} * ${D})`},handleNegativeBareValue:({value:D})=>{let E=e.resolve(null,["--spacing"]);return!E||!ne(D)?null:`calc(${E} * -${D})`},handle:v,staticValues:T}),i(s,()=>[{values:e.get(["--spacing"])?bt:[],supportsNegative:C,supportsFractions:b,valueThemeKeys:g}])}t("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip-path","inset(50%)"],["white-space","nowrap"],["border-width","0"]]),t("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip-path","none"],["white-space","normal"]]),t("pointer-events-none",[["pointer-events","none"]]),t("pointer-events-auto",[["pointer-events","auto"]]),t("visible",[["visibility","visible"]]),t("invisible",[["visibility","hidden"]]),t("collapse",[["visibility","collapse"]]),t("static",[["position","static"]]),t("fixed",[["position","fixed"]]),t("absolute",[["position","absolute"]]),t("relative",[["position","relative"]]),t("sticky",[["position","sticky"]]);for(let[s,g]of[["inset","inset"],["inset-x","inset-inline"],["inset-y","inset-block"],["start","inset-inline-start"],["end","inset-inline-end"],["top","top"],["right","right"],["bottom","bottom"],["left","left"]])t(`${s}-auto`,[[g,"auto"]]),t(`${s}-full`,[[g,"100%"]]),t(`-${s}-full`,[[g,"-100%"]]),o(s,["--inset","--spacing"],v=>[a(g,v)],{supportsNegative:!0,supportsFractions:!0});t("isolate",[["isolation","isolate"]]),t("isolation-auto",[["isolation","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--z-index"],handle:s=>[a("z-index",s)],staticValues:{auto:[a("z-index","auto")]}}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),n("order",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--order"],handle:s=>[a("order",s)],staticValues:{first:[a("order","-9999")],last:[a("order","9999")]}}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:["--order"]}]),n("col",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-column"],handle:s=>[a("grid-column",s)],staticValues:{auto:[a("grid-column","auto")]}}),n("col-span",{handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("grid-column",`span ${s} / span ${s}`)],staticValues:{full:[a("grid-column","1 / -1")]}}),n("col-start",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-column-start"],handle:s=>[a("grid-column-start",s)],staticValues:{auto:[a("grid-column-start","auto")]}}),n("col-end",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-column-end"],handle:s=>[a("grid-column-end",s)],staticValues:{auto:[a("grid-column-end","auto")]}}),i("col-span",()=>[{values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-column-end"]}]),n("row",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-row"],handle:s=>[a("grid-row",s)],staticValues:{auto:[a("grid-row","auto")]}}),n("row-span",{themeKeys:[],handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("grid-row",`span ${s} / span ${s}`)],staticValues:{full:[a("grid-row","1 / -1")]}}),n("row-start",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-row-start"],handle:s=>[a("grid-row-start",s)],staticValues:{auto:[a("grid-row-start","auto")]}}),n("row-end",{supportsNegative:!0,handleBareValue:({value:s})=>O(s)?s:null,themeKeys:["--grid-row-end"],handle:s=>[a("grid-row-end",s)],staticValues:{auto:[a("grid-row-end","auto")]}}),i("row-span",()=>[{values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-row-end"]}]),t("float-start",[["float","inline-start"]]),t("float-end",[["float","inline-end"]]),t("float-right",[["float","right"]]),t("float-left",[["float","left"]]),t("float-none",[["float","none"]]),t("clear-start",[["clear","inline-start"]]),t("clear-end",[["clear","inline-end"]]),t("clear-right",[["clear","right"]]),t("clear-left",[["clear","left"]]),t("clear-both",[["clear","both"]]),t("clear-none",[["clear","none"]]);for(let[s,g]of[["m","margin"],["mx","margin-inline"],["my","margin-block"],["ms","margin-inline-start"],["me","margin-inline-end"],["mt","margin-top"],["mr","margin-right"],["mb","margin-bottom"],["ml","margin-left"]])t(`${s}-auto`,[[g,"auto"]]),o(s,["--margin","--spacing"],v=>[a(g,v)],{supportsNegative:!0});t("box-border",[["box-sizing","border-box"]]),t("box-content",[["box-sizing","content-box"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("overflow","hidden"),a("display","-webkit-box"),a("-webkit-box-orient","vertical"),a("-webkit-line-clamp",s)],staticValues:{none:[a("overflow","visible"),a("display","block"),a("-webkit-box-orient","horizontal"),a("-webkit-line-clamp","unset")]}}),i("line-clamp",()=>[{values:["1","2","3","4","5","6"],valueThemeKeys:["--line-clamp"]}]),t("block",[["display","block"]]),t("inline-block",[["display","inline-block"]]),t("inline",[["display","inline"]]),t("hidden",[["display","none"]]),t("inline-flex",[["display","inline-flex"]]),t("table",[["display","table"]]),t("inline-table",[["display","inline-table"]]),t("table-caption",[["display","table-caption"]]),t("table-cell",[["display","table-cell"]]),t("table-column",[["display","table-column"]]),t("table-column-group",[["display","table-column-group"]]),t("table-footer-group",[["display","table-footer-group"]]),t("table-header-group",[["display","table-header-group"]]),t("table-row-group",[["display","table-row-group"]]),t("table-row",[["display","table-row"]]),t("flow-root",[["display","flow-root"]]),t("flex",[["display","flex"]]),t("grid",[["display","grid"]]),t("inline-grid",[["display","inline-grid"]]),t("contents",[["display","contents"]]),t("list-item",[["display","list-item"]]),t("field-sizing-content",[["field-sizing","content"]]),t("field-sizing-fixed",[["field-sizing","fixed"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:s})=>{if(s===null)return null;let[g,v]=L(s,"/");return!O(g)||!O(v)?null:s},handle:s=>[a("aspect-ratio",s)],staticValues:{auto:[a("aspect-ratio","auto")],square:[a("aspect-ratio","1 / 1")]}});for(let[s,g]of[["full","100%"],["svw","100svw"],["lvw","100lvw"],["dvw","100dvw"],["svh","100svh"],["lvh","100lvh"],["dvh","100dvh"],["min","min-content"],["max","max-content"],["fit","fit-content"]])t(`size-${s}`,[["--tw-sort","size"],["width",g],["height",g]]),t(`w-${s}`,[["width",g]]),t(`h-${s}`,[["height",g]]),t(`min-w-${s}`,[["min-width",g]]),t(`min-h-${s}`,[["min-height",g]]),t(`max-w-${s}`,[["max-width",g]]),t(`max-h-${s}`,[["max-height",g]]);t("size-auto",[["--tw-sort","size"],["width","auto"],["height","auto"]]),t("w-auto",[["width","auto"]]),t("h-auto",[["height","auto"]]),t("min-w-auto",[["min-width","auto"]]),t("min-h-auto",[["min-height","auto"]]),t("h-lh",[["height","1lh"]]),t("min-h-lh",[["min-height","1lh"]]),t("max-h-lh",[["max-height","1lh"]]),t("w-screen",[["width","100vw"]]),t("min-w-screen",[["min-width","100vw"]]),t("max-w-screen",[["max-width","100vw"]]),t("h-screen",[["height","100vh"]]),t("min-h-screen",[["min-height","100vh"]]),t("max-h-screen",[["max-height","100vh"]]),t("max-w-none",[["max-width","none"]]),t("max-h-none",[["max-height","none"]]),o("size",["--size","--spacing"],s=>[a("--tw-sort","size"),a("width",s),a("height",s)],{supportsFractions:!0});for(let[s,g,v]of[["w",["--width","--spacing","--container"],"width"],["min-w",["--min-width","--spacing","--container"],"min-width"],["max-w",["--max-width","--spacing","--container"],"max-width"],["h",["--height","--spacing"],"height"],["min-h",["--min-height","--height","--spacing"],"min-height"],["max-h",["--max-height","--height","--spacing"],"max-height"]])o(s,g,C=>[a(v,C)],{supportsFractions:!0});r.static("container",()=>{let s=[...e.namespace("--breakpoint").values()];s.sort((v,C)=>Oe(v,C,"asc"));let g=[a("--tw-sort","--tw-container-component"),a("width","100%")];for(let v of s)g.push(F("@media",`(width >= ${v})`,[a("max-width",v)]));return g}),t("flex-auto",[["flex","auto"]]),t("flex-initial",[["flex","0 auto"]]),t("flex-none",[["flex","none"]]),r.functional("flex",s=>{if(s.value){if(s.value.kind==="arbitrary")return s.modifier?void 0:[a("flex",s.value.value)];if(s.value.fraction){let[g,v]=L(s.value.fraction,"/");return!O(g)||!O(v)?void 0:[a("flex",`calc(${s.value.fraction} * 100%)`)]}if(O(s.value.value))return s.modifier?void 0:[a("flex",s.value.value)]}}),i("flex",()=>[{supportsFractions:!0},{values:Array.from({length:12},(s,g)=>`${g+1}`)}]),n("shrink",{defaultValue:"1",handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("flex-shrink",s)]}),n("grow",{defaultValue:"1",handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("flex-grow",s)]}),i("shrink",()=>[{values:["0"],valueThemeKeys:[],hasDefaultValue:!0}]),i("grow",()=>[{values:["0"],valueThemeKeys:[],hasDefaultValue:!0}]),t("basis-auto",[["flex-basis","auto"]]),t("basis-full",[["flex-basis","100%"]]),o("basis",["--flex-basis","--spacing","--container"],s=>[a("flex-basis",s)],{supportsFractions:!0}),t("table-auto",[["table-layout","auto"]]),t("table-fixed",[["table-layout","fixed"]]),t("caption-top",[["caption-side","top"]]),t("caption-bottom",[["caption-side","bottom"]]),t("border-collapse",[["border-collapse","collapse"]]),t("border-separate",[["border-collapse","separate"]]);let f=()=>W([$("--tw-border-spacing-x","0",""),$("--tw-border-spacing-y","0","")]);o("border-spacing",["--border-spacing","--spacing"],s=>[f(),a("--tw-border-spacing-x",s),a("--tw-border-spacing-y",s),a("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),o("border-spacing-x",["--border-spacing","--spacing"],s=>[f(),a("--tw-border-spacing-x",s),a("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),o("border-spacing-y",["--border-spacing","--spacing"],s=>[f(),a("--tw-border-spacing-y",s),a("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),n("origin",{themeKeys:["--transform-origin"],handle:s=>[a("transform-origin",s)],staticValues:{center:[a("transform-origin","center")],top:[a("transform-origin","top")],"top-right":[a("transform-origin","100% 0")],right:[a("transform-origin","100%")],"bottom-right":[a("transform-origin","100% 100%")],bottom:[a("transform-origin","bottom")],"bottom-left":[a("transform-origin","0 100%")],left:[a("transform-origin","0")],"top-left":[a("transform-origin","0 0")]}}),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:s=>[a("perspective-origin",s)],staticValues:{center:[a("perspective-origin","center")],top:[a("perspective-origin","top")],"top-right":[a("perspective-origin","100% 0")],right:[a("perspective-origin","100%")],"bottom-right":[a("perspective-origin","100% 100%")],bottom:[a("perspective-origin","bottom")],"bottom-left":[a("perspective-origin","0 100%")],left:[a("perspective-origin","0")],"top-left":[a("perspective-origin","0 0")]}}),n("perspective",{themeKeys:["--perspective"],handle:s=>[a("perspective",s)],staticValues:{none:[a("perspective","none")]}});let u=()=>W([$("--tw-translate-x","0"),$("--tw-translate-y","0"),$("--tw-translate-z","0")]);t("translate-none",[["translate","none"]]),t("-translate-full",[u,["--tw-translate-x","-100%"],["--tw-translate-y","-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),t("translate-full",[u,["--tw-translate-x","100%"],["--tw-translate-y","100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),o("translate",["--translate","--spacing"],s=>[u(),a("--tw-translate-x",s),a("--tw-translate-y",s),a("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let s of["x","y"])t(`-translate-${s}-full`,[u,[`--tw-translate-${s}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),t(`translate-${s}-full`,[u,[`--tw-translate-${s}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),o(`translate-${s}`,["--translate","--spacing"],g=>[u(),a(`--tw-translate-${s}`,g),a("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});o("translate-z",["--translate","--spacing"],s=>[u(),a("--tw-translate-z",s),a("translate","var(--tw-translate-x) var(--tw-translate-y) var(--tw-translate-z)")],{supportsNegative:!0}),t("translate-3d",[u,["translate","var(--tw-translate-x) var(--tw-translate-y) var(--tw-translate-z)"]]);let c=()=>W([$("--tw-scale-x","1"),$("--tw-scale-y","1"),$("--tw-scale-z","1")]);t("scale-none",[["scale","none"]]);function m({negative:s}){return g=>{if(!g.value||g.modifier)return;let v;return g.value.kind==="arbitrary"?(v=g.value.value,v=s?`calc(${v} * -1)`:v,[a("scale",v)]):(v=e.resolve(g.value.value,["--scale"]),!v&&O(g.value.value)&&(v=`${g.value.value}%`),v?(v=s?`calc(${v} * -1)`:v,[c(),a("--tw-scale-x",v),a("--tw-scale-y",v),a("--tw-scale-z",v),a("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}r.functional("-scale",m({negative:!0})),r.functional("scale",m({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let s of["x","y","z"])n(`scale-${s}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:g})=>O(g)?`${g}%`:null,handle:g=>[c(),a(`--tw-scale-${s}`,g),a("scale",`var(--tw-scale-x) var(--tw-scale-y)${s==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${s}`,()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);t("scale-3d",[c,["scale","var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z)"]]),t("rotate-none",[["rotate","none"]]);function d({negative:s}){return g=>{if(!g.value||g.modifier)return;let v;if(g.value.kind==="arbitrary"){v=g.value.value;let C=g.value.dataType??Q(v,["angle","vector"]);if(C==="vector")return[a("rotate",`${v} var(--tw-rotate)`)];if(C!=="angle")return[a("rotate",s?`calc(${v} * -1)`:v)]}else if(v=e.resolve(g.value.value,["--rotate"]),!v&&O(g.value.value)&&(v=`${g.value.value}deg`),!v)return;return[a("rotate",s?`calc(${v} * -1)`:v)]}}r.functional("-rotate",d({negative:!0})),r.functional("rotate",d({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let s=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),g=()=>W([$("--tw-rotate-x"),$("--tw-rotate-y"),$("--tw-rotate-z"),$("--tw-skew-x"),$("--tw-skew-y")]);for(let v of["x","y","z"])n(`rotate-${v}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:C})=>O(C)?`${C}deg`:null,handle:C=>[g(),a(`--tw-rotate-${v}`,`rotate${v.toUpperCase()}(${C})`),a("transform",s)]}),i(`rotate-${v}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>O(v)?`${v}deg`:null,handle:v=>[g(),a("--tw-skew-x",`skewX(${v})`),a("--tw-skew-y",`skewY(${v})`),a("transform",s)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>O(v)?`${v}deg`:null,handle:v=>[g(),a("--tw-skew-x",`skewX(${v})`),a("transform",s)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:v})=>O(v)?`${v}deg`:null,handle:v=>[g(),a("--tw-skew-y",`skewY(${v})`),a("transform",s)]}),i("skew",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),i("skew-x",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),i("skew-y",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12"],valueThemeKeys:["--skew"]}]),r.functional("transform",v=>{if(v.modifier)return;let C=null;if(v.value?v.value.kind==="arbitrary"&&(C=v.value.value):C=s,C!==null)return[g(),a("transform",C)]}),i("transform",()=>[{hasDefaultValue:!0}]),t("transform-cpu",[["transform",s]]),t("transform-gpu",[["transform",`translateZ(0) ${s}`]]),t("transform-none",[["transform","none"]])}t("transform-flat",[["transform-style","flat"]]),t("transform-3d",[["transform-style","preserve-3d"]]),t("transform-content",[["transform-box","content-box"]]),t("transform-border",[["transform-box","border-box"]]),t("transform-fill",[["transform-box","fill-box"]]),t("transform-stroke",[["transform-box","stroke-box"]]),t("transform-view",[["transform-box","view-box"]]),t("backface-visible",[["backface-visibility","visible"]]),t("backface-hidden",[["backface-visibility","hidden"]]);for(let s of["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out"])t(`cursor-${s}`,[["cursor",s]]);n("cursor",{themeKeys:["--cursor"],handle:s=>[a("cursor",s)]});for(let s of["auto","none","manipulation"])t(`touch-${s}`,[["touch-action",s]]);let p=()=>W([$("--tw-pan-x"),$("--tw-pan-y"),$("--tw-pinch-zoom")]);for(let s of["x","left","right"])t(`touch-pan-${s}`,[p,["--tw-pan-x",`pan-${s}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let s of["y","up","down"])t(`touch-pan-${s}`,[p,["--tw-pan-y",`pan-${s}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);t("touch-pinch-zoom",[p,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let s of["none","text","all","auto"])t(`select-${s}`,[["-webkit-user-select",s],["user-select",s]]);t("resize-none",[["resize","none"]]),t("resize-x",[["resize","horizontal"]]),t("resize-y",[["resize","vertical"]]),t("resize",[["resize","both"]]),t("snap-none",[["scroll-snap-type","none"]]);let k=()=>W([$("--tw-scroll-snap-strictness","proximity","*")]);for(let s of["x","y","both"])t(`snap-${s}`,[k,["scroll-snap-type",`${s} var(--tw-scroll-snap-strictness)`]]);t("snap-mandatory",[k,["--tw-scroll-snap-strictness","mandatory"]]),t("snap-proximity",[k,["--tw-scroll-snap-strictness","proximity"]]),t("snap-align-none",[["scroll-snap-align","none"]]),t("snap-start",[["scroll-snap-align","start"]]),t("snap-end",[["scroll-snap-align","end"]]),t("snap-center",[["scroll-snap-align","center"]]),t("snap-normal",[["scroll-snap-stop","normal"]]),t("snap-always",[["scroll-snap-stop","always"]]);for(let[s,g]of[["scroll-m","scroll-margin"],["scroll-mx","scroll-margin-inline"],["scroll-my","scroll-margin-block"],["scroll-ms","scroll-margin-inline-start"],["scroll-me","scroll-margin-inline-end"],["scroll-mt","scroll-margin-top"],["scroll-mr","scroll-margin-right"],["scroll-mb","scroll-margin-bottom"],["scroll-ml","scroll-margin-left"]])o(s,["--scroll-margin","--spacing"],v=>[a(g,v)],{supportsNegative:!0});for(let[s,g]of[["scroll-p","scroll-padding"],["scroll-px","scroll-padding-inline"],["scroll-py","scroll-padding-block"],["scroll-ps","scroll-padding-inline-start"],["scroll-pe","scroll-padding-inline-end"],["scroll-pt","scroll-padding-top"],["scroll-pr","scroll-padding-right"],["scroll-pb","scroll-padding-bottom"],["scroll-pl","scroll-padding-left"]])o(s,["--scroll-padding","--spacing"],v=>[a(g,v)]);t("list-inside",[["list-style-position","inside"]]),t("list-outside",[["list-style-position","outside"]]),n("list",{themeKeys:["--list-style-type"],handle:s=>[a("list-style-type",s)],staticValues:{none:[a("list-style-type","none")],disc:[a("list-style-type","disc")],decimal:[a("list-style-type","decimal")]}}),n("list-image",{themeKeys:["--list-style-image"],handle:s=>[a("list-style-image",s)],staticValues:{none:[a("list-style-image","none")]}}),t("appearance-none",[["appearance","none"]]),t("appearance-auto",[["appearance","auto"]]),t("scheme-normal",[["color-scheme","normal"]]),t("scheme-dark",[["color-scheme","dark"]]),t("scheme-light",[["color-scheme","light"]]),t("scheme-light-dark",[["color-scheme","light dark"]]),t("scheme-only-dark",[["color-scheme","only dark"]]),t("scheme-only-light",[["color-scheme","only light"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:s})=>O(s)?s:null,handle:s=>[a("columns",s)],staticValues:{auto:[a("columns","auto")]}}),i("columns",()=>[{values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:["--columns","--container"]}]);for(let s of["auto","avoid","all","avoid-page","page","left","right","column"])t(`break-before-${s}`,[["break-before",s]]);for(let s of["auto","avoid","avoid-page","avoid-column"])t(`break-inside-${s}`,[["break-inside",s]]);for(let s of["auto","avoid","all","avoid-page","page","left","right","column"])t(`break-after-${s}`,[["break-after",s]]);t("grid-flow-row",[["grid-auto-flow","row"]]),t("grid-flow-col",[["grid-auto-flow","column"]]),t("grid-flow-dense",[["grid-auto-flow","dense"]]),t("grid-flow-row-dense",[["grid-auto-flow","row dense"]]),t("grid-flow-col-dense",[["grid-auto-flow","column dense"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:s=>[a("grid-auto-columns",s)],staticValues:{auto:[a("grid-auto-columns","auto")],min:[a("grid-auto-columns","min-content")],max:[a("grid-auto-columns","max-content")],fr:[a("grid-auto-columns","minmax(0, 1fr)")]}}),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:s=>[a("grid-auto-rows",s)],staticValues:{auto:[a("grid-auto-rows","auto")],min:[a("grid-auto-rows","min-content")],max:[a("grid-auto-rows","max-content")],fr:[a("grid-auto-rows","minmax(0, 1fr)")]}}),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:s})=>Qt(s)?`repeat(${s}, minmax(0, 1fr))`:null,handle:s=>[a("grid-template-columns",s)],staticValues:{none:[a("grid-template-columns","none")],subgrid:[a("grid-template-columns","subgrid")]}}),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:s})=>Qt(s)?`repeat(${s}, minmax(0, 1fr))`:null,handle:s=>[a("grid-template-rows",s)],staticValues:{none:[a("grid-template-rows","none")],subgrid:[a("grid-template-rows","subgrid")]}}),i("grid-cols",()=>[{values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(s,g)=>`${g+1}`),valueThemeKeys:["--grid-template-rows"]}]),t("flex-row",[["flex-direction","row"]]),t("flex-row-reverse",[["flex-direction","row-reverse"]]),t("flex-col",[["flex-direction","column"]]),t("flex-col-reverse",[["flex-direction","column-reverse"]]),t("flex-wrap",[["flex-wrap","wrap"]]),t("flex-nowrap",[["flex-wrap","nowrap"]]),t("flex-wrap-reverse",[["flex-wrap","wrap-reverse"]]),t("place-content-center",[["place-content","center"]]),t("place-content-start",[["place-content","start"]]),t("place-content-end",[["place-content","end"]]),t("place-content-center-safe",[["place-content","safe center"]]),t("place-content-end-safe",[["place-content","safe end"]]),t("place-content-between",[["place-content","space-between"]]),t("place-content-around",[["place-content","space-around"]]),t("place-content-evenly",[["place-content","space-evenly"]]),t("place-content-baseline",[["place-content","baseline"]]),t("place-content-stretch",[["place-content","stretch"]]),t("place-items-center",[["place-items","center"]]),t("place-items-start",[["place-items","start"]]),t("place-items-end",[["place-items","end"]]),t("place-items-center-safe",[["place-items","safe center"]]),t("place-items-end-safe",[["place-items","safe end"]]),t("place-items-baseline",[["place-items","baseline"]]),t("place-items-stretch",[["place-items","stretch"]]),t("content-normal",[["align-content","normal"]]),t("content-center",[["align-content","center"]]),t("content-start",[["align-content","flex-start"]]),t("content-end",[["align-content","flex-end"]]),t("content-center-safe",[["align-content","safe center"]]),t("content-end-safe",[["align-content","safe flex-end"]]),t("content-between",[["align-content","space-between"]]),t("content-around",[["align-content","space-around"]]),t("content-evenly",[["align-content","space-evenly"]]),t("content-baseline",[["align-content","baseline"]]),t("content-stretch",[["align-content","stretch"]]),t("items-center",[["align-items","center"]]),t("items-start",[["align-items","flex-start"]]),t("items-end",[["align-items","flex-end"]]),t("items-center-safe",[["align-items","safe center"]]),t("items-end-safe",[["align-items","safe flex-end"]]),t("items-baseline",[["align-items","baseline"]]),t("items-baseline-last",[["align-items","last baseline"]]),t("items-stretch",[["align-items","stretch"]]),t("justify-normal",[["justify-content","normal"]]),t("justify-center",[["justify-content","center"]]),t("justify-start",[["justify-content","flex-start"]]),t("justify-end",[["justify-content","flex-end"]]),t("justify-center-safe",[["justify-content","safe center"]]),t("justify-end-safe",[["justify-content","safe flex-end"]]),t("justify-between",[["justify-content","space-between"]]),t("justify-around",[["justify-content","space-around"]]),t("justify-evenly",[["justify-content","space-evenly"]]),t("justify-baseline",[["justify-content","baseline"]]),t("justify-stretch",[["justify-content","stretch"]]),t("justify-items-normal",[["justify-items","normal"]]),t("justify-items-center",[["justify-items","center"]]),t("justify-items-start",[["justify-items","start"]]),t("justify-items-end",[["justify-items","end"]]),t("justify-items-center-safe",[["justify-items","safe center"]]),t("justify-items-end-safe",[["justify-items","safe end"]]),t("justify-items-stretch",[["justify-items","stretch"]]),o("gap",["--gap","--spacing"],s=>[a("gap",s)]),o("gap-x",["--gap","--spacing"],s=>[a("column-gap",s)]),o("gap-y",["--gap","--spacing"],s=>[a("row-gap",s)]),o("space-x",["--space","--spacing"],s=>[W([$("--tw-space-x-reverse","0")]),q(":where(& > :not(:last-child))",[a("--tw-sort","row-gap"),a("--tw-space-x-reverse","0"),a("margin-inline-start",`calc(${s} * var(--tw-space-x-reverse))`),a("margin-inline-end",`calc(${s} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),o("space-y",["--space","--spacing"],s=>[W([$("--tw-space-y-reverse","0")]),q(":where(& > :not(:last-child))",[a("--tw-sort","column-gap"),a("--tw-space-y-reverse","0"),a("margin-block-start",`calc(${s} * var(--tw-space-y-reverse))`),a("margin-block-end",`calc(${s} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),t("space-x-reverse",[()=>W([$("--tw-space-x-reverse","0")]),()=>q(":where(& > :not(:last-child))",[a("--tw-sort","row-gap"),a("--tw-space-x-reverse","1")])]),t("space-y-reverse",[()=>W([$("--tw-space-y-reverse","0")]),()=>q(":where(& > :not(:last-child))",[a("--tw-sort","column-gap"),a("--tw-space-y-reverse","1")])]),t("accent-auto",[["accent-color","auto"]]),l("accent",{themeKeys:["--accent-color","--color"],handle:s=>[a("accent-color",s)]}),l("caret",{themeKeys:["--caret-color","--color"],handle:s=>[a("caret-color",s)]}),l("divide",{themeKeys:["--divide-color","--border-color","--color"],handle:s=>[q(":where(& > :not(:last-child))",[a("--tw-sort","divide-color"),a("border-color",s)])]}),t("place-self-auto",[["place-self","auto"]]),t("place-self-start",[["place-self","start"]]),t("place-self-end",[["place-self","end"]]),t("place-self-center",[["place-self","center"]]),t("place-self-end-safe",[["place-self","safe end"]]),t("place-self-center-safe",[["place-self","safe center"]]),t("place-self-stretch",[["place-self","stretch"]]),t("self-auto",[["align-self","auto"]]),t("self-start",[["align-self","flex-start"]]),t("self-end",[["align-self","flex-end"]]),t("self-center",[["align-self","center"]]),t("self-end-safe",[["align-self","safe flex-end"]]),t("self-center-safe",[["align-self","safe center"]]),t("self-stretch",[["align-self","stretch"]]),t("self-baseline",[["align-self","baseline"]]),t("self-baseline-last",[["align-self","last baseline"]]),t("justify-self-auto",[["justify-self","auto"]]),t("justify-self-start",[["justify-self","flex-start"]]),t("justify-self-end",[["justify-self","flex-end"]]),t("justify-self-center",[["justify-self","center"]]),t("justify-self-end-safe",[["justify-self","safe flex-end"]]),t("justify-self-center-safe",[["justify-self","safe center"]]),t("justify-self-stretch",[["justify-self","stretch"]]);for(let s of["auto","hidden","clip","visible","scroll"])t(`overflow-${s}`,[["overflow",s]]),t(`overflow-x-${s}`,[["overflow-x",s]]),t(`overflow-y-${s}`,[["overflow-y",s]]);for(let s of["auto","contain","none"])t(`overscroll-${s}`,[["overscroll-behavior",s]]),t(`overscroll-x-${s}`,[["overscroll-behavior-x",s]]),t(`overscroll-y-${s}`,[["overscroll-behavior-y",s]]);t("scroll-auto",[["scroll-behavior","auto"]]),t("scroll-smooth",[["scroll-behavior","smooth"]]),t("truncate",[["overflow","hidden"],["text-overflow","ellipsis"],["white-space","nowrap"]]),t("text-ellipsis",[["text-overflow","ellipsis"]]),t("text-clip",[["text-overflow","clip"]]),t("hyphens-none",[["-webkit-hyphens","none"],["hyphens","none"]]),t("hyphens-manual",[["-webkit-hyphens","manual"],["hyphens","manual"]]),t("hyphens-auto",[["-webkit-hyphens","auto"],["hyphens","auto"]]),t("whitespace-normal",[["white-space","normal"]]),t("whitespace-nowrap",[["white-space","nowrap"]]),t("whitespace-pre",[["white-space","pre"]]),t("whitespace-pre-line",[["white-space","pre-line"]]),t("whitespace-pre-wrap",[["white-space","pre-wrap"]]),t("whitespace-break-spaces",[["white-space","break-spaces"]]),t("text-wrap",[["text-wrap","wrap"]]),t("text-nowrap",[["text-wrap","nowrap"]]),t("text-balance",[["text-wrap","balance"]]),t("text-pretty",[["text-wrap","pretty"]]),t("break-normal",[["overflow-wrap","normal"],["word-break","normal"]]),t("break-all",[["word-break","break-all"]]),t("break-keep",[["word-break","keep-all"]]),t("wrap-anywhere",[["overflow-wrap","anywhere"]]),t("wrap-break-word",[["overflow-wrap","break-word"]]),t("wrap-normal",[["overflow-wrap","normal"]]);for(let[s,g]of[["rounded",["border-radius"]],["rounded-s",["border-start-start-radius","border-end-start-radius"]],["rounded-e",["border-start-end-radius","border-end-end-radius"]],["rounded-t",["border-top-left-radius","border-top-right-radius"]],["rounded-r",["border-top-right-radius","border-bottom-right-radius"]],["rounded-b",["border-bottom-right-radius","border-bottom-left-radius"]],["rounded-l",["border-top-left-radius","border-bottom-left-radius"]],["rounded-ss",["border-start-start-radius"]],["rounded-se",["border-start-end-radius"]],["rounded-ee",["border-end-end-radius"]],["rounded-es",["border-end-start-radius"]],["rounded-tl",["border-top-left-radius"]],["rounded-tr",["border-top-right-radius"]],["rounded-br",["border-bottom-right-radius"]],["rounded-bl",["border-bottom-left-radius"]]])n(s,{themeKeys:["--radius"],handle:v=>g.map(C=>a(C,v)),staticValues:{none:g.map(v=>a(v,"0")),full:g.map(v=>a(v,"calc(infinity * 1px)"))}});t("border-solid",[["--tw-border-style","solid"],["border-style","solid"]]),t("border-dashed",[["--tw-border-style","dashed"],["border-style","dashed"]]),t("border-dotted",[["--tw-border-style","dotted"],["border-style","dotted"]]),t("border-double",[["--tw-border-style","double"],["border-style","double"]]),t("border-hidden",[["--tw-border-style","hidden"],["border-style","hidden"]]),t("border-none",[["--tw-border-style","none"],["border-style","none"]]);{let g=function(v,C){r.functional(v,b=>{if(!b.value){if(b.modifier)return;let T=e.get(["--default-border-width"])??"1px",D=C.width(T);return D?[s(),...D]:void 0}if(b.value.kind==="arbitrary"){let T=b.value.value;switch(b.value.dataType??Q(T,["color","line-width","length"])){case"line-width":case"length":{if(b.modifier)return;let E=C.width(T);return E?[s(),...E]:void 0}default:return T=X(T,b.modifier,e),T===null?void 0:C.color(T)}}{let T=te(b,e,["--border-color","--color"]);if(T)return C.color(T)}{if(b.modifier)return;let T=e.resolve(b.value.value,["--border-width"]);if(T){let D=C.width(T);return D?[s(),...D]:void 0}if(O(b.value.value)){let D=C.width(`${b.value.value}px`);return D?[s(),...D]:void 0}}}),i(v,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(b,T)=>`${T*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var I=g;let s=()=>W([$("--tw-border-style","solid")]);g("border",{width:v=>[a("border-style","var(--tw-border-style)"),a("border-width",v)],color:v=>[a("border-color",v)]}),g("border-x",{width:v=>[a("border-inline-style","var(--tw-border-style)"),a("border-inline-width",v)],color:v=>[a("border-inline-color",v)]}),g("border-y",{width:v=>[a("border-block-style","var(--tw-border-style)"),a("border-block-width",v)],color:v=>[a("border-block-color",v)]}),g("border-s",{width:v=>[a("border-inline-start-style","var(--tw-border-style)"),a("border-inline-start-width",v)],color:v=>[a("border-inline-start-color",v)]}),g("border-e",{width:v=>[a("border-inline-end-style","var(--tw-border-style)"),a("border-inline-end-width",v)],color:v=>[a("border-inline-end-color",v)]}),g("border-t",{width:v=>[a("border-top-style","var(--tw-border-style)"),a("border-top-width",v)],color:v=>[a("border-top-color",v)]}),g("border-r",{width:v=>[a("border-right-style","var(--tw-border-style)"),a("border-right-width",v)],color:v=>[a("border-right-color",v)]}),g("border-b",{width:v=>[a("border-bottom-style","var(--tw-border-style)"),a("border-bottom-width",v)],color:v=>[a("border-bottom-color",v)]}),g("border-l",{width:v=>[a("border-left-style","var(--tw-border-style)"),a("border-left-width",v)],color:v=>[a("border-left-color",v)]}),n("divide-x",{defaultValue:e.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:v})=>O(v)?`${v}px`:null,handle:v=>[W([$("--tw-divide-x-reverse","0")]),q(":where(& > :not(:last-child))",[a("--tw-sort","divide-x-width"),s(),a("--tw-divide-x-reverse","0"),a("border-inline-style","var(--tw-border-style)"),a("border-inline-start-width",`calc(${v} * var(--tw-divide-x-reverse))`),a("border-inline-end-width",`calc(${v} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:e.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:v})=>O(v)?`${v}px`:null,handle:v=>[W([$("--tw-divide-y-reverse","0")]),q(":where(& > :not(:last-child))",[a("--tw-sort","divide-y-width"),s(),a("--tw-divide-y-reverse","0"),a("border-bottom-style","var(--tw-border-style)"),a("border-top-style","var(--tw-border-style)"),a("border-top-width",`calc(${v} * var(--tw-divide-y-reverse))`),a("border-bottom-width",`calc(${v} * calc(1 - var(--tw-divide-y-reverse)))`)])]}),i("divide-x",()=>[{values:["0","2","4","8"],valueThemeKeys:["--divide-width","--border-width"],hasDefaultValue:!0}]),i("divide-y",()=>[{values:["0","2","4","8"],valueThemeKeys:["--divide-width","--border-width"],hasDefaultValue:!0}]),t("divide-x-reverse",[()=>W([$("--tw-divide-x-reverse","0")]),()=>q(":where(& > :not(:last-child))",[a("--tw-divide-x-reverse","1")])]),t("divide-y-reverse",[()=>W([$("--tw-divide-y-reverse","0")]),()=>q(":where(& > :not(:last-child))",[a("--tw-divide-y-reverse","1")])]);for(let v of["solid","dashed","dotted","double","none"])t(`divide-${v}`,[()=>q(":where(& > :not(:last-child))",[a("--tw-sort","divide-style"),a("--tw-border-style",v),a("border-style",v)])])}t("bg-auto",[["background-size","auto"]]),t("bg-cover",[["background-size","cover"]]),t("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(s){if(s)return[a("background-size",s)]}}),t("bg-fixed",[["background-attachment","fixed"]]),t("bg-local",[["background-attachment","local"]]),t("bg-scroll",[["background-attachment","scroll"]]),t("bg-top",[["background-position","top"]]),t("bg-top-left",[["background-position","left top"]]),t("bg-top-right",[["background-position","right top"]]),t("bg-bottom",[["background-position","bottom"]]),t("bg-bottom-left",[["background-position","left bottom"]]),t("bg-bottom-right",[["background-position","right bottom"]]),t("bg-left",[["background-position","left"]]),t("bg-right",[["background-position","right"]]),t("bg-center",[["background-position","center"]]),n("bg-position",{handle(s){if(s)return[a("background-position",s)]}}),t("bg-repeat",[["background-repeat","repeat"]]),t("bg-no-repeat",[["background-repeat","no-repeat"]]),t("bg-repeat-x",[["background-repeat","repeat-x"]]),t("bg-repeat-y",[["background-repeat","repeat-y"]]),t("bg-repeat-round",[["background-repeat","round"]]),t("bg-repeat-space",[["background-repeat","space"]]),t("bg-none",[["background-image","none"]]);{let v=function(T){let D="in oklab";if(T?.kind==="named")switch(T.value){case"longer":case"shorter":case"increasing":case"decreasing":D=`in oklch ${T.value} hue`;break;default:D=`in ${T.value}`}else T?.kind==="arbitrary"&&(D=T.value);return D},C=function({negative:T}){return D=>{if(!D.value)return;if(D.value.kind==="arbitrary"){if(D.modifier)return;let j=D.value.value;switch(D.value.dataType??Q(j,["angle"])){case"angle":return j=T?`calc(${j} * -1)`:`${j}`,[a("--tw-gradient-position",j),a("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)];default:return T?void 0:[a("--tw-gradient-position",j),a("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)]}}let E=D.value.value;if(!T&&g.has(E))E=g.get(E);else if(O(E))E=T?`calc(${E}deg * -1)`:`${E}deg`;else return;let R=v(D.modifier);return[a("--tw-gradient-position",`${E}`),Z("@supports (background-image: linear-gradient(in lab, red, red))",[a("--tw-gradient-position",`${E} ${R}`)]),a("background-image","linear-gradient(var(--tw-gradient-stops))")]}},b=function({negative:T}){return D=>{if(D.value?.kind==="arbitrary"){if(D.modifier)return;let j=D.value.value;return[a("--tw-gradient-position",j),a("background-image",`conic-gradient(var(--tw-gradient-stops,${j}))`)]}let E=v(D.modifier);if(!D.value)return[a("--tw-gradient-position",E),a("background-image","conic-gradient(var(--tw-gradient-stops))")];let R=D.value.value;if(O(R))return R=T?`calc(${R}deg * -1)`:`${R}deg`,[a("--tw-gradient-position",`from ${R} ${E}`),a("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var M=v,Y=C,G=b;let s=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],g=new Map([["to-t","to top"],["to-tr","to top right"],["to-r","to right"],["to-br","to bottom right"],["to-b","to bottom"],["to-bl","to bottom left"],["to-l","to left"],["to-tl","to top left"]]);r.functional("-bg-linear",C({negative:!0})),r.functional("bg-linear",C({negative:!1})),i("bg-linear",()=>[{values:[...g.keys()],modifiers:s},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:s}]),r.functional("-bg-conic",b({negative:!0})),r.functional("bg-conic",b({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:s},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:s}]),r.functional("bg-radial",T=>{if(!T.value){let D=v(T.modifier);return[a("--tw-gradient-position",D),a("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(T.value.kind==="arbitrary"){if(T.modifier)return;let D=T.value.value;return[a("--tw-gradient-position",D),a("background-image",`radial-gradient(var(--tw-gradient-stops,${D}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:s}])}r.functional("bg",s=>{if(s.value){if(s.value.kind==="arbitrary"){let g=s.value.value;switch(s.value.dataType??Q(g,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return s.modifier?void 0:[a("background-position",g)];case"bg-size":case"length":case"size":return s.modifier?void 0:[a("background-size",g)];case"image":case"url":return s.modifier?void 0:[a("background-image",g)];default:return g=X(g,s.modifier,e),g===null?void 0:[a("background-color",g)]}}{let g=te(s,e,["--background-color","--color"]);if(g)return[a("background-color",g)]}{if(s.modifier)return;let g=e.resolve(s.value.value,["--background-image"]);if(g)return[a("background-image",g)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let h=()=>W([$("--tw-gradient-position"),$("--tw-gradient-from","#0000",""),$("--tw-gradient-via","#0000",""),$("--tw-gradient-to","#0000",""),$("--tw-gradient-stops"),$("--tw-gradient-via-stops"),$("--tw-gradient-from-position","0%",""),$("--tw-gradient-via-position","50%",""),$("--tw-gradient-to-position","100%","")]);function w(s,g){r.functional(s,v=>{if(v.value){if(v.value.kind==="arbitrary"){let C=v.value.value;switch(v.value.dataType??Q(C,["color","length","percentage"])){case"length":case"percentage":return v.modifier?void 0:g.position(C);default:return C=X(C,v.modifier,e),C===null?void 0:g.color(C)}}{let C=te(v,e,["--background-color","--color"]);if(C)return g.color(C)}{if(v.modifier)return;let C=e.resolve(v.value.value,["--gradient-color-stop-positions"]);if(C)return g.position(C);if(v.value.value[v.value.value.length-1]==="%"&&O(v.value.value.slice(0,-1)))return g.position(v.value.value)}}}),i(s,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)},{values:Array.from({length:21},(v,C)=>`${C*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}w("from",{color:s=>[h(),a("--tw-sort","--tw-gradient-from"),a("--tw-gradient-from",s),a("--tw-gradient-stops","var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))")],position:s=>[h(),a("--tw-gradient-from-position",s)]}),t("via-none",[["--tw-gradient-via-stops","initial"]]),w("via",{color:s=>[h(),a("--tw-sort","--tw-gradient-via"),a("--tw-gradient-via",s),a("--tw-gradient-via-stops","var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position)"),a("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:s=>[h(),a("--tw-gradient-via-position",s)]}),w("to",{color:s=>[h(),a("--tw-sort","--tw-gradient-to"),a("--tw-gradient-to",s),a("--tw-gradient-stops","var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))")],position:s=>[h(),a("--tw-gradient-to-position",s)]}),t("mask-none",[["mask-image","none"]]),r.functional("mask",s=>{if(!s.value||s.modifier||s.value.kind!=="arbitrary")return;let g=s.value.value;switch(s.value.dataType??Q(g,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return s.modifier?void 0:[a("mask-position",g)];case"bg-size":case"length":case"size":return[a("mask-size",g)];case"image":case"url":default:return[a("mask-image",g)]}}),t("mask-add",[["mask-composite","add"]]),t("mask-subtract",[["mask-composite","subtract"]]),t("mask-intersect",[["mask-composite","intersect"]]),t("mask-exclude",[["mask-composite","exclude"]]),t("mask-alpha",[["mask-mode","alpha"]]),t("mask-luminance",[["mask-mode","luminance"]]),t("mask-match",[["mask-mode","match-source"]]),t("mask-type-alpha",[["mask-type","alpha"]]),t("mask-type-luminance",[["mask-type","luminance"]]),t("mask-auto",[["mask-size","auto"]]),t("mask-cover",[["mask-size","cover"]]),t("mask-contain",[["mask-size","contain"]]),n("mask-size",{handle(s){if(s)return[a("mask-size",s)]}}),t("mask-top",[["mask-position","top"]]),t("mask-top-left",[["mask-position","left top"]]),t("mask-top-right",[["mask-position","right top"]]),t("mask-bottom",[["mask-position","bottom"]]),t("mask-bottom-left",[["mask-position","left bottom"]]),t("mask-bottom-right",[["mask-position","right bottom"]]),t("mask-left",[["mask-position","left"]]),t("mask-right",[["mask-position","right"]]),t("mask-center",[["mask-position","center"]]),n("mask-position",{handle(s){if(s)return[a("mask-position",s)]}}),t("mask-repeat",[["mask-repeat","repeat"]]),t("mask-no-repeat",[["mask-repeat","no-repeat"]]),t("mask-repeat-x",[["mask-repeat","repeat-x"]]),t("mask-repeat-y",[["mask-repeat","repeat-y"]]),t("mask-repeat-round",[["mask-repeat","round"]]),t("mask-repeat-space",[["mask-repeat","space"]]),t("mask-clip-border",[["mask-clip","border-box"]]),t("mask-clip-padding",[["mask-clip","padding-box"]]),t("mask-clip-content",[["mask-clip","content-box"]]),t("mask-clip-fill",[["mask-clip","fill-box"]]),t("mask-clip-stroke",[["mask-clip","stroke-box"]]),t("mask-clip-view",[["mask-clip","view-box"]]),t("mask-no-clip",[["mask-clip","no-clip"]]),t("mask-origin-border",[["mask-origin","border-box"]]),t("mask-origin-padding",[["mask-origin","padding-box"]]),t("mask-origin-content",[["mask-origin","content-box"]]),t("mask-origin-fill",[["mask-origin","fill-box"]]),t("mask-origin-stroke",[["mask-origin","stroke-box"]]),t("mask-origin-view",[["mask-origin","view-box"]]);let x=()=>W([$("--tw-mask-linear","linear-gradient(#fff, #fff)"),$("--tw-mask-radial","linear-gradient(#fff, #fff)"),$("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function S(s,g){r.functional(s,v=>{if(v.value){if(v.value.kind==="arbitrary"){let C=v.value.value;switch(v.value.dataType??Q(C,["length","percentage","color"])){case"color":return C=X(C,v.modifier,e),C===null?void 0:g.color(C);case"percentage":return v.modifier||!O(C.slice(0,-1))?void 0:g.position(C);default:return v.modifier?void 0:g.position(C)}}{let C=te(v,e,["--background-color","--color"]);if(C)return g.color(C)}{if(v.modifier)return;let C=Q(v.value.value,["number","percentage"]);if(!C)return;switch(C){case"number":{let b=e.resolve(null,["--spacing"]);return!b||!ne(v.value.value)?void 0:g.position(`calc(${b} * ${v.value.value})`)}case"percentage":return O(v.value.value.slice(0,-1))?g.position(v.value.value):void 0;default:return}}}}),i(s,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)},{values:Array.from({length:21},(v,C)=>`${C*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(s,()=>[{values:Array.from({length:21},(v,C)=>`${C*5}%`)},{values:e.get(["--spacing"])?bt:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(v,C)=>`${C*5}`)}])}let A=()=>W([$("--tw-mask-left","linear-gradient(#fff, #fff)"),$("--tw-mask-right","linear-gradient(#fff, #fff)"),$("--tw-mask-bottom","linear-gradient(#fff, #fff)"),$("--tw-mask-top","linear-gradient(#fff, #fff)")]);function y(s,g,v){S(s,{color(C){let b=[x(),A(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let T of["top","right","bottom","left"])v[T]&&(b.push(a(`--tw-mask-${T}`,`linear-gradient(to ${T}, var(--tw-mask-${T}-from-color) var(--tw-mask-${T}-from-position), var(--tw-mask-${T}-to-color) var(--tw-mask-${T}-to-position))`)),b.push(W([$(`--tw-mask-${T}-from-position`,"0%"),$(`--tw-mask-${T}-to-position`,"100%"),$(`--tw-mask-${T}-from-color`,"black"),$(`--tw-mask-${T}-to-color`,"transparent")])),b.push(a(`--tw-mask-${T}-${g}-color`,C)));return b},position(C){let b=[x(),A(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let T of["top","right","bottom","left"])v[T]&&(b.push(a(`--tw-mask-${T}`,`linear-gradient(to ${T}, var(--tw-mask-${T}-from-color) var(--tw-mask-${T}-from-position), var(--tw-mask-${T}-to-color) var(--tw-mask-${T}-to-position))`)),b.push(W([$(`--tw-mask-${T}-from-position`,"0%"),$(`--tw-mask-${T}-to-position`,"100%"),$(`--tw-mask-${T}-from-color`,"black"),$(`--tw-mask-${T}-to-color`,"transparent")])),b.push(a(`--tw-mask-${T}-${g}-position`,C)));return b}})}y("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),y("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),y("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),y("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),y("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),y("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),y("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),y("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),y("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),y("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),y("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),y("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let K=()=>W([$("--tw-mask-linear-position","0deg"),$("--tw-mask-linear-from-position","0%"),$("--tw-mask-linear-to-position","100%"),$("--tw-mask-linear-from-color","black"),$("--tw-mask-linear-to-color","transparent")]);n("mask-linear",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(s){return O(s.value)?`calc(1deg * ${s.value})`:null},handleNegativeBareValue(s){return O(s.value)?`calc(1deg * -${s.value})`:null},handle:s=>[x(),K(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),a("--tw-mask-linear-position",s)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),S("mask-linear-from",{color:s=>[x(),K(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),a("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),a("--tw-mask-linear-from-color",s)],position:s=>[x(),K(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),a("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),a("--tw-mask-linear-from-position",s)]}),S("mask-linear-to",{color:s=>[x(),K(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),a("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),a("--tw-mask-linear-to-color",s)],position:s=>[x(),K(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-linear-stops","var(--tw-mask-linear-position), var(--tw-mask-linear-from-color) var(--tw-mask-linear-from-position), var(--tw-mask-linear-to-color) var(--tw-mask-linear-to-position)"),a("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),a("--tw-mask-linear-to-position",s)]});let N=()=>W([$("--tw-mask-radial-from-position","0%"),$("--tw-mask-radial-to-position","100%"),$("--tw-mask-radial-from-color","black"),$("--tw-mask-radial-to-color","transparent"),$("--tw-mask-radial-shape","ellipse"),$("--tw-mask-radial-size","farthest-corner"),$("--tw-mask-radial-position","center")]);t("mask-circle",[["--tw-mask-radial-shape","circle"]]),t("mask-ellipse",[["--tw-mask-radial-shape","ellipse"]]),t("mask-radial-closest-side",[["--tw-mask-radial-size","closest-side"]]),t("mask-radial-farthest-side",[["--tw-mask-radial-size","farthest-side"]]),t("mask-radial-closest-corner",[["--tw-mask-radial-size","closest-corner"]]),t("mask-radial-farthest-corner",[["--tw-mask-radial-size","farthest-corner"]]),t("mask-radial-at-top",[["--tw-mask-radial-position","top"]]),t("mask-radial-at-top-left",[["--tw-mask-radial-position","top left"]]),t("mask-radial-at-top-right",[["--tw-mask-radial-position","top right"]]),t("mask-radial-at-bottom",[["--tw-mask-radial-position","bottom"]]),t("mask-radial-at-bottom-left",[["--tw-mask-radial-position","bottom left"]]),t("mask-radial-at-bottom-right",[["--tw-mask-radial-position","bottom right"]]),t("mask-radial-at-left",[["--tw-mask-radial-position","left"]]),t("mask-radial-at-right",[["--tw-mask-radial-position","right"]]),t("mask-radial-at-center",[["--tw-mask-radial-position","center"]]),n("mask-radial-at",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:s=>[a("--tw-mask-radial-position",s)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:s=>[x(),N(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),a("--tw-mask-radial-size",s)]}),S("mask-radial-from",{color:s=>[x(),N(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),a("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),a("--tw-mask-radial-from-color",s)],position:s=>[x(),N(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),a("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),a("--tw-mask-radial-from-position",s)]}),S("mask-radial-to",{color:s=>[x(),N(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),a("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),a("--tw-mask-radial-to-color",s)],position:s=>[x(),N(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-radial-stops","var(--tw-mask-radial-shape) var(--tw-mask-radial-size) at var(--tw-mask-radial-position), var(--tw-mask-radial-from-color) var(--tw-mask-radial-from-position), var(--tw-mask-radial-to-color) var(--tw-mask-radial-to-position)"),a("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),a("--tw-mask-radial-to-position",s)]});let P=()=>W([$("--tw-mask-conic-position","0deg"),$("--tw-mask-conic-from-position","0%"),$("--tw-mask-conic-to-position","100%"),$("--tw-mask-conic-from-color","black"),$("--tw-mask-conic-to-color","transparent")]);n("mask-conic",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(s){return O(s.value)?`calc(1deg * ${s.value})`:null},handleNegativeBareValue(s){return O(s.value)?`calc(1deg * -${s.value})`:null},handle:s=>[x(),P(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),a("--tw-mask-conic-position",s)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),S("mask-conic-from",{color:s=>[x(),P(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),a("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),a("--tw-mask-conic-from-color",s)],position:s=>[x(),P(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),a("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),a("--tw-mask-conic-from-position",s)]}),S("mask-conic-to",{color:s=>[x(),P(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),a("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),a("--tw-mask-conic-to-color",s)],position:s=>[x(),P(),a("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),a("mask-composite","intersect"),a("--tw-mask-conic-stops","from var(--tw-mask-conic-position), var(--tw-mask-conic-from-color) var(--tw-mask-conic-from-position), var(--tw-mask-conic-to-color) var(--tw-mask-conic-to-position)"),a("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),a("--tw-mask-conic-to-position",s)]}),t("box-decoration-slice",[["-webkit-box-decoration-break","slice"],["box-decoration-break","slice"]]),t("box-decoration-clone",[["-webkit-box-decoration-break","clone"],["box-decoration-break","clone"]]),t("bg-clip-text",[["background-clip","text"]]),t("bg-clip-border",[["background-clip","border-box"]]),t("bg-clip-padding",[["background-clip","padding-box"]]),t("bg-clip-content",[["background-clip","content-box"]]),t("bg-origin-border",[["background-origin","border-box"]]),t("bg-origin-padding",[["background-origin","padding-box"]]),t("bg-origin-content",[["background-origin","content-box"]]);for(let s of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])t(`bg-blend-${s}`,[["background-blend-mode",s]]),t(`mix-blend-${s}`,[["mix-blend-mode",s]]);t("mix-blend-plus-darker",[["mix-blend-mode","plus-darker"]]),t("mix-blend-plus-lighter",[["mix-blend-mode","plus-lighter"]]),t("fill-none",[["fill","none"]]),r.functional("fill",s=>{if(!s.value)return;if(s.value.kind==="arbitrary"){let v=X(s.value.value,s.modifier,e);return v===null?void 0:[a("fill",v)]}let g=te(s,e,["--fill","--color"]);if(g)return[a("fill",g)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)}]),t("stroke-none",[["stroke","none"]]),r.functional("stroke",s=>{if(s.value){if(s.value.kind==="arbitrary"){let g=s.value.value;switch(s.value.dataType??Q(g,["color","number","length","percentage"])){case"number":case"length":case"percentage":return s.modifier?void 0:[a("stroke-width",g)];default:return g=X(s.value.value,s.modifier,e),g===null?void 0:[a("stroke",g)]}}{let g=te(s,e,["--stroke","--color"]);if(g)return[a("stroke",g)]}{let g=e.resolve(s.value.value,["--stroke-width"]);if(g)return[a("stroke-width",g)];if(O(s.value.value))return[a("stroke-width",s.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:["0","1","2","3"],valueThemeKeys:["--stroke-width"]}]),t("object-contain",[["object-fit","contain"]]),t("object-cover",[["object-fit","cover"]]),t("object-fill",[["object-fit","fill"]]),t("object-none",[["object-fit","none"]]),t("object-scale-down",[["object-fit","scale-down"]]),n("object",{themeKeys:["--object-position"],handle:s=>[a("object-position",s)],staticValues:{top:[a("object-position","top")],"top-left":[a("object-position","left top")],"top-right":[a("object-position","right top")],bottom:[a("object-position","bottom")],"bottom-left":[a("object-position","left bottom")],"bottom-right":[a("object-position","right bottom")],left:[a("object-position","left")],right:[a("object-position","right")],center:[a("object-position","center")]}});for(let[s,g]of[["p","padding"],["px","padding-inline"],["py","padding-block"],["ps","padding-inline-start"],["pe","padding-inline-end"],["pt","padding-top"],["pr","padding-right"],["pb","padding-bottom"],["pl","padding-left"]])o(s,["--padding","--spacing"],v=>[a(g,v)]);t("text-left",[["text-align","left"]]),t("text-center",[["text-align","center"]]),t("text-right",[["text-align","right"]]),t("text-justify",[["text-align","justify"]]),t("text-start",[["text-align","start"]]),t("text-end",[["text-align","end"]]),o("indent",["--text-indent","--spacing"],s=>[a("text-indent",s)],{supportsNegative:!0}),t("align-baseline",[["vertical-align","baseline"]]),t("align-top",[["vertical-align","top"]]),t("align-middle",[["vertical-align","middle"]]),t("align-bottom",[["vertical-align","bottom"]]),t("align-text-top",[["vertical-align","text-top"]]),t("align-text-bottom",[["vertical-align","text-bottom"]]),t("align-sub",[["vertical-align","sub"]]),t("align-super",[["vertical-align","super"]]),n("align",{themeKeys:[],handle:s=>[a("vertical-align",s)]}),r.functional("font",s=>{if(!(!s.value||s.modifier)){if(s.value.kind==="arbitrary"){let g=s.value.value;switch(s.value.dataType??Q(g,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[a("font-family",g)];default:return[W([$("--tw-font-weight")]),a("--tw-font-weight",g),a("font-weight",g)]}}{let g=e.resolveWith(s.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(g){let[v,C={}]=g;return[a("font-family",v),a("font-feature-settings",C["--font-feature-settings"]),a("font-variation-settings",C["--font-variation-settings"])]}}{let g=e.resolve(s.value.value,["--font-weight"]);if(g)return[W([$("--tw-font-weight")]),a("--tw-font-weight",g),a("font-weight",g)]}}}),i("font",()=>[{values:[],valueThemeKeys:["--font"]},{values:[],valueThemeKeys:["--font-weight"]}]),t("uppercase",[["text-transform","uppercase"]]),t("lowercase",[["text-transform","lowercase"]]),t("capitalize",[["text-transform","capitalize"]]),t("normal-case",[["text-transform","none"]]),t("italic",[["font-style","italic"]]),t("not-italic",[["font-style","normal"]]),t("underline",[["text-decoration-line","underline"]]),t("overline",[["text-decoration-line","overline"]]),t("line-through",[["text-decoration-line","line-through"]]),t("no-underline",[["text-decoration-line","none"]]),t("font-stretch-normal",[["font-stretch","normal"]]),t("font-stretch-ultra-condensed",[["font-stretch","ultra-condensed"]]),t("font-stretch-extra-condensed",[["font-stretch","extra-condensed"]]),t("font-stretch-condensed",[["font-stretch","condensed"]]),t("font-stretch-semi-condensed",[["font-stretch","semi-condensed"]]),t("font-stretch-semi-expanded",[["font-stretch","semi-expanded"]]),t("font-stretch-expanded",[["font-stretch","expanded"]]),t("font-stretch-extra-expanded",[["font-stretch","extra-expanded"]]),t("font-stretch-ultra-expanded",[["font-stretch","ultra-expanded"]]),n("font-stretch",{handleBareValue:({value:s})=>{if(!s.endsWith("%"))return null;let g=Number(s.slice(0,-1));return!O(g)||Number.isNaN(g)||g<50||g>200?null:s},handle:s=>[a("font-stretch",s)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),l("placeholder",{themeKeys:["--background-color","--color"],handle:s=>[q("&::placeholder",[a("--tw-sort","placeholder-color"),a("color",s)])]}),t("decoration-solid",[["text-decoration-style","solid"]]),t("decoration-double",[["text-decoration-style","double"]]),t("decoration-dotted",[["text-decoration-style","dotted"]]),t("decoration-dashed",[["text-decoration-style","dashed"]]),t("decoration-wavy",[["text-decoration-style","wavy"]]),t("decoration-auto",[["text-decoration-thickness","auto"]]),t("decoration-from-font",[["text-decoration-thickness","from-font"]]),r.functional("decoration",s=>{if(s.value){if(s.value.kind==="arbitrary"){let g=s.value.value;switch(s.value.dataType??Q(g,["color","length","percentage"])){case"length":case"percentage":return s.modifier?void 0:[a("text-decoration-thickness",g)];default:return g=X(g,s.modifier,e),g===null?void 0:[a("text-decoration-color",g)]}}{let g=e.resolve(s.value.value,["--text-decoration-thickness"]);if(g)return s.modifier?void 0:[a("text-decoration-thickness",g)];if(O(s.value.value))return s.modifier?void 0:[a("text-decoration-thickness",`${s.value.value}px`)]}{let g=te(s,e,["--text-decoration-color","--color"]);if(g)return[a("text-decoration-color",g)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),n("animate",{themeKeys:["--animate"],handle:s=>[a("animation",s)],staticValues:{none:[a("animation","none")]}});{let s=["var(--tw-blur,)","var(--tw-brightness,)","var(--tw-contrast,)","var(--tw-grayscale,)","var(--tw-hue-rotate,)","var(--tw-invert,)","var(--tw-saturate,)","var(--tw-sepia,)","var(--tw-drop-shadow,)"].join(" "),g=["var(--tw-backdrop-blur,)","var(--tw-backdrop-brightness,)","var(--tw-backdrop-contrast,)","var(--tw-backdrop-grayscale,)","var(--tw-backdrop-hue-rotate,)","var(--tw-backdrop-invert,)","var(--tw-backdrop-opacity,)","var(--tw-backdrop-saturate,)","var(--tw-backdrop-sepia,)"].join(" "),v=()=>W([$("--tw-blur"),$("--tw-brightness"),$("--tw-contrast"),$("--tw-grayscale"),$("--tw-hue-rotate"),$("--tw-invert"),$("--tw-opacity"),$("--tw-saturate"),$("--tw-sepia"),$("--tw-drop-shadow"),$("--tw-drop-shadow-color"),$("--tw-drop-shadow-alpha","100%",""),$("--tw-drop-shadow-size")]),C=()=>W([$("--tw-backdrop-blur"),$("--tw-backdrop-brightness"),$("--tw-backdrop-contrast"),$("--tw-backdrop-grayscale"),$("--tw-backdrop-hue-rotate"),$("--tw-backdrop-invert"),$("--tw-backdrop-opacity"),$("--tw-backdrop-saturate"),$("--tw-backdrop-sepia")]);r.functional("filter",b=>{if(!b.modifier){if(b.value===null)return[v(),a("filter",s)];if(b.value.kind==="arbitrary")return[a("filter",b.value.value)];switch(b.value.value){case"none":return[a("filter","none")]}}}),r.functional("backdrop-filter",b=>{if(!b.modifier){if(b.value===null)return[C(),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)];if(b.value.kind==="arbitrary")return[a("-webkit-backdrop-filter",b.value.value),a("backdrop-filter",b.value.value)];switch(b.value.value){case"none":return[a("-webkit-backdrop-filter","none"),a("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:b=>[v(),a("--tw-blur",`blur(${b})`),a("filter",s)],staticValues:{none:[v(),a("--tw-blur"," "),a("filter",s)]}}),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:b=>[C(),a("--tw-backdrop-blur",`blur(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)],staticValues:{none:[C(),a("--tw-backdrop-blur"," "),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}}),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[v(),a("--tw-brightness",`brightness(${b})`),a("filter",s)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[C(),a("--tw-backdrop-brightness",`brightness(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("brightness",()=>[{values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--brightness"]}]),i("backdrop-brightness",()=>[{values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--backdrop-brightness","--brightness"]}]),n("contrast",{themeKeys:["--contrast"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[v(),a("--tw-contrast",`contrast(${b})`),a("filter",s)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[C(),a("--tw-backdrop-contrast",`contrast(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("contrast",()=>[{values:["0","50","75","100","125","150","200"],valueThemeKeys:["--contrast"]}]),i("backdrop-contrast",()=>[{values:["0","50","75","100","125","150","200"],valueThemeKeys:["--backdrop-contrast","--contrast"]}]),n("grayscale",{themeKeys:["--grayscale"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),a("--tw-grayscale",`grayscale(${b})`),a("filter",s)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),a("--tw-backdrop-grayscale",`grayscale(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("grayscale",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--grayscale"],hasDefaultValue:!0}]),i("backdrop-grayscale",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--backdrop-grayscale","--grayscale"],hasDefaultValue:!0}]),n("hue-rotate",{supportsNegative:!0,themeKeys:["--hue-rotate"],handleBareValue:({value:b})=>O(b)?`${b}deg`:null,handle:b=>[v(),a("--tw-hue-rotate",`hue-rotate(${b})`),a("filter",s)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:b})=>O(b)?`${b}deg`:null,handle:b=>[C(),a("--tw-backdrop-hue-rotate",`hue-rotate(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("hue-rotate",()=>[{values:["0","15","30","60","90","180"],valueThemeKeys:["--hue-rotate"]}]),i("backdrop-hue-rotate",()=>[{values:["0","15","30","60","90","180"],valueThemeKeys:["--backdrop-hue-rotate","--hue-rotate"]}]),n("invert",{themeKeys:["--invert"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),a("--tw-invert",`invert(${b})`),a("filter",s)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),a("--tw-backdrop-invert",`invert(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("invert",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--invert"],hasDefaultValue:!0}]),i("backdrop-invert",()=>[{values:["0","25","50","75","100"],valueThemeKeys:["--backdrop-invert","--invert"],hasDefaultValue:!0}]),n("saturate",{themeKeys:["--saturate"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[v(),a("--tw-saturate",`saturate(${b})`),a("filter",s)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,handle:b=>[C(),a("--tw-backdrop-saturate",`saturate(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("saturate",()=>[{values:["0","50","100","150","200"],valueThemeKeys:["--saturate"]}]),i("backdrop-saturate",()=>[{values:["0","50","100","150","200"],valueThemeKeys:["--backdrop-saturate","--saturate"]}]),n("sepia",{themeKeys:["--sepia"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[v(),a("--tw-sepia",`sepia(${b})`),a("filter",s)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:b})=>O(b)?`${b}%`:null,defaultValue:"100%",handle:b=>[C(),a("--tw-backdrop-sepia",`sepia(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("sepia",()=>[{values:["0","50","100"],valueThemeKeys:["--sepia"],hasDefaultValue:!0}]),i("backdrop-sepia",()=>[{values:["0","50","100"],valueThemeKeys:["--backdrop-sepia","--sepia"],hasDefaultValue:!0}]),t("drop-shadow-none",[v,["--tw-drop-shadow"," "],["filter",s]]),r.functional("drop-shadow",b=>{let T;if(b.modifier&&(b.modifier.kind==="arbitrary"?T=b.modifier.value:O(b.modifier.value)&&(T=`${b.modifier.value}%`)),!b.value){let D=e.get(["--drop-shadow"]),E=e.resolve(null,["--drop-shadow"]);return D===null||E===null?void 0:[v(),a("--tw-drop-shadow-alpha",T),...yt("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),a("--tw-drop-shadow",L(E,",").map(R=>`drop-shadow(${R})`).join(" ")),a("filter",s)]}if(b.value.kind==="arbitrary"){let D=b.value.value;switch(b.value.dataType??Q(D,["color"])){case"color":return D=X(D,b.modifier,e),D===null?void 0:[v(),a("--tw-drop-shadow-color",J(D,"var(--tw-drop-shadow-alpha)")),a("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return b.modifier&&!T?void 0:[v(),a("--tw-drop-shadow-alpha",T),...yt("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),a("--tw-drop-shadow","var(--tw-drop-shadow-size)"),a("filter",s)]}}{let D=e.get([`--drop-shadow-${b.value.value}`]),E=e.resolve(b.value.value,["--drop-shadow"]);if(D&&E)return b.modifier&&!T?void 0:T?[v(),a("--tw-drop-shadow-alpha",T),...yt("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),a("--tw-drop-shadow","var(--tw-drop-shadow-size)"),a("filter",s)]:[v(),a("--tw-drop-shadow-alpha",T),...yt("--tw-drop-shadow-size",D,T,R=>`var(--tw-drop-shadow-color, ${R})`),a("--tw-drop-shadow",L(E,",").map(R=>`drop-shadow(${R})`).join(" ")),a("filter",s)]}{let D=te(b,e,["--drop-shadow-color","--color"]);if(D)return D==="inherit"?[v(),a("--tw-drop-shadow-color","inherit"),a("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[v(),a("--tw-drop-shadow-color",J(D,"var(--tw-drop-shadow-alpha)")),a("--tw-drop-shadow","var(--tw-drop-shadow-size)")]}}),i("drop-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--drop-shadow-color","--color"],modifiers:Array.from({length:21},(b,T)=>`${T*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:b})=>wt(b)?`${b}%`:null,handle:b=>[C(),a("--tw-backdrop-opacity",`opacity(${b})`),a("-webkit-backdrop-filter",g),a("backdrop-filter",g)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(b,T)=>`${T*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let s=`var(--tw-ease, ${e.resolve(null,["--default-transition-timing-function"])??"ease"})`,g=`var(--tw-duration, ${e.resolve(null,["--default-transition-duration"])??"0s"})`;n("transition",{defaultValue:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:v=>[a("transition-property",v),a("transition-timing-function",s),a("transition-duration",g)],staticValues:{none:[a("transition-property","none")],all:[a("transition-property","all"),a("transition-timing-function",s),a("transition-duration",g)],colors:[a("transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"),a("transition-timing-function",s),a("transition-duration",g)],opacity:[a("transition-property","opacity"),a("transition-timing-function",s),a("transition-duration",g)],shadow:[a("transition-property","box-shadow"),a("transition-timing-function",s),a("transition-duration",g)],transform:[a("transition-property","transform, translate, scale, rotate"),a("transition-timing-function",s),a("transition-duration",g)]}}),t("transition-discrete",[["transition-behavior","allow-discrete"]]),t("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:v})=>O(v)?`${v}ms`:null,themeKeys:["--transition-delay"],handle:v=>[a("transition-delay",v)]});{let v=()=>W([$("--tw-duration")]);t("duration-initial",[v,["--tw-duration","initial"]]),r.functional("duration",C=>{if(C.modifier||!C.value)return;let b=null;if(C.value.kind==="arbitrary"?b=C.value.value:(b=e.resolve(C.value.fraction??C.value.value,["--transition-duration"]),b===null&&O(C.value.value)&&(b=`${C.value.value}ms`)),b!==null)return[v(),a("--tw-duration",b),a("transition-duration",b)]})}i("delay",()=>[{values:["75","100","150","200","300","500","700","1000"],valueThemeKeys:["--transition-delay"]}]),i("duration",()=>[{values:["75","100","150","200","300","500","700","1000"],valueThemeKeys:["--transition-duration"]}])}{let s=()=>W([$("--tw-ease")]);n("ease",{themeKeys:["--ease"],handle:g=>[s(),a("--tw-ease",g),a("transition-timing-function",g)],staticValues:{initial:[s(),a("--tw-ease","initial")],linear:[s(),a("--tw-ease","linear"),a("transition-timing-function","linear")]}})}t("will-change-auto",[["will-change","auto"]]),t("will-change-scroll",[["will-change","scroll-position"]]),t("will-change-contents",[["will-change","contents"]]),t("will-change-transform",[["will-change","transform"]]),n("will-change",{themeKeys:[],handle:s=>[a("will-change",s)]}),t("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:["--content"],handle:s=>[W([$("--tw-content",'""')]),a("--tw-content",s),a("content","var(--tw-content)")]});{let s="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",g=()=>W([$("--tw-contain-size"),$("--tw-contain-layout"),$("--tw-contain-paint"),$("--tw-contain-style")]);t("contain-none",[["contain","none"]]),t("contain-content",[["contain","content"]]),t("contain-strict",[["contain","strict"]]),t("contain-size",[g,["--tw-contain-size","size"],["contain",s]]),t("contain-inline-size",[g,["--tw-contain-size","inline-size"],["contain",s]]),t("contain-layout",[g,["--tw-contain-layout","layout"],["contain",s]]),t("contain-paint",[g,["--tw-contain-paint","paint"],["contain",s]]),t("contain-style",[g,["--tw-contain-style","style"],["contain",s]]),n("contain",{themeKeys:[],handle:v=>[a("contain",v)]})}t("forced-color-adjust-none",[["forced-color-adjust","none"]]),t("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),o("leading",["--leading","--spacing"],s=>[W([$("--tw-leading")]),a("--tw-leading",s),a("line-height",s)],{staticValues:{none:[W([$("--tw-leading")]),a("--tw-leading","1"),a("line-height","1")]}}),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:s=>[W([$("--tw-tracking")]),a("--tw-tracking",s),a("letter-spacing",s)]}),t("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),t("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let s="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",g=()=>W([$("--tw-ordinal"),$("--tw-slashed-zero"),$("--tw-numeric-figure"),$("--tw-numeric-spacing"),$("--tw-numeric-fraction")]);t("normal-nums",[["font-variant-numeric","normal"]]),t("ordinal",[g,["--tw-ordinal","ordinal"],["font-variant-numeric",s]]),t("slashed-zero",[g,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",s]]),t("lining-nums",[g,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",s]]),t("oldstyle-nums",[g,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",s]]),t("proportional-nums",[g,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",s]]),t("tabular-nums",[g,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",s]]),t("diagonal-fractions",[g,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",s]]),t("stacked-fractions",[g,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",s]])}{let s=()=>W([$("--tw-outline-style","solid")]);r.static("outline-hidden",()=>[a("--tw-outline-style","none"),a("outline-style","none"),F("@media","(forced-colors: active)",[a("outline","2px solid transparent"),a("outline-offset","2px")])]),t("outline-none",[["--tw-outline-style","none"],["outline-style","none"]]),t("outline-solid",[["--tw-outline-style","solid"],["outline-style","solid"]]),t("outline-dashed",[["--tw-outline-style","dashed"],["outline-style","dashed"]]),t("outline-dotted",[["--tw-outline-style","dotted"],["outline-style","dotted"]]),t("outline-double",[["--tw-outline-style","double"],["outline-style","double"]]),r.functional("outline",g=>{if(g.value===null){if(g.modifier)return;let v=e.get(["--default-outline-width"])??"1px";return[s(),a("outline-style","var(--tw-outline-style)"),a("outline-width",v)]}if(g.value.kind==="arbitrary"){let v=g.value.value;switch(g.value.dataType??Q(v,["color","length","number","percentage"])){case"length":case"number":case"percentage":return g.modifier?void 0:[s(),a("outline-style","var(--tw-outline-style)"),a("outline-width",v)];default:return v=X(v,g.modifier,e),v===null?void 0:[a("outline-color",v)]}}{let v=te(g,e,["--outline-color","--color"]);if(v)return[a("outline-color",v)]}{if(g.modifier)return;let v=e.resolve(g.value.value,["--outline-width"]);if(v)return[s(),a("outline-style","var(--tw-outline-style)"),a("outline-width",v)];if(O(g.value.value))return[s(),a("outline-style","var(--tw-outline-style)"),a("outline-width",`${g.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(g,v)=>`${v*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:g})=>O(g)?`${g}px`:null,handle:g=>[a("outline-offset",g)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:s})=>wt(s)?`${s}%`:null,handle:s=>[a("opacity",s)]}),i("opacity",()=>[{values:Array.from({length:21},(s,g)=>`${g*5}`),valueThemeKeys:["--opacity"]}]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:s})=>O(s)?`${s}px`:null,handle:s=>[a("text-underline-offset",s)],staticValues:{auto:[a("text-underline-offset","auto")]}}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),r.functional("text",s=>{if(s.value){if(s.value.kind==="arbitrary"){let g=s.value.value;switch(s.value.dataType??Q(g,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(s.modifier){let C=s.modifier.kind==="arbitrary"?s.modifier.value:e.resolve(s.modifier.value,["--leading"]);if(!C&&ne(s.modifier.value)){let b=e.resolve(null,["--spacing"]);if(!b)return null;C=`calc(${b} * ${s.modifier.value})`}return!C&&s.modifier.value==="none"&&(C="1"),C?[a("font-size",g),a("line-height",C)]:null}return[a("font-size",g)]}default:return g=X(g,s.modifier,e),g===null?void 0:[a("color",g)]}}{let g=te(s,e,["--text-color","--color"]);if(g)return[a("color",g)]}{let g=e.resolveWith(s.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(g){let[v,C={}]=Array.isArray(g)?g:[g];if(s.modifier){let b=s.modifier.kind==="arbitrary"?s.modifier.value:e.resolve(s.modifier.value,["--leading"]);if(!b&&ne(s.modifier.value)){let D=e.resolve(null,["--spacing"]);if(!D)return null;b=`calc(${D} * ${s.modifier.value})`}if(!b&&s.modifier.value==="none"&&(b="1"),!b)return null;let T=[a("font-size",v)];return b&&T.push(a("line-height",b)),T}return typeof C=="string"?[a("font-size",v),a("line-height",C)]:[a("font-size",v),a("line-height",C["--line-height"]?`var(--tw-leading, ${C["--line-height"]})`:void 0),a("letter-spacing",C["--letter-spacing"]?`var(--tw-tracking, ${C["--letter-spacing"]})`:void 0),a("font-weight",C["--font-weight"]?`var(--tw-font-weight, ${C["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let z=()=>W([$("--tw-text-shadow-color"),$("--tw-text-shadow-alpha","100%","")]);t("text-shadow-initial",[z,["--tw-text-shadow-color","initial"]]),r.functional("text-shadow",s=>{let g;if(s.modifier&&(s.modifier.kind==="arbitrary"?g=s.modifier.value:O(s.modifier.value)&&(g=`${s.modifier.value}%`)),!s.value){let v=e.get(["--text-shadow"]);return v===null?void 0:[z(),a("--tw-text-shadow-alpha",g),...ye("text-shadow",v,g,C=>`var(--tw-text-shadow-color, ${C})`)]}if(s.value.kind==="arbitrary"){let v=s.value.value;switch(s.value.dataType??Q(v,["color"])){case"color":return v=X(v,s.modifier,e),v===null?void 0:[z(),a("--tw-text-shadow-color",J(v,"var(--tw-text-shadow-alpha)"))];default:return[z(),a("--tw-text-shadow-alpha",g),...ye("text-shadow",v,g,b=>`var(--tw-text-shadow-color, ${b})`)]}}switch(s.value.value){case"none":return s.modifier?void 0:[z(),a("text-shadow","none")];case"inherit":return s.modifier?void 0:[z(),a("--tw-text-shadow-color","inherit")]}{let v=e.get([`--text-shadow-${s.value.value}`]);if(v)return[z(),a("--tw-text-shadow-alpha",g),...ye("text-shadow",v,g,C=>`var(--tw-text-shadow-color, ${C})`)]}{let v=te(s,e,["--text-shadow-color","--color"]);if(v)return[z(),a("--tw-text-shadow-color",J(v,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`),hasDefaultValue:e.get(["--text-shadow"])!==null}]);{let b=function(E){return`var(--tw-ring-inset,) 0 0 0 calc(${E} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${C})`},T=function(E){return`inset 0 0 0 ${E} var(--tw-inset-ring-color, currentcolor)`};var ae=b,le=T;let s=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),g="0 0 #0000",v=()=>W([$("--tw-shadow",g),$("--tw-shadow-color"),$("--tw-shadow-alpha","100%",""),$("--tw-inset-shadow",g),$("--tw-inset-shadow-color"),$("--tw-inset-shadow-alpha","100%",""),$("--tw-ring-color"),$("--tw-ring-shadow",g),$("--tw-inset-ring-color"),$("--tw-inset-ring-shadow",g),$("--tw-ring-inset"),$("--tw-ring-offset-width","0px",""),$("--tw-ring-offset-color","#fff"),$("--tw-ring-offset-shadow",g)]);t("shadow-initial",[v,["--tw-shadow-color","initial"]]),r.functional("shadow",E=>{let R;if(E.modifier&&(E.modifier.kind==="arbitrary"?R=E.modifier.value:O(E.modifier.value)&&(R=`${E.modifier.value}%`)),!E.value){let j=e.get(["--shadow"]);return j===null?void 0:[v(),a("--tw-shadow-alpha",R),...ye("--tw-shadow",j,R,pe=>`var(--tw-shadow-color, ${pe})`),a("box-shadow",s)]}if(E.value.kind==="arbitrary"){let j=E.value.value;switch(E.value.dataType??Q(j,["color"])){case"color":return j=X(j,E.modifier,e),j===null?void 0:[v(),a("--tw-shadow-color",J(j,"var(--tw-shadow-alpha)"))];default:return[v(),a("--tw-shadow-alpha",R),...ye("--tw-shadow",j,R,Dt=>`var(--tw-shadow-color, ${Dt})`),a("box-shadow",s)]}}switch(E.value.value){case"none":return E.modifier?void 0:[v(),a("--tw-shadow",g),a("box-shadow",s)];case"inherit":return E.modifier?void 0:[v(),a("--tw-shadow-color","inherit")]}{let j=e.get([`--shadow-${E.value.value}`]);if(j)return[v(),a("--tw-shadow-alpha",R),...ye("--tw-shadow",j,R,pe=>`var(--tw-shadow-color, ${pe})`),a("box-shadow",s)]}{let j=te(E,e,["--box-shadow-color","--color"]);if(j)return[v(),a("--tw-shadow-color",J(j,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`),hasDefaultValue:e.get(["--shadow"])!==null}]),t("inset-shadow-initial",[v,["--tw-inset-shadow-color","initial"]]),r.functional("inset-shadow",E=>{let R;if(E.modifier&&(E.modifier.kind==="arbitrary"?R=E.modifier.value:O(E.modifier.value)&&(R=`${E.modifier.value}%`)),!E.value){let j=e.get(["--inset-shadow"]);return j===null?void 0:[v(),a("--tw-inset-shadow-alpha",R),...ye("--tw-inset-shadow",j,R,pe=>`var(--tw-inset-shadow-color, ${pe})`),a("box-shadow",s)]}if(E.value.kind==="arbitrary"){let j=E.value.value;switch(E.value.dataType??Q(j,["color"])){case"color":return j=X(j,E.modifier,e),j===null?void 0:[v(),a("--tw-inset-shadow-color",J(j,"var(--tw-inset-shadow-alpha)"))];default:return[v(),a("--tw-inset-shadow-alpha",R),...ye("--tw-inset-shadow",j,R,Dt=>`var(--tw-inset-shadow-color, ${Dt})`,"inset "),a("box-shadow",s)]}}switch(E.value.value){case"none":return E.modifier?void 0:[v(),a("--tw-inset-shadow",g),a("box-shadow",s)];case"inherit":return E.modifier?void 0:[v(),a("--tw-inset-shadow-color","inherit")]}{let j=e.get([`--inset-shadow-${E.value.value}`]);if(j)return[v(),a("--tw-inset-shadow-alpha",R),...ye("--tw-inset-shadow",j,R,pe=>`var(--tw-inset-shadow-color, ${pe})`),a("box-shadow",s)]}{let j=te(E,e,["--box-shadow-color","--color"]);if(j)return[v(),a("--tw-inset-shadow-color",J(j,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`),hasDefaultValue:e.get(["--inset-shadow"])!==null}]),t("ring-inset",[v,["--tw-ring-inset","inset"]]);let C=e.get(["--default-ring-color"])??"currentcolor";r.functional("ring",E=>{if(!E.value){if(E.modifier)return;let R=e.get(["--default-ring-width"])??"1px";return[v(),a("--tw-ring-shadow",b(R)),a("box-shadow",s)]}if(E.value.kind==="arbitrary"){let R=E.value.value;switch(E.value.dataType??Q(R,["color","length"])){case"length":return E.modifier?void 0:[v(),a("--tw-ring-shadow",b(R)),a("box-shadow",s)];default:return R=X(R,E.modifier,e),R===null?void 0:[a("--tw-ring-color",R)]}}{let R=te(E,e,["--ring-color","--color"]);if(R)return[a("--tw-ring-color",R)]}{if(E.modifier)return;let R=e.resolve(E.value.value,["--ring-width"]);if(R===null&&O(E.value.value)&&(R=`${E.value.value}px`),R)return[v(),a("--tw-ring-shadow",b(R)),a("box-shadow",s)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),r.functional("inset-ring",E=>{if(!E.value)return E.modifier?void 0:[v(),a("--tw-inset-ring-shadow",T("1px")),a("box-shadow",s)];if(E.value.kind==="arbitrary"){let R=E.value.value;switch(E.value.dataType??Q(R,["color","length"])){case"length":return E.modifier?void 0:[v(),a("--tw-inset-ring-shadow",T(R)),a("box-shadow",s)];default:return R=X(R,E.modifier,e),R===null?void 0:[a("--tw-inset-ring-color",R)]}}{let R=te(E,e,["--ring-color","--color"]);if(R)return[a("--tw-inset-ring-color",R)]}{if(E.modifier)return;let R=e.resolve(E.value.value,["--ring-width"]);if(R===null&&O(E.value.value)&&(R=`${E.value.value}px`),R)return[v(),a("--tw-inset-ring-shadow",T(R)),a("box-shadow",s)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(E,R)=>`${R*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let D="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";r.functional("ring-offset",E=>{if(E.value){if(E.value.kind==="arbitrary"){let R=E.value.value;switch(E.value.dataType??Q(R,["color","length"])){case"length":return E.modifier?void 0:[a("--tw-ring-offset-width",R),a("--tw-ring-offset-shadow",D)];default:return R=X(R,E.modifier,e),R===null?void 0:[a("--tw-ring-offset-color",R)]}}{let R=e.resolve(E.value.value,["--ring-offset-width"]);if(R)return E.modifier?void 0:[a("--tw-ring-offset-width",R),a("--tw-ring-offset-shadow",D)];if(O(E.value.value))return E.modifier?void 0:[a("--tw-ring-offset-width",`${E.value.value}px`),a("--tw-ring-offset-shadow",D)]}{let R=te(E,e,["--ring-offset-color","--color"]);if(R)return[a("--tw-ring-offset-color",R)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(s,g)=>`${g*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),r.functional("@container",s=>{let g=null;if(s.value===null?g="inline-size":s.value.kind==="arbitrary"?g=s.value.value:s.value.kind==="named"&&s.value.value==="normal"?g="normal":!1,g!==null)return s.modifier?[a("container-type",g),a("container-name",s.modifier.value)]:[a("container-type",g)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),r}var Xt=["number","integer","ratio","percentage"];function Jr(e){let r=e.params;return so.test(r)?i=>{let t={"--value":{usedSpacingInteger:!1,usedSpacingNumber:!1,themeKeys:new Set,literals:new Set},"--modifier":{usedSpacingInteger:!1,usedSpacingNumber:!1,themeKeys:new Set,literals:new Set}};_(e.nodes,n=>{if(n.kind!=="declaration"||!n.value||!n.value.includes("--value(")&&!n.value.includes("--modifier("))return;let l=B(n.value);_(l,o=>{if(o.kind!=="function")return;if(o.value==="--spacing"&&!(t["--modifier"].usedSpacingNumber&&t["--value"].usedSpacingNumber))return _(o.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let c=u.value;for(let m of u.nodes)if(m.kind==="word"){if(m.value==="integer")t[c].usedSpacingInteger||=!0;else if(m.value==="number"&&(t[c].usedSpacingNumber||=!0,t["--modifier"].usedSpacingNumber&&t["--value"].usedSpacingNumber))return V.Stop}}),V.Continue;if(o.value!=="--value"&&o.value!=="--modifier")return;let f=L(H(o.nodes),",");for(let[u,c]of f.entries())c=c.replace(/\\\*/g,"*"),c=c.replace(/--(.*?)\s--(.*?)/g,"--$1-*--$2"),c=c.replace(/\s+/g,""),c=c.replace(/(-\*){2,}/g,"-*"),c[0]==="-"&&c[1]==="-"&&!c.includes("-*")&&(c+="-*"),f[u]=c;o.nodes=B(f.join(","));for(let u of o.nodes)if(u.kind==="word"&&(u.value[0]==='"'||u.value[0]==="'")&&u.value[0]===u.value[u.value.length-1]){let c=u.value.slice(1,-1);t[o.value].literals.add(c)}else if(u.kind==="word"&&u.value[0]==="-"&&u.value[1]==="-"){let c=u.value.replace(/-\*.*$/g,"");t[o.value].themeKeys.add(c)}else if(u.kind==="word"&&!(u.value[0]==="["&&u.value[u.value.length-1]==="]")&&!Xt.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${Xt.map(w=>`"${w}"`).join(", ")}. +`);let c=u.value,m=structuredClone(o),d="\xB6";_(m.nodes,w=>{if(w.kind==="word"&&w.value===c)return V.ReplaceSkip({kind:"word",value:d})});let p="^".repeat(H([u]).length),k=H([m]).indexOf(d),h=["```css",H([o])," ".repeat(k)+p,"```"].join(` +`);console.warn(h)}}),n.value=H(l)}),i.utilities.functional(r.slice(0,-2),n=>{let l=ee(e),o=n.value,f=n.modifier;if(o===null)return;let u=!1,c=!1,m=!1,d=!1,p=new Map,k=!1;if(_([l],(h,w)=>{let x=w.parent;if(x?.kind!=="rule"&&x?.kind!=="at-rule"||h.kind!=="declaration"||!h.value)return;let S=!1,A=B(h.value);if(_(A,y=>{if(y.kind==="function"){if(y.value==="--value"){u=!0;let K=Gr(o,y,i);return K?(c=!0,K.ratio?k=!0:p.set(h,x),V.ReplaceSkip(K.nodes)):(u||=!1,S=!0,V.Stop)}else if(y.value==="--modifier"){if(f===null)return S=!0,V.Stop;m=!0;let K=Gr(f,y,i);return K?(d=!0,V.ReplaceSkip(K.nodes)):(m||=!1,S=!0,V.Stop)}}}),S)return V.ReplaceSkip([]);h.value=H(A)}),u&&!c||m&&!d||k&&d||f&&!k&&!d)return null;if(k)for(let[h,w]of p){let x=w.nodes.indexOf(h);x!==-1&&w.nodes.splice(x,1)}return l.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],l=[];for(let[o,{literals:f,usedSpacingNumber:u,usedSpacingInteger:c,themeKeys:m}]of[[n,t["--value"]],[l,t["--modifier"]]]){for(let d of f)o.push(d);if(u)o.push(...bt);else if(c)for(let d of bt)O(d)&&o.push(d);for(let d of i.theme.keysInNamespaces(m))o.push(d.replace(Zr,(p,k,h)=>`${k}.${h}`))}return[{values:n,modifiers:l}]})}:lo.test(r)?i=>{i.utilities.static(r,()=>e.nodes.map(ee))}:null}function Gr(e,r,i){for(let t of r.nodes){if(e.kind==="named"&&t.kind==="word"&&(t.value[0]==="'"||t.value[0]==='"')&&t.value[t.value.length-1]===t.value[0]&&t.value.slice(1,-1)===e.value)return{nodes:B(e.value)};if(e.kind==="named"&&t.kind==="word"&&t.value[0]==="-"&&t.value[1]==="-"){let n=t.value;if(n.endsWith("-*")){n=n.slice(0,-2);let l=i.theme.resolve(e.value,[n]);if(l)return{nodes:B(l)}}else{let l=n.split("-*");if(l.length<=1)continue;let o=[l.shift()],f=i.theme.resolveWith(e.value,o,l);if(f){let[,u={}]=f;{let c=u[l.pop()];if(c)return{nodes:B(c)}}}}}else if(e.kind==="named"&&t.kind==="word"){if(!Xt.includes(t.value))continue;let n=t.value==="ratio"&&"fraction"in e?e.fraction:e.value;if(!n)continue;let l=Q(n,[t.value]);if(l===null)continue;if(l==="ratio"){let[o,f]=L(n,"/");if(!O(o)||!O(f))continue}else{if(l==="number"&&!ne(n))continue;if(l==="percentage"&&!O(n.slice(0,-1)))continue}return{nodes:B(n),ratio:l==="ratio"}}else if(e.kind==="arbitrary"&&t.kind==="word"&&t.value[0]==="["&&t.value[t.value.length-1]==="]"){let n=t.value.slice(1,-1);if(n==="*")return{nodes:B(e.value)};if("dataType"in e&&e.dataType&&e.dataType!==n)continue;if("dataType"in e&&e.dataType)return{nodes:B(e.value)};if(Q(e.value,[n])!==null)return{nodes:B(e.value)}}}}function ye(e,r,i,t,n=""){let l=!1,o=nt(r,u=>i==null?t(u):u.startsWith("current")?t(J(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(l=!0),t(Hr(u,i))));function f(u){return n?L(u,",").map(c=>n+c).join(","):u}return l?[a(e,f(nt(r,t))),Z("@supports (color: lab(from red l a b))",[a(e,f(o))])]:[a(e,f(o))]}function yt(e,r,i,t,n=""){let l=!1,o=L(r,",").map(f=>nt(f,u=>i==null?t(u):u.startsWith("current")?t(J(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(l=!0),t(Hr(u,i))))).map(f=>`drop-shadow(${f})`).join(" ");return l?[a(e,n+L(r,",").map(f=>`drop-shadow(${nt(f,t)})`).join(" ")),Z("@supports (color: lab(from red l a b))",[a(e,n+o)])]:[a(e,n+o)]}var er={"--alpha":uo,"--spacing":co,"--theme":fo,theme:po};function uo(e,r,i,...t){let[n,l]=L(i,"/").map(o=>o.trim());if(!n||!l)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${l||"50%"})\``);if(t.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${l||"50%"})\``);return J(n,l)}function co(e,r,i,...t){if(!i)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(t.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${t.length+1}.`);let n=e.theme.resolve(null,["--spacing"]);if(!n)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${n} * ${i})`}function fo(e,r,i,...t){if(!i.startsWith("--"))throw new Error("The --theme(\u2026) function can only be used with CSS variables from your theme.");let n=!1;i.endsWith(" inline")&&(n=!0,i=i.slice(0,-7)),r.kind==="at-rule"&&(n=!0);let l=e.resolveThemeValue(i,n);if(!l){if(t.length>0)return t.join(", ");throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the variable name is correct or provide a fallback value to silence this error.`)}if(t.length===0)return l;let o=t.join(", ");if(o==="initial")return l;if(l==="initial")return o;if(l.startsWith("var(")||l.startsWith("theme(")||l.startsWith("--theme(")){let f=B(l);return go(f,o),H(f)}return l}function po(e,r,i,...t){i=mo(i);let n=e.resolveThemeValue(i);if(!n&&t.length>0)return t.join(", ");if(!n)throw new Error(`Could not resolve value for theme function: \`theme(${i})\`. Consider checking if the path is correct or provide a fallback value to silence this error.`);return n}var Xr=new RegExp(Object.keys(er).map(e=>`${e}\\(`).join("|"));function Fe(e,r){let i=0;return _(e,t=>{if(t.kind==="declaration"&&t.value&&Xr.test(t.value)){i|=8,t.value=ei(t.value,t,r);return}t.kind==="at-rule"&&(t.name==="@media"||t.name==="@custom-media"||t.name==="@container"||t.name==="@supports")&&Xr.test(t.params)&&(i|=8,t.params=ei(t.params,t,r))}),i}function ei(e,r,i){let t=B(e);return _(t,n=>{if(n.kind==="function"&&n.value in er){let l=L(H(n.nodes).trim(),",").map(f=>f.trim()),o=er[n.value](i,r,...l);return V.Replace(B(o))}}),H(t)}function mo(e){if(e[0]!=="'"&&e[0]!=='"')return e;let r="",i=e[0];for(let t=1;t{if(i.kind==="function"&&!(i.value!=="var"&&i.value!=="theme"&&i.value!=="--theme"))if(i.nodes.length===1)i.nodes.push({kind:"word",value:`, ${r}`});else{let t=i.nodes[i.nodes.length-1];t.kind==="word"&&t.value==="initial"&&(t.value=r)}})}function xt(e,r){let i=e.length,t=r.length,n=i=48&&o<=57&&f>=48&&f<=57){let u=l,c=l+1,m=l,d=l+1;for(o=e.charCodeAt(c);o>=48&&o<=57;)o=e.charCodeAt(++c);for(f=r.charCodeAt(d);f>=48&&f<=57;)f=r.charCodeAt(++d);let p=e.slice(u,c),k=r.slice(m,d),h=Number(p)-Number(k);if(h)return h;if(pk)return 1;continue}if(o!==f)return o-f}return e.length-r.length}function ti(e){if(e[0]!=="["||e[e.length-1]!=="]")return null;let r=1,i=r,t=e.length-1;for(;We(e.charCodeAt(r));)r++;{for(i=r;r=65&&m<=90)&&!(m>=97&&m<=122)&&!(m>=48&&m<=57)&&!(m===45||m===95))break}if(i===r)return null}let n=e.slice(i,r);for(;We(e.charCodeAt(r));)r++;if(r===t)return{attribute:n,operator:null,quote:null,value:null,sensitivity:null};let l=null,o=e.charCodeAt(r);if(o===61)l="=",r++;else if((o===126||o===124||o===94||o===36||o===42)&&e.charCodeAt(r+1)===61)l=e[r]+"=",r+=2;else return null;for(;We(e.charCodeAt(r));)r++;if(r===t)return null;let f="",u=null;if(o=e.charCodeAt(r),o===39||o===34){u=e[r],r++,i=r;for(let m=r;m/g,"1")),t[0]==="opacity"&&(typeof n=="number"||typeof n=="string")){let o=typeof n=="string"?parseFloat(n):n;o>=0&&o<=1&&(n=o*100+"%")}let l=Ye(t);l&&e.theme.add(`--${l}`,""+n,7)}if(Object.hasOwn(r,"fontFamily")){let t=5;{let n=Be(r.fontFamily.sans);n&&e.theme.hasDefault("--font-sans")&&(e.theme.add("--default-font-family",n,t),e.theme.add("--default-font-feature-settings",Be(r.fontFamily.sans,"fontFeatureSettings")??"normal",t),e.theme.add("--default-font-variation-settings",Be(r.fontFamily.sans,"fontVariationSettings")??"normal",t))}{let n=Be(r.fontFamily.mono);n&&e.theme.hasDefault("--font-mono")&&(e.theme.add("--default-mono-font-family",n,t),e.theme.add("--default-mono-font-feature-settings",Be(r.fontFamily.mono,"fontFeatureSettings")??"normal",t),e.theme.add("--default-mono-font-variation-settings",Be(r.fontFamily.mono,"fontVariationSettings")??"normal",t))}}return r}function vo(e){let r=[];return ii(e,[],(i,t)=>{if(bo(i))return r.push([t,i]),1;if(xo(i)){r.push([t,i[0]]);for(let n of Reflect.ownKeys(i[1]))r.push([[...t,`-${n}`],i[1][n]]);return 1}if(Array.isArray(i)&&i.every(n=>typeof n=="string"))return t[0]==="fontSize"?(r.push([t,i[0]]),i.length>=2&&r.push([[...t,"-line-height"],i[1]])):r.push([t,i.join(", ")]),1}),r}var ko={borderWidth:"border-width",outlineWidth:"outline-width",ringColor:"ring-color",ringWidth:"ring-width",transitionDuration:"transition-duration",transitionTimingFunction:"transition-timing-function"},wo={animation:"animate",aspectRatio:"aspect",borderRadius:"radius",boxShadow:"shadow",colors:"color",containers:"container",fontFamily:"font",fontSize:"text",letterSpacing:"tracking",lineHeight:"leading",maxWidth:"container",screens:"breakpoint",transitionTimingFunction:"ease"},yo=/^[a-zA-Z0-9-_%/\.]+$/;function Ye(e){let r=ko[e[0]];if(r&&e[1]==="DEFAULT")return`default-${r}`;if(e[0]==="container")return null;for(let t of e)if(!yo.test(t))return null;let i=wo[e[0]];return i&&(e=e.slice(),e[0]=i),e.map((t,n,l)=>t==="1"&&n!==l.length-1?"":t).map((t,n)=>(t=t.replaceAll(".","_"),(n===0||t.startsWith("-")||t==="lineHeight")&&(t=t.replace(/([a-z])([A-Z])/g,(o,f,u)=>`${f}-${u.toLowerCase()}`)),t)).filter((t,n)=>t!=="DEFAULT"||n!==e.length-1).join("-")}function bo(e){return typeof e=="number"||typeof e=="string"}function xo(e){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"&&typeof e[0]!="number"||e[1]===void 0||e[1]===null||typeof e[1]!="object")return!1;for(let r of Reflect.ownKeys(e[1]))if(typeof r!="string"||typeof e[1][r]!="string"&&typeof e[1][r]!="number")return!1;return!0}function ii(e,r=[],i){for(let t of Reflect.ownKeys(e)){let n=e[t];if(n==null)continue;let l=[...r,t],o=i(n,l)??0;if(o!==1){if(o===2)return 2;if(!(!Array.isArray(n)&&typeof n!="object")&&ii(n,l,i)===2)return 2}}}var Ao=/^(?[-+]?(?:\d*\.)?\d+)(?[a-z]+|%)?$/i,_e=new U(e=>{let r=Ao.exec(e);if(!r)return null;let i=r.groups?.value;if(i===void 0)return null;let t=Number(i);if(Number.isNaN(t))return null;let n=r.groups?.unit;return n===void 0?[t,null]:[t,n]});function At(e,r=null){let i=!1,t=B(e);return _(t,{exit(n){if(n.kind==="word"&&n.value!=="0"){let l=Co(n.value,r);return l===null||l===n.value?void 0:(i=!0,V.ReplaceSkip(oe(l)))}else if(n.kind==="function"&&(n.value==="calc"||n.value==="")){if(n.nodes.length!==5)return;let l=_e.get(n.nodes[0].value),o=n.nodes[2].value,f=_e.get(n.nodes[4].value);if(o==="*"&&(l?.[0]===0&&l?.[1]===null||f?.[0]===0&&f?.[1]===null))return i=!0,V.ReplaceSkip(oe("0"));if(l===null||f===null)return;switch(o){case"*":{if(l[1]===f[1]||l[1]===null&&f[1]!==null||l[1]!==null&&f[1]===null)return i=!0,V.ReplaceSkip(oe(`${l[0]*f[0]}${l[1]??""}`));break}case"+":{if(l[1]===f[1])return i=!0,V.ReplaceSkip(oe(`${l[0]+f[0]}${l[1]??""}`));break}case"-":{if(l[1]===f[1])return i=!0,V.ReplaceSkip(oe(`${l[0]-f[0]}${l[1]??""}`));break}case"/":{if(f[0]!==0&&(l[1]===null&&f[1]===null||l[1]!==null&&f[1]===null))return i=!0,V.ReplaceSkip(oe(`${l[0]/f[0]}${l[1]??""}`));break}}}}}),i?H(t):e}function Co(e,r=null){let i=_e.get(e);if(i===null)return null;let[t,n]=i;if(n===null)return`${t}`;if(t===0&&je(e))return"0";switch(n.toLowerCase()){case"in":return`${t*96}px`;case"cm":return`${t*96/2.54}px`;case"mm":return`${t*96/2.54/10}px`;case"q":return`${t*96/2.54/10/4}px`;case"pc":return`${t*96/6}px`;case"pt":return`${t*96/72}px`;case"rem":return r!==null?`${t*r}px`:null;case"grad":return`${t*.9}deg`;case"rad":return`${t*180/Math.PI}deg`;case"turn":return`${t*360}deg`;case"ms":return`${t/1e3}s`;case"khz":return`${t*1e3}hz`;default:return`${t}${n}`}}function ni(e,r="top",i="right",t="bottom",n="left"){return si(`${e}-${r}`,`${e}-${i}`,`${e}-${t}`,`${e}-${n}`)}function si(e="top",r="right",i="bottom",t="left"){return{1:[[e,0],[r,0],[i,0],[t,0]],2:[[e,0],[r,1],[i,0],[t,1]],3:[[e,0],[r,1],[i,2],[t,1]],4:[[e,0],[r,1],[i,2],[t,3]]}}function Ie(e,r){return{1:[[e,0],[r,0]],2:[[e,0],[r,1]]}}var oi={inset:si(),margin:ni("margin"),padding:ni("padding"),gap:Ie("row-gap","column-gap")},ai={"inset-block":Ie("top","bottom"),"inset-inline":Ie("left","right"),"margin-block":Ie("margin-top","margin-bottom"),"margin-inline":Ie("margin-left","margin-right"),"padding-block":Ie("padding-top","padding-bottom"),"padding-inline":Ie("padding-left","padding-right")},li={"border-block":["border-bottom","border-top"],"border-block-color":["border-bottom-color","border-top-color"],"border-block-style":["border-bottom-style","border-top-style"],"border-block-width":["border-bottom-width","border-top-width"],"border-inline":["border-left","border-right"],"border-inline-color":["border-left-color","border-right-color"],"border-inline-style":["border-left-style","border-right-style"],"border-inline-width":["border-left-width","border-right-width"]};function ui(e,r){if(r&2){if(e.property in ai){let i=L(e.value," ");return ai[e.property][i.length]?.map(([t,n])=>a(t,i[n],e.important))}if(e.property in li)return li[e.property]?.map(i=>a(i,e.value,e.important))}if(e.property in oi){let i=L(e.value," ");return oi[e.property][i.length]?.map(([t,n])=>a(t,i[n],e.important))}return null}function So(e){return{kind:"combinator",value:e}}function $o(e,r){return{kind:"function",value:e,nodes:r}}function Se(e){return{kind:"selector",value:e}}function To(e){return{kind:"separator",value:e}}function Eo(e){return{kind:"value",value:e}}function me(e){let r="";for(let i of e)switch(i.kind){case"combinator":case"selector":case"separator":case"value":{r+=i.value;break}case"function":r+=i.value+"("+me(i.nodes)+")"}return r}var ci=92,No=93,fi=41,Vo=58,pi=44,Ro=34,Oo=46,di=62,mi=10,Po=35,gi=91,hi=40,vi=43,_o=39,ki=32,wi=9,yi=126,Io=38,Do=42;function De(e){e=e.replaceAll(`\r +`,` +`);let r=[],i=[],t=null,n="",l;for(let o=0;o0){let p=Se(n);t?t.nodes.push(p):r.push(p),n=""}let u=o,c=o+1;for(;c0){let c=Se(n);u.nodes.push(c),n=""}i.length>0?t=i[i.length-1]:t=null;break}case Oo:case Vo:case Po:{if(n.length>0){let u=Se(n);t?t.nodes.push(u):r.push(u)}n=e[o];break}case gi:{if(n.length>0){let m=Se(n);t?t.nodes.push(m):r.push(m)}n="";let u=o,c=0;for(let m=o+1;m0){let u=Se(n);t?t.nodes.push(u):r.push(u),n=""}t?t.nodes.push(Se(e[o])):r.push(Se(e[o]));break}case ci:{n+=e[o]+e[o+1],o+=1;break}default:n+=e[o]}}return n.length>0&&r.push(Se(n)),r}function ce(e,r){for(let i in e)delete e[i];return Object.assign(e,r)}function Ue(e){let r=[];for(let i of L(e,".")){if(!i.includes("[")){r.push(i);continue}let t=0;for(;;){let n=i.indexOf("[",t),l=i.indexOf("]",n);if(n===-1||l===-1)break;n>t&&r.push(i.slice(t,n)),r.push(i.slice(n+1,l)),t=l+1}t<=i.length-1&&r.push(i.slice(t))}return r}function tr(e,r){let i=e;return i.storage[Ci]??=Uo(),i.storage[Si]??=Ko(i),i.storage[$i]??=jo(),i.storage[Ti]??=Wo(),i.storage[Ei]??=Yo(),i.storage[ir]??=Qo(i),i.storage[$t]??=ea(i,r),i.storage[ge]??=pa(i),i.storage[nr]??=ma(),i.storage[Tt]??=ga(i),i.storage[or]??=ha(i),i.storage[Nt]??=va(i),i.storage[Ri]??=ka(i),i}var Ci=Symbol();function Uo(){return new U(e=>new U(r=>({rem:e,features:r})))}function Lo(e,r){let i=0;return r?.collapse&&(i|=1),r?.logicalToPhysical&&(i|=2),tr(e,r).storage[Ci].get(r?.rem??null).get(i)}var Si=Symbol();function Ko(e){return new U(r=>new U(i=>({features:i,designSystem:e,signatureOptions:r})))}function zo(e,r,i){let t=0;return i?.collapse&&(t|=1),tr(e).storage[Si].get(r).get(t)}function rr(e,r,i){let t=Lo(e,i),n=zo(e,t,i),l=tr(e),o=new Set,f=l.storage[$i].get(n);for(let u of r)o.add(f.get(u));return o.size<=1||!(n.features&1)?Array.from(o):Mo(n,Array.from(o))}function Mo(e,r){if(r.length<=1)return r;let i=e.designSystem,t=new U(f=>new U(u=>new Set)),n=e.designSystem.theme.prefix?`${e.designSystem.theme.prefix}:`:"";for(let f of r){let u=L(f,":"),c=u.pop(),m=c.endsWith("!");m&&(c=c.slice(0,-1));let d=u.length>0?`${u.join(":")}:`:"",p=m?"!":"";t.get(d).get(p).add(`${n}${c}`)}let l=new Set;for(let[f,u]of t.entries())for(let[c,m]of u.entries())for(let d of o(Array.from(m)))n&&d.startsWith(n)&&(d=d.slice(n.length)),l.add(`${f}${d}${c}`);return Array.from(l);function o(f){let u=e.signatureOptions,c=i.storage[Tt].get(u),m=i.storage[nr].get(u),d=f.map(S=>c.get(S));if(d.some(S=>S.has("line-height"))){let S=i.theme.keysInNamespaces(["--text"]);if(S.length>0){let A=new Set,y=new Set;for(let N of d)for(let P of N.get("line-height")){if(y.has(P))continue;y.add(P);let z=i.storage[$t]?.get(P)??null;if(z!==null)if(ne(z)){A.add(z);for(let I of S)c.get(`text-${I}/${z}`)}else{A.add(P);for(let I of S)c.get(`text-${I}/[${P}]`)}}let K=new Set;for(let N of d)for(let P of N.get("font-size"))if(!K.has(P)){K.add(P);for(let z of A)ne(z)?c.get(`text-[${P}]/${z}`):c.get(`text-[${P}]/[${z}]`)}}}let p=d.map(S=>{let A=null;for(let y of S.keys()){let K=new Set;for(let N of m.get(y).values())for(let P of N)K.add(P);if(A===null?A=K:A=Ai(A,K),A.size===0)return A}return A}),k=new U(S=>new Set([S]));for(let S=0;SS.split(",").map(Number));for(let S of k.values()){let A=Array.from(S).sort((y,K)=>y-K);h.get(A.join(","))}let w=new Set(f),x=new Set;for(let S of h.values())for(let A of ya(S)){if(A.some(N=>x.has(f[N])))continue;let y=A.flatMap(N=>p[N]).reduce(Ai),K=i.storage[ge].get(u).get(A.map(N=>f[N]).sort((N,P)=>N.localeCompare(P)).join(" "));for(let N of y)if(i.storage[ge].get(u).get(N)===K){for(let z of A)x.add(f[z]);w.add(N);break}}for(let S of x)w.delete(S);return Array.from(w)}}var $i=Symbol();function jo(){return new U(e=>{let r=e.designSystem,i=r.theme.prefix?`${r.theme.prefix}:`:"",t=r.storage[Ti].get(e),n=r.storage[Ei].get(e);return new U((l,o)=>{for(let f of r.parseCandidate(l)){let u=f.variants.slice().reverse().flatMap(d=>t.get(d)),c=f.important;if(c||u.length>0){let p=o.get(r.printCandidate({...f,variants:[],important:!1}));return r.theme.prefix!==null&&u.length>0&&(p=p.slice(i.length)),u.length>0&&(p=`${u.map(k=>r.printVariant(k)).join(":")}:${p}`),c&&(p+="!"),r.theme.prefix!==null&&u.length>0&&(p=`${i}${p}`),p}let m=n.get(l);if(m!==l)return m}return l})})}var Fo=[Zo,ua,ca,aa],Ti=Symbol();function Wo(){return new U(e=>new U(r=>{let i=[r];for(let t of Fo)for(let n of i.splice(0)){let l=t(Me(n),e);if(Array.isArray(l)){i.push(...l);continue}else i.push(l)}return i}))}var Bo=[Go,Ho,ta,ia,oa,la,sa,fa],Ei=Symbol();function Yo(){return new U(e=>{let r=e.designSystem;return new U(i=>{for(let t of r.parseCandidate(i)){let n=Lr(t);for(let o of Bo)n=o(n,e);let l=r.printCandidate(n);if(i!==l)return l}return i})})}var qo=["t","tr","r","br","b","bl","l","tl"];function Go(e){if(e.kind==="static"&&e.root.startsWith("bg-gradient-to-")){let r=e.root.slice(15);return qo.includes(r)&&(e.root=`bg-linear-to-${r}`),e}return e}function Ho(e,r){let i=r.designSystem.storage[ir];if(e.kind==="arbitrary"){let[t,n]=i(e.value,e.modifier===null?1:0);t!==e.value&&(e.value=t,n!==null&&(e.modifier=n))}else if(e.kind==="functional"&&e.value?.kind==="arbitrary"){let[t,n]=i(e.value.value,e.modifier===null?1:0);t!==e.value.value&&(e.value.value=t,n!==null&&(e.modifier=n))}return e}function Zo(e,r){let i=r.designSystem.storage[ir],t=Et(e);for(let[n]of t)if(n.kind==="arbitrary"){let[l]=i(n.selector,2);l!==n.selector&&(n.selector=l)}else if(n.kind==="functional"&&n.value?.kind==="arbitrary"){let[l]=i(n.value.value,2);l!==n.value.value&&(n.value.value=l)}return e}var ir=Symbol();function Qo(e){return r(e);function r(i){function t(f,u=0){let c=B(f);if(u&2)return[Ct(c,o),null];let m=0,d=0;if(_(c,h=>{h.kind==="function"&&h.value==="theme"&&(m+=1,_(h.nodes,w=>w.kind==="separator"&&w.value.includes(",")?V.Stop:w.kind==="word"&&w.value==="/"?(d+=1,V.Stop):V.Skip))}),m===0)return[f,null];if(d===0)return[Ct(c,l),null];if(d>1)return[Ct(c,o),null];let p=null;return[Ct(c,(h,w)=>{let x=L(h,"/").map(S=>S.trim());if(x.length>2)return null;if(c.length===1&&x.length===2&&u&1){let[S,A]=x;if(/^\d+%$/.test(A))p={kind:"named",value:A.slice(0,-1)};else if(/^0?\.\d+$/.test(A)){let y=Number(A)*100;p={kind:Number.isInteger(y)?"named":"arbitrary",value:y.toString()}}else p={kind:"arbitrary",value:A};h=S}return l(h,w)||o(h,w)}),p]}function n(f,u=!0){let c=`--${Ye(Ue(f))}`;return i.theme.get([c])?u&&i.theme.prefix?`--${i.theme.prefix}-${c.slice(2)}`:c:null}function l(f,u){let c=n(f);if(c)return u?`var(${c}, ${u})`:`var(${c})`;let m=Ue(f);if(m[0]==="spacing"&&i.theme.get(["--spacing"])){let d=m[1];return ne(d)?`--spacing(${d})`:null}return null}function o(f,u){let c=L(f,"/").map(p=>p.trim());f=c.shift();let m=n(f,!1);if(!m)return null;let d=c.length>0?`/${c.join("/")}`:"";return u?`--theme(${m}${d}, ${u})`:`--theme(${m}${d})`}return t}}function Ct(e,r){return _(e,(i,t)=>{if(i.kind==="function"&&i.value==="theme"){if(i.nodes.length<1)return;i.nodes[0].kind==="separator"&&i.nodes[0].value.trim()===""&&i.nodes.shift();let n=i.nodes[0];if(n.kind!=="word")return;let l=n.value,o=1;for(let c=o;c0?r(l,H(f)):r(l);if(u===null)return;if(t.parent){let c=t.parent.nodes.indexOf(i)-1;for(;c!==-1;){let m=t.parent.nodes[c];if(m.kind==="separator"&&m.value.trim()===""){c-=1;continue}/^[-+*/]$/.test(m.value.trim())&&(u=`(${u})`);break}}return V.Replace(B(u))}}),H(e)}function Jo(e){if(e[0]!=="'"&&e[0]!=='"')return e;let r="",i=e[0];for(let t=1;t{if(n===0)return null;let f=_e.get(At(o,r?.rem??null));if(!f)return null;let[u,c]=f;return c!==l?null:u/n})}function ta(e,r){if(e.kind!=="arbitrary"&&!(e.kind==="functional"&&e.value?.kind==="arbitrary"))return e;let i=r.designSystem,t=i.storage[or].get(r.signatureOptions),n=i.storage[ge].get(r.signatureOptions),l=i.printCandidate(e),o=n.get(l);if(typeof o!="string")return e;for(let u of f(o,e)){let c=i.printCandidate(u);if(n.get(c)===o&&ra(i,e,u))return u}return e;function*f(u,c){let m=t.get(u);if(!(m.length>1)){if(m.length===0&&c.modifier){let d={...c,modifier:null},p=n.get(i.printCandidate(d));if(typeof p=="string")for(let k of f(p,d))yield Object.assign({},k,{modifier:c.modifier})}if(m.length===1)for(let d of be(i,m[0]))yield d;else if(m.length===0){let d=c.kind==="arbitrary"?c.value:c.value?.value??null;if(d===null)return;if(r.signatureOptions.rem!==null&&c.kind==="functional"&&c.value?.kind==="arbitrary"){let h=i.storage[$t]?.get(d)??null;h!==null&&ne(h)&&(yield Object.assign({},c,{value:{kind:"named",value:h,fraction:null}}))}let p=i.storage[$t]?.get(d)??null,k="";p!==null&&p<0&&(k="-",p=Math.abs(p));for(let h of Array.from(i.utilities.keys("functional")).sort((w,x)=>+(w[0]==="-")-+(x[0]==="-"))){k&&(h=`${k}${h}`);for(let w of be(i,`${h}-${d}`))yield w;if(c.modifier)for(let w of be(i,`${h}-${d}${c.modifier}`))yield w;if(p!==null){for(let w of be(i,`${h}-${p}`))yield w;if(c.modifier)for(let w of be(i,`${h}-${p}${it(c.modifier)}`))yield w}for(let w of be(i,`${h}-[${d}]`))yield w;if(c.modifier)for(let w of be(i,`${h}-[${d}]${it(c.modifier)}`))yield w}}}}}function ra(e,r,i){let t=null;if(r.kind==="functional"&&r.value?.kind==="arbitrary"&&r.value.value.includes("var(--")?t=r.value.value:r.kind==="arbitrary"&&r.value.includes("var(--")&&(t=r.value),t===null)return!0;let n=e.candidatesToCss([e.printCandidate(i)]).join(` +`),l=!0;return _(B(t),o=>{if(o.kind==="function"&&o.value==="var"){let f=o.nodes[0].value;if(!new RegExp(`var\\(${f}[,)]\\s*`,"g").test(n)||n.includes(`${f}:`))return l=!1,V.Stop}}),l}function ia(e,r){if(e.kind!=="functional"||e.value?.kind!=="named")return e;let i=r.designSystem,t=i.storage[or].get(r.signatureOptions),n=i.storage[ge].get(r.signatureOptions),l=i.printCandidate(e),o=n.get(l);if(typeof o!="string")return e;for(let u of f(o,e)){let c=i.printCandidate(u);if(n.get(c)===o)return u}return e;function*f(u,c){let m=t.get(u);if(!(m.length>1)){if(m.length===0&&c.modifier){let d={...c,modifier:null},p=n.get(i.printCandidate(d));if(typeof p=="string")for(let k of f(p,d))yield Object.assign({},k,{modifier:c.modifier})}if(m.length===1)for(let d of be(i,m[0]))yield d}}}var na=new Map([["order-none","order-0"],["break-words","wrap-break-word"]]);function oa(e,r){let i=r.designSystem,t=i.storage[ge].get(r.signatureOptions),n=Xo(i,e),l=na.get(n)??null;if(l===null)return e;let o=t.get(n);if(typeof o!="string")return e;let f=t.get(l);if(typeof f!="string"||o!==f)return e;let[u]=be(i,l);return u}function aa(e,r){let i=r.designSystem,t=i.storage[Nt],n=i.storage[Ri],l=Et(e);for(let[o]of l){if(o.kind==="compound")continue;let f=i.printVariant(o),u=t.get(f);if(typeof u!="string")continue;let c=n.get(u);if(c.length!==1)continue;let m=c[0],d=i.parseVariant(m);d!==null&&ce(o,d)}return e}function la(e,r){let i=r.designSystem,t=i.storage[ge].get(r.signatureOptions);if(e.kind==="functional"&&e.value?.kind==="arbitrary"&&e.value.dataType!==null){let n=i.printCandidate({...e,value:{...e.value,dataType:null}});t.get(i.printCandidate(e))===t.get(n)&&(e.value.dataType=null)}return e}function sa(e,r){if(e.kind!=="functional"||e.value?.kind!=="arbitrary")return e;let i=r.designSystem,t=i.storage[ge].get(r.signatureOptions),n=t.get(i.printCandidate(e));if(n===null)return e;for(let l of Ni(e))if(t.get(i.printCandidate({...e,value:l}))===n)return e.value=l,e;return e}function ua(e){let r=Et(e);for(let[i]of r)if(i.kind==="functional"&&i.root==="data"&&i.value?.kind==="arbitrary"&&!i.value.value.includes("="))i.value={kind:"named",value:i.value.value};else if(i.kind==="functional"&&i.root==="aria"&&i.value?.kind==="arbitrary"&&(i.value.value.endsWith("=true")||i.value.value.endsWith('="true"')||i.value.value.endsWith("='true'"))){let[t,n]=L(i.value.value,"=");if(t[t.length-1]==="~"||t[t.length-1]==="|"||t[t.length-1]==="^"||t[t.length-1]==="$"||t[t.length-1]==="*")continue;i.value={kind:"named",value:i.value.value.slice(0,i.value.value.indexOf("="))}}else i.kind==="functional"&&i.root==="supports"&&i.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(i.value.value)&&(i.value={kind:"named",value:i.value.value});return e}function*Ni(e,r=e.value?.value??"",i=new Set){if(i.has(r))return;if(i.add(r),yield{kind:"named",value:r,fraction:null},r.endsWith("%")&&ne(r.slice(0,-1))&&(yield{kind:"named",value:r.slice(0,-1),fraction:null}),r.includes("/")){let[l,o]=r.split("/");O(l)&&O(o)&&(yield{kind:"named",value:l,fraction:`${l}/${o}`})}let t=new Set;for(let l of r.matchAll(/(\d+\/\d+)|(\d+\.?\d+)/g))t.add(l[0].trim());let n=Array.from(t).sort((l,o)=>l.length-o.length);for(let l of n)yield*Ni(e,l,i)}function xi(e){return!e.some(r=>r.kind==="separator"&&r.value.trim()===",")}function St(e){let r=e.value.trim();return e.kind==="selector"&&r[0]==="["&&r[r.length-1]==="]"}function ca(e,r){let i=[e],t=r.designSystem,n=t.storage[Nt],l=Et(e);for(let[o,f]of l)if(o.kind==="compound"&&(o.root==="has"||o.root==="not"||o.root==="in")&&o.modifier!==null&&"modifier"in o.variant&&(o.variant.modifier=o.modifier,o.modifier=null),o.kind==="arbitrary"){if(o.relative)continue;let u=De(o.selector.trim());if(!xi(u))continue;if(f===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&u[2].value==="*"){ce(o,t.parseVariant("*"));continue}if(f===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="*"){ce(o,t.parseVariant("**"));continue}if(f===null&&u.length===3&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="&"){u.pop(),u.pop(),ce(o,t.parseVariant(`in-[${me(u)}]`));continue}if(f===null&&u[0].kind==="selector"&&(u[0].value==="@media"||u[0].value==="@supports")){let p=n.get(t.printVariant(o)),k=B(me(u)),h=!1;if(_(k,w=>{if(w.kind==="word"&&w.value==="not")return h=!0,V.Replace([])}),k=B(H(k)),_(k,w=>{w.kind==="separator"&&w.value!==" "&&w.value.trim()===""&&(w.value=" ")}),h){let w=t.parseVariant(`not-[${H(k)}]`);if(w===null)continue;let x=n.get(t.printVariant(w));if(p===x){ce(o,w);continue}}}let c=null;f===null&&u.length===3&&u[0].kind==="selector"&&u[0].value.trim()==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&(St(u[2])||u[2].value[0]===":")&&(u=[u[2]],c=t.parseVariant("*")),f===null&&u.length===3&&u[0].kind==="selector"&&u[0].value.trim()==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&(St(u[2])||u[2].value[0]===":")&&(u=[u[2]],c=t.parseVariant("**"));let m=u.filter(p=>!(p.kind==="selector"&&p.value.trim()==="&"));if(m.length!==1)continue;let d=m[0];if(d.kind==="function"&&d.value===":is"){if(!xi(d.nodes)||d.nodes.length!==1||!St(d.nodes[0]))continue;d=d.nodes[0]}if(d.kind==="function"&&d.value[0]===":"||d.kind==="selector"&&d.value[0]===":"){let p=d,k=!1;if(p.kind==="function"&&p.value===":not"){if(k=!0,p.nodes.length!==1||p.nodes[0].kind!=="selector"&&p.nodes[0].kind!=="function"||p.nodes[0].value[0]!==":")continue;p=p.nodes[0]}let h=(x=>{if(x===":nth-child"&&p.kind==="function"&&p.nodes.length===1&&p.nodes[0].kind==="value"&&p.nodes[0].value==="odd")return k?(k=!1,"even"):"odd";if(x===":nth-child"&&p.kind==="function"&&p.nodes.length===1&&p.nodes[0].kind==="value"&&p.nodes[0].value==="even")return k?(k=!1,"odd"):"even";for(let[S,A]of[[":nth-child","nth"],[":nth-last-child","nth-last"],[":nth-of-type","nth-of-type"],[":nth-last-of-type","nth-of-last-type"]])if(x===S&&p.kind==="function"&&p.nodes.length===1)return p.nodes.length===1&&p.nodes[0].kind==="value"&&O(p.nodes[0].value)?`${A}-${p.nodes[0].value}`:`${A}-[${me(p.nodes)}]`;if(k){let S=n.get(t.printVariant(o)),A=n.get(`not-[${x}]`);if(S===A)return`[&${x}]`}return null})(p.value);if(h===null){if(c)return ce(o,{kind:"arbitrary",selector:d.value,relative:!1}),[c,o];continue}k&&(h=`not-${h}`);let w=t.parseVariant(h);if(w===null)continue;ce(o,w)}else if(St(d)){let p=ti(d.value);if(p===null)continue;if(p.attribute.startsWith("data-")){let k=p.attribute.slice(5);ce(o,{kind:"functional",root:"data",modifier:null,value:p.value===null?{kind:"named",value:k}:{kind:"arbitrary",value:`${k}${p.operator}${p.quote??""}${p.value}${p.quote??""}${p.sensitivity?` ${p.sensitivity}`:""}`}})}else if(p.attribute.startsWith("aria-")){let k=p.attribute.slice(5);ce(o,{kind:"functional",root:"aria",modifier:null,value:p.value===null?{kind:"arbitrary",value:k}:p.operator==="="&&p.value==="true"&&p.sensitivity===null?{kind:"named",value:k}:{kind:"arbitrary",value:`${p.attribute}${p.operator}${p.quote??""}${p.value}${p.quote??""}${p.sensitivity?` ${p.sensitivity}`:""}`}})}else ce(o,{kind:"arbitrary",selector:d.value,relative:!1})}if(c)return[c,o]}return i}function fa(e,r){if(e.kind!=="functional"&&e.kind!=="arbitrary"||e.modifier===null)return e;let i=r.designSystem,t=i.storage[ge].get(r.signatureOptions),n=t.get(i.printCandidate(e)),l=e.modifier;if(n===t.get(i.printCandidate({...e,modifier:null})))return e.modifier=null,e;{let o={kind:"named",value:l.value.endsWith("%")?l.value.includes(".")?`${Number(l.value.slice(0,-1))}`:l.value.slice(0,-1):l.value,fraction:null};if(n===t.get(i.printCandidate({...e,modifier:o})))return e.modifier=o,e}{let o={kind:"named",value:`${parseFloat(l.value)*100}`,fraction:null};if(n===t.get(i.printCandidate({...e,modifier:o})))return e.modifier=o,e}return e}var ge=Symbol();function pa(e){return new U(r=>new U(i=>{try{i=e.theme.prefix&&!i.startsWith(e.theme.prefix)?`${e.theme.prefix}:${i}`:i;let t=[q(".x",[F("@apply",i)])];return wa(e,()=>{for(let l of e.parseCandidate(i))e.compileAstNodes(l,1);$e(t,e)}),Vi(e,t,r),ie(t)}catch{return Symbol()}}))}function Vi(e,r,i){let{rem:t}=i;return _(r,{enter(n,l){if(n.kind==="declaration"){if(n.value===void 0||n.property==="--tw-sort")return V.Replace([]);if(n.property.startsWith("--tw-")&&(l.parent?.nodes??[]).some(o=>o.kind==="declaration"&&n.value===o.value&&n.important===o.important&&!o.property.startsWith("--tw-")))return V.Replace([]);if(i.features&1){let o=ui(n,i.features);if(o)return V.Replace(o)}n.value.includes("var(")&&(n.value=da(n.value,e)),n.value=At(n.value,t),n.value=Ce(n.value)}else{if(n.kind==="context"||n.kind==="at-root")return V.Replace(n.nodes);if(n.kind==="comment")return V.Replace([]);if(n.kind==="at-rule"&&n.name==="@property")return V.Replace([])}},exit(n){if(n.kind==="rule"||n.kind==="at-rule"){if(n.nodes.length>1){let l=new Set;for(let o=n.nodes.length-1;o>=0;o--){let f=n.nodes[o];f.kind==="declaration"&&f.value!==void 0&&(l.has(f.property)&&n.nodes.splice(o,1),l.add(f.property))}}n.nodes.sort((l,o)=>l.kind!=="declaration"||o.kind!=="declaration"?0:l.property.localeCompare(o.property))}}}),r}function da(e,r){let i=!1,t=B(e),n=new Set;return _(t,l=>{if(l.kind!=="function"||l.value!=="var"||l.nodes.length!==1&&l.nodes.length<3)return;let o=l.nodes[0].value;r.theme.prefix&&o.startsWith(`--${r.theme.prefix}-`)&&(o=o.slice(`--${r.theme.prefix}-`.length));let f=r.resolveThemeValue(o);if(!n.has(o)&&(n.add(o),f!==void 0&&(l.nodes.length===1&&(i=!0,l.nodes.push(...B(`,${f}`))),l.nodes.length>=3))){let u=H(l.nodes),c=`${l.nodes[0].value},${f}`;if(u===c)return i=!0,V.Replace(B(f))}}),i?H(t):e}var nr=Symbol();function ma(){return new U(e=>new U(r=>new U(i=>new Set)))}var Tt=Symbol();function ga(e){return new U(r=>new U(i=>{let t=new U(l=>new Set);e.theme.prefix&&!i.startsWith(e.theme.prefix)&&(i=`${e.theme.prefix}:${i}`);let n=e.parseCandidate(i);return n.length===0||_(Vi(e,e.compileAstNodes(n[0]).map(l=>ee(l.node)),r),l=>{l.kind==="declaration"&&(t.get(l.property).add(l.value),e.storage[nr].get(r).get(l.property).get(l.value).add(i))}),t}))}var or=Symbol();function ha(e){return new U(r=>{let i=e.storage[ge].get(r),t=new U(()=>[]);for(let[n,l]of e.getClassList()){let o=i.get(n);if(typeof o=="string"){if(n[0]==="-"&&n.endsWith("-0")){let f=i.get(n.slice(1));if(typeof f=="string"&&o===f)continue}t.get(o).push(n),e.storage[Tt].get(r).get(n);for(let f of l.modifiers){if(ne(f))continue;let u=`${n}/${f}`,c=i.get(u);typeof c=="string"&&(t.get(c).push(u),e.storage[Tt].get(r).get(u))}}}return t})}var Nt=Symbol();function va(e){return new U(r=>{try{r=e.theme.prefix&&!r.startsWith(e.theme.prefix)?`${e.theme.prefix}:${r}`:r;let i=[q(".x",[F("@apply",`${r}:flex`)])];return $e(i,e),_(i,n=>{if(n.kind==="at-rule"&&n.params.includes(" "))n.params=n.params.replaceAll(" ","");else if(n.kind==="rule"){let l=De(n.selector),o=!1;_(l,f=>{if(f.kind==="separator"&&f.value!==" ")f.value=f.value.trim(),o=!0;else if(f.kind==="function"&&f.value===":is"){if(f.nodes.length===1)return o=!0,V.Replace(f.nodes);if(f.nodes.length===2&&f.nodes[0].kind==="selector"&&f.nodes[0].value==="*"&&f.nodes[1].kind==="selector"&&f.nodes[1].value[0]===":")return o=!0,V.Replace(f.nodes[1])}else f.kind==="function"&&f.value[0]===":"&&f.nodes[0]?.kind==="selector"&&f.nodes[0]?.value[0]===":"&&(o=!0,f.nodes.unshift({kind:"selector",value:"*"}))}),o&&(n.selector=me(l))}}),ie(i)}catch{return Symbol()}})}var Ri=Symbol();function ka(e){let r=e.storage[Nt],i=new U(()=>[]);for(let[t,n]of e.variants.entries())if(n.kind==="static"){let l=r.get(t);if(typeof l!="string")continue;i.get(l).push(t)}return i}function wa(e,r){let i=e.theme.values.get,t=new Set;e.theme.values.get=n=>{let l=i.call(e.theme.values,n);return l===void 0||l.options&1&&(t.add(l),l.options&=-2),l};try{return r()}finally{e.theme.values.get=i;for(let n of t)n.options|=1}}function*ya(e){let r=e.length,i=1n<=2;t--){let n=(1n<>BigInt(u)&1n&&l.push(e[u]);yield l;let o=n&-n,f=n+o;n=((f^n)>>2n)/o|f}}}function Ai(e,r){if(typeof e.intersection=="function")return e.intersection(r);if(e.size===0||r.size===0)return new Set;let i=new Set(e);for(let t of r)i.has(t)||i.delete(t);return i}var xa=/^\d+\/\d+$/;function Oi(e){let r=new U(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of e.utilities.keys("static")){if(e.utilities.getCompletions(n).length===0)continue;let o=r.get(n);o.fraction=!1,o.modifiers=[]}for(let n of e.utilities.keys("functional")){let l=e.utilities.getCompletions(n);for(let o of l)for(let f of o.values){let u=f!==null&&xa.test(f),c=f===null?n:`${n}-${f}`,m=r.get(c);if(m.utility=n,m.fraction||=u,m.modifiers.push(...o.modifiers),o.supportsNegative){let d=r.get(`-${c}`);d.utility=`-${n}`,d.fraction||=u,d.modifiers.push(...o.modifiers)}m.modifiers=Array.from(new Set(m.modifiers))}}if(r.size===0)return[];let i=Array.from(r.values());return i.sort((n,l)=>xt(n.name,l.name)),Aa(i)}function Aa(e){let r=[],i=null,t=new Map,n=new U(()=>[]);for(let o of e){let{utility:f,fraction:u}=o;i||(i={utility:f,items:[]},t.set(f,i)),f!==i.utility&&(r.push(i),i={utility:f,items:[]},t.set(f,i)),u?n.get(f).push(o):i.items.push(o)}i&&r[r.length-1]!==i&&r.push(i);for(let[o,f]of n){let u=t.get(o);u&&u.items.push(...f)}let l=[];for(let o of r)for(let f of o.items)l.push([f.name,{modifiers:f.modifiers}]);return l}function Pi(e){let r=[];for(let[t,n]of e.variants.entries()){let f=function({value:u,modifier:c}={}){let m=t;u&&(m+=l?`-${u}`:u),c&&(m+=`/${c}`);let d=e.parseVariant(m);if(!d)return[];let p=q(".__placeholder__",[]);if(qe(p,d,e.variants)===null)return[];let k=[];return _(p.nodes,{exit(h,w){if(h.kind!=="rule"&&h.kind!=="at-rule"||h.nodes.length>0)return;let x=w.path();x.push(h),x.sort((y,K)=>{let N=y.kind==="at-rule",P=K.kind==="at-rule";return N&&!P?-1:!N&&P?1:0});let S=x.flatMap(y=>y.kind==="rule"?y.selector==="&"?[]:[y.selector]:y.kind==="at-rule"?[`${y.name} ${y.params}`]:[]),A="";for(let y=S.length-1;y>=0;y--)A=A===""?S[y]:`${S[y]} { ${A} }`;k.push(A)}}),k};var i=f;if(n.kind==="arbitrary")continue;let l=t!=="@",o=e.variants.getCompletions(t);switch(n.kind){case"static":{r.push({name:t,values:o,isArbitrary:!1,hasDash:l,selectors:f});break}case"functional":{r.push({name:t,values:o,isArbitrary:!0,hasDash:l,selectors:f});break}case"compound":{r.push({name:t,values:o,isArbitrary:!0,hasDash:l,selectors:f});break}}}return r}function _i(e,r){let{astNodes:i,nodeSorting:t}=Te(Array.from(r),e),n=new Map(r.map(o=>[o,null])),l=0n;for(let o of i){let f=t.get(o)?.candidate;f&&n.set(f,n.get(f)??l++)}return r.map(o=>[o,n.get(o)??null])}var Vt=/^@?[a-z0-9][a-zA-Z0-9_-]*(?{o.kind==="rule"?n.push(o.selector):o.kind==="at-rule"&&o.name==="@variant"?l=!0:o.kind==="at-rule"&&o.name!=="@slot"&&n.push(`${o.name} ${o.params}`)}),this.static(r,o=>{let f=i.map(ee);l&&ot(f,t),lr(f,o.nodes),o.nodes=f},{compounds:Le(n)})}functional(r,i,{compounds:t,order:n}={}){this.set(r,{kind:"functional",applyFn:i,compoundsWith:0,compounds:t??2,order:n})}compound(r,i,t,{compounds:n,order:l}={}){this.set(r,{kind:"compound",applyFn:t,compoundsWith:i,compounds:n??2,order:l})}group(r,i){this.groupOrder=this.nextOrder(),i&&this.compareFns.set(this.groupOrder,i),r(),this.groupOrder=null}has(r){return this.variants.has(r)}get(r){return this.variants.get(r)}kind(r){return this.variants.get(r)?.kind}compoundsWith(r,i){let t=this.variants.get(r),n=typeof i=="string"?this.variants.get(i):i.kind==="arbitrary"?{compounds:Le([i.selector])}:this.variants.get(i.root);return!(!t||!n||t.kind!=="compound"||n.compounds===0||t.compoundsWith===0||(t.compoundsWith&n.compounds)===0)}suggest(r,i){this.completions.set(r,i)}getCompletions(r){return this.completions.get(r)?.()??[]}compare(r,i){if(r===i)return 0;if(r===null)return-1;if(i===null)return 1;if(r.kind==="arbitrary"&&i.kind==="arbitrary")return r.selector{p.nodes=m.map(k=>Z(k,p.nodes))},{compounds:d})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function t(c,m){return m.map(d=>{d=d.trim();let p=L(d," ");return p[0]==="not"?p.slice(1).join(" "):c==="@container"?p[0][0]==="("?`not ${d}`:p[1]==="not"?`${p[0]} ${p.slice(2).join(" ")}`:`${p[0]} not ${p.slice(1).join(" ")}`:`not ${d}`})}let n=["@media","@supports","@container"];function l(c){for(let m of n){if(m!==c.name)continue;let d=L(c.params,",");return d.length>1?null:(d=t(c.name,d),F(c.name,d.join(", ")))}return null}function o(c){return c.includes("::")?null:`&:not(${L(c,",").map(d=>(d=d.replaceAll("&","*"),d)).join(", ")})`}r.compound("not",3,(c,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative||m.modifier)return null;let d=!1;if(_([c],(p,k)=>{if(p.kind!=="rule"&&p.kind!=="at-rule")return V.Continue;if(p.nodes.length>0)return V.Continue;let h=[],w=[],x=k.path();x.push(p);for(let A of x)A.kind==="at-rule"?h.push(A):A.kind==="rule"&&w.push(A);if(h.length>1)return V.Stop;if(w.length>1)return V.Stop;let S=[];for(let A of w){let y=o(A.selector);if(!y)return d=!1,V.Stop;S.push(q(y,[]))}for(let A of h){let y=l(A);if(!y)return d=!1,V.Stop;S.push(y)}return Object.assign(c,q("&",S)),d=!0,V.Skip}),c.kind==="rule"&&c.selector==="&"&&c.nodes.length===1&&Object.assign(c,c.nodes[0]),!d)return null}),r.suggest("not",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("not",c))),r.compound("group",2,(c,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative)return null;let d=m.modifier?`:where(.${e.prefix?`${e.prefix}\\:`:""}group\\/${m.modifier.value})`:`:where(.${e.prefix?`${e.prefix}\\:`:""}group)`,p=!1;if(_([c],(k,h)=>{if(k.kind!=="rule")return V.Continue;for(let x of h.path())if(x.kind==="rule")return p=!1,V.Stop;let w=k.selector.replaceAll("&",d);L(w,",").length>1&&(w=`:is(${w})`),k.selector=`&:is(${w} *)`,p=!0}),!p)return null}),r.suggest("group",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("group",c))),r.compound("peer",2,(c,m)=>{if(m.variant.kind==="arbitrary"&&m.variant.relative)return null;let d=m.modifier?`:where(.${e.prefix?`${e.prefix}\\:`:""}peer\\/${m.modifier.value})`:`:where(.${e.prefix?`${e.prefix}\\:`:""}peer)`,p=!1;if(_([c],(k,h)=>{if(k.kind!=="rule")return V.Continue;for(let x of h.path())if(x.kind==="rule")return p=!1,V.Stop;let w=k.selector.replaceAll("&",d);L(w,",").length>1&&(w=`:is(${w})`),k.selector=`&:is(${w} ~ *)`,p=!0}),!p)return null}),r.suggest("peer",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("peer",c))),i("first-letter",["&::first-letter"]),i("first-line",["&::first-line"]),i("marker",["& *::marker","&::marker","& *::-webkit-details-marker","&::-webkit-details-marker"]),i("selection",["& *::selection","&::selection"]),i("file",["&::file-selector-button"]),i("placeholder",["&::placeholder"]),i("backdrop",["&::backdrop"]),i("details-content",["&::details-content"]);{let c=function(){return W([F("@property","--tw-content",[a("syntax",'"*"'),a("initial-value",'""'),a("inherits","false")])])};var f=c;r.static("before",m=>{m.nodes=[q("&::before",[c(),a("content","var(--tw-content)"),...m.nodes])]},{compounds:0}),r.static("after",m=>{m.nodes=[q("&::after",[c(),a("content","var(--tw-content)"),...m.nodes])]},{compounds:0})}i("first",["&:first-child"]),i("last",["&:last-child"]),i("only",["&:only-child"]),i("odd",["&:nth-child(odd)"]),i("even",["&:nth-child(even)"]),i("first-of-type",["&:first-of-type"]),i("last-of-type",["&:last-of-type"]),i("only-of-type",["&:only-of-type"]),i("visited",["&:visited"]),i("target",["&:target"]),i("open",["&:is([open], :popover-open, :open)"]),i("default",["&:default"]),i("checked",["&:checked"]),i("indeterminate",["&:indeterminate"]),i("placeholder-shown",["&:placeholder-shown"]),i("autofill",["&:autofill"]),i("optional",["&:optional"]),i("required",["&:required"]),i("valid",["&:valid"]),i("invalid",["&:invalid"]),i("user-valid",["&:user-valid"]),i("user-invalid",["&:user-invalid"]),i("in-range",["&:in-range"]),i("out-of-range",["&:out-of-range"]),i("read-only",["&:read-only"]),i("empty",["&:empty"]),i("focus-within",["&:focus-within"]),r.static("hover",c=>{c.nodes=[q("&:hover",[F("@media","(hover: hover)",c.nodes)])]}),i("focus",["&:focus"]),i("focus-visible",["&:focus-visible"]),i("active",["&:active"]),i("enabled",["&:enabled"]),i("disabled",["&:disabled"]),i("inert",["&:is([inert], [inert] *)"]),r.compound("in",2,(c,m)=>{if(m.modifier)return null;let d=!1;if(_([c],(p,k)=>{if(p.kind!=="rule")return V.Continue;for(let h of k.path())if(h.kind==="rule")return d=!1,V.Stop;p.selector=`:where(${p.selector.replaceAll("&","*")}) &`,d=!0}),!d)return null}),r.suggest("in",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("in",c))),r.compound("has",2,(c,m)=>{if(m.modifier)return null;let d=!1;if(_([c],(p,k)=>{if(p.kind!=="rule")return V.Continue;for(let h of k.path())if(h.kind==="rule")return d=!1,V.Stop;p.selector=`&:has(${p.selector.replaceAll("&","*")})`,d=!0}),!d)return null}),r.suggest("has",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("has",c))),r.functional("aria",(c,m)=>{if(!m.value||m.modifier)return null;m.value.kind==="arbitrary"?c.nodes=[q(`&[aria-${Ii(m.value.value)}]`,c.nodes)]:c.nodes=[q(`&[aria-${m.value.value}="true"]`,c.nodes)]}),r.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),r.functional("data",(c,m)=>{if(!m.value||m.modifier)return null;c.nodes=[q(`&[data-${Ii(m.value.value)}]`,c.nodes)]}),r.functional("nth",(c,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!O(m.value.value))return null;c.nodes=[q(`&:nth-child(${m.value.value})`,c.nodes)]}),r.functional("nth-last",(c,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!O(m.value.value))return null;c.nodes=[q(`&:nth-last-child(${m.value.value})`,c.nodes)]}),r.functional("nth-of-type",(c,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!O(m.value.value))return null;c.nodes=[q(`&:nth-of-type(${m.value.value})`,c.nodes)]}),r.functional("nth-last-of-type",(c,m)=>{if(!m.value||m.modifier||m.value.kind==="named"&&!O(m.value.value))return null;c.nodes=[q(`&:nth-last-of-type(${m.value.value})`,c.nodes)]}),r.functional("supports",(c,m)=>{if(!m.value||m.modifier)return null;let d=m.value.value;if(d===null)return null;if(/^[\w-]*\s*\(/.test(d)){let p=d.replace(/\b(and|or|not)\b/g," $1 ");c.nodes=[F("@supports",p,c.nodes)];return}d.includes(":")||(d=`${d}: var(--tw)`),(d[0]!=="("||d[d.length-1]!==")")&&(d=`(${d})`),c.nodes=[F("@supports",d,c.nodes)]},{compounds:1}),i("motion-safe",["@media (prefers-reduced-motion: no-preference)"]),i("motion-reduce",["@media (prefers-reduced-motion: reduce)"]),i("contrast-more",["@media (prefers-contrast: more)"]),i("contrast-less",["@media (prefers-contrast: less)"]);{let c=function(m,d,p,k){if(m===d)return 0;let h=k.get(m);if(h===null)return p==="asc"?-1:1;let w=k.get(d);return w===null?p==="asc"?1:-1:Oe(h,w,p)};var u=c;{let m=e.namespace("--breakpoint"),d=new U(p=>{switch(p.kind){case"static":return e.resolveValue(p.root,["--breakpoint"])??null;case"functional":{if(!p.value||p.modifier)return null;let k=null;return p.value.kind==="arbitrary"?k=p.value.value:p.value.kind==="named"&&(k=e.resolveValue(p.value.value,["--breakpoint"])),!k||k.includes("var(")?null:k}case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("max",(p,k)=>{if(k.modifier)return null;let h=d.get(k);if(h===null)return null;p.nodes=[F("@media",`(width < ${h})`,p.nodes)]},{compounds:1})},(p,k)=>c(p,k,"desc",d)),r.suggest("max",()=>Array.from(m.keys()).filter(p=>p!==null)),r.group(()=>{for(let[p,k]of e.namespace("--breakpoint"))p!==null&&r.static(p,h=>{h.nodes=[F("@media",`(width >= ${k})`,h.nodes)]},{compounds:1});r.functional("min",(p,k)=>{if(k.modifier)return null;let h=d.get(k);if(h===null)return null;p.nodes=[F("@media",`(width >= ${h})`,p.nodes)]},{compounds:1})},(p,k)=>c(p,k,"asc",d)),r.suggest("min",()=>Array.from(m.keys()).filter(p=>p!==null))}{let m=e.namespace("--container"),d=new U(p=>{switch(p.kind){case"functional":{if(p.value===null)return null;let k=null;return p.value.kind==="arbitrary"?k=p.value.value:p.value.kind==="named"&&(k=e.resolveValue(p.value.value,["--container"])),!k||k.includes("var(")?null:k}case"static":case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("@max",(p,k)=>{let h=d.get(k);if(h===null)return null;p.nodes=[F("@container",k.modifier?`${k.modifier.value} (width < ${h})`:`(width < ${h})`,p.nodes)]},{compounds:1})},(p,k)=>c(p,k,"desc",d)),r.suggest("@max",()=>Array.from(m.keys()).filter(p=>p!==null)),r.group(()=>{r.functional("@",(p,k)=>{let h=d.get(k);if(h===null)return null;p.nodes=[F("@container",k.modifier?`${k.modifier.value} (width >= ${h})`:`(width >= ${h})`,p.nodes)]},{compounds:1}),r.functional("@min",(p,k)=>{let h=d.get(k);if(h===null)return null;p.nodes=[F("@container",k.modifier?`${k.modifier.value} (width >= ${h})`:`(width >= ${h})`,p.nodes)]},{compounds:1})},(p,k)=>c(p,k,"asc",d)),r.suggest("@min",()=>Array.from(m.keys()).filter(p=>p!==null)),r.suggest("@",()=>Array.from(m.keys()).filter(p=>p!==null))}}return i("portrait",["@media (orientation: portrait)"]),i("landscape",["@media (orientation: landscape)"]),i("ltr",['&:where(:dir(ltr), [dir="ltr"], [dir="ltr"] *)']),i("rtl",['&:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *)']),i("dark",["@media (prefers-color-scheme: dark)"]),i("starting",["@starting-style"]),i("print",["@media print"]),i("forced-colors",["@media (forced-colors: active)"]),i("inverted-colors",["@media (inverted-colors: inverted)"]),i("pointer-none",["@media (pointer: none)"]),i("pointer-coarse",["@media (pointer: coarse)"]),i("pointer-fine",["@media (pointer: fine)"]),i("any-pointer-none",["@media (any-pointer: none)"]),i("any-pointer-coarse",["@media (any-pointer: coarse)"]),i("any-pointer-fine",["@media (any-pointer: fine)"]),i("noscript",["@media (scripting: none)"]),r}function Ii(e){if(e.includes("=")){let[r,...i]=L(e,"="),t=i.join("=").trim();if(t[0]==="'"||t[0]==='"')return e;if(t.length>1){let n=t[t.length-1];if(t[t.length-2]===" "&&(n==="i"||n==="I"||n==="s"||n==="S"))return`${r}="${t.slice(0,-2)}" ${n}`}return`${r}="${t}"`}return e}function lr(e,r){_(e,i=>{if(i.kind==="at-rule"&&i.name==="@slot")return V.Replace(r);if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,W([F(i.name,i.params,i.nodes)])),V.Skip})}function ot(e,r){let i=0;return _(e,t=>{if(t.kind!=="at-rule"||t.name!=="@variant")return;let n=q("&",t.nodes),l=t.params,o=r.parseVariant(l);if(o===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${l}`);if(qe(n,o,r.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${l}`);return i|=32,V.Replace(n)}),i}function Ui(e,r){let i=Qr(e),t=Di(e),n=new U(d=>zr(d,m)),l=new U(d=>Array.from(Kr(d,m))),o=new U(d=>new U(p=>{let k=Li(p,m,d);try{Fe(k.map(({node:h})=>h),m),ot(k.map(({node:h})=>h),m)}catch{return[]}return k})),f=new U(d=>{for(let p of gt(d))e.markUsedVariable(p)});function u(d){let p=[];for(let k of d){let h=!0,{astNodes:w}=Te([k],m,{onInvalidCandidate(){h=!1}});r&&_(w,x=>(x.src??=r,V.Continue)),w=Re(w,m,0),p.push(h?w:[])}return p}function c(d){return u(d).map(p=>p.length>0?ie(p):null)}let m={theme:e,utilities:i,variants:t,invalidCandidates:new Set,important:!1,candidatesToCss:c,candidatesToAst:u,getClassOrder(d){return _i(this,d)},getClassList(){return Oi(this)},getVariants(){return Pi(this)},parseCandidate(d){return l.get(d)},parseVariant(d){return n.get(d)},compileAstNodes(d,p=1){return o.get(p).get(d)},printCandidate(d){return jr(m,d)},printVariant(d){return kt(d)},getVariantOrder(){let d=Array.from(n.values());d.sort((w,x)=>this.variants.compare(w,x));let p=new Map,k,h=0;for(let w of d)w!==null&&(k!==void 0&&this.variants.compare(k,w)!==0&&h++,p.set(w,h),k=w);return p},resolveThemeValue(d,p=!0){let k=d.lastIndexOf("/"),h=null;k!==-1&&(h=d.slice(k+1).trim(),d=d.slice(0,k).trim());let w=e.resolve(null,[d],p?1:0)??void 0;return h&&w?J(w,h):w},trackUsedVariables(d){f.get(d)},canonicalizeCandidates(d,p){return rr(this,d,p)},storage:{}};return m}var sr=["container-type","pointer-events","visibility","position","inset","inset-inline","inset-block","inset-inline-start","inset-inline-end","top","right","bottom","left","isolation","z-index","order","grid-column","grid-column-start","grid-column-end","grid-row","grid-row-start","grid-row-end","float","clear","--tw-container-component","margin","margin-inline","margin-block","margin-inline-start","margin-inline-end","margin-top","margin-right","margin-bottom","margin-left","box-sizing","display","field-sizing","aspect-ratio","height","max-height","min-height","width","max-width","min-width","flex","flex-shrink","flex-grow","flex-basis","table-layout","caption-side","border-collapse","border-spacing","transform-origin","translate","--tw-translate-x","--tw-translate-y","--tw-translate-z","scale","--tw-scale-x","--tw-scale-y","--tw-scale-z","rotate","--tw-rotate-x","--tw-rotate-y","--tw-rotate-z","--tw-skew-x","--tw-skew-y","transform","animation","cursor","touch-action","--tw-pan-x","--tw-pan-y","--tw-pinch-zoom","resize","scroll-snap-type","--tw-scroll-snap-strictness","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-margin-inline","scroll-margin-block","scroll-margin-inline-start","scroll-margin-inline-end","scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left","scroll-padding","scroll-padding-inline","scroll-padding-block","scroll-padding-inline-start","scroll-padding-inline-end","scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left","list-style-position","list-style-type","list-style-image","appearance","columns","break-before","break-inside","break-after","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-template-columns","grid-template-rows","flex-direction","flex-wrap","place-content","place-items","align-content","align-items","justify-content","justify-items","gap","column-gap","row-gap","--tw-space-x-reverse","--tw-space-y-reverse","divide-x-width","divide-y-width","--tw-divide-y-reverse","divide-style","divide-color","place-self","align-self","justify-self","overflow","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-behavior","border-radius","border-start-radius","border-end-radius","border-top-radius","border-right-radius","border-bottom-radius","border-left-radius","border-start-start-radius","border-start-end-radius","border-end-end-radius","border-end-start-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-width","border-inline-width","border-block-width","border-inline-start-width","border-inline-end-width","border-top-width","border-right-width","border-bottom-width","border-left-width","border-style","border-inline-style","border-block-style","border-inline-start-style","border-inline-end-style","border-top-style","border-right-style","border-bottom-style","border-left-style","border-color","border-inline-color","border-block-color","border-inline-start-color","border-inline-end-color","border-top-color","border-right-color","border-bottom-color","border-left-color","background-color","background-image","--tw-gradient-position","--tw-gradient-stops","--tw-gradient-via-stops","--tw-gradient-from","--tw-gradient-from-position","--tw-gradient-via","--tw-gradient-via-position","--tw-gradient-to","--tw-gradient-to-position","mask-image","--tw-mask-top","--tw-mask-top-from-color","--tw-mask-top-from-position","--tw-mask-top-to-color","--tw-mask-top-to-position","--tw-mask-right","--tw-mask-right-from-color","--tw-mask-right-from-position","--tw-mask-right-to-color","--tw-mask-right-to-position","--tw-mask-bottom","--tw-mask-bottom-from-color","--tw-mask-bottom-from-position","--tw-mask-bottom-to-color","--tw-mask-bottom-to-position","--tw-mask-left","--tw-mask-left-from-color","--tw-mask-left-from-position","--tw-mask-left-to-color","--tw-mask-left-to-position","--tw-mask-linear","--tw-mask-linear-position","--tw-mask-linear-from-color","--tw-mask-linear-from-position","--tw-mask-linear-to-color","--tw-mask-linear-to-position","--tw-mask-radial","--tw-mask-radial-shape","--tw-mask-radial-size","--tw-mask-radial-position","--tw-mask-radial-from-color","--tw-mask-radial-from-position","--tw-mask-radial-to-color","--tw-mask-radial-to-position","--tw-mask-conic","--tw-mask-conic-position","--tw-mask-conic-from-color","--tw-mask-conic-from-position","--tw-mask-conic-to-color","--tw-mask-conic-to-position","box-decoration-break","background-size","background-attachment","background-clip","background-position","background-repeat","background-origin","mask-composite","mask-mode","mask-type","mask-size","mask-clip","mask-position","mask-repeat","mask-origin","fill","stroke","stroke-width","object-fit","object-position","padding","padding-inline","padding-block","padding-inline-start","padding-inline-end","padding-top","padding-right","padding-bottom","padding-left","text-align","text-indent","vertical-align","font-family","font-size","line-height","font-weight","letter-spacing","text-wrap","overflow-wrap","word-break","text-overflow","hyphens","white-space","color","text-transform","font-style","font-stretch","font-variant-numeric","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","-webkit-font-smoothing","placeholder-color","caret-color","accent-color","color-scheme","opacity","background-blend-mode","mix-blend-mode","box-shadow","--tw-shadow","--tw-shadow-color","--tw-ring-shadow","--tw-ring-color","--tw-inset-shadow","--tw-inset-shadow-color","--tw-inset-ring-shadow","--tw-inset-ring-color","--tw-ring-offset-width","--tw-ring-offset-color","outline","outline-width","outline-offset","outline-color","--tw-blur","--tw-brightness","--tw-contrast","--tw-drop-shadow","--tw-grayscale","--tw-hue-rotate","--tw-invert","--tw-saturate","--tw-sepia","filter","--tw-backdrop-blur","--tw-backdrop-brightness","--tw-backdrop-contrast","--tw-backdrop-grayscale","--tw-backdrop-hue-rotate","--tw-backdrop-invert","--tw-backdrop-opacity","--tw-backdrop-saturate","--tw-backdrop-sepia","backdrop-filter","transition-property","transition-behavior","transition-delay","transition-duration","transition-timing-function","will-change","contain","content","forced-color-adjust"];function Te(e,r,{onInvalidCandidate:i,respectImportant:t}={}){let n=new Map,l=[],o=new Map;for(let c of e){if(r.invalidCandidates.has(c)){i?.(c);continue}let m=r.parseCandidate(c);if(m.length===0){i?.(c);continue}o.set(c,m)}let f=0;(t??!0)&&(f|=1);let u=r.getVariantOrder();for(let[c,m]of o){let d=!1;for(let p of m){let k=r.compileAstNodes(p,f);if(k.length!==0){d=!0;for(let{node:h,propertySort:w}of k){let x=0n;for(let S of p.variants)x|=1n<{let d=n.get(c),p=n.get(m);if(d.variants-p.variants!==0n)return Number(d.variants-p.variants);let k=0;for(;k1)return null;for(let u of o.nodes)if(u.kind!=="rule"&&u.kind!=="at-rule"||n(u,r)===null)return null;_(o.nodes,u=>{if((u.kind==="rule"||u.kind==="at-rule")&&u.nodes.length<=0)return u.nodes=e.nodes,V.Skip}),e.nodes=o.nodes;return}if(n(e,r)===null)return null}function Ki(e){let r=e.options?.types??[];return r.length>1&&r.includes("any")}function Ca(e,r){if(e.kind==="arbitrary"){let o=e.value;return e.modifier&&(o=X(o,e.modifier,r.theme)),o===null?[]:[[a(e.property,o)]]}let i=r.utilities.get(e.root)??[],t=[],n=i.filter(o=>!Ki(o));for(let o of n){if(o.kind!==e.kind)continue;let f=o.compileFn(e);if(f!==void 0){if(f===null)return t;t.push(f)}}if(t.length>0)return t;let l=i.filter(o=>Ki(o));for(let o of l){if(o.kind!==e.kind)continue;let f=o.compileFn(e);if(f!==void 0){if(f===null)return t;t.push(f)}}return t}function zi(e){for(let r of e)r.kind!=="at-root"&&(r.kind==="declaration"?r.important=!0:(r.kind==="rule"||r.kind==="at-rule")&&zi(r.nodes))}function Sa(e){let r=new Set,i=0,t=e.slice(),n=!1;for(;t.length>0;){let l=t.shift();if(l.kind==="declaration"){if(l.value===void 0||(i++,n))continue;if(l.property==="--tw-sort"){let f=sr.indexOf(l.value??"");if(f!==-1){r.add(f),n=!0;continue}}let o=sr.indexOf(l.property);o!==-1&&r.add(o)}else if(l.kind==="rule"||l.kind==="at-rule")for(let o of l.nodes)t.push(o)}return{order:Array.from(r).sort((l,o)=>l-o),count:i}}function $e(e,r){let i=0,t=Z("&",e),n=new Set,l=new U(()=>new Set),o=new U(()=>new Set);_([t],(d,p)=>{if(d.kind==="at-rule"){if(d.name==="@keyframes")return _(d.nodes,k=>{if(k.kind==="at-rule"&&k.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),V.Skip;if(d.name==="@utility"){let k=d.params.replace(/-\*$/,"");o.get(k).add(d),_(d.nodes,h=>{if(!(h.kind!=="at-rule"||h.name!=="@apply")){n.add(d);for(let w of Mi(h,r))l.get(d).add(w)}});return}if(d.name==="@apply"){if(p.parent===null)return;i|=1,n.add(p.parent);for(let k of Mi(d,r))for(let h of p.path())n.has(h)&&l.get(h).add(k)}}});let f=new Set,u=[],c=new Set;function m(d,p=[]){if(!f.has(d)){if(c.has(d)){let k=p[(p.indexOf(d)+1)%p.length];throw d.kind==="at-rule"&&d.name==="@utility"&&k.kind==="at-rule"&&k.name==="@utility"&&_(d.nodes,h=>{if(h.kind!=="at-rule"||h.name!=="@apply")return;let w=h.params.split(/\s+/g);for(let x of w)for(let S of r.parseCandidate(x))switch(S.kind){case"arbitrary":break;case"static":case"functional":if(k.params.replace(/-\*$/,"")===S.root)throw new Error(`You cannot \`@apply\` the \`${x}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${ie([d])} +Relies on: + +${ie([k])}`)}c.add(d);for(let k of l.get(d))for(let h of o.get(k))p.push(d),m(h,p),p.pop();f.add(d),c.delete(d),u.push(d)}}for(let d of n)m(d);for(let d of u)"nodes"in d&&_(d.nodes,p=>{if(p.kind!=="at-rule"||p.name!=="@apply")return;let k=p.params.split(/(\s+)/g),h={},w=0;for(let[x,S]of k.entries())x%2===0&&(h[S]=w),w+=S.length;{let x=Object.keys(h),S=Te(x,r,{respectImportant:!1,onInvalidCandidate:N=>{if(r.theme.prefix&&!N.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${N}\`. Did you mean \`${r.theme.prefix}:${N}\`?`);if(r.invalidCandidates.has(N))throw new Error(`Cannot apply utility class \`${N}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let P=L(N,":");if(P.length>1){let z=P.pop();if(r.candidatesToCss([z])[0]){let I=r.candidatesToCss(P.map(Y=>`${Y}:[--tw-variant-check:1]`)),M=P.filter((Y,G)=>I[G]===null);if(M.length>0){if(M.length===1)throw new Error(`Cannot apply utility class \`${N}\` because the ${M.map(Y=>`\`${Y}\``)} variant does not exist.`);{let Y=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${N}\` because the ${Y.format(M.map(G=>`\`${G}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${N}\`. Are you using CSS modules or similar and missing \`@reference\`? https://tailwindcss.com/docs/functions-and-directives#reference-directive`):new Error(`Cannot apply unknown utility class \`${N}\``)}}),A=p.src,y=S.astNodes.map(N=>{let P=S.nodeSorting.get(N)?.candidate,z=P?h[P]:void 0;if(N=ee(N),!A||!P||z===void 0)return _([N],M=>{M.src=A}),N;let I=[A[0],A[1],A[2]];return I[1]+=7+z,I[2]=I[1]+P.length,_([N],M=>{M.src=I}),N}),K=[];for(let N of y)if(N.kind==="rule")for(let P of N.nodes)K.push(P);else K.push(N);return V.Replace(K)}});return i}function*Mi(e,r){for(let i of e.params.split(/\s+/g))for(let t of r.parseCandidate(i))switch(t.kind){case"arbitrary":break;case"static":case"functional":yield t.root;break;default:}}async function ur(e,r,i,t=0,n=!1){let l=0,o=[];return _(e,f=>{if(f.kind==="at-rule"&&(f.name==="@import"||f.name==="@reference")){let u=$a(B(f.params));if(u===null)return;f.name==="@reference"&&(u.media="reference"),l|=2;let{uri:c,layer:m,media:d,supports:p}=u;if(c.startsWith("data:")||c.startsWith("http://")||c.startsWith("https://"))return;let k=de({},[]);return o.push((async()=>{if(t>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${c}\` in \`${r}\`)`);let h=await i(c,r),w=Ne(h.content,{from:n?h.path:void 0});await ur(w,h.base,i,t+1,n),k.nodes=Ta(f,[de({base:h.base},w)],m,d,p)})()),V.ReplaceSkip(k)}}),o.length>0&&await Promise.all(o),l}function $a(e){let r,i=null,t=null,n=null;for(let l=0;l{let c=Ue(n),[m,d]=Ea(e.theme,c),p=i(ji(r()??{},c)??null);if(typeof p=="string"&&(p=p.replace("","1")),typeof m!="object")return typeof d!="object"&&d&4?p??m:m;if(p!==null&&typeof p=="object"&&!Array.isArray(p)){let k=at({},[p],(h,w)=>w);if(m===null&&Object.hasOwn(p,"__CSS_VALUES__")){let h={};for(let w in p.__CSS_VALUES__)h[w]=p[w],delete k[w];m=h}for(let h in m)h!=="__CSS_VALUES__"&&(p?.__CSS_VALUES__?.[h]&4&&ji(k,h.split("-"))!==void 0||(k[Ve(h)]=m[h]));return k}if(Array.isArray(m)&&Array.isArray(d)&&Array.isArray(p)){let k=m[0],h=m[1];d[0]&4&&(k=p[0]??k);for(let w of Object.keys(h))d[1][w]&4&&(h[w]=p[1][w]??h[w]);return[k,h]}return m??p})();return f&&typeof u=="string"&&(u=J(u,f)),u??l}}function Ea(e,r){if(r.length===1&&r[0].startsWith("--"))return[e.get([r[0]]),e.getOptions(r[0])];let i=Ye(r),t=new Map,n=new U(()=>new Map),l=e.namespace(`--${i}`);if(l.size===0)return[null,0];let o=new Map;for(let[m,d]of l){if(!m||!m.includes("--")){t.set(m,d),o.set(m,e.getOptions(m?`--${i}-${m}`:`--${i}`));continue}let p=m.indexOf("--"),k=m.slice(0,p),h=m.slice(p+2);h=h.replace(/-([a-z])/g,(w,x)=>x.toUpperCase()),n.get(k===""?null:k).set(h,[d,e.getOptions(`--${i}${m}`)])}let f=e.getOptions(`--${i}`);for(let[m,d]of n){let p=t.get(m);if(typeof p!="string")continue;let k={},h={};for(let[w,[x,S]]of d)k[w]=x,h[w]=S;t.set(m,[p,k]),o.set(m,[f,h])}let u={},c={};for(let[m,d]of t)Fi(u,[m??"DEFAULT"],d);for(let[m,d]of o)Fi(c,[m??"DEFAULT"],d);return r[r.length-1]==="DEFAULT"?[u?.DEFAULT??null,c.DEFAULT??0]:"DEFAULT"in u&&Object.keys(u).length===1?[u.DEFAULT,c.DEFAULT??0]:(u.__CSS_VALUES__=c,[u,c])}function ji(e,r){for(let i=0;i{m.src=l}),r.push(c)},addVariant(f,u){if(!Vt.test(f))throw new Error(`\`addVariant('${f}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes, or underscore characters and start with a lowercase letter or number.`);if(typeof u=="string"){if(u.includes(":merge("))return}else if(Array.isArray(u)){if(u.some(m=>m.includes(":merge(")))return}else if(typeof u=="object"){let m=function(d,p){return Object.entries(d).some(([k,h])=>k.includes(p)||typeof h=="object"&&m(h,p))};var c=m;if(m(u,":merge("))return}typeof u=="string"||Array.isArray(u)?e.variants.static(f,m=>{m.nodes=Bi(u,m.nodes)},{compounds:Le(typeof u=="string"?[u]:u)}):typeof u=="object"&&e.variants.fromAst(f,he(u),e)},matchVariant(f,u,c){function m(p,k,h){let w=u(p,{modifier:k?.value??null});return Bi(w,h)}try{let p=u("a",{modifier:null});if(typeof p=="string"&&p.includes(":merge("))return;if(Array.isArray(p)&&p.some(k=>k.includes(":merge(")))return}catch{}let d=Object.keys(c?.values??{});e.variants.group(()=>{e.variants.functional(f,(p,k)=>{if(!k.value){if(c?.values&&"DEFAULT"in c.values){p.nodes=m(c.values.DEFAULT,k.modifier,p.nodes);return}return null}if(k.value.kind==="arbitrary")p.nodes=m(k.value.value,k.modifier,p.nodes);else if(k.value.kind==="named"&&c?.values){let h=c.values[k.value.value];if(typeof h!="string")return null;p.nodes=m(h,k.modifier,p.nodes)}else return null})},(p,k)=>{if(p.kind!=="functional"||k.kind!=="functional")return 0;let h=p.value?p.value.value:"DEFAULT",w=k.value?k.value.value:"DEFAULT",x=c?.values?.[h]??h,S=c?.values?.[w]??w;if(c&&typeof c.sort=="function")return c.sort({value:x,modifier:p.modifier?.value??null},{value:S,modifier:k.modifier?.value??null});let A=d.indexOf(h),y=d.indexOf(w);return A=A===-1?d.length:A,y=y===-1?d.length:y,A!==y?A-y:xObject.keys(c?.values??{}).filter(p=>p!=="DEFAULT"))},addUtilities(f){f=Array.isArray(f)?f:[f];let u=f.flatMap(m=>Object.entries(m));u=u.flatMap(([m,d])=>L(m,",").map(p=>[p.trim(),d]));let c=new U(()=>[]);for(let[m,d]of u){if(m.startsWith("@keyframes ")){if(!n){let h=Z(m,he(d));_([h],w=>{w.src=l}),r.push(h)}continue}let p=De(m),k=!1;if(_(p,h=>{if(h.kind==="selector"&&h.value[0]==="."&&Wi.test(h.value.slice(1))){let w=h.value;h.value="&";let x=me(p),S=w.slice(1),A=x==="&"?he(d):[Z(x,he(d))];c.get(S).push(...A),k=!0,h.value=w;return}if(h.kind==="function"&&h.value===":not")return V.Skip}),!k)throw new Error(`\`addUtilities({ '${m}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[m,d]of c)e.theme.prefix&&_(d,p=>{if(p.kind==="rule"){let k=De(p.selector);_(k,h=>{h.kind==="selector"&&h.value[0]==="."&&(h.value=`.${e.theme.prefix}\\:${h.value.slice(1)}`)}),p.selector=me(k)}}),e.utilities.static(m,p=>{let k=d.map(ee);return Yi(k,m,p.raw),t.current|=$e(k,e),k})},matchUtilities(f,u){let c=u?.type?Array.isArray(u?.type)?u.type:[u.type]:["any"];for(let[d,p]of Object.entries(f)){let k=function({negative:h}){return w=>{if(w.value?.kind==="arbitrary"&&c.length>0&&!c.includes("any")&&(w.value.dataType&&!c.includes(w.value.dataType)||!w.value.dataType&&!Q(w.value.value,c)))return;let x=c.includes("color"),S=null,A=!1;{let N=u?.values??{};x&&(N=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},N)),w.value?w.value.kind==="arbitrary"?S=w.value.value:w.value.fraction&&N[w.value.fraction]?(S=N[w.value.fraction],A=!0):N[w.value.value]?S=N[w.value.value]:N.__BARE_VALUE__&&(S=N.__BARE_VALUE__(w.value)??null,A=(w.value.fraction!==null&&S?.includes("/"))??!1):S=N.DEFAULT??null}if(S===null)return;let y;{let N=u?.modifiers??null;w.modifier?N==="any"||w.modifier.kind==="arbitrary"?y=w.modifier.value:N?.[w.modifier.value]?y=N[w.modifier.value]:x&&!Number.isNaN(Number(w.modifier.value))?y=`${w.modifier.value}%`:y=null:y=null}if(w.modifier&&y===null&&!A)return w.value?.kind==="arbitrary"?null:void 0;x&&y!==null&&(S=J(S,y)),h&&(S=`calc(${S} * -1)`);let K=he(p(S,{modifier:y}));return Yi(K,d,w.raw),t.current|=$e(K,e),K}};var m=k;if(!Wi.test(d))throw new Error(`\`matchUtilities({ '${d}' : \u2026 })\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter, eg. \`scrollbar\`.`);u?.supportsNegativeValues&&e.utilities.functional(`-${d}`,k({negative:!0}),{types:c}),e.utilities.functional(d,k({negative:!1}),{types:c}),e.utilities.suggest(d,()=>{let h=u?.values??{},w=new Set(Object.keys(h));w.delete("__BARE_VALUE__"),w.delete("__CSS_VALUES__"),w.has("DEFAULT")&&(w.delete("DEFAULT"),w.add(null));let x=u?.modifiers??{},S=x==="any"?[]:Object.keys(x);return[{supportsNegative:u?.supportsNegativeValues??!1,values:Array.from(w),modifiers:S}]})}},addComponents(f,u){this.addUtilities(f,u)},matchComponents(f,u){this.matchUtilities(f,u)},theme:Rt(e,()=>i.theme??{},f=>f),prefix(f){return f},config(f,u){let c=i;if(!f)return c;let m=Ue(f);for(let d=0;dObject.entries(t));for(let[t,n]of i)if(n!=null&&n!==!1)if(typeof n!="object"){if(!t.startsWith("--")){if(n==="@slot"){r.push(Z(t,[F("@slot")]));continue}t=t.replace(/([A-Z])/g,"-$1").toLowerCase()}r.push(a(t,String(n)))}else if(Array.isArray(n))for(let l of n)typeof l=="string"?r.push(a(t,l)):r.push(Z(t,he(l)));else r.push(Z(t,he(n)));return r}function Bi(e,r){return(typeof e=="string"?[e]:e).flatMap(t=>{if(t.trim().endsWith("}")){let n=t.replace("}","{@slot}}"),l=Ne(n);return lr(l,r),l}else return Z(t,r)})}function Yi(e,r,i){_(e,t=>{if(t.kind==="rule"){let n=De(t.selector);_(n,l=>{l.kind==="selector"&&l.value===`.${r}`&&(l.value=`.${xe(i)}`)}),t.selector=me(n)}})}function qi(e,r){for(let i of Na(r))e.theme.addKeyframes(i)}function Na(e){let r=[];if("keyframes"in e.theme)for(let[i,t]of Object.entries(e.theme.keyframes))r.push(F("@keyframes",i,he(t)));return r}var Ot={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};function Ke(e){return{__BARE_VALUE__:e}}var fe=Ke(e=>{if(O(e.value))return e.value}),re=Ke(e=>{if(O(e.value))return`${e.value}%`}),Ee=Ke(e=>{if(O(e.value))return`${e.value}px`}),Gi=Ke(e=>{if(O(e.value))return`${e.value}ms`}),Pt=Ke(e=>{if(O(e.value))return`${e.value}deg`}),Va=Ke(e=>{if(e.fraction===null)return;let[r,i]=L(e.fraction,"/");if(!(!O(r)||!O(i)))return e.fraction}),Hi=Ke(e=>{if(O(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),Zi={accentColor:({theme:e})=>e("colors"),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9",...Va},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...re}),backdropContrast:({theme:e})=>({...e("contrast"),...re}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...re}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...Pt}),backdropInvert:({theme:e})=>({...e("invert"),...re}),backdropOpacity:({theme:e})=>({...e("opacity"),...re}),backdropSaturate:({theme:e})=>({...e("saturate"),...re}),backdropSepia:({theme:e})=>({...e("sepia"),...re}),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>e("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...Ee},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2",...re},caretColor:({theme:e})=>e("colors"),colors:()=>({...Ot}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",...fe},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...re},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>({...e("borderWidth"),...Ee}),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>e("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",...e("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...fe},flexShrink:{0:"0",DEFAULT:"1",...fe},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%",...re},grayscale:{0:"0",DEFAULT:"100%",...re},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...fe},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...fe},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...fe},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13",...fe},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...Hi},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",...Hi},height:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...Pt},inset:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),invert:{0:"0",DEFAULT:"100%",...re},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...fe},maxHeight:({theme:e})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),maxWidth:({theme:e})=>({none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e("spacing")}),minHeight:({theme:e})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),minWidth:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1",...re},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",...fe},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:"currentcolor",...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...Pt},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...re},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",...re},screens:{sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"},scrollMargin:({theme:e})=>e("spacing"),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%",...re},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...Pt},space:({theme:e})=>e("spacing"),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...fe},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...Ee},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...Gi},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...Gi},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...e("spacing")}),size:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),width:({theme:e})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content",...e("spacing")}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",...fe}};function Qi(e){return{theme:{...Zi,colors:({theme:r})=>r("color",{}),extend:{fontSize:({theme:r})=>({...r("text",{})}),boxShadow:({theme:r})=>({...r("shadow",{})}),animation:({theme:r})=>({...r("animate",{})}),aspectRatio:({theme:r})=>({...r("aspect",{})}),borderRadius:({theme:r})=>({...r("radius",{})}),screens:({theme:r})=>({...r("breakpoint",{})}),letterSpacing:({theme:r})=>({...r("tracking",{})}),lineHeight:({theme:r})=>({...r("leading",{})}),transitionDuration:{DEFAULT:e.get(["--default-transition-duration"])??null},transitionTimingFunction:{DEFAULT:e.get(["--default-transition-timing-function"])??null},maxWidth:({theme:r})=>({...r("container",{})})}}}}var Ra={blocklist:[],future:{},experimental:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function pr(e,r){let i={design:e,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(Ra)};for(let n of r)fr(i,n);for(let n of i.configs)"darkMode"in n&&n.darkMode!==void 0&&(i.result.darkMode=n.darkMode??null),"prefix"in n&&n.prefix!==void 0&&(i.result.prefix=n.prefix??""),"blocklist"in n&&n.blocklist!==void 0&&(i.result.blocklist=n.blocklist??[]),"important"in n&&n.important!==void 0&&(i.result.important=n.important??!1);let t=Pa(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:t}}function Oa(e,r){if(Array.isArray(e)&&Ge(e[0]))return e.concat(r);if(Array.isArray(r)&&Ge(r[0])&&Ge(e))return[e,...r];if(Array.isArray(r))return r}function fr(e,{config:r,base:i,path:t,reference:n,src:l}){let o=[];for(let c of r.plugins??[])"__isOptionsFunction"in c?o.push({...c(),reference:n,src:l}):"handler"in c?o.push({...c,reference:n,src:l}):o.push({handler:c,reference:n,src:l});if(Array.isArray(r.presets)&&r.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let c of r.presets??[])fr(e,{path:t,base:i,config:c,reference:n,src:l});for(let c of o)e.plugins.push(c),c.config&&fr(e,{path:t,base:i,config:c.config,reference:!!c.reference,src:c.src??l});let f=r.content??[],u=Array.isArray(f)?f:f.files;for(let c of u)e.content.files.push(typeof c=="object"?c:{base:i,pattern:c});e.configs.push(r)}function Pa(e){let r=new Set,i=Rt(e.design,()=>e.theme,n),t=Object.assign(i,{theme:i,colors:Ot});function n(l){return typeof l=="function"?l(t)??null:l??null}for(let l of e.configs){let o=l.theme??{},f=o.extend??{};for(let u in o)u!=="extend"&&r.add(u);Object.assign(e.theme,o);for(let u in f)e.extend[u]??=[],e.extend[u].push(f[u])}delete e.theme.extend;for(let l in e.extend){let o=[e.theme[l],...e.extend[l]];e.theme[l]=()=>{let f=o.map(n);return at({},f,Oa)}}for(let l in e.theme)e.theme[l]=n(e.theme[l]);if(e.theme.screens&&typeof e.theme.screens=="object")for(let l of Object.keys(e.theme.screens)){let o=e.theme.screens[l];o&&typeof o=="object"&&("raw"in o||"max"in o||"min"in o&&(e.theme.screens[l]=o.min))}return r}function Ji(e,r){let i=e.theme.container||{};if(typeof i!="object"||i===null)return;let t=_a(i,r);t.length!==0&&r.utilities.static("container",()=>t.map(ee))}function _a({center:e,padding:r,screens:i},t){let n=[],l=null;if(e&&n.push(a("margin-inline","auto")),(typeof r=="string"||typeof r=="object"&&r!==null&&"DEFAULT"in r)&&n.push(a("padding-inline",typeof r=="string"?r:r.DEFAULT)),typeof i=="object"&&i!==null){l=new Map;let o=Array.from(t.theme.namespace("--breakpoint").entries());if(o.sort((f,u)=>Oe(f[1],u[1],"asc")),o.length>0){let[f]=o[0];n.push(F("@media",`(width >= --theme(--breakpoint-${f}))`,[a("max-width","none")]))}for(let[f,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;l.set(f,F("@media",`(width >= ${u})`,[a("max-width",u)]))}}if(typeof r=="object"&&r!==null){let o=Object.entries(r).filter(([f])=>f!=="DEFAULT").map(([f,u])=>[f,t.theme.resolveValue(f,["--breakpoint"]),u]).filter(Boolean);o.sort((f,u)=>Oe(f[1],u[1],"asc"));for(let[f,,u]of o)if(l&&l.has(f))l.get(f).nodes.push(a("padding-inline",u));else{if(l)continue;n.push(F("@media",`(width >= theme(--breakpoint-${f}))`,[a("padding-inline",u)]))}}if(l)for(let[,o]of l)n.push(o);return n}function Xi({addVariant:e,config:r}){let i=r("darkMode",null),[t,n=".dark"]=Array.isArray(i)?i:[i];if(t==="variant"){let l;if(Array.isArray(n)||typeof n=="function"?l=n:typeof n=="string"&&(l=[n]),Array.isArray(l))for(let o of l)o===".dark"?(t=!1,console.warn('When using `variant` for `darkMode`, you must provide a selector.\nExample: `darkMode: ["variant", ".your-selector &"]`')):o.includes("&")||(t=!1,console.warn('When using `variant` for `darkMode`, your selector must contain `&`.\nExample `darkMode: ["variant", ".your-selector &"]`'));n=l}t===null||(t==="selector"?e("dark",`&:where(${n}, ${n} *)`):t==="media"?e("dark","@media (prefers-color-scheme: dark)"):t==="variant"?e("dark",n):t==="class"&&e("dark",`&:is(${n} *)`))}function en(e){for(let[r,i]of[["t","top"],["tr","top right"],["r","right"],["br","bottom right"],["b","bottom"],["bl","bottom left"],["l","left"],["tl","top left"]])e.utilities.suggest(`bg-gradient-to-${r}`,()=>[]),e.utilities.static(`bg-gradient-to-${r}`,()=>[a("--tw-gradient-position",`to ${i} in oklab`),a("background-image","linear-gradient(var(--tw-gradient-stops))")]);e.utilities.suggest("bg-left-top",()=>[]),e.utilities.static("bg-left-top",()=>[a("background-position","left top")]),e.utilities.suggest("bg-right-top",()=>[]),e.utilities.static("bg-right-top",()=>[a("background-position","right top")]),e.utilities.suggest("bg-left-bottom",()=>[]),e.utilities.static("bg-left-bottom",()=>[a("background-position","left bottom")]),e.utilities.suggest("bg-right-bottom",()=>[]),e.utilities.static("bg-right-bottom",()=>[a("background-position","right bottom")]),e.utilities.suggest("object-left-top",()=>[]),e.utilities.static("object-left-top",()=>[a("object-position","left top")]),e.utilities.suggest("object-right-top",()=>[]),e.utilities.static("object-right-top",()=>[a("object-position","right top")]),e.utilities.suggest("object-left-bottom",()=>[]),e.utilities.static("object-left-bottom",()=>[a("object-position","left bottom")]),e.utilities.suggest("object-right-bottom",()=>[]),e.utilities.static("object-right-bottom",()=>[a("object-position","right bottom")]),e.utilities.suggest("max-w-screen",()=>[]),e.utilities.functional("max-w-screen",r=>{if(!r.value||r.value.kind==="arbitrary")return;let i=e.theme.resolve(r.value.value,["--breakpoint"]);if(i)return[a("max-width",i)]}),e.utilities.suggest("overflow-ellipsis",()=>[]),e.utilities.static("overflow-ellipsis",()=>[a("text-overflow","ellipsis")]),e.utilities.suggest("decoration-slice",()=>[]),e.utilities.static("decoration-slice",()=>[a("-webkit-box-decoration-break","slice"),a("box-decoration-break","slice")]),e.utilities.suggest("decoration-clone",()=>[]),e.utilities.static("decoration-clone",()=>[a("-webkit-box-decoration-break","clone"),a("box-decoration-break","clone")]),e.utilities.suggest("flex-shrink",()=>[]),e.utilities.functional("flex-shrink",r=>{if(!r.modifier){if(!r.value)return[a("flex-shrink","1")];if(r.value.kind==="arbitrary")return[a("flex-shrink",r.value.value)];if(O(r.value.value))return[a("flex-shrink",r.value.value)]}}),e.utilities.suggest("flex-grow",()=>[]),e.utilities.functional("flex-grow",r=>{if(!r.modifier){if(!r.value)return[a("flex-grow","1")];if(r.value.kind==="arbitrary")return[a("flex-grow",r.value.value)];if(O(r.value.value))return[a("flex-grow",r.value.value)]}}),e.utilities.suggest("order-none",()=>[]),e.utilities.static("order-none",()=>[a("order","0")]),e.utilities.suggest("break-words",()=>[]),e.utilities.static("break-words",()=>[a("overflow-wrap","break-word")])}function tn(e,r){let i=e.theme.screens||{},t=r.variants.get("min")?.order??0,n=[];for(let[o,f]of Object.entries(i)){let p=function(k){r.variants.static(o,h=>{h.nodes=[F("@media",d,h.nodes)]},{order:k})};var l=p;let u=r.variants.get(o),c=r.theme.resolveValue(o,["--breakpoint"]);if(u&&c&&!r.theme.hasDefault(`--breakpoint-${o}`))continue;let m=!0;typeof f=="string"&&(m=!1);let d=Ia(f);m?n.push(p):p(t)}if(n.length!==0){for(let[,o]of r.variants.variants)o.order>t&&(o.order+=n.length);r.variants.compareFns=new Map(Array.from(r.variants.compareFns).map(([o,f])=>(o>t&&(o+=n.length),[o,f])));for(let[o,f]of n.entries())f(t+o+1)}}function Ia(e){return(Array.isArray(e)?e:[e]).map(i=>typeof i=="string"?{min:i}:i&&typeof i=="object"?i:null).map(i=>{if(i===null)return null;if("raw"in i)return i.raw;let t="";return i.max!==void 0&&(t+=`${i.max} >= `),t+="width",i.min!==void 0&&(t+=` >= ${i.min}`),`(${t})`}).filter(Boolean).join(", ")}function rn(e,r){let i=e.theme.aria||{},t=e.theme.supports||{},n=e.theme.data||{};if(Object.keys(i).length>0){let l=r.variants.get("aria"),o=l?.applyFn,f=l?.compounds;r.variants.functional("aria",(u,c)=>{let m=c.value;return m&&m.kind==="named"&&m.value in i?o?.(u,{...c,value:{kind:"arbitrary",value:i[m.value]}}):o?.(u,c)},{compounds:f})}if(Object.keys(t).length>0){let l=r.variants.get("supports"),o=l?.applyFn,f=l?.compounds;r.variants.functional("supports",(u,c)=>{let m=c.value;return m&&m.kind==="named"&&m.value in t?o?.(u,{...c,value:{kind:"arbitrary",value:t[m.value]}}):o?.(u,c)},{compounds:f})}if(Object.keys(n).length>0){let l=r.variants.get("data"),o=l?.applyFn,f=l?.compounds;r.variants.functional("data",(u,c)=>{let m=c.value;return m&&m.kind==="named"&&m.value in n?o?.(u,{...c,value:{kind:"arbitrary",value:n[m.value]}}):o?.(u,c)},{compounds:f})}}var Da=/^[a-z]+$/;async function on({designSystem:e,base:r,ast:i,loadModule:t,sources:n}){let l=0,o=[],f=[];_(i,(d,p)=>{if(d.kind!=="at-rule")return;let k=et(p);if(d.name==="@plugin"){if(k.parent!==null)throw new Error("`@plugin` cannot be nested.");let h=d.params.slice(1,-1);if(h.length===0)throw new Error("`@plugin` must have a path.");let w={};for(let x of d.nodes??[]){if(x.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${ie([x])} + +\`@plugin\` options must be a flat list of declarations.`);if(x.value===void 0)continue;let S=x.value,A=L(S,",").map(y=>{if(y=y.trim(),y==="null")return null;if(y==="true")return!0;if(y==="false")return!1;if(Number.isNaN(Number(y))){if(y[0]==='"'&&y[y.length-1]==='"'||y[0]==="'"&&y[y.length-1]==="'")return y.slice(1,-1);if(y[0]==="{"&&y[y.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${ie([x]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(y);return y});w[x.property]=A.length===1?A[0]:A}return o.push([{id:h,base:k.context.base,reference:!!k.context.reference,src:d.src},Object.keys(w).length>0?w:null]),l|=4,V.Replace([])}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(k.parent!==null)throw new Error("`@config` cannot be nested.");return f.push({id:d.params.slice(1,-1),base:k.context.base,reference:!!k.context.reference,src:d.src}),l|=4,V.Replace([])}}),en(e);let u=e.resolveThemeValue;if(e.resolveThemeValue=function(p,k){return p.startsWith("--")?u(p,k):(l|=nn({designSystem:e,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),e.resolveThemeValue(p,k))},!o.length&&!f.length)return 0;let[c,m]=await Promise.all([Promise.all(f.map(async({id:d,base:p,reference:k,src:h})=>{let w=await t(d,p,"config");return{path:d,base:w.base,config:w.module,reference:k,src:h}})),Promise.all(o.map(async([{id:d,base:p,reference:k,src:h},w])=>{let x=await t(d,p,"plugin");return{path:d,base:x.base,plugin:x.module,options:w,reference:k,src:h}}))]);return l|=nn({designSystem:e,base:r,ast:i,sources:n,configs:c,pluginDetails:m}),l}function nn({designSystem:e,base:r,ast:i,sources:t,configs:n,pluginDetails:l}){let o=0,u=[...l.map(w=>{if(!w.options)return{config:{plugins:[w.plugin]},base:w.base,reference:w.reference,src:w.src};if("__isOptionsFunction"in w.plugin)return{config:{plugins:[w.plugin(w.options)]},base:w.base,reference:w.reference,src:w.src};throw new Error(`The plugin "${w.path}" does not accept options`)}),...n],{resolvedConfig:c}=pr(e,[{config:Qi(e.theme),base:r,reference:!0,src:void 0},...u,{config:{plugins:[Xi]},base:r,reference:!0,src:void 0}]),{resolvedConfig:m,replacedThemeKeys:d}=pr(e,u),p={designSystem:e,ast:i,resolvedConfig:c,featuresRef:{set current(w){o|=w}}},k=cr({...p,referenceMode:!1,src:void 0}),h=e.resolveThemeValue;e.resolveThemeValue=function(x,S){if(x[0]==="-"&&x[1]==="-")return h(x,S);let A=k.theme(x,void 0);if(Array.isArray(A)&&A.length===2)return A[0];if(Array.isArray(A))return A.join(", ");if(typeof A=="object"&&A!==null&&"DEFAULT"in A)return A.DEFAULT;if(typeof A=="string")return A};for(let{handler:w,reference:x,src:S}of c.plugins){let A=cr({...p,referenceMode:x??!1,src:S});w(A)}if(ri(e,m,d),qi(e,m),rn(m,e),tn(m,e),Ji(m,e),!e.theme.prefix&&c.prefix){if(c.prefix.endsWith("-")&&(c.prefix=c.prefix.slice(0,-1),console.warn(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only and is written as a variant before all utilities. We have fixed up the prefix for you. Remove the trailing \`-\` to silence this warning.`)),!Da.test(c.prefix))throw new Error(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);e.theme.prefix=c.prefix}if(!e.important&&c.important===!0&&(e.important=!0),typeof c.important=="string"){let w=c.important;_(i,(x,S)=>{if(x.kind!=="at-rule"||x.name!=="@tailwind"||x.params!=="utilities")return;let A=et(S);return A.parent?.kind==="rule"&&A.parent.selector===w?V.Stop:V.ReplaceStop(q(w,[x]))})}for(let w of c.blocklist)e.invalidCandidates.add(w);for(let w of c.content.files){if("raw"in w)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry: + +${JSON.stringify(w,null,2)} + +This feature is not currently supported.`);let x=!1;w.pattern[0]=="!"&&(x=!0,w.pattern=w.pattern.slice(1)),t.push({...w,negated:x})}return o}function an({ast:e}){let r=new U(n=>st(n.code)),i=new U(n=>({url:n.file,content:n.code,ignore:!1})),t={file:null,sources:[],mappings:[]};_(e,n=>{if(!n.src||!n.dst)return;let l=i.get(n.src[0]);if(!l.content)return;let o=r.get(n.src[0]),f=r.get(n.dst[0]),u=l.content.slice(n.src[1],n.src[2]),c=0;for(let p of u.split(` +`)){if(p.trim()!==""){let k=o.find(n.src[1]+c),h=f.find(n.dst[1]);t.mappings.push({name:null,originalPosition:{source:l,...k},generatedPosition:h})}c+=p.length,c+=1}let m=o.find(n.src[2]),d=f.find(n.dst[2]);t.mappings.push({name:null,originalPosition:{source:l,...m},generatedPosition:d})});for(let n of r.keys())t.sources.push(i.get(n));return t.mappings.sort((n,l)=>n.generatedPosition.line-l.generatedPosition.line||n.generatedPosition.column-l.generatedPosition.column||(n.originalPosition?.line??0)-(l.originalPosition?.line??0)||(n.originalPosition?.column??0)-(l.originalPosition?.column??0)),t}var ln=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function _t(e){let r=e.indexOf("{");if(r===-1)return[e];let i=[],t=e.slice(0,r),n=e.slice(r),l=0,o=n.lastIndexOf("}");for(let d=0;d_t(d));let m=_t(u);for(let d of m)for(let p of c)i.push(t+p+d);return i}function Ua(e){return ln.test(e)}function La(e){let r=e.match(ln);if(!r)return[e];let[,i,t,n]=r,l=n?parseInt(n,10):void 0,o=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(t)){let f=parseInt(i,10),u=parseInt(t,10);if(l===void 0&&(l=f<=u?1:-1),l===0)throw new Error("Step cannot be zero in sequence expansion.");let c=f0&&(l=-l);for(let m=f;c?m<=u:m>=u;m+=l)o.push(m.toString())}return o}function sn(e,r){let i=new Set,t=new Set,n=[];function l(o,f=[]){if(e.has(o)&&!i.has(o)){t.has(o)&&r.onCircularDependency?.(f,o),t.add(o);for(let u of e.get(o)??[])f.push(o),l(u,f),f.pop();i.add(o),t.delete(o),n.push(o)}}for(let o of e.keys())l(o);return n}var Ka=/^[a-z]+$/,ht=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(ht||{});function za(){throw new Error("No `loadModule` function provided to `compile`")}function Ma(){throw new Error("No `loadStylesheet` function provided to `compile`")}function ja(e){let r=0,i=null;for(let t of L(e," "))t==="reference"?r|=2:t==="inline"?r|=1:t==="default"?r|=4:t==="static"?r|=8:t.startsWith("prefix(")&&t.endsWith(")")&&(i=t.slice(7,-1));return[r,i]}var Pe=(u=>(u[u.None=0]="None",u[u.AtApply=1]="AtApply",u[u.AtImport=2]="AtImport",u[u.JsPluginCompat=4]="JsPluginCompat",u[u.ThemeFunction=8]="ThemeFunction",u[u.Utilities=16]="Utilities",u[u.Variants=32]="Variants",u[u.AtTheme=64]="AtTheme",u))(Pe||{});async function un(e,{base:r="",from:i,loadModule:t=za,loadStylesheet:n=Ma}={}){let l=0;e=[de({base:r},e)],l|=await ur(e,r,n,0,i!==void 0);let o=null,f=new mt,u=new Map,c=new Map,m=[],d=null,p=null,k=[],h=[],w=[],x=[],S=null;_(e,(y,K)=>{if(y.kind!=="at-rule")return;let N=et(K);if(y.name==="@tailwind"&&(y.params==="utilities"||y.params.startsWith("utilities"))){if(p!==null)return V.Replace([]);if(N.context.reference)return V.Replace([]);let P=L(y.params," ");for(let z of P)if(z.startsWith("source(")){let I=z.slice(7,-1);if(I==="none"){S=I;continue}if(I[0]==='"'&&I[I.length-1]!=='"'||I[0]==="'"&&I[I.length-1]!=="'"||I[0]!=="'"&&I[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");S={base:N.context.sourceBase??N.context.base,pattern:I.slice(1,-1)}}p=y,l|=16}if(y.name==="@utility"){if(N.parent!==null)throw new Error("`@utility` cannot be nested.");if(y.nodes.length===0)throw new Error(`\`@utility ${y.params}\` is empty. Utilities should include at least one property.`);let P=Jr(y);if(P===null){if(!y.params.endsWith("-*")){if(y.params.endsWith("*"))throw new Error(`\`@utility ${y.params}\` defines an invalid utility name. A functional utility must end in \`-*\`.`);if(y.params.includes("*"))throw new Error(`\`@utility ${y.params}\` defines an invalid utility name. The dynamic portion marked by \`-*\` must appear once at the end.`)}throw new Error(`\`@utility ${y.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`)}m.push(P)}if(y.name==="@source"){if(y.nodes.length>0)throw new Error("`@source` cannot have a body.");if(N.parent!==null)throw new Error("`@source` cannot be nested.");let P=!1,z=!1,I=y.params;if(I[0]==="n"&&I.startsWith("not ")&&(P=!0,I=I.slice(4)),I[0]==="i"&&I.startsWith("inline(")&&(z=!0,I=I.slice(7,-1)),I[0]==='"'&&I[I.length-1]!=='"'||I[0]==="'"&&I[I.length-1]!=="'"||I[0]!=="'"&&I[0]!=='"')throw new Error("`@source` paths must be quoted.");let M=I.slice(1,-1);if(z){let Y=P?x:w,G=L(M," ");for(let ae of G)for(let le of _t(ae))Y.push(le)}else h.push({base:N.context.base,pattern:M,negated:P});return V.ReplaceSkip([])}if(y.name==="@variant"&&(N.parent===null?y.nodes.length===0?y.name="@custom-variant":(_(y.nodes,P=>{if(P.kind==="at-rule"&&P.name==="@slot")return y.name="@custom-variant",V.Stop}),y.name==="@variant"&&k.push(y)):k.push(y)),y.name==="@custom-variant"){if(N.parent!==null)throw new Error("`@custom-variant` cannot be nested.");let[P,z]=L(y.params," ");if(!Vt.test(P))throw new Error(`\`@custom-variant ${P}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes, or underscore characters and start with a lowercase letter or number.`);if(y.nodes.length>0&&z)throw new Error(`\`@custom-variant ${P}\` cannot have both a selector and a body.`);if(y.nodes.length===0){if(!z)throw new Error(`\`@custom-variant ${P}\` has no selector or body.`);let I=L(z.slice(1,-1),",");if(I.length===0||I.some(G=>G.trim()===""))throw new Error(`\`@custom-variant ${P} (${I.join(",")})\` selector is invalid.`);let M=[],Y=[];for(let G of I)G=G.trim(),G[0]==="@"?M.push(G):Y.push(G);u.set(P,G=>{G.variants.static(P,ae=>{let le=[];Y.length>0&&le.push(q(Y.join(", "),ae.nodes));for(let s of M)le.push(Z(s,ae.nodes));ae.nodes=le},{compounds:Le([...Y,...M])})}),c.set(P,new Set)}else{let I=new Set;_(y.nodes,M=>{M.kind==="at-rule"&&M.name==="@variant"&&I.add(M.params)}),u.set(P,M=>{M.variants.fromAst(P,y.nodes,M)}),c.set(P,I)}return V.ReplaceSkip([])}if(y.name==="@media"){let P=L(y.params," "),z=[];for(let I of P)if(I.startsWith("source(")){let M=I.slice(7,-1);_(y.nodes,Y=>{if(Y.kind==="at-rule"&&Y.name==="@tailwind"&&Y.params==="utilities")return Y.params+=` source(${M})`,V.ReplaceStop([de({sourceBase:N.context.base},[Y])])})}else if(I.startsWith("theme(")){let M=I.slice(6,-1),Y=M.includes("reference");_(y.nodes,G=>{if(G.kind!=="context"){if(G.kind!=="at-rule"){if(Y)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return V.Continue}if(G.name==="@theme")return G.params+=" "+M,V.Skip}})}else if(I.startsWith("prefix(")){let M=I.slice(7,-1);_(y.nodes,Y=>{if(Y.kind==="at-rule"&&Y.name==="@theme")return Y.params+=` prefix(${M})`,V.Skip})}else I==="important"?o=!0:I==="reference"?y.nodes=[de({reference:!0},y.nodes)]:z.push(I);if(z.length>0)y.params=z.join(" ");else if(P.length>0)return V.Replace(y.nodes);return V.Continue}if(y.name==="@theme"){let[P,z]=ja(y.params);if(l|=64,N.context.reference&&(P|=2),z){if(!Ka.test(z))throw new Error(`The prefix "${z}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);f.prefix=z}return _(y.nodes,I=>{if(I.kind==="at-rule"&&I.name==="@keyframes")return f.addKeyframes(I),V.Skip;if(I.kind==="comment")return;if(I.kind==="declaration"&&I.property.startsWith("--")){f.add(Ve(I.property),I.value??"",P,I.src);return}let M=ie([F(y.name,y.params,[I])]).split(` +`).map((Y,G,ae)=>`${G===0||G>=ae.length-2?" ":">"} ${Y}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${M}`)}),d?V.ReplaceSkip([]):(d=q(":root, :host",[]),d.src=y.src,V.ReplaceSkip(d))}});let A=Ui(f,p?.src);if(o&&(A.important=o),x.length>0)for(let y of x)A.invalidCandidates.add(y);l|=await on({designSystem:A,base:r,ast:e,loadModule:t,sources:h});for(let y of u.keys())A.variants.static(y,()=>{});for(let y of sn(c,{onCircularDependency(K,N){let P=ie(K.map((z,I)=>F("@custom-variant",z,[F("@variant",K[I+1]??N,[])]))).replaceAll(";"," { \u2026 }").replace(`@custom-variant ${N} {`,`@custom-variant ${N} { /* \u2190 */`);throw new Error(`Circular dependency detected in custom variants: + +${P}`)}}))u.get(y)?.(A);for(let y of m)y(A);if(d){let y=[];for(let[N,P]of A.theme.entries()){if(P.options&2)continue;let z=a(xe(N),P.value);z.src=P.src,y.push(z)}let K=A.theme.getKeyframes();for(let N of K)e.push(de({theme:!0},[W([N])]));d.nodes=[de({theme:!0},y)]}if(l|=ot(e,A),l|=Fe(e,A),l|=$e(e,A),p){let y=p;y.kind="context",y.context={}}return _(e,y=>{if(y.kind==="at-rule")return y.name==="@utility"?V.Replace([]):V.Skip}),{designSystem:A,ast:e,sources:h,root:S,utilitiesNode:p,features:l,inlineCandidates:w}}async function cn(e,r={}){let{designSystem:i,ast:t,sources:n,root:l,utilitiesNode:o,features:f,inlineCandidates:u}=await un(e,r);t.unshift(dt(`! tailwindcss v${dr} | MIT License | https://tailwindcss.com `));function c(h){i.invalidCandidates.add(h)}let m=new Set,d=null,p=0,k=!1;for(let h of u)i.invalidCandidates.has(h)||(m.add(h),k=!0);return{sources:n,root:l,features:f,build(h){if(f===0)return e;if(!o)return d??=Re(t,i,r.polyfills),d;let w=k,x=!1;k=!1;let S=m.size;for(let y of h)if(!i.invalidCandidates.has(y))if(y[0]==="-"&&y[1]==="-"){let K=i.theme.markUsedVariable(y);w||=K,x||=K}else m.add(y),w||=m.size!==S;if(!w)return d??=Re(t,i,r.polyfills),d;let A=Te(m,i,{onInvalidCandidate:c}).astNodes;return r.from&&_(A,y=>{y.src??=o.src}),!x&&p===A.length?(d??=Re(t,i,r.polyfills),d):(p=A.length,o.nodes=A,d=Re(t,i,r.polyfills),d)}}}async function Fa(e,r={}){let i=Ne(e,{from:r.from}),t=await cn(i,r),n=i,l=e;return{...t,build(o){let f=t.build(o);return f===n||(l=ie(f,!!r.from),n=f),l},buildSourceMap(){return an({ast:n})}}}async function Wa(e,r={}){return(await un(Ne(e,{from:r.from}),r)).designSystem}function lt(){throw new Error("It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.")}for(let e in It)e!=="default"&&(lt[e]=It[e]);module.exports=lt; diff --git a/node_modules/tailwindcss/dist/lib.mjs b/node_modules/tailwindcss/dist/lib.mjs new file mode 100644 index 0000000..a3ec939 --- /dev/null +++ b/node_modules/tailwindcss/dist/lib.mjs @@ -0,0 +1 @@ +import{a,b,c,d,e,f}from"./chunk-CT46QCH7.mjs";import"./chunk-GFBUASX3.mjs";import"./chunk-HTB5LLOP.mjs";export{b as Features,a as Polyfills,e as __unstable__loadDesignSystem,d as compile,c as compileAst,f as default}; diff --git a/node_modules/tailwindcss/dist/plugin.d.mts b/node_modules/tailwindcss/dist/plugin.d.mts new file mode 100644 index 0000000..5c32fa7 --- /dev/null +++ b/node_modules/tailwindcss/dist/plugin.d.mts @@ -0,0 +1,11 @@ +export { P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs'; +import { a as PluginFn, C as Config, b as PluginWithConfig, c as PluginWithOptions } from './types-CJYAW1ql.mjs'; +export { d as PluginAPI, P as PluginsConfig, T as ThemeConfig } from './types-CJYAW1ql.mjs'; +import './colors.mjs'; + +declare function createPlugin(handler: PluginFn, config?: Partial): PluginWithConfig; +declare namespace createPlugin { + var withOptions: (pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial) => PluginWithOptions; +} + +export { Config, PluginFn as PluginCreator, createPlugin as default }; diff --git a/node_modules/tailwindcss/dist/plugin.d.ts b/node_modules/tailwindcss/dist/plugin.d.ts new file mode 100644 index 0000000..058f351 --- /dev/null +++ b/node_modules/tailwindcss/dist/plugin.d.ts @@ -0,0 +1,134 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-BIFUA2FY.js'; +import './colors-b_6i0Oi7.js'; + +/** + * The source code for one or more nodes in the AST + * + * This generally corresponds to a stylesheet + */ +interface Source { + /** + * The path to the file that contains the referenced source code + * + * If this references the *output* source code, this is `null`. + */ + file: string | null; + /** + * The referenced source code + */ + code: string; +} +/** + * The file and offsets within it that this node covers + * + * This can represent either: + * - A location in the original CSS which caused this node to be created + * - A location in the output CSS where this node resides + */ +type SourceLocation = [source: Source, start: number, end: number]; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; + src?: SourceLocation | undefined; +}; +type PluginWithOptions = { + (options?: T): PluginWithConfig; + __isOptionsFunction: true; +}; +type Plugin = PluginFn | PluginWithConfig | PluginWithOptions; +type PluginAPI = { + addBase(base: CssInJs): void; + addVariant(name: string, variant: string | string[] | CssInJs): void; + matchVariant(name: string, cb: (value: T | string, extra: { + modifier: string | null; + }) => string | string[], options?: { + values?: Record; + sort?(a: { + value: T | string; + modifier: string | null; + }, b: { + value: T | string; + modifier: string | null; + }): number; + }): void; + addUtilities(utilities: Record | Record[], options?: {}): void; + matchUtilities(utilities: Record CssInJs | CssInJs[]>, options?: Partial<{ + type: string | string[]; + supportsNegativeValues: boolean; + values: Record & { + __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined; + }; + modifiers: 'any' | Record; + }>): void; + addComponents(utilities: Record | Record[], options?: {}): void; + matchComponents(utilities: Record CssInJs>, options?: Partial<{ + type: string | string[]; + supportsNegativeValues: boolean; + values: Record & { + __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined; + }; + modifiers: 'any' | Record; + }>): void; + theme(path: string, defaultValue?: any): any; + config(path?: string, defaultValue?: any): any; + prefix(className: string): string; +}; +type CssInJs = { + [key: string]: string | string[] | CssInJs | CssInJs[]; +}; + +type ResolvableTo = T | ((utils: PluginUtils) => T); +type ThemeValue = ResolvableTo> | null | undefined; +type ThemeConfig = Record & { + extend?: Record; +}; +type ContentFile = string | { + raw: string; + extension?: string; +}; +type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]]; +interface UserConfig { + presets?: UserConfig[]; + theme?: ThemeConfig; + plugins?: Plugin[]; +} +interface UserConfig { + content?: ContentFile[] | { + relative?: boolean; + files: ContentFile[]; + }; +} +interface UserConfig { + darkMode?: DarkModeStrategy; +} +interface UserConfig { + prefix?: string; +} +interface UserConfig { + blocklist?: string[]; +} +interface UserConfig { + important?: boolean | string; +} +interface UserConfig { + future?: 'all' | Record; +} +interface UserConfig { + experimental?: 'all' | Record; +} + +declare function createPlugin(handler: PluginFn, config?: Partial): PluginWithConfig; +declare namespace createPlugin { + var withOptions: (pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial) => PluginWithOptions; +} + +export { createPlugin as default }; diff --git a/node_modules/tailwindcss/dist/plugin.js b/node_modules/tailwindcss/dist/plugin.js new file mode 100644 index 0000000..eca100c --- /dev/null +++ b/node_modules/tailwindcss/dist/plugin.js @@ -0,0 +1 @@ +"use strict";function g(i,n){return{handler:i,config:n}}g.withOptions=function(i,n=()=>({})){function t(o){return{handler:i(o),config:n(o)}}return t.__isOptionsFunction=!0,t};var u=g;module.exports=u; diff --git a/node_modules/tailwindcss/dist/plugin.mjs b/node_modules/tailwindcss/dist/plugin.mjs new file mode 100644 index 0000000..430fa25 --- /dev/null +++ b/node_modules/tailwindcss/dist/plugin.mjs @@ -0,0 +1 @@ +function g(i,n){return{handler:i,config:n}}g.withOptions=function(i,n=()=>({})){function t(o){return{handler:i(o),config:n(o)}}return t.__isOptionsFunction=!0,t};var u=g;export{u as default}; diff --git a/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts b/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts new file mode 100644 index 0000000..5d9dbe2 --- /dev/null +++ b/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts @@ -0,0 +1,29 @@ +import { _ as _default } from './colors-b_6i0Oi7.js'; + +type NamedUtilityValue = { + kind: 'named'; + /** + * ``` + * bg-red-500 + * ^^^^^^^ + * + * w-1/2 + * ^ + * ``` + */ + value: string; + /** + * ``` + * w-1/2 + * ^^^ + * ``` + */ + fraction: string | null; +}; + +type PluginUtils = { + theme: (keypath: string, defaultValue?: any) => any; + colors: typeof _default; +}; + +export type { NamedUtilityValue as N, PluginUtils as P }; diff --git a/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts b/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts new file mode 100644 index 0000000..e1cde16 --- /dev/null +++ b/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts @@ -0,0 +1,190 @@ +import _default from './colors.mjs'; + +type ArbitraryUtilityValue = { + kind: 'arbitrary'; + /** + * ``` + * bg-[color:var(--my-color)] + * ^^^^^ + * + * bg-(color:--my-color) + * ^^^^^ + * ``` + */ + dataType: string | null; + /** + * ``` + * bg-[#0088cc] + * ^^^^^^^ + * + * bg-[var(--my_variable)] + * ^^^^^^^^^^^^^^^^^^ + * + * bg-(--my_variable) + * ^^^^^^^^^^^^^^ + * ``` + */ + value: string; +}; +type NamedUtilityValue = { + kind: 'named'; + /** + * ``` + * bg-red-500 + * ^^^^^^^ + * + * w-1/2 + * ^ + * ``` + */ + value: string; + /** + * ``` + * w-1/2 + * ^^^ + * ``` + */ + fraction: string | null; +}; +type ArbitraryModifier = { + kind: 'arbitrary'; + /** + * ``` + * bg-red-500/[50%] + * ^^^ + * ``` + */ + value: string; +}; +type NamedModifier = { + kind: 'named'; + /** + * ``` + * bg-red-500/50 + * ^^ + * ``` + */ + value: string; +}; +type ArbitraryVariantValue = { + kind: 'arbitrary'; + value: string; +}; +type NamedVariantValue = { + kind: 'named'; + value: string; +}; +type Variant = +/** + * Arbitrary variants are variants that take a selector and generate a variant + * on the fly. + * + * E.g.: `[&_p]` + */ +{ + kind: 'arbitrary'; + selector: string; + relative: boolean; +} +/** + * Static variants are variants that don't take any arguments. + * + * E.g.: `hover` + */ + | { + kind: 'static'; + root: string; +} +/** + * Functional variants are variants that can take an argument. The argument is + * either a named variant value or an arbitrary variant value. + * + * E.g.: + * + * - `aria-disabled` + * - `aria-[disabled]` + * - `@container-size` -> @container, with named value `size` + * - `@container-[inline-size]` -> @container, with arbitrary variant value `inline-size` + * - `@container` -> @container, with no value + */ + | { + kind: 'functional'; + root: string; + value: ArbitraryVariantValue | NamedVariantValue | null; + modifier: ArbitraryModifier | NamedModifier | null; +} +/** + * Compound variants are variants that take another variant as an argument. + * + * E.g.: + * + * - `has-[&_p]` + * - `group-*` + * - `peer-*` + */ + | { + kind: 'compound'; + root: string; + modifier: ArbitraryModifier | NamedModifier | null; + variant: Variant; +}; +type Candidate = +/** + * Arbitrary candidates are candidates that register utilities on the fly with + * a property and a value. + * + * E.g.: + * + * - `[color:red]` + * - `[color:red]/50` + * - `[color:red]/50!` + */ +{ + kind: 'arbitrary'; + property: string; + value: string; + modifier: ArbitraryModifier | NamedModifier | null; + variants: Variant[]; + important: boolean; + raw: string; +} +/** + * Static candidates are candidates that don't take any arguments. + * + * E.g.: + * + * - `underline` + * - `box-border` + */ + | { + kind: 'static'; + root: string; + variants: Variant[]; + important: boolean; + raw: string; +} +/** + * Functional candidates are candidates that can take an argument. + * + * E.g.: + * + * - `bg-red-500` + * - `bg-[#0088cc]` + * - `w-1/2` + */ + | { + kind: 'functional'; + root: string; + value: ArbitraryUtilityValue | NamedUtilityValue | null; + modifier: ArbitraryModifier | NamedModifier | null; + variants: Variant[]; + important: boolean; + raw: string; +}; + +type PluginUtils = { + theme: (keypath: string, defaultValue?: any) => any; + colors: typeof _default; +}; + +export type { Candidate as C, NamedUtilityValue as N, PluginUtils as P, Variant as V }; diff --git a/node_modules/tailwindcss/dist/types-CJYAW1ql.d.mts b/node_modules/tailwindcss/dist/types-CJYAW1ql.d.mts new file mode 100644 index 0000000..6d5ca4a --- /dev/null +++ b/node_modules/tailwindcss/dist/types-CJYAW1ql.d.mts @@ -0,0 +1,128 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs'; + +/** + * The source code for one or more nodes in the AST + * + * This generally corresponds to a stylesheet + */ +interface Source { + /** + * The path to the file that contains the referenced source code + * + * If this references the *output* source code, this is `null`. + */ + file: string | null; + /** + * The referenced source code + */ + code: string; +} +/** + * The file and offsets within it that this node covers + * + * This can represent either: + * - A location in the original CSS which caused this node to be created + * - A location in the output CSS where this node resides + */ +type SourceLocation = [source: Source, start: number, end: number]; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; + src?: SourceLocation | undefined; +}; +type PluginWithOptions = { + (options?: T): PluginWithConfig; + __isOptionsFunction: true; +}; +type Plugin = PluginFn | PluginWithConfig | PluginWithOptions; +type PluginAPI = { + addBase(base: CssInJs): void; + addVariant(name: string, variant: string | string[] | CssInJs): void; + matchVariant(name: string, cb: (value: T | string, extra: { + modifier: string | null; + }) => string | string[], options?: { + values?: Record; + sort?(a: { + value: T | string; + modifier: string | null; + }, b: { + value: T | string; + modifier: string | null; + }): number; + }): void; + addUtilities(utilities: Record | Record[], options?: {}): void; + matchUtilities(utilities: Record CssInJs | CssInJs[]>, options?: Partial<{ + type: string | string[]; + supportsNegativeValues: boolean; + values: Record & { + __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined; + }; + modifiers: 'any' | Record; + }>): void; + addComponents(utilities: Record | Record[], options?: {}): void; + matchComponents(utilities: Record CssInJs>, options?: Partial<{ + type: string | string[]; + supportsNegativeValues: boolean; + values: Record & { + __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined; + }; + modifiers: 'any' | Record; + }>): void; + theme(path: string, defaultValue?: any): any; + config(path?: string, defaultValue?: any): any; + prefix(className: string): string; +}; +type CssInJs = { + [key: string]: string | string[] | CssInJs | CssInJs[]; +}; + +type ResolvableTo = T | ((utils: PluginUtils) => T); +type ThemeValue = ResolvableTo> | null | undefined; +type ThemeConfig = Record & { + extend?: Record; +}; +type ContentFile = string | { + raw: string; + extension?: string; +}; +type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]]; +interface UserConfig { + presets?: UserConfig[]; + theme?: ThemeConfig; + plugins?: Plugin[]; +} +interface UserConfig { + content?: ContentFile[] | { + relative?: boolean; + files: ContentFile[]; + }; +} +interface UserConfig { + darkMode?: DarkModeStrategy; +} +interface UserConfig { + prefix?: string; +} +interface UserConfig { + blocklist?: string[]; +} +interface UserConfig { + important?: boolean | string; +} +interface UserConfig { + future?: 'all' | Record; +} +interface UserConfig { + experimental?: 'all' | Record; +} + +export type { Config as C, Plugin as P, SourceLocation as S, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d }; diff --git a/node_modules/tailwindcss/index.css b/node_modules/tailwindcss/index.css new file mode 100644 index 0000000..a8369c1 --- /dev/null +++ b/node_modules/tailwindcss/index.css @@ -0,0 +1,896 @@ +@layer theme, base, components, utilities; + +@layer theme { + @theme default { + --font-sans: + ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; + --font-mono: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; + + --color-red-50: oklch(97.1% 0.013 17.38); + --color-red-100: oklch(93.6% 0.032 17.717); + --color-red-200: oklch(88.5% 0.062 18.334); + --color-red-300: oklch(80.8% 0.114 19.571); + --color-red-400: oklch(70.4% 0.191 22.216); + --color-red-500: oklch(63.7% 0.237 25.331); + --color-red-600: oklch(57.7% 0.245 27.325); + --color-red-700: oklch(50.5% 0.213 27.518); + --color-red-800: oklch(44.4% 0.177 26.899); + --color-red-900: oklch(39.6% 0.141 25.723); + --color-red-950: oklch(25.8% 0.092 26.042); + + --color-orange-50: oklch(98% 0.016 73.684); + --color-orange-100: oklch(95.4% 0.038 75.164); + --color-orange-200: oklch(90.1% 0.076 70.697); + --color-orange-300: oklch(83.7% 0.128 66.29); + --color-orange-400: oklch(75% 0.183 55.934); + --color-orange-500: oklch(70.5% 0.213 47.604); + --color-orange-600: oklch(64.6% 0.222 41.116); + --color-orange-700: oklch(55.3% 0.195 38.402); + --color-orange-800: oklch(47% 0.157 37.304); + --color-orange-900: oklch(40.8% 0.123 38.172); + --color-orange-950: oklch(26.6% 0.079 36.259); + + --color-amber-50: oklch(98.7% 0.022 95.277); + --color-amber-100: oklch(96.2% 0.059 95.617); + --color-amber-200: oklch(92.4% 0.12 95.746); + --color-amber-300: oklch(87.9% 0.169 91.605); + --color-amber-400: oklch(82.8% 0.189 84.429); + --color-amber-500: oklch(76.9% 0.188 70.08); + --color-amber-600: oklch(66.6% 0.179 58.318); + --color-amber-700: oklch(55.5% 0.163 48.998); + --color-amber-800: oklch(47.3% 0.137 46.201); + --color-amber-900: oklch(41.4% 0.112 45.904); + --color-amber-950: oklch(27.9% 0.077 45.635); + + --color-yellow-50: oklch(98.7% 0.026 102.212); + --color-yellow-100: oklch(97.3% 0.071 103.193); + --color-yellow-200: oklch(94.5% 0.129 101.54); + --color-yellow-300: oklch(90.5% 0.182 98.111); + --color-yellow-400: oklch(85.2% 0.199 91.936); + --color-yellow-500: oklch(79.5% 0.184 86.047); + --color-yellow-600: oklch(68.1% 0.162 75.834); + --color-yellow-700: oklch(55.4% 0.135 66.442); + --color-yellow-800: oklch(47.6% 0.114 61.907); + --color-yellow-900: oklch(42.1% 0.095 57.708); + --color-yellow-950: oklch(28.6% 0.066 53.813); + + --color-lime-50: oklch(98.6% 0.031 120.757); + --color-lime-100: oklch(96.7% 0.067 122.328); + --color-lime-200: oklch(93.8% 0.127 124.321); + --color-lime-300: oklch(89.7% 0.196 126.665); + --color-lime-400: oklch(84.1% 0.238 128.85); + --color-lime-500: oklch(76.8% 0.233 130.85); + --color-lime-600: oklch(64.8% 0.2 131.684); + --color-lime-700: oklch(53.2% 0.157 131.589); + --color-lime-800: oklch(45.3% 0.124 130.933); + --color-lime-900: oklch(40.5% 0.101 131.063); + --color-lime-950: oklch(27.4% 0.072 132.109); + + --color-green-50: oklch(98.2% 0.018 155.826); + --color-green-100: oklch(96.2% 0.044 156.743); + --color-green-200: oklch(92.5% 0.084 155.995); + --color-green-300: oklch(87.1% 0.15 154.449); + --color-green-400: oklch(79.2% 0.209 151.711); + --color-green-500: oklch(72.3% 0.219 149.579); + --color-green-600: oklch(62.7% 0.194 149.214); + --color-green-700: oklch(52.7% 0.154 150.069); + --color-green-800: oklch(44.8% 0.119 151.328); + --color-green-900: oklch(39.3% 0.095 152.535); + --color-green-950: oklch(26.6% 0.065 152.934); + + --color-emerald-50: oklch(97.9% 0.021 166.113); + --color-emerald-100: oklch(95% 0.052 163.051); + --color-emerald-200: oklch(90.5% 0.093 164.15); + --color-emerald-300: oklch(84.5% 0.143 164.978); + --color-emerald-400: oklch(76.5% 0.177 163.223); + --color-emerald-500: oklch(69.6% 0.17 162.48); + --color-emerald-600: oklch(59.6% 0.145 163.225); + --color-emerald-700: oklch(50.8% 0.118 165.612); + --color-emerald-800: oklch(43.2% 0.095 166.913); + --color-emerald-900: oklch(37.8% 0.077 168.94); + --color-emerald-950: oklch(26.2% 0.051 172.552); + + --color-teal-50: oklch(98.4% 0.014 180.72); + --color-teal-100: oklch(95.3% 0.051 180.801); + --color-teal-200: oklch(91% 0.096 180.426); + --color-teal-300: oklch(85.5% 0.138 181.071); + --color-teal-400: oklch(77.7% 0.152 181.912); + --color-teal-500: oklch(70.4% 0.14 182.503); + --color-teal-600: oklch(60% 0.118 184.704); + --color-teal-700: oklch(51.1% 0.096 186.391); + --color-teal-800: oklch(43.7% 0.078 188.216); + --color-teal-900: oklch(38.6% 0.063 188.416); + --color-teal-950: oklch(27.7% 0.046 192.524); + + --color-cyan-50: oklch(98.4% 0.019 200.873); + --color-cyan-100: oklch(95.6% 0.045 203.388); + --color-cyan-200: oklch(91.7% 0.08 205.041); + --color-cyan-300: oklch(86.5% 0.127 207.078); + --color-cyan-400: oklch(78.9% 0.154 211.53); + --color-cyan-500: oklch(71.5% 0.143 215.221); + --color-cyan-600: oklch(60.9% 0.126 221.723); + --color-cyan-700: oklch(52% 0.105 223.128); + --color-cyan-800: oklch(45% 0.085 224.283); + --color-cyan-900: oklch(39.8% 0.07 227.392); + --color-cyan-950: oklch(30.2% 0.056 229.695); + + --color-sky-50: oklch(97.7% 0.013 236.62); + --color-sky-100: oklch(95.1% 0.026 236.824); + --color-sky-200: oklch(90.1% 0.058 230.902); + --color-sky-300: oklch(82.8% 0.111 230.318); + --color-sky-400: oklch(74.6% 0.16 232.661); + --color-sky-500: oklch(68.5% 0.169 237.323); + --color-sky-600: oklch(58.8% 0.158 241.966); + --color-sky-700: oklch(50% 0.134 242.749); + --color-sky-800: oklch(44.3% 0.11 240.79); + --color-sky-900: oklch(39.1% 0.09 240.876); + --color-sky-950: oklch(29.3% 0.066 243.157); + + --color-blue-50: oklch(97% 0.014 254.604); + --color-blue-100: oklch(93.2% 0.032 255.585); + --color-blue-200: oklch(88.2% 0.059 254.128); + --color-blue-300: oklch(80.9% 0.105 251.813); + --color-blue-400: oklch(70.7% 0.165 254.624); + --color-blue-500: oklch(62.3% 0.214 259.815); + --color-blue-600: oklch(54.6% 0.245 262.881); + --color-blue-700: oklch(48.8% 0.243 264.376); + --color-blue-800: oklch(42.4% 0.199 265.638); + --color-blue-900: oklch(37.9% 0.146 265.522); + --color-blue-950: oklch(28.2% 0.091 267.935); + + --color-indigo-50: oklch(96.2% 0.018 272.314); + --color-indigo-100: oklch(93% 0.034 272.788); + --color-indigo-200: oklch(87% 0.065 274.039); + --color-indigo-300: oklch(78.5% 0.115 274.713); + --color-indigo-400: oklch(67.3% 0.182 276.935); + --color-indigo-500: oklch(58.5% 0.233 277.117); + --color-indigo-600: oklch(51.1% 0.262 276.966); + --color-indigo-700: oklch(45.7% 0.24 277.023); + --color-indigo-800: oklch(39.8% 0.195 277.366); + --color-indigo-900: oklch(35.9% 0.144 278.697); + --color-indigo-950: oklch(25.7% 0.09 281.288); + + --color-violet-50: oklch(96.9% 0.016 293.756); + --color-violet-100: oklch(94.3% 0.029 294.588); + --color-violet-200: oklch(89.4% 0.057 293.283); + --color-violet-300: oklch(81.1% 0.111 293.571); + --color-violet-400: oklch(70.2% 0.183 293.541); + --color-violet-500: oklch(60.6% 0.25 292.717); + --color-violet-600: oklch(54.1% 0.281 293.009); + --color-violet-700: oklch(49.1% 0.27 292.581); + --color-violet-800: oklch(43.2% 0.232 292.759); + --color-violet-900: oklch(38% 0.189 293.745); + --color-violet-950: oklch(28.3% 0.141 291.089); + + --color-purple-50: oklch(97.7% 0.014 308.299); + --color-purple-100: oklch(94.6% 0.033 307.174); + --color-purple-200: oklch(90.2% 0.063 306.703); + --color-purple-300: oklch(82.7% 0.119 306.383); + --color-purple-400: oklch(71.4% 0.203 305.504); + --color-purple-500: oklch(62.7% 0.265 303.9); + --color-purple-600: oklch(55.8% 0.288 302.321); + --color-purple-700: oklch(49.6% 0.265 301.924); + --color-purple-800: oklch(43.8% 0.218 303.724); + --color-purple-900: oklch(38.1% 0.176 304.987); + --color-purple-950: oklch(29.1% 0.149 302.717); + + --color-fuchsia-50: oklch(97.7% 0.017 320.058); + --color-fuchsia-100: oklch(95.2% 0.037 318.852); + --color-fuchsia-200: oklch(90.3% 0.076 319.62); + --color-fuchsia-300: oklch(83.3% 0.145 321.434); + --color-fuchsia-400: oklch(74% 0.238 322.16); + --color-fuchsia-500: oklch(66.7% 0.295 322.15); + --color-fuchsia-600: oklch(59.1% 0.293 322.896); + --color-fuchsia-700: oklch(51.8% 0.253 323.949); + --color-fuchsia-800: oklch(45.2% 0.211 324.591); + --color-fuchsia-900: oklch(40.1% 0.17 325.612); + --color-fuchsia-950: oklch(29.3% 0.136 325.661); + + --color-pink-50: oklch(97.1% 0.014 343.198); + --color-pink-100: oklch(94.8% 0.028 342.258); + --color-pink-200: oklch(89.9% 0.061 343.231); + --color-pink-300: oklch(82.3% 0.12 346.018); + --color-pink-400: oklch(71.8% 0.202 349.761); + --color-pink-500: oklch(65.6% 0.241 354.308); + --color-pink-600: oklch(59.2% 0.249 0.584); + --color-pink-700: oklch(52.5% 0.223 3.958); + --color-pink-800: oklch(45.9% 0.187 3.815); + --color-pink-900: oklch(40.8% 0.153 2.432); + --color-pink-950: oklch(28.4% 0.109 3.907); + + --color-rose-50: oklch(96.9% 0.015 12.422); + --color-rose-100: oklch(94.1% 0.03 12.58); + --color-rose-200: oklch(89.2% 0.058 10.001); + --color-rose-300: oklch(81% 0.117 11.638); + --color-rose-400: oklch(71.2% 0.194 13.428); + --color-rose-500: oklch(64.5% 0.246 16.439); + --color-rose-600: oklch(58.6% 0.253 17.585); + --color-rose-700: oklch(51.4% 0.222 16.935); + --color-rose-800: oklch(45.5% 0.188 13.697); + --color-rose-900: oklch(41% 0.159 10.272); + --color-rose-950: oklch(27.1% 0.105 12.094); + + --color-slate-50: oklch(98.4% 0.003 247.858); + --color-slate-100: oklch(96.8% 0.007 247.896); + --color-slate-200: oklch(92.9% 0.013 255.508); + --color-slate-300: oklch(86.9% 0.022 252.894); + --color-slate-400: oklch(70.4% 0.04 256.788); + --color-slate-500: oklch(55.4% 0.046 257.417); + --color-slate-600: oklch(44.6% 0.043 257.281); + --color-slate-700: oklch(37.2% 0.044 257.287); + --color-slate-800: oklch(27.9% 0.041 260.031); + --color-slate-900: oklch(20.8% 0.042 265.755); + --color-slate-950: oklch(12.9% 0.042 264.695); + + --color-gray-50: oklch(98.5% 0.002 247.839); + --color-gray-100: oklch(96.7% 0.003 264.542); + --color-gray-200: oklch(92.8% 0.006 264.531); + --color-gray-300: oklch(87.2% 0.01 258.338); + --color-gray-400: oklch(70.7% 0.022 261.325); + --color-gray-500: oklch(55.1% 0.027 264.364); + --color-gray-600: oklch(44.6% 0.03 256.802); + --color-gray-700: oklch(37.3% 0.034 259.733); + --color-gray-800: oklch(27.8% 0.033 256.848); + --color-gray-900: oklch(21% 0.034 264.665); + --color-gray-950: oklch(13% 0.028 261.692); + + --color-zinc-50: oklch(98.5% 0 0); + --color-zinc-100: oklch(96.7% 0.001 286.375); + --color-zinc-200: oklch(92% 0.004 286.32); + --color-zinc-300: oklch(87.1% 0.006 286.286); + --color-zinc-400: oklch(70.5% 0.015 286.067); + --color-zinc-500: oklch(55.2% 0.016 285.938); + --color-zinc-600: oklch(44.2% 0.017 285.786); + --color-zinc-700: oklch(37% 0.013 285.805); + --color-zinc-800: oklch(27.4% 0.006 286.033); + --color-zinc-900: oklch(21% 0.006 285.885); + --color-zinc-950: oklch(14.1% 0.005 285.823); + + --color-neutral-50: oklch(98.5% 0 0); + --color-neutral-100: oklch(97% 0 0); + --color-neutral-200: oklch(92.2% 0 0); + --color-neutral-300: oklch(87% 0 0); + --color-neutral-400: oklch(70.8% 0 0); + --color-neutral-500: oklch(55.6% 0 0); + --color-neutral-600: oklch(43.9% 0 0); + --color-neutral-700: oklch(37.1% 0 0); + --color-neutral-800: oklch(26.9% 0 0); + --color-neutral-900: oklch(20.5% 0 0); + --color-neutral-950: oklch(14.5% 0 0); + + --color-stone-50: oklch(98.5% 0.001 106.423); + --color-stone-100: oklch(97% 0.001 106.424); + --color-stone-200: oklch(92.3% 0.003 48.717); + --color-stone-300: oklch(86.9% 0.005 56.366); + --color-stone-400: oklch(70.9% 0.01 56.259); + --color-stone-500: oklch(55.3% 0.013 58.071); + --color-stone-600: oklch(44.4% 0.011 73.639); + --color-stone-700: oklch(37.4% 0.01 67.558); + --color-stone-800: oklch(26.8% 0.007 34.298); + --color-stone-900: oklch(21.6% 0.006 56.043); + --color-stone-950: oklch(14.7% 0.004 49.25); + + --color-black: #000; + --color-white: #fff; + + --spacing: 0.25rem; + + --breakpoint-sm: 40rem; + --breakpoint-md: 48rem; + --breakpoint-lg: 64rem; + --breakpoint-xl: 80rem; + --breakpoint-2xl: 96rem; + + --container-3xs: 16rem; + --container-2xs: 18rem; + --container-xs: 20rem; + --container-sm: 24rem; + --container-md: 28rem; + --container-lg: 32rem; + --container-xl: 36rem; + --container-2xl: 42rem; + --container-3xl: 48rem; + --container-4xl: 56rem; + --container-5xl: 64rem; + --container-6xl: 72rem; + --container-7xl: 80rem; + + --text-xs: 0.75rem; + --text-xs--line-height: calc(1 / 0.75); + --text-sm: 0.875rem; + --text-sm--line-height: calc(1.25 / 0.875); + --text-base: 1rem; + --text-base--line-height: calc(1.5 / 1); + --text-lg: 1.125rem; + --text-lg--line-height: calc(1.75 / 1.125); + --text-xl: 1.25rem; + --text-xl--line-height: calc(1.75 / 1.25); + --text-2xl: 1.5rem; + --text-2xl--line-height: calc(2 / 1.5); + --text-3xl: 1.875rem; + --text-3xl--line-height: calc(2.25 / 1.875); + --text-4xl: 2.25rem; + --text-4xl--line-height: calc(2.5 / 2.25); + --text-5xl: 3rem; + --text-5xl--line-height: 1; + --text-6xl: 3.75rem; + --text-6xl--line-height: 1; + --text-7xl: 4.5rem; + --text-7xl--line-height: 1; + --text-8xl: 6rem; + --text-8xl--line-height: 1; + --text-9xl: 8rem; + --text-9xl--line-height: 1; + + --font-weight-thin: 100; + --font-weight-extralight: 200; + --font-weight-light: 300; + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --font-weight-extrabold: 800; + --font-weight-black: 900; + + --tracking-tighter: -0.05em; + --tracking-tight: -0.025em; + --tracking-normal: 0em; + --tracking-wide: 0.025em; + --tracking-wider: 0.05em; + --tracking-widest: 0.1em; + + --leading-tight: 1.25; + --leading-snug: 1.375; + --leading-normal: 1.5; + --leading-relaxed: 1.625; + --leading-loose: 2; + + --radius-xs: 0.125rem; + --radius-sm: 0.25rem; + --radius-md: 0.375rem; + --radius-lg: 0.5rem; + --radius-xl: 0.75rem; + --radius-2xl: 1rem; + --radius-3xl: 1.5rem; + --radius-4xl: 2rem; + + --shadow-2xs: 0 1px rgb(0 0 0 / 0.05); + --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --shadow-md: + 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --shadow-lg: + 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --shadow-xl: + 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); + --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); + + --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05); + --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05); + --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05); + + --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05); + --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15); + --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12); + --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15); + --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1); + --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15); + + --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15); + --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2); + --text-shadow-sm: + 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), + 0px 2px 2px rgb(0 0 0 / 0.075); + --text-shadow-md: + 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), + 0px 2px 4px rgb(0 0 0 / 0.1); + --text-shadow-lg: + 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), + 0px 4px 8px rgb(0 0 0 / 0.1); + + --ease-in: cubic-bezier(0.4, 0, 1, 1); + --ease-out: cubic-bezier(0, 0, 0.2, 1); + --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); + + --animate-spin: spin 1s linear infinite; + --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; + --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; + --animate-bounce: bounce 1s infinite; + + @keyframes spin { + to { + transform: rotate(360deg); + } + } + + @keyframes ping { + 75%, + 100% { + transform: scale(2); + opacity: 0; + } + } + + @keyframes pulse { + 50% { + opacity: 0.5; + } + } + + @keyframes bounce { + 0%, + 100% { + transform: translateY(-25%); + animation-timing-function: cubic-bezier(0.8, 0, 1, 1); + } + + 50% { + transform: none; + animation-timing-function: cubic-bezier(0, 0, 0.2, 1); + } + } + + --blur-xs: 4px; + --blur-sm: 8px; + --blur-md: 12px; + --blur-lg: 16px; + --blur-xl: 24px; + --blur-2xl: 40px; + --blur-3xl: 64px; + + --perspective-dramatic: 100px; + --perspective-near: 300px; + --perspective-normal: 500px; + --perspective-midrange: 800px; + --perspective-distant: 1200px; + + --aspect-video: 16 / 9; + + --default-transition-duration: 150ms; + --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + --default-font-family: --theme(--font-sans, initial); + --default-font-feature-settings: --theme( + --font-sans--font-feature-settings, + initial + ); + --default-font-variation-settings: --theme( + --font-sans--font-variation-settings, + initial + ); + --default-mono-font-family: --theme(--font-mono, initial); + --default-mono-font-feature-settings: --theme( + --font-mono--font-feature-settings, + initial + ); + --default-mono-font-variation-settings: --theme( + --font-mono--font-variation-settings, + initial + ); + } + + /* Deprecated */ + @theme default inline reference { + --blur: 8px; + --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05); + --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06); + --radius: 0.25rem; + --max-width-prose: 65ch; + } +} + +@layer base { + /* + 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) + 2. Remove default margins and padding + 3. Reset all borders. +*/ + + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + box-sizing: border-box; /* 1 */ + margin: 0; /* 2 */ + padding: 0; /* 2 */ + border: 0 solid; /* 3 */ + } + + /* + 1. Use a consistent sensible line-height in all browsers. + 2. Prevent adjustments of font size after orientation changes in iOS. + 3. Use a more readable tab size. + 4. Use the user's configured `sans` font-family by default. + 5. Use the user's configured `sans` font-feature-settings by default. + 6. Use the user's configured `sans` font-variation-settings by default. + 7. Disable tap highlights on iOS. +*/ + + html, + :host { + line-height: 1.5; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + tab-size: 4; /* 3 */ + font-family: --theme( + --default-font-family, + ui-sans-serif, + system-ui, + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + "Segoe UI Symbol", + "Noto Color Emoji" + ); /* 4 */ + font-feature-settings: --theme( + --default-font-feature-settings, + normal + ); /* 5 */ + font-variation-settings: --theme( + --default-font-variation-settings, + normal + ); /* 6 */ + -webkit-tap-highlight-color: transparent; /* 7 */ + } + + /* + 1. Add the correct height in Firefox. + 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) + 3. Reset the default border style to a 1px solid border. +*/ + + hr { + height: 0; /* 1 */ + color: inherit; /* 2 */ + border-top-width: 1px; /* 3 */ + } + + /* + Add the correct text decoration in Chrome, Edge, and Safari. +*/ + + abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + /* + Remove the default font size and weight for headings. +*/ + + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: inherit; + font-weight: inherit; + } + + /* + Reset links to optimize for opt-in styling instead of opt-out. +*/ + + a { + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + } + + /* + Add the correct font weight in Edge and Safari. +*/ + + b, + strong { + font-weight: bolder; + } + + /* + 1. Use the user's configured `mono` font-family by default. + 2. Use the user's configured `mono` font-feature-settings by default. + 3. Use the user's configured `mono` font-variation-settings by default. + 4. Correct the odd `em` font sizing in all browsers. +*/ + + code, + kbd, + samp, + pre { + font-family: --theme( + --default-mono-font-family, + ui-monospace, + SFMono-Regular, + Menlo, + Monaco, + Consolas, + "Liberation Mono", + "Courier New", + monospace + ); /* 1 */ + font-feature-settings: --theme( + --default-mono-font-feature-settings, + normal + ); /* 2 */ + font-variation-settings: --theme( + --default-mono-font-variation-settings, + normal + ); /* 3 */ + font-size: 1em; /* 4 */ + } + + /* + Add the correct font size in all browsers. +*/ + + small { + font-size: 80%; + } + + /* + Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + /* + 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) + 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) + 3. Remove gaps between table borders by default. +*/ + + table { + text-indent: 0; /* 1 */ + border-color: inherit; /* 2 */ + border-collapse: collapse; /* 3 */ + } + + /* + Use the modern Firefox focus style for all focusable elements. +*/ + + :-moz-focusring { + outline: auto; + } + + /* + Add the correct vertical alignment in Chrome and Firefox. +*/ + + progress { + vertical-align: baseline; + } + + /* + Add the correct display in Chrome and Safari. +*/ + + summary { + display: list-item; + } + + /* + Make lists unstyled by default. +*/ + + ol, + ul, + menu { + list-style: none; + } + + /* + 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) + 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + + img, + svg, + video, + canvas, + audio, + iframe, + embed, + object { + display: block; /* 1 */ + vertical-align: middle; /* 2 */ + } + + /* + Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + + img, + video { + max-width: 100%; + height: auto; + } + + /* + 1. Inherit font styles in all browsers. + 2. Remove border radius in all browsers. + 3. Remove background color in all browsers. + 4. Ensure consistent opacity for disabled states in all browsers. +*/ + + button, + input, + select, + optgroup, + textarea, + ::file-selector-button { + font: inherit; /* 1 */ + font-feature-settings: inherit; /* 1 */ + font-variation-settings: inherit; /* 1 */ + letter-spacing: inherit; /* 1 */ + color: inherit; /* 1 */ + border-radius: 0; /* 2 */ + background-color: transparent; /* 3 */ + opacity: 1; /* 4 */ + } + + /* + Restore default font weight. +*/ + + :where(select:is([multiple], [size])) optgroup { + font-weight: bolder; + } + + /* + Restore indentation. +*/ + + :where(select:is([multiple], [size])) optgroup option { + padding-inline-start: 20px; + } + + /* + Restore space after button. +*/ + + ::file-selector-button { + margin-inline-end: 4px; + } + + /* + Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +*/ + + ::placeholder { + opacity: 1; + } + + /* + Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not + crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194) +*/ + + @supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or + (contain-intrinsic-size: 1px) /* Safari 17+ */ { + ::placeholder { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + } + + /* + Prevent resizing textareas horizontally by default. +*/ + + textarea { + resize: vertical; + } + + /* + Remove the inner padding in Chrome and Safari on macOS. +*/ + + ::-webkit-search-decoration { + -webkit-appearance: none; + } + + /* + 1. Ensure date/time inputs have the same height when empty in iOS Safari. + 2. Ensure text alignment can be changed on date/time inputs in iOS Safari. +*/ + + ::-webkit-date-and-time-value { + min-height: 1lh; /* 1 */ + text-align: inherit; /* 2 */ + } + + /* + Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`. +*/ + + ::-webkit-datetime-edit { + display: inline-flex; + } + + /* + Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers. +*/ + + ::-webkit-datetime-edit-fields-wrapper { + padding: 0; + } + + ::-webkit-datetime-edit, + ::-webkit-datetime-edit-year-field, + ::-webkit-datetime-edit-month-field, + ::-webkit-datetime-edit-day-field, + ::-webkit-datetime-edit-hour-field, + ::-webkit-datetime-edit-minute-field, + ::-webkit-datetime-edit-second-field, + ::-webkit-datetime-edit-millisecond-field, + ::-webkit-datetime-edit-meridiem-field { + padding-block: 0; + } + + /* + Center dropdown marker shown on inputs with paired ``s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499) +*/ + + ::-webkit-calendar-picker-indicator { + line-height: 1; + } + + /* + Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + + :-moz-ui-invalid { + box-shadow: none; + } + + /* + Correct the inability to style the border radius in iOS Safari. +*/ + + button, + input:where([type="button"], [type="reset"], [type="submit"]), + ::file-selector-button { + appearance: button; + } + + /* + Correct the cursor style of increment and decrement buttons in Safari. +*/ + + ::-webkit-inner-spin-button, + ::-webkit-outer-spin-button { + height: auto; + } + + /* + Make elements with the HTML hidden attribute stay hidden by default. +*/ + + [hidden]:where(:not([hidden="until-found"])) { + display: none !important; + } +} + +@layer utilities { + @tailwind utilities; +} diff --git a/node_modules/tailwindcss/package.json b/node_modules/tailwindcss/package.json new file mode 100644 index 0000000..9dab906 --- /dev/null +++ b/node_modules/tailwindcss/package.json @@ -0,0 +1,89 @@ +{ + "name": "tailwindcss", + "version": "4.1.18", + "description": "A utility-first CSS framework for rapidly building custom user interfaces.", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tailwindlabs/tailwindcss.git", + "directory": "packages/tailwindcss" + }, + "bugs": "https://github.com/tailwindlabs/tailwindcss/issues", + "homepage": "https://tailwindcss.com", + "exports": { + ".": { + "types": "./dist/lib.d.mts", + "style": "./index.css", + "require": "./dist/lib.js", + "import": "./dist/lib.mjs" + }, + "./plugin": { + "require": "./dist/plugin.js", + "import": "./dist/plugin.mjs" + }, + "./plugin.js": { + "require": "./dist/plugin.js", + "import": "./dist/plugin.mjs" + }, + "./defaultTheme": { + "require": "./dist/default-theme.js", + "import": "./dist/default-theme.mjs" + }, + "./defaultTheme.js": { + "require": "./dist/default-theme.js", + "import": "./dist/default-theme.mjs" + }, + "./colors": { + "require": "./dist/colors.js", + "import": "./dist/colors.mjs" + }, + "./colors.js": { + "require": "./dist/colors.js", + "import": "./dist/colors.mjs" + }, + "./lib/util/flattenColorPalette": { + "require": "./dist/flatten-color-palette.js", + "import": "./dist/flatten-color-palette.mjs" + }, + "./lib/util/flattenColorPalette.js": { + "require": "./dist/flatten-color-palette.js", + "import": "./dist/flatten-color-palette.mjs" + }, + "./package.json": "./package.json", + "./index.css": "./index.css", + "./index": "./index.css", + "./preflight.css": "./preflight.css", + "./preflight": "./preflight.css", + "./theme.css": "./theme.css", + "./theme": "./theme.css", + "./utilities.css": "./utilities.css", + "./utilities": "./utilities.css" + }, + "publishConfig": { + "provenance": true, + "access": "public" + }, + "style": "index.css", + "files": [ + "dist", + "index.css", + "preflight.css", + "theme.css", + "utilities.css" + ], + "devDependencies": { + "@jridgewell/remapping": "^2.3.4", + "@types/node": "^20.19.0", + "dedent": "1.7.0", + "lightningcss": "1.30.2", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "@tailwindcss/oxide": "^4.1.18" + }, + "scripts": { + "lint": "tsc --noEmit", + "build": "tsup-node --env.NODE_ENV production", + "dev": "tsup-node --env.NODE_ENV development --watch", + "test:ui": "playwright test" + } +} \ No newline at end of file diff --git a/node_modules/tailwindcss/preflight.css b/node_modules/tailwindcss/preflight.css new file mode 100644 index 0000000..753e79e --- /dev/null +++ b/node_modules/tailwindcss/preflight.css @@ -0,0 +1,393 @@ +/* + 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) + 2. Remove default margins and padding + 3. Reset all borders. +*/ + +*, +::after, +::before, +::backdrop, +::file-selector-button { + box-sizing: border-box; /* 1 */ + margin: 0; /* 2 */ + padding: 0; /* 2 */ + border: 0 solid; /* 3 */ +} + +/* + 1. Use a consistent sensible line-height in all browsers. + 2. Prevent adjustments of font size after orientation changes in iOS. + 3. Use a more readable tab size. + 4. Use the user's configured `sans` font-family by default. + 5. Use the user's configured `sans` font-feature-settings by default. + 6. Use the user's configured `sans` font-variation-settings by default. + 7. Disable tap highlights on iOS. +*/ + +html, +:host { + line-height: 1.5; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + tab-size: 4; /* 3 */ + font-family: --theme( + --default-font-family, + ui-sans-serif, + system-ui, + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol', + 'Noto Color Emoji' + ); /* 4 */ + font-feature-settings: --theme(--default-font-feature-settings, normal); /* 5 */ + font-variation-settings: --theme(--default-font-variation-settings, normal); /* 6 */ + -webkit-tap-highlight-color: transparent; /* 7 */ +} + +/* + 1. Add the correct height in Firefox. + 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) + 3. Reset the default border style to a 1px solid border. +*/ + +hr { + height: 0; /* 1 */ + color: inherit; /* 2 */ + border-top-width: 1px; /* 3 */ +} + +/* + Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* + Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* + Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; +} + +/* + Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* + 1. Use the user's configured `mono` font-family by default. + 2. Use the user's configured `mono` font-feature-settings by default. + 3. Use the user's configured `mono` font-variation-settings by default. + 4. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: --theme( + --default-mono-font-family, + ui-monospace, + SFMono-Regular, + Menlo, + Monaco, + Consolas, + 'Liberation Mono', + 'Courier New', + monospace + ); /* 1 */ + font-feature-settings: --theme(--default-mono-font-feature-settings, normal); /* 2 */ + font-variation-settings: --theme(--default-mono-font-variation-settings, normal); /* 3 */ + font-size: 1em; /* 4 */ +} + +/* + Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* + Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* + 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) + 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) + 3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; /* 1 */ + border-color: inherit; /* 2 */ + border-collapse: collapse; /* 3 */ +} + +/* + Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* + Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* + Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* + Make lists unstyled by default. +*/ + +ol, +ul, +menu { + list-style: none; +} + +/* + 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) + 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; /* 1 */ + vertical-align: middle; /* 2 */ +} + +/* + Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* + 1. Inherit font styles in all browsers. + 2. Remove border radius in all browsers. + 3. Remove background color in all browsers. + 4. Ensure consistent opacity for disabled states in all browsers. +*/ + +button, +input, +select, +optgroup, +textarea, +::file-selector-button { + font: inherit; /* 1 */ + font-feature-settings: inherit; /* 1 */ + font-variation-settings: inherit; /* 1 */ + letter-spacing: inherit; /* 1 */ + color: inherit; /* 1 */ + border-radius: 0; /* 2 */ + background-color: transparent; /* 3 */ + opacity: 1; /* 4 */ +} + +/* + Restore default font weight. +*/ + +:where(select:is([multiple], [size])) optgroup { + font-weight: bolder; +} + +/* + Restore indentation. +*/ + +:where(select:is([multiple], [size])) optgroup option { + padding-inline-start: 20px; +} + +/* + Restore space after button. +*/ + +::file-selector-button { + margin-inline-end: 4px; +} + +/* + Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +*/ + +::placeholder { + opacity: 1; +} + +/* + Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not + crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194) +*/ + +@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or + (contain-intrinsic-size: 1px) /* Safari 17+ */ { + ::placeholder { + color: color-mix(in oklab, currentcolor 50%, transparent); + } +} + +/* + Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* + Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* + 1. Ensure date/time inputs have the same height when empty in iOS Safari. + 2. Ensure text alignment can be changed on date/time inputs in iOS Safari. +*/ + +::-webkit-date-and-time-value { + min-height: 1lh; /* 1 */ + text-align: inherit; /* 2 */ +} + +/* + Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`. +*/ + +::-webkit-datetime-edit { + display: inline-flex; +} + +/* + Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers. +*/ + +::-webkit-datetime-edit-fields-wrapper { + padding: 0; +} + +::-webkit-datetime-edit, +::-webkit-datetime-edit-year-field, +::-webkit-datetime-edit-month-field, +::-webkit-datetime-edit-day-field, +::-webkit-datetime-edit-hour-field, +::-webkit-datetime-edit-minute-field, +::-webkit-datetime-edit-second-field, +::-webkit-datetime-edit-millisecond-field, +::-webkit-datetime-edit-meridiem-field { + padding-block: 0; +} + +/* + Center dropdown marker shown on inputs with paired ``s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499) +*/ + +::-webkit-calendar-picker-indicator { + line-height: 1; +} + +/* + Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* + Correct the inability to style the border radius in iOS Safari. +*/ + +button, +input:where([type='button'], [type='reset'], [type='submit']), +::file-selector-button { + appearance: button; +} + +/* + Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* + Make elements with the HTML hidden attribute stay hidden by default. +*/ + +[hidden]:where(:not([hidden='until-found'])) { + display: none !important; +} diff --git a/node_modules/tailwindcss/theme.css b/node_modules/tailwindcss/theme.css new file mode 100644 index 0000000..52d447f --- /dev/null +++ b/node_modules/tailwindcss/theme.css @@ -0,0 +1,462 @@ +@theme default { + --font-sans: + ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', + 'Noto Color Emoji'; + --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif; + --font-mono: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', + monospace; + + --color-red-50: oklch(97.1% 0.013 17.38); + --color-red-100: oklch(93.6% 0.032 17.717); + --color-red-200: oklch(88.5% 0.062 18.334); + --color-red-300: oklch(80.8% 0.114 19.571); + --color-red-400: oklch(70.4% 0.191 22.216); + --color-red-500: oklch(63.7% 0.237 25.331); + --color-red-600: oklch(57.7% 0.245 27.325); + --color-red-700: oklch(50.5% 0.213 27.518); + --color-red-800: oklch(44.4% 0.177 26.899); + --color-red-900: oklch(39.6% 0.141 25.723); + --color-red-950: oklch(25.8% 0.092 26.042); + + --color-orange-50: oklch(98% 0.016 73.684); + --color-orange-100: oklch(95.4% 0.038 75.164); + --color-orange-200: oklch(90.1% 0.076 70.697); + --color-orange-300: oklch(83.7% 0.128 66.29); + --color-orange-400: oklch(75% 0.183 55.934); + --color-orange-500: oklch(70.5% 0.213 47.604); + --color-orange-600: oklch(64.6% 0.222 41.116); + --color-orange-700: oklch(55.3% 0.195 38.402); + --color-orange-800: oklch(47% 0.157 37.304); + --color-orange-900: oklch(40.8% 0.123 38.172); + --color-orange-950: oklch(26.6% 0.079 36.259); + + --color-amber-50: oklch(98.7% 0.022 95.277); + --color-amber-100: oklch(96.2% 0.059 95.617); + --color-amber-200: oklch(92.4% 0.12 95.746); + --color-amber-300: oklch(87.9% 0.169 91.605); + --color-amber-400: oklch(82.8% 0.189 84.429); + --color-amber-500: oklch(76.9% 0.188 70.08); + --color-amber-600: oklch(66.6% 0.179 58.318); + --color-amber-700: oklch(55.5% 0.163 48.998); + --color-amber-800: oklch(47.3% 0.137 46.201); + --color-amber-900: oklch(41.4% 0.112 45.904); + --color-amber-950: oklch(27.9% 0.077 45.635); + + --color-yellow-50: oklch(98.7% 0.026 102.212); + --color-yellow-100: oklch(97.3% 0.071 103.193); + --color-yellow-200: oklch(94.5% 0.129 101.54); + --color-yellow-300: oklch(90.5% 0.182 98.111); + --color-yellow-400: oklch(85.2% 0.199 91.936); + --color-yellow-500: oklch(79.5% 0.184 86.047); + --color-yellow-600: oklch(68.1% 0.162 75.834); + --color-yellow-700: oklch(55.4% 0.135 66.442); + --color-yellow-800: oklch(47.6% 0.114 61.907); + --color-yellow-900: oklch(42.1% 0.095 57.708); + --color-yellow-950: oklch(28.6% 0.066 53.813); + + --color-lime-50: oklch(98.6% 0.031 120.757); + --color-lime-100: oklch(96.7% 0.067 122.328); + --color-lime-200: oklch(93.8% 0.127 124.321); + --color-lime-300: oklch(89.7% 0.196 126.665); + --color-lime-400: oklch(84.1% 0.238 128.85); + --color-lime-500: oklch(76.8% 0.233 130.85); + --color-lime-600: oklch(64.8% 0.2 131.684); + --color-lime-700: oklch(53.2% 0.157 131.589); + --color-lime-800: oklch(45.3% 0.124 130.933); + --color-lime-900: oklch(40.5% 0.101 131.063); + --color-lime-950: oklch(27.4% 0.072 132.109); + + --color-green-50: oklch(98.2% 0.018 155.826); + --color-green-100: oklch(96.2% 0.044 156.743); + --color-green-200: oklch(92.5% 0.084 155.995); + --color-green-300: oklch(87.1% 0.15 154.449); + --color-green-400: oklch(79.2% 0.209 151.711); + --color-green-500: oklch(72.3% 0.219 149.579); + --color-green-600: oklch(62.7% 0.194 149.214); + --color-green-700: oklch(52.7% 0.154 150.069); + --color-green-800: oklch(44.8% 0.119 151.328); + --color-green-900: oklch(39.3% 0.095 152.535); + --color-green-950: oklch(26.6% 0.065 152.934); + + --color-emerald-50: oklch(97.9% 0.021 166.113); + --color-emerald-100: oklch(95% 0.052 163.051); + --color-emerald-200: oklch(90.5% 0.093 164.15); + --color-emerald-300: oklch(84.5% 0.143 164.978); + --color-emerald-400: oklch(76.5% 0.177 163.223); + --color-emerald-500: oklch(69.6% 0.17 162.48); + --color-emerald-600: oklch(59.6% 0.145 163.225); + --color-emerald-700: oklch(50.8% 0.118 165.612); + --color-emerald-800: oklch(43.2% 0.095 166.913); + --color-emerald-900: oklch(37.8% 0.077 168.94); + --color-emerald-950: oklch(26.2% 0.051 172.552); + + --color-teal-50: oklch(98.4% 0.014 180.72); + --color-teal-100: oklch(95.3% 0.051 180.801); + --color-teal-200: oklch(91% 0.096 180.426); + --color-teal-300: oklch(85.5% 0.138 181.071); + --color-teal-400: oklch(77.7% 0.152 181.912); + --color-teal-500: oklch(70.4% 0.14 182.503); + --color-teal-600: oklch(60% 0.118 184.704); + --color-teal-700: oklch(51.1% 0.096 186.391); + --color-teal-800: oklch(43.7% 0.078 188.216); + --color-teal-900: oklch(38.6% 0.063 188.416); + --color-teal-950: oklch(27.7% 0.046 192.524); + + --color-cyan-50: oklch(98.4% 0.019 200.873); + --color-cyan-100: oklch(95.6% 0.045 203.388); + --color-cyan-200: oklch(91.7% 0.08 205.041); + --color-cyan-300: oklch(86.5% 0.127 207.078); + --color-cyan-400: oklch(78.9% 0.154 211.53); + --color-cyan-500: oklch(71.5% 0.143 215.221); + --color-cyan-600: oklch(60.9% 0.126 221.723); + --color-cyan-700: oklch(52% 0.105 223.128); + --color-cyan-800: oklch(45% 0.085 224.283); + --color-cyan-900: oklch(39.8% 0.07 227.392); + --color-cyan-950: oklch(30.2% 0.056 229.695); + + --color-sky-50: oklch(97.7% 0.013 236.62); + --color-sky-100: oklch(95.1% 0.026 236.824); + --color-sky-200: oklch(90.1% 0.058 230.902); + --color-sky-300: oklch(82.8% 0.111 230.318); + --color-sky-400: oklch(74.6% 0.16 232.661); + --color-sky-500: oklch(68.5% 0.169 237.323); + --color-sky-600: oklch(58.8% 0.158 241.966); + --color-sky-700: oklch(50% 0.134 242.749); + --color-sky-800: oklch(44.3% 0.11 240.79); + --color-sky-900: oklch(39.1% 0.09 240.876); + --color-sky-950: oklch(29.3% 0.066 243.157); + + --color-blue-50: oklch(97% 0.014 254.604); + --color-blue-100: oklch(93.2% 0.032 255.585); + --color-blue-200: oklch(88.2% 0.059 254.128); + --color-blue-300: oklch(80.9% 0.105 251.813); + --color-blue-400: oklch(70.7% 0.165 254.624); + --color-blue-500: oklch(62.3% 0.214 259.815); + --color-blue-600: oklch(54.6% 0.245 262.881); + --color-blue-700: oklch(48.8% 0.243 264.376); + --color-blue-800: oklch(42.4% 0.199 265.638); + --color-blue-900: oklch(37.9% 0.146 265.522); + --color-blue-950: oklch(28.2% 0.091 267.935); + + --color-indigo-50: oklch(96.2% 0.018 272.314); + --color-indigo-100: oklch(93% 0.034 272.788); + --color-indigo-200: oklch(87% 0.065 274.039); + --color-indigo-300: oklch(78.5% 0.115 274.713); + --color-indigo-400: oklch(67.3% 0.182 276.935); + --color-indigo-500: oklch(58.5% 0.233 277.117); + --color-indigo-600: oklch(51.1% 0.262 276.966); + --color-indigo-700: oklch(45.7% 0.24 277.023); + --color-indigo-800: oklch(39.8% 0.195 277.366); + --color-indigo-900: oklch(35.9% 0.144 278.697); + --color-indigo-950: oklch(25.7% 0.09 281.288); + + --color-violet-50: oklch(96.9% 0.016 293.756); + --color-violet-100: oklch(94.3% 0.029 294.588); + --color-violet-200: oklch(89.4% 0.057 293.283); + --color-violet-300: oklch(81.1% 0.111 293.571); + --color-violet-400: oklch(70.2% 0.183 293.541); + --color-violet-500: oklch(60.6% 0.25 292.717); + --color-violet-600: oklch(54.1% 0.281 293.009); + --color-violet-700: oklch(49.1% 0.27 292.581); + --color-violet-800: oklch(43.2% 0.232 292.759); + --color-violet-900: oklch(38% 0.189 293.745); + --color-violet-950: oklch(28.3% 0.141 291.089); + + --color-purple-50: oklch(97.7% 0.014 308.299); + --color-purple-100: oklch(94.6% 0.033 307.174); + --color-purple-200: oklch(90.2% 0.063 306.703); + --color-purple-300: oklch(82.7% 0.119 306.383); + --color-purple-400: oklch(71.4% 0.203 305.504); + --color-purple-500: oklch(62.7% 0.265 303.9); + --color-purple-600: oklch(55.8% 0.288 302.321); + --color-purple-700: oklch(49.6% 0.265 301.924); + --color-purple-800: oklch(43.8% 0.218 303.724); + --color-purple-900: oklch(38.1% 0.176 304.987); + --color-purple-950: oklch(29.1% 0.149 302.717); + + --color-fuchsia-50: oklch(97.7% 0.017 320.058); + --color-fuchsia-100: oklch(95.2% 0.037 318.852); + --color-fuchsia-200: oklch(90.3% 0.076 319.62); + --color-fuchsia-300: oklch(83.3% 0.145 321.434); + --color-fuchsia-400: oklch(74% 0.238 322.16); + --color-fuchsia-500: oklch(66.7% 0.295 322.15); + --color-fuchsia-600: oklch(59.1% 0.293 322.896); + --color-fuchsia-700: oklch(51.8% 0.253 323.949); + --color-fuchsia-800: oklch(45.2% 0.211 324.591); + --color-fuchsia-900: oklch(40.1% 0.17 325.612); + --color-fuchsia-950: oklch(29.3% 0.136 325.661); + + --color-pink-50: oklch(97.1% 0.014 343.198); + --color-pink-100: oklch(94.8% 0.028 342.258); + --color-pink-200: oklch(89.9% 0.061 343.231); + --color-pink-300: oklch(82.3% 0.12 346.018); + --color-pink-400: oklch(71.8% 0.202 349.761); + --color-pink-500: oklch(65.6% 0.241 354.308); + --color-pink-600: oklch(59.2% 0.249 0.584); + --color-pink-700: oklch(52.5% 0.223 3.958); + --color-pink-800: oklch(45.9% 0.187 3.815); + --color-pink-900: oklch(40.8% 0.153 2.432); + --color-pink-950: oklch(28.4% 0.109 3.907); + + --color-rose-50: oklch(96.9% 0.015 12.422); + --color-rose-100: oklch(94.1% 0.03 12.58); + --color-rose-200: oklch(89.2% 0.058 10.001); + --color-rose-300: oklch(81% 0.117 11.638); + --color-rose-400: oklch(71.2% 0.194 13.428); + --color-rose-500: oklch(64.5% 0.246 16.439); + --color-rose-600: oklch(58.6% 0.253 17.585); + --color-rose-700: oklch(51.4% 0.222 16.935); + --color-rose-800: oklch(45.5% 0.188 13.697); + --color-rose-900: oklch(41% 0.159 10.272); + --color-rose-950: oklch(27.1% 0.105 12.094); + + --color-slate-50: oklch(98.4% 0.003 247.858); + --color-slate-100: oklch(96.8% 0.007 247.896); + --color-slate-200: oklch(92.9% 0.013 255.508); + --color-slate-300: oklch(86.9% 0.022 252.894); + --color-slate-400: oklch(70.4% 0.04 256.788); + --color-slate-500: oklch(55.4% 0.046 257.417); + --color-slate-600: oklch(44.6% 0.043 257.281); + --color-slate-700: oklch(37.2% 0.044 257.287); + --color-slate-800: oklch(27.9% 0.041 260.031); + --color-slate-900: oklch(20.8% 0.042 265.755); + --color-slate-950: oklch(12.9% 0.042 264.695); + + --color-gray-50: oklch(98.5% 0.002 247.839); + --color-gray-100: oklch(96.7% 0.003 264.542); + --color-gray-200: oklch(92.8% 0.006 264.531); + --color-gray-300: oklch(87.2% 0.01 258.338); + --color-gray-400: oklch(70.7% 0.022 261.325); + --color-gray-500: oklch(55.1% 0.027 264.364); + --color-gray-600: oklch(44.6% 0.03 256.802); + --color-gray-700: oklch(37.3% 0.034 259.733); + --color-gray-800: oklch(27.8% 0.033 256.848); + --color-gray-900: oklch(21% 0.034 264.665); + --color-gray-950: oklch(13% 0.028 261.692); + + --color-zinc-50: oklch(98.5% 0 0); + --color-zinc-100: oklch(96.7% 0.001 286.375); + --color-zinc-200: oklch(92% 0.004 286.32); + --color-zinc-300: oklch(87.1% 0.006 286.286); + --color-zinc-400: oklch(70.5% 0.015 286.067); + --color-zinc-500: oklch(55.2% 0.016 285.938); + --color-zinc-600: oklch(44.2% 0.017 285.786); + --color-zinc-700: oklch(37% 0.013 285.805); + --color-zinc-800: oklch(27.4% 0.006 286.033); + --color-zinc-900: oklch(21% 0.006 285.885); + --color-zinc-950: oklch(14.1% 0.005 285.823); + + --color-neutral-50: oklch(98.5% 0 0); + --color-neutral-100: oklch(97% 0 0); + --color-neutral-200: oklch(92.2% 0 0); + --color-neutral-300: oklch(87% 0 0); + --color-neutral-400: oklch(70.8% 0 0); + --color-neutral-500: oklch(55.6% 0 0); + --color-neutral-600: oklch(43.9% 0 0); + --color-neutral-700: oklch(37.1% 0 0); + --color-neutral-800: oklch(26.9% 0 0); + --color-neutral-900: oklch(20.5% 0 0); + --color-neutral-950: oklch(14.5% 0 0); + + --color-stone-50: oklch(98.5% 0.001 106.423); + --color-stone-100: oklch(97% 0.001 106.424); + --color-stone-200: oklch(92.3% 0.003 48.717); + --color-stone-300: oklch(86.9% 0.005 56.366); + --color-stone-400: oklch(70.9% 0.01 56.259); + --color-stone-500: oklch(55.3% 0.013 58.071); + --color-stone-600: oklch(44.4% 0.011 73.639); + --color-stone-700: oklch(37.4% 0.01 67.558); + --color-stone-800: oklch(26.8% 0.007 34.298); + --color-stone-900: oklch(21.6% 0.006 56.043); + --color-stone-950: oklch(14.7% 0.004 49.25); + + --color-black: #000; + --color-white: #fff; + + --spacing: 0.25rem; + + --breakpoint-sm: 40rem; + --breakpoint-md: 48rem; + --breakpoint-lg: 64rem; + --breakpoint-xl: 80rem; + --breakpoint-2xl: 96rem; + + --container-3xs: 16rem; + --container-2xs: 18rem; + --container-xs: 20rem; + --container-sm: 24rem; + --container-md: 28rem; + --container-lg: 32rem; + --container-xl: 36rem; + --container-2xl: 42rem; + --container-3xl: 48rem; + --container-4xl: 56rem; + --container-5xl: 64rem; + --container-6xl: 72rem; + --container-7xl: 80rem; + + --text-xs: 0.75rem; + --text-xs--line-height: calc(1 / 0.75); + --text-sm: 0.875rem; + --text-sm--line-height: calc(1.25 / 0.875); + --text-base: 1rem; + --text-base--line-height: calc(1.5 / 1); + --text-lg: 1.125rem; + --text-lg--line-height: calc(1.75 / 1.125); + --text-xl: 1.25rem; + --text-xl--line-height: calc(1.75 / 1.25); + --text-2xl: 1.5rem; + --text-2xl--line-height: calc(2 / 1.5); + --text-3xl: 1.875rem; + --text-3xl--line-height: calc(2.25 / 1.875); + --text-4xl: 2.25rem; + --text-4xl--line-height: calc(2.5 / 2.25); + --text-5xl: 3rem; + --text-5xl--line-height: 1; + --text-6xl: 3.75rem; + --text-6xl--line-height: 1; + --text-7xl: 4.5rem; + --text-7xl--line-height: 1; + --text-8xl: 6rem; + --text-8xl--line-height: 1; + --text-9xl: 8rem; + --text-9xl--line-height: 1; + + --font-weight-thin: 100; + --font-weight-extralight: 200; + --font-weight-light: 300; + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --font-weight-extrabold: 800; + --font-weight-black: 900; + + --tracking-tighter: -0.05em; + --tracking-tight: -0.025em; + --tracking-normal: 0em; + --tracking-wide: 0.025em; + --tracking-wider: 0.05em; + --tracking-widest: 0.1em; + + --leading-tight: 1.25; + --leading-snug: 1.375; + --leading-normal: 1.5; + --leading-relaxed: 1.625; + --leading-loose: 2; + + --radius-xs: 0.125rem; + --radius-sm: 0.25rem; + --radius-md: 0.375rem; + --radius-lg: 0.5rem; + --radius-xl: 0.75rem; + --radius-2xl: 1rem; + --radius-3xl: 1.5rem; + --radius-4xl: 2rem; + + --shadow-2xs: 0 1px rgb(0 0 0 / 0.05); + --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); + --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); + + --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05); + --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05); + --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05); + + --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05); + --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15); + --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12); + --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15); + --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1); + --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15); + + --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15); + --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2); + --text-shadow-sm: + 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075); + --text-shadow-md: + 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1); + --text-shadow-lg: + 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1); + + --ease-in: cubic-bezier(0.4, 0, 1, 1); + --ease-out: cubic-bezier(0, 0, 0.2, 1); + --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); + + --animate-spin: spin 1s linear infinite; + --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; + --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; + --animate-bounce: bounce 1s infinite; + + @keyframes spin { + to { + transform: rotate(360deg); + } + } + + @keyframes ping { + 75%, + 100% { + transform: scale(2); + opacity: 0; + } + } + + @keyframes pulse { + 50% { + opacity: 0.5; + } + } + + @keyframes bounce { + 0%, + 100% { + transform: translateY(-25%); + animation-timing-function: cubic-bezier(0.8, 0, 1, 1); + } + + 50% { + transform: none; + animation-timing-function: cubic-bezier(0, 0, 0.2, 1); + } + } + + --blur-xs: 4px; + --blur-sm: 8px; + --blur-md: 12px; + --blur-lg: 16px; + --blur-xl: 24px; + --blur-2xl: 40px; + --blur-3xl: 64px; + + --perspective-dramatic: 100px; + --perspective-near: 300px; + --perspective-normal: 500px; + --perspective-midrange: 800px; + --perspective-distant: 1200px; + + --aspect-video: 16 / 9; + + --default-transition-duration: 150ms; + --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + --default-font-family: --theme(--font-sans, initial); + --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial); + --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial); + --default-mono-font-family: --theme(--font-mono, initial); + --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial); + --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial); +} + +/* Deprecated */ +@theme default inline reference { + --blur: 8px; + --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05); + --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06); + --radius: 0.25rem; + --max-width-prose: 65ch; +} diff --git a/node_modules/tailwindcss/utilities.css b/node_modules/tailwindcss/utilities.css new file mode 100644 index 0000000..65dd5f6 --- /dev/null +++ b/node_modules/tailwindcss/utilities.css @@ -0,0 +1 @@ +@tailwind utilities; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ad629fd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,944 @@ +{ + "name": "livres", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "livres", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@tailwindcss/cli": "^4.1.18", + "tailwindcss": "^4.1.18" + }, + "devDependencies": {} + }, + "node_modules/@parcel/watcher": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", + "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "hasInstallScript": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz", + "integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz", + "integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz", + "integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz", + "integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz", + "integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz", + "integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz", + "integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz", + "integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz", + "integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz", + "integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz", + "integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz", + "integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz", + "integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@parcel/watcher/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@tailwindcss/cli": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.1.18.tgz", + "integrity": "sha512-sMZ+lZbDyxwjD2E0L7oRUjJ01Ffjtme5OtjvvnC+cV4CEDcbqzbp25TCpxHj6kWLU9+DlqJOiNgSOgctC2aZmg==", + "dependencies": { + "@parcel/watcher": "^2.5.1", + "@tailwindcss/node": "4.1.18", + "@tailwindcss/oxide": "4.1.18", + "enhanced-resolve": "^5.18.3", + "mri": "^1.2.0", + "picocolors": "^1.1.1", + "tailwindcss": "4.1.18" + }, + "bin": { + "tailwindcss": "dist/index.mjs" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz", + "integrity": "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.6.1", + "lightningcss": "1.30.2", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.18" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" + }, + "node_modules/@tailwindcss/node/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@tailwindcss/node/node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@tailwindcss/node/node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz", + "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.30.2", + "lightningcss-darwin-arm64": "1.30.2", + "lightningcss-darwin-x64": "1.30.2", + "lightningcss-freebsd-x64": "1.30.2", + "lightningcss-linux-arm-gnueabihf": "1.30.2", + "lightningcss-linux-arm64-gnu": "1.30.2", + "lightningcss-linux-arm64-musl": "1.30.2", + "lightningcss-linux-x64-gnu": "1.30.2", + "lightningcss-linux-x64-musl": "1.30.2", + "lightningcss-win32-arm64-msvc": "1.30.2", + "lightningcss-win32-x64-msvc": "1.30.2" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz", + "integrity": "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz", + "integrity": "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@tailwindcss/node/node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.18.tgz", + "integrity": "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-arm64": "4.1.18", + "@tailwindcss/oxide-darwin-x64": "4.1.18", + "@tailwindcss/oxide-freebsd-x64": "4.1.18", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", + "@tailwindcss/oxide-linux-x64-musl": "4.1.18", + "@tailwindcss/oxide-wasm32-wasi": "4.1.18", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.18" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.18.tgz", + "integrity": "sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.18.tgz", + "integrity": "sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.18.tgz", + "integrity": "sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.18.tgz", + "integrity": "sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.18.tgz", + "integrity": "sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.18.tgz", + "integrity": "sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.18.tgz", + "integrity": "sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.18.tgz", + "integrity": "sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@emnapi/wasi-threads": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.0", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz", + "integrity": "sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.18.tgz", + "integrity": "sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz", + "integrity": "sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide/node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz", + "integrity": "sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.4", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", + "integrity": "sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enhanced-resolve/node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/enhanced-resolve/node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.30.2.tgz", + "integrity": "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.2.tgz", + "integrity": "sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.2.tgz", + "integrity": "sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.2.tgz", + "integrity": "sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.2.tgz", + "integrity": "sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.2.tgz", + "integrity": "sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.2.tgz", + "integrity": "sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.2.tgz", + "integrity": "sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.2", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.2.tgz", + "integrity": "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/tailwindcss": { + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz", + "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9340b30 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "livres", + "version": "1.0.0", + "description": "test modification k.d", + "main": "index.js", + "directories": { + "lib": "lib", + "test": "test" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@git.artcode.re:mithril/livres.git" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@tailwindcss/cli": "^4.1.18", + "tailwindcss": "^4.1.18" + } +}