diff --git a/.gitattributes b/.gitattributes index 5e9a6acb22a5311aa47b4282ce66966599ed606a..e8c09ad00a4d802e22f0e9e2246b52f1bb1ecb25 100644 --- a/.gitattributes +++ b/.gitattributes @@ -101,3 +101,5 @@ tools/ui/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node filter=lfs di tools/ui/node_modules/@parcel/watcher-linux-x64-musl/watcher.node filter=lfs diff=lfs merge=lfs -text tools/ui/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text tools/ui/node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text +tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text +tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..d7361ed3a60aa5b22d0bf368001642e18a72a0f5 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.stories.svelte @@ -0,0 +1,30 @@ + + + { + const canvas = within(canvasElement); + const loginButton = canvas.getByRole('button', { name: /Log in/i }); + await expect(loginButton).toBeInTheDocument(); + await userEvent.click(loginButton); + await waitFor(() => expect(loginButton).not.toBeInTheDocument()); + + const logoutButton = canvas.getByRole('button', { name: /Log out/i }); + await expect(logoutButton).toBeInTheDocument(); + }} + /> + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.svelte new file mode 100644 index 0000000000000000000000000000000000000000..92a95c00c5c557f4b19de54198832d0f195917c8 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/js/Page.svelte @@ -0,0 +1,70 @@ + + +
+
(user = { name: 'Jane Doe' })} + onLogout={() => (user = null)} + onCreateAccount={() => (user = { name: 'Jane Doe' })} + /> + +
+

Pages in Storybook

+

+ We recommend building UIs with a + + component-driven + + process starting with atomic components and ending with pages. +

+

+ Render pages with mock data. This makes it easy to build and review page states without + needing to navigate to them in your app. Here are some handy patterns for managing page data + in Storybook: +

+
    +
  • + Use a higher-level connected component. Storybook helps you compose such data from the + "args" of child component stories +
  • +
  • + Assemble data in the page component from your services. You can mock these services out + using Storybook. +
  • +
+

+ Get a guided tutorial on component-driven development at + + Storybook tutorials + + . Read more in the + docs + . +

+
+ Tip + Adjust the width of the canvas with the + + + + + + Viewports addon in the toolbar +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..718708998f6239a6ecab71b9680015eb15a1ecd0 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.svelte new file mode 100644 index 0000000000000000000000000000000000000000..c34befec5be584db001021908d1d67aea22e27f1 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Button.svelte @@ -0,0 +1,30 @@ + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..23175a8203e537e7d5d5618c3755adf2800f6be3 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.stories.svelte @@ -0,0 +1,26 @@ + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.svelte new file mode 100644 index 0000000000000000000000000000000000000000..d6b7b216631527272641372f4fafd3e06f04b40b --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Header.svelte @@ -0,0 +1,45 @@ + + +
+
+
+ + + + + + + +

Acme

+
+
+ {#if user} + + Welcome, {user.name}! + +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..8f2ff2283d3e90b1eb820c074dc465dc5331e985 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.stories.svelte @@ -0,0 +1,30 @@ + + + { + const canvas = within(canvasElement); + const loginButton = canvas.getByRole('button', { name: /Log in/i }); + await expect(loginButton).toBeInTheDocument(); + await userEvent.click(loginButton); + await waitFor(() => expect(loginButton).not.toBeInTheDocument()); + + const logoutButton = canvas.getByRole('button', { name: /Log out/i }); + await expect(logoutButton).toBeInTheDocument(); + }} +/> + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.svelte new file mode 100644 index 0000000000000000000000000000000000000000..c4c069a5a50b31f1717a5c6f2da68a9bd0537ac6 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/cli/ts/Page.svelte @@ -0,0 +1,70 @@ + + +
+
(user = { name: 'Jane Doe' })} + onLogout={() => (user = undefined)} + onCreateAccount={() => (user = { name: 'Jane Doe' })} + /> + +
+

Pages in Storybook

+

+ We recommend building UIs with a + + component-driven + + process starting with atomic components and ending with pages. +

+

+ Render pages with mock data. This makes it easy to build and review page states without + needing to navigate to them in your app. Here are some handy patterns for managing page data + in Storybook: +

+
    +
  • + Use a higher-level connected component. Storybook helps you compose such data from the + "args" of child component stories +
  • +
  • + Assemble data in the page component from your services. You can mock these services out + using Storybook. +
  • +
+

+ Get a guided tutorial on component-driven development at + + Storybook tutorials + + . Read more in the + docs + . +

+
+ Tip + Adjust the width of the canvas with the + + + + + + Viewports addon in the toolbar +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.stories.js b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..8fe1f95365e8ef72b3ed0d33b233d632fb6f4416 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.stories.js @@ -0,0 +1,17 @@ +import JSDoc from './jsdoc.svelte'; + +/** @typedef {import('@storybook/svelte-vite').StoryObj} StoryObj */ + +/** @type {Meta} */ +const meta = { + component: JSDoc, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: JSDoc, + props: { ...args, argTypes }, + }), +}; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.svelte new file mode 100644 index 0000000000000000000000000000000000000000..458c87ffd084dbe91eb61f60e904bf8498123d44 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-js/docgen/jsdoc.svelte @@ -0,0 +1,92 @@ + + +

Docgen: JS - JSDoc

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      trueLiteral,
+      symbol,
+      nullValue,
+      undefinedValue,
+      any,
+      date,
+      unionLiteralStrings,
+      unionLiteralNumbers,
+      object,
+      inlineObject,
+      record,
+      unionTypes,
+      intersection,
+      func,
+      argTypes,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.stories.js b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..8fe1f95365e8ef72b3ed0d33b233d632fb6f4416 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.stories.js @@ -0,0 +1,17 @@ +import JSDoc from './jsdoc.svelte'; + +/** @typedef {import('@storybook/svelte-vite').StoryObj} StoryObj */ + +/** @type {Meta} */ +const meta = { + component: JSDoc, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: JSDoc, + props: { ...args, argTypes }, + }), +}; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.svelte new file mode 100644 index 0000000000000000000000000000000000000000..e6175648d0c30f5bf448f0b4ced3cb96ab4c0685 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/jsdoc.svelte @@ -0,0 +1,91 @@ + + +

Docgen: JS - JSDoc

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      trueLiteral,
+      symbol,
+      nullValue,
+      undefinedValue,
+      any,
+      date,
+      unionLiteralStrings,
+      unionLiteralNumbers,
+      object,
+      inlineObject,
+      record,
+      unionTypes,
+      intersection,
+      func,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.stories.ts b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..58726860ef1997ee5a69babb9c730aeb4c10f4a0 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.stories.ts @@ -0,0 +1,16 @@ +import type { Meta } from '@storybook/svelte-vite'; + +import TSInlinePropTypes from './ts-inline-prop-types.svelte'; + +const meta = { + component: TSInlinePropTypes, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: TSInlinePropTypes, + props: { ...args, argTypes }, + }), +} satisfies Meta; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.svelte new file mode 100644 index 0000000000000000000000000000000000000000..9dde0a2d7c06a726ead772391c8bc535cfbcb94e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-inline-prop-types.svelte @@ -0,0 +1,103 @@ + + +

Docgen: TS - inline prop types

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      nullValue,
+      date,
+      arrayOfNumbers,
+      enumValue,
+      record,
+      unionTypes,
+      func,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.stories.ts b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..95a9b484b744f440db8f85e761194226ee20fcbb --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.stories.ts @@ -0,0 +1,16 @@ +import type { Meta } from '@storybook/svelte-vite'; + +import TSLegacy from './ts-legacy.svelte'; + +const meta = { + component: TSLegacy, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: TSLegacy, + props: { ...args, argTypes } as any, + }), +} satisfies Meta; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.svelte new file mode 100644 index 0000000000000000000000000000000000000000..fea7f5e4a418b37f92426c8994a65f832c333998 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-legacy.svelte @@ -0,0 +1,98 @@ + + +

Docgen: TS - legacy

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      trueLiteral,
+      symbol,
+      nullValue,
+      undefinedValue,
+      any,
+      date,
+      arrayOfNumbers,
+      enumValue,
+      unionLiteralStrings,
+      unionLiteralNumbers,
+      object,
+      inlineObject,
+      record,
+      unionTypes,
+      intersection,
+      func,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.stories.ts b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..9058b0a1b12b7c4053ef48b76e84b63924ea7af9 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.stories.ts @@ -0,0 +1,16 @@ +import type { Meta } from '@storybook/svelte-vite'; + +import TSReferencedPropTypes from './ts-referenced-prop-types.svelte'; + +const meta = { + component: TSReferencedPropTypes, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: TSReferencedPropTypes, + props: { ...args, argTypes }, + }), +} satisfies Meta; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.svelte new file mode 100644 index 0000000000000000000000000000000000000000..0bc3913fdec3ac678a167d55cf4b6fbfe526b98e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts-referenced-prop-types.svelte @@ -0,0 +1,107 @@ + + +

Docgen: TS - referenced prop types

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      nullValue,
+      arrayOfNumbers,
+      enumValue,
+      record,
+      date,
+      unionTypes,
+      func,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.stories.ts b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca0eafcf5224bc66bd980e6f88c6d4e5acff9ffc --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.stories.ts @@ -0,0 +1,16 @@ +import type { Meta } from '@storybook/svelte-vite'; + +import TS from './ts.svelte'; + +const meta = { + component: TS, + tags: ['autodocs'], + render: (args, { argTypes }) => ({ + Component: TS, + props: { ...args, argTypes }, + }), +} satisfies Meta; + +export default meta; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.svelte b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.svelte new file mode 100644 index 0000000000000000000000000000000000000000..a9290b4087acd325cc681da472efa13a298b580c --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/ts.svelte @@ -0,0 +1,125 @@ + + +

Docgen: TS

+ +

Args

+
{JSON.stringify(
+    {
+      boolean,
+      string,
+      stringRequired,
+      number,
+      trueLiteral,
+      symbol,
+      nullValue,
+      undefinedValue,
+      any,
+      date,
+      arrayOfNumbers,
+      enumValue,
+      unionLiteralStrings,
+      unionLiteralNumbers,
+      object,
+      inlineObject,
+      record,
+      unionTypes,
+      intersection,
+      func,
+    },
+    null,
+    2
+  )}
+ +

Children

+{#if children} + {@render children()} +{/if} + +

Arg Types

+
{JSON.stringify(argTypes, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/types.ts b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..199b60cbba22ef12769b1e86a4cee06a60975c1d --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/node_modules/@storybook/svelte-vite/template/stories_svelte-vite-default-ts/docgen/types.ts @@ -0,0 +1,7 @@ +export type LiteralNumbers = 100 | 1000 | 10000; +export type LiteralStrings = 'apple' | 'grape' | 'orange'; + +export enum MyEnum { + FOO = 'foo', + BAR = 'bar', +} diff --git a/tools/ui/node_modules/@storybook/sveltekit/package.json b/tools/ui/node_modules/@storybook/sveltekit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3f2f2642c4289adbe96b7d21ac9227b67ee62b6e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/package.json @@ -0,0 +1,78 @@ +{ + "name": "@storybook/sveltekit", + "version": "10.5.6", + "description": "Storybook for SvelteKit: Develop, document, and test UI components in isolation", + "keywords": [ + "storybook", + "storybook-framework", + "svelte", + "sveltekit", + "svelte-kit", + "vite", + "component", + "components" + ], + "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit", + "bugs": { + "url": "https://github.com/storybookjs/storybook/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/storybookjs/storybook.git", + "directory": "code/frameworks/sveltekit" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "license": "MIT", + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "code": "./src/index.ts", + "default": "./dist/index.js" + }, + "./internal/MockProvider.svelte": "./static/MockProvider.svelte", + "./internal/mocks/app/forms": "./dist/mocks/app/forms.js", + "./internal/mocks/app/navigation": "./dist/mocks/app/navigation.js", + "./internal/mocks/app/state.svelte.js": "./static/app-state-mock.svelte.js", + "./internal/mocks/app/stores": "./dist/mocks/app/stores.js", + "./node": { + "types": "./dist/node/index.d.ts", + "code": "./src/node/index.ts", + "default": "./dist/node/index.js" + }, + "./package.json": "./package.json", + "./preset": "./dist/preset.js", + "./preview": "./dist/preview.js", + "./vite-plugin": "./dist/vite-plugin.js" + }, + "files": [ + "dist/**/*", + "static/**/*", + "template/**/*", + "README.md", + "*.js", + "*.d.ts" + ], + "dependencies": { + "@storybook/builder-vite": "10.5.6", + "@storybook/svelte": "10.5.6", + "@storybook/svelte-vite": "10.5.6" + }, + "devDependencies": { + "@types/node": "^22.19.1", + "typescript": "^6.0.3", + "vite": "^7.0.4" + }, + "peerDependencies": { + "storybook": "^10.5.6", + "svelte": "^5.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae1l" +} \ No newline at end of file diff --git a/tools/ui/node_modules/@storybook/sveltekit/preset.js b/tools/ui/node_modules/@storybook/sveltekit/preset.js new file mode 100644 index 0000000000000000000000000000000000000000..4bd63d3240021d58a8eb61d58a3b44183be247ae --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/preset.js @@ -0,0 +1 @@ +export * from './dist/preset.js'; diff --git a/tools/ui/node_modules/@storybook/sveltekit/preview.js b/tools/ui/node_modules/@storybook/sveltekit/preview.js new file mode 100644 index 0000000000000000000000000000000000000000..542d45f8cf2617907e1d790c274acd38cdbd572e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/preview.js @@ -0,0 +1 @@ +export * from './dist/preview.js'; diff --git a/tools/ui/node_modules/@storybook/sveltekit/static/MockProvider.svelte b/tools/ui/node_modules/@storybook/sveltekit/static/MockProvider.svelte new file mode 100644 index 0000000000000000000000000000000000000000..f05396ee732716cadffaf6bd8b2de9b579781ba9 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/static/MockProvider.svelte @@ -0,0 +1,127 @@ + + +{@render children()} diff --git a/tools/ui/node_modules/@storybook/sveltekit/static/app-state-mock.svelte.js b/tools/ui/node_modules/@storybook/sveltekit/static/app-state-mock.svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..be46966e5f5a7959dfb2db132c046b10b051a05c --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/static/app-state-mock.svelte.js @@ -0,0 +1,234 @@ +/** + * Inspired by the the code: + * {@link https://github.com/sveltejs/kit/blob/main/packages/kit/src/runtime/client/state.svelte.js} + * + * The differences: + * + * - Legacy Svelte support is not included + * - Not using classes (internal coding style preference) + * + * @module + */ +import { fn } from 'storybook/test'; + +/** + * @typedef {Object} App + * @property {Object} Error + * @property {string} Error.message + * @property {Object} Locals + * @property {Object} PageData + * @property {Object} PageState + * @property {Object} Platform + */ + +/** + * @typedef {Object} Page + * @property {URL} url + * @property {Record} params + * @property {Object} route + * @property {string | null} route.id + * @property {number} status + * @property {App.Error | null} error + * @property {App.PageData & Record} data + * @property {App.PageState} state + * @property {any} form + */ + +const defaultStatePageValues = { + data: {}, + form: null, + error: null, + params: {}, + route: { id: null }, + state: {}, + status: -1, + url: new URL(location.origin), +}; + +/** @type {Page['data']} */ +let pageData = $state.raw(defaultStatePageValues.data); +/** @type {Page['form']} */ +let pageForm = $state.raw(defaultStatePageValues.form); +/** @type {Page['error']} */ +let pageError = $state.raw(defaultStatePageValues.error); +/** @type {Page['params']} */ +let pageParams = $state.raw(defaultStatePageValues.params); +/** @type {Page['route']} */ +let pageRoute = $state.raw(defaultStatePageValues.route); +/** @type {Page['state']} */ +let pageState = $state.raw(defaultStatePageValues.state); +/** @type {Page['status']} */ +let pageStatus = $state.raw(defaultStatePageValues.status); +/** @type {Page['url']} */ +let pageUrl = $state.raw(defaultStatePageValues.url); + +/** @type {Page} */ +export let page = { + get data() { + return pageData; + }, + set data(newPageData) { + pageData = newPageData; + }, + get form() { + return pageForm; + }, + set form(newPageForm) { + pageForm = newPageForm; + }, + get error() { + return pageError; + }, + set error(newPageError) { + pageError = newPageError; + }, + get params() { + return pageParams; + }, + set params(newPageParams) { + pageParams = newPageParams; + }, + get route() { + return pageRoute; + }, + set route(newPageRoute) { + pageRoute = newPageRoute; + }, + get state() { + return pageState; + }, + set state(newPageState) { + pageState = newPageState; + }, + get status() { + return pageStatus; + }, + set status(newPageStatus) { + pageStatus = newPageStatus; + }, + get url() { + return pageUrl; + }, + set url(newPageUrl) { + pageUrl = newPageUrl; + }, +}; + +export function setAppStatePage(params = {}) { + page.data = params.data ?? defaultStatePageValues.data; + page.form = params.form ?? defaultStatePageValues.form; + page.error = params.error ?? defaultStatePageValues.error; + page.params = params.params ?? defaultStatePageValues.params; + page.route = params.route ?? defaultStatePageValues.route; + page.state = params.state ?? defaultStatePageValues.state; + page.status = params.status ?? defaultStatePageValues.status; + page.url = params.url ?? defaultStatePageValues.url; +} + +/** + * @typedef {Object} NavigationTarget + * @property {Record | null} params + * @property {Object} route + * @property {string | null} route.id + * @property {URL} url + */ + +/** @typedef {'enter' | 'form' | 'leave' | 'link' | 'goto' | 'popstate'} NavigationType */ + +/** + * @typedef {Object} Navigation + * @property {NavigationTarget | null} from + * @property {NavigationTarget | null} to + * @property {Exclude} type + * @property {boolean} willUnload + * @property {number} [delta] + * @property {Promise} complete + */ + +const defaultStateNavigatingValues = { + from: null, + to: null, + type: null, + willUnload: null, + delta: null, + complete: null, +}; + +/** @type {Navigation['from'] | null} */ +let navigatingFrom = $state.raw(defaultStateNavigatingValues.from); +/** @type {Navigation['to'] | null} */ +let navigatingTo = $state.raw(defaultStateNavigatingValues.to); +/** @type {Navigation['type'] | null} */ +let navigatingType = $state.raw(defaultStateNavigatingValues.type); +/** @type {Navigation['willUnload'] | null} */ +let navigatingWillUnload = $state.raw(defaultStateNavigatingValues.willUnload); +/** @type {Navigation['delta'] | null} */ +let navigatingDelta = $state.raw(defaultStateNavigatingValues.delta); +/** @type {Navigation['complete'] | null} */ +let navigatingComplete = $state.raw(defaultStateNavigatingValues.complete); + +/** @type {Navigation} */ +export let navigating = { + get from() { + return navigatingFrom; + }, + set from(newNavigatingFrom) { + navigatingFrom = newNavigatingFrom; + }, + get to() { + return navigatingTo; + }, + set to(newNavigatingTo) { + navigatingTo = newNavigatingTo; + }, + get type() { + return navigatingType; + }, + set type(newNavigatingType) { + navigatingType = newNavigatingType; + }, + get willUnload() { + return navigatingWillUnload; + }, + set willUnload(newNavigatingWillUnload) { + navigatingWillUnload = newNavigatingWillUnload; + }, + get delta() { + return navigatingDelta; + }, + set delta(newNavigatingDelta) { + navigatingDelta = newNavigatingDelta; + }, + get complete() { + return navigatingComplete; + }, + set complete(newNavigatingComplete) { + navigatingComplete = newNavigatingComplete; + }, +}; + +export function setAppStateNavigating(params = {}) { + navigating.from = params.from ?? defaultStateNavigatingValues.from; + navigating.to = params.to ?? defaultStateNavigatingValues.to; + navigating.type = params.type ?? defaultStateNavigatingValues.type; + navigating.willUnload = params.willUnload ?? defaultStateNavigatingValues.willUnload; + navigating.delta = params.delta ?? defaultStateNavigatingValues.delta; + navigating.complete = params.complete ?? defaultStateNavigatingValues.complete; +} + +/** @type {boolean} */ +let updatedCurrent = $state.raw(false); + +export let updated = { + get current() { + return updatedCurrent; + }, + set current(newCurrent) { + updatedCurrent = newCurrent; + }, + check: fn(() => Promise.resolve(updatedCurrent)), +}; + +export function setAppStateUpdated(params = {}) { + updated.current = params.current ?? false; +} diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..718708998f6239a6ecab71b9680015eb15a1ecd0 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.svelte new file mode 100644 index 0000000000000000000000000000000000000000..efb82fdc4dcce2b3490e7bb63286dbe55e9078e8 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Button.svelte @@ -0,0 +1,27 @@ + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..23175a8203e537e7d5d5618c3755adf2800f6be3 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.stories.svelte @@ -0,0 +1,26 @@ + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.svelte new file mode 100644 index 0000000000000000000000000000000000000000..eac52bebd55d2be713886fe6b602bcd1a3e973d7 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Header.svelte @@ -0,0 +1,47 @@ + + +
+
+
+ + + + + + + +

Acme

+
+
+ {#if user} + + Welcome, {user.name}! + +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..d7361ed3a60aa5b22d0bf368001642e18a72a0f5 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.stories.svelte @@ -0,0 +1,30 @@ + + + { + const canvas = within(canvasElement); + const loginButton = canvas.getByRole('button', { name: /Log in/i }); + await expect(loginButton).toBeInTheDocument(); + await userEvent.click(loginButton); + await waitFor(() => expect(loginButton).not.toBeInTheDocument()); + + const logoutButton = canvas.getByRole('button', { name: /Log out/i }); + await expect(logoutButton).toBeInTheDocument(); + }} + /> + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.svelte new file mode 100644 index 0000000000000000000000000000000000000000..6b92ef599b60fda7bff4b4058dab03b571ad504f --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/js/Page.svelte @@ -0,0 +1,70 @@ + + +
+
(user = { name: 'Jane Doe' })} + onLogout={() => (user = undefined)} + onCreateAccount={() => (user = { name: 'Jane Doe' })} + /> + +
+

Pages in Storybook

+

+ We recommend building UIs with a + + component-driven + + process starting with atomic components and ending with pages. +

+

+ Render pages with mock data. This makes it easy to build and review page states without + needing to navigate to them in your app. Here are some handy patterns for managing page data + in Storybook: +

+
    +
  • + Use a higher-level connected component. Storybook helps you compose such data from the + "args" of child component stories +
  • +
  • + Assemble data in the page component from your services. You can mock these services out + using Storybook. +
  • +
+

+ Get a guided tutorial on component-driven development at + + Storybook tutorials + + . Read more in the + docs + . +

+
+ Tip + Adjust the width of the canvas with the + + + + + + Viewports addon in the toolbar +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..718708998f6239a6ecab71b9680015eb15a1ecd0 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.svelte new file mode 100644 index 0000000000000000000000000000000000000000..c34befec5be584db001021908d1d67aea22e27f1 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Button.svelte @@ -0,0 +1,30 @@ + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..23175a8203e537e7d5d5618c3755adf2800f6be3 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.stories.svelte @@ -0,0 +1,26 @@ + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.svelte new file mode 100644 index 0000000000000000000000000000000000000000..d6b7b216631527272641372f4fafd3e06f04b40b --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Header.svelte @@ -0,0 +1,45 @@ + + +
+
+
+ + + + + + + +

Acme

+
+
+ {#if user} + + Welcome, {user.name}! + +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.stories.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.stories.svelte new file mode 100644 index 0000000000000000000000000000000000000000..8f2ff2283d3e90b1eb820c074dc465dc5331e985 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.stories.svelte @@ -0,0 +1,30 @@ + + + { + const canvas = within(canvasElement); + const loginButton = canvas.getByRole('button', { name: /Log in/i }); + await expect(loginButton).toBeInTheDocument(); + await userEvent.click(loginButton); + await waitFor(() => expect(loginButton).not.toBeInTheDocument()); + + const logoutButton = canvas.getByRole('button', { name: /Log out/i }); + await expect(logoutButton).toBeInTheDocument(); + }} +/> + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.svelte new file mode 100644 index 0000000000000000000000000000000000000000..c4c069a5a50b31f1717a5c6f2da68a9bd0537ac6 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/cli/ts/Page.svelte @@ -0,0 +1,70 @@ + + +
+
(user = { name: 'Jane Doe' })} + onLogout={() => (user = undefined)} + onCreateAccount={() => (user = { name: 'Jane Doe' })} + /> + +
+

Pages in Storybook

+

+ We recommend building UIs with a + + component-driven + + process starting with atomic components and ending with pages. +

+

+ Render pages with mock data. This makes it easy to build and review page states without + needing to navigate to them in your app. Here are some handy patterns for managing page data + in Storybook: +

+
    +
  • + Use a higher-level connected component. Storybook helps you compose such data from the + "args" of child component stories +
  • +
  • + Assemble data in the page component from your services. You can mock these services out + using Storybook. +
  • +
+

+ Get a guided tutorial on component-driven development at + + Storybook tutorials + + . Read more in the + docs + . +

+
+ Tip + Adjust the width of the canvas with the + + + + + + Viewports addon in the toolbar +
+
+
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Environment.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Environment.svelte new file mode 100644 index 0000000000000000000000000000000000000000..7cdc852f7fcfb53321b341f035bd0b707668b91f --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Environment.svelte @@ -0,0 +1,8 @@ + + +
{browser}
+
{dev}
+
{building}
+
{version}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Forms.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Forms.svelte new file mode 100644 index 0000000000000000000000000000000000000000..8513ae2a7064de593bc0234bbf7eff5196375e7e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Forms.svelte @@ -0,0 +1,7 @@ + + +
+ +
\ No newline at end of file diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Hrefs.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Hrefs.svelte new file mode 100644 index 0000000000000000000000000000000000000000..4e7d69e0e051350543d06f0fec61b9bda55444f7 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Hrefs.svelte @@ -0,0 +1,8 @@ + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Navigation.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Navigation.svelte new file mode 100644 index 0000000000000000000000000000000000000000..c66e745f6df77f0992cbdd2fee67d4ec59230288 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Navigation.svelte @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Paths.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Paths.svelte new file mode 100644 index 0000000000000000000000000000000000000000..f4c1e81b53fed07cf7646a1a92f34188cbd40d91 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Paths.svelte @@ -0,0 +1,6 @@ + + +
{assets}
+
{base}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/State.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/State.svelte new file mode 100644 index 0000000000000000000000000000000000000000..9ded27316b130aa46348f4ed40cae8e861a2929b --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/State.svelte @@ -0,0 +1,16 @@ + + +

$app/state

+ +

page

+
{JSON.stringify(page, null, 2)}
+ +

navigating

+
{JSON.stringify(navigating, null, 2)}
+ +

updated

+
{JSON.stringify(updated, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Stores.svelte b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Stores.svelte new file mode 100644 index 0000000000000000000000000000000000000000..164b00f7fa8b1cbfa9f9df1219133a97adaf9b6b --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/Stores.svelte @@ -0,0 +1,17 @@ + + +

Directly importing

+
{JSON.stringify($page, null, 2)}
+
{JSON.stringify($navigating, null, 2)}
+
{JSON.stringify($updated, null, 2)}
+ +

With getStores

+
{JSON.stringify($pageStore, null, 2)}
+
{JSON.stringify($navigatingStore, null, 2)}
+
{JSON.stringify($updatedStore, null, 2)}
diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/environment.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/environment.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..126497d843272a85fffabf7364e1541229c8f7d5 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/environment.stories.js @@ -0,0 +1,8 @@ +import Environment from './Environment.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/environment', + component: Environment, +}; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/forms.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/forms.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..277f88c4bde4ff27299db0c562d0f32c883fe6bb --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/forms.stories.js @@ -0,0 +1,26 @@ +import { expect, fn, within } from 'storybook/test'; + +import Forms from './Forms.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/forms', + component: Forms, +}; + +const enhance = fn(); + +export const Enhance = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('enhance'); + button.click(); + expect(enhance).toHaveBeenCalled(); + }, + parameters: { + sveltekit_experimental: { + forms: { + enhance, + }, + }, + }, +}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/hrefs.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/hrefs.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..bfbc9926a6e650237e45e7d3b9ee1f0f5238b81e --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/hrefs.stories.js @@ -0,0 +1,52 @@ +import { expect, fn, within } from 'storybook/test'; + +import Hrefs from './Hrefs.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/hrefs', + component: Hrefs, +}; + +export const DefaultActions = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + + const initialUrl = window.location.toString(); + + const basicHref = canvas.getByText('/basic-href'); + basicHref.click(); + + const complexHref = canvas.getByText( + '/deep/nested/link?with=true&multiple-params=200#and-an-id' + ); + complexHref.click(); + + const finalUrl = window.location.toString(); + expect(finalUrl).toBe(initialUrl); + }, +}; + +const basicStringMatch = fn(); +const noMatch = fn(); +const exactStringMatch = fn(); +const regexMatch = fn(); + +export const Callbacks = { + parameters: { + sveltekit_experimental: { + hrefs: { + '/basic-href': basicStringMatch, + '/basic': noMatch, + '/deep/nested/link?with=true&multiple-params=200#and-an-id': exactStringMatch, + 'nested/link\\?with': { callback: regexMatch, asRegex: true }, + }, + }, + }, + play: async (ctx) => { + await DefaultActions.play(ctx); + expect(basicStringMatch).toHaveBeenCalledTimes(1); + expect(noMatch).not.toHaveBeenCalled(); + expect(exactStringMatch).toHaveBeenCalledTimes(1); + expect(regexMatch).toHaveBeenCalledTimes(1); + }, +}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/navigation.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/navigation.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..89e396b095325dbf3fdeae1d4d95f00ee3e67380 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/navigation.stories.js @@ -0,0 +1,120 @@ +import { expect, fn, within } from 'storybook/test'; + +import Navigation from './Navigation.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/navigation', + component: Navigation, +}; + +const goto = fn(); + +export const Goto = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('goto'); + button.click(); + expect(goto).toHaveBeenCalledWith('/storybook-goto'); + }, + parameters: { + sveltekit_experimental: { + navigation: { + goto, + }, + }, + }, +}; + +const replaceState = fn(); + +export const ReplaceState = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('replaceState'); + button.click(); + expect(replaceState).toHaveBeenCalledWith('/storybook-replace-state', {}); + }, + parameters: { + sveltekit_experimental: { + navigation: { + replaceState, + }, + }, + }, +}; + +const pushState = fn(); + +export const PushState = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('pushState'); + button.click(); + expect(pushState).toHaveBeenCalledWith('/storybook-push-state', {}); + }, + parameters: { + sveltekit_experimental: { + navigation: { + pushState, + }, + }, + }, +}; + +export const DefaultActions = {}; + +const invalidate = fn(); + +export const Invalidate = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('invalidate', { exact: true }); + button.click(); + expect(invalidate).toHaveBeenCalledWith('/storybook-invalidate'); + }, + parameters: { + sveltekit_experimental: { + navigation: { + invalidate, + }, + }, + }, +}; + +const invalidateAll = fn(); + +export const InvalidateAll = { + async play({ canvasElement }) { + const canvas = within(canvasElement); + const button = canvas.getByText('invalidateAll'); + button.click(); + expect(invalidateAll).toHaveBeenCalledWith(); + }, + parameters: { + sveltekit_experimental: { + navigation: { + invalidateAll, + }, + }, + }, +}; + +const afterNavigateFn = fn(); + +export const AfterNavigate = { + async play() { + expect(afterNavigateFn).toHaveBeenCalledWith({ test: 'passed' }); + }, + args: { + afterNavigateFn, + }, + parameters: { + sveltekit_experimental: { + navigation: { + afterNavigate: { + test: 'passed', + }, + }, + }, + }, +}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/paths.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/paths.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..e69ae8e59e53c4d946e02d6c0b19936a5af7ed54 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/paths.stories.js @@ -0,0 +1,8 @@ +import Paths from './Paths.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/paths', + component: Paths, +}; + +export const Default = {}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/state.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/state.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..ad46633ea1baf6b8be4f98d1046808b98470e3a3 --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/state.stories.js @@ -0,0 +1,84 @@ +import State from './State.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/state', + component: State, + parameters: { + sveltekit_experimental: { + state: { + page: { + url: new URL('https://storybook.js.org'), // necessary to make the rendered output deterministic in CH snapshots + }, + }, + }, + }, +}; + +export const Default = {}; + +export const Page = { + parameters: { + sveltekit_experimental: { + state: { + page: { + data: { + test: 'passed', + }, + form: { + framework: 'SvelteKit', + rating: 5, + }, + params: { + referrer: 'storybook', + }, + route: { + id: '/framework/sveltekit', + }, + status: 200, + url: new URL('https://svelte.dev/docs/kit/'), + }, + }, + }, + }, +}; + +export const Navigating = { + parameters: { + sveltekit_experimental: { + state: { + navigating: { + from: { + params: { + framework: 'SvelteKit', + }, + route: { + id: '/framework/sveltekit', + }, + url: new URL('https://svelte.dev'), + }, + to: { + route: { id: '/storybook' }, + params: {}, + url: new URL('https://storybook.js.org'), + }, + type: 'link', + willUnload: true, + delta: 3, + complete: Promise.resolve(), + }, + }, + }, + }, +}; + +export const Updated = { + parameters: { + sveltekit_experimental: { + state: { + updated: { + current: true, + }, + }, + }, + }, +}; diff --git a/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/stores.stories.js b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/stores.stories.js new file mode 100644 index 0000000000000000000000000000000000000000..539f35176599213768c9f5ef6f816717797bdeee --- /dev/null +++ b/tools/ui/node_modules/@storybook/sveltekit/template/stories_svelte-kit-skeleton-ts/modules/stores.stories.js @@ -0,0 +1,115 @@ +import Stores from './Stores.svelte'; + +export default { + title: 'stories/frameworks/sveltekit/modules/stores', + component: Stores, +}; + +export const AllUndefined = {}; + +export const PageStore = { + parameters: { + sveltekit_experimental: { + stores: { + page: { + data: { + test: 'passed', + }, + }, + }, + }, + }, +}; + +export const NavigatingStore = { + parameters: { + sveltekit_experimental: { + stores: { + navigating: { + route: { + id: '/storybook', + }, + }, + }, + }, + }, +}; + +export const UpdatedStore = { + parameters: { + sveltekit_experimental: { + stores: { + updated: true, + }, + }, + }, +}; + +export const PageAndNavigatingStore = { + parameters: { + sveltekit_experimental: { + stores: { + page: { + data: { + test: 'passed', + }, + }, + navigating: { + route: { + id: '/storybook', + }, + }, + }, + }, + }, +}; + +export const PageAndUpdatedStore = { + parameters: { + sveltekit_experimental: { + stores: { + page: { + data: { + test: 'passed', + }, + }, + updated: true, + }, + }, + }, +}; + +export const NavigatingAndUpdatedStore = { + parameters: { + sveltekit_experimental: { + stores: { + navigating: { + route: { + id: '/storybook', + }, + }, + updated: true, + }, + }, + }, +}; + +export const AllThreeStores = { + parameters: { + sveltekit_experimental: { + stores: { + page: { + data: { + test: 'passed', + }, + }, + navigating: { + route: { + id: '/storybook', + }, + }, + updated: true, + }, + }, + }, +}; diff --git a/tools/ui/node_modules/@sveltejs/acorn-typescript/LICENSE.md b/tools/ui/node_modules/@sveltejs/acorn-typescript/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..36d00ff1fd751829a244f1edd040dc153712c699 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/acorn-typescript/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2022 Tyreal Hu +Copyright (c) 2025 The Svelte Team + +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/tools/ui/node_modules/@sveltejs/acorn-typescript/README.md b/tools/ui/node_modules/@sveltejs/acorn-typescript/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c6305decb779ffdfc6604810ed7b10a50439dc36 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/acorn-typescript/README.md @@ -0,0 +1,70 @@ +# @sveltejs/acorn-typescript + +[![License](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat) + +This is a plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. + +It was created as an experimental alternative, faster [TypeScript](https://www.typescriptlang.org/) parser. It will help you to parse +TypeScript using Acorn. + +## Usage + +To get started, import the plugin and use Acorn's extension mechanism to register it. You have to enable `options.locations` while using `@sveltejs/acorn-typescript`. + +```typescript +import { Parser } from 'acorn'; +import { tsPlugin } from '@sveltejs/acorn-typescript'; + +const node = Parser.extend(tsPlugin()).parse( + ` +const a = 1 +type A = number +export { + a, + type A as B +} +`, + { + sourceType: 'module', + ecmaVersion: 'latest', + locations: true + } +); +``` + +If you want to enable parsing within a TypeScript ambient context, where certain syntax have different rules (like `.d.ts` files and inside [declare module blocks](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)): + +```typescript +import { Parser } from 'acorn'; +import { tsPlugin } from '@sveltejs/acorn-typescript'; + +const node = Parser.extend(tsPlugin({ dts: true })).parse( + ` +const a = 1 +type A = number +export { + a, + type A as B +} +`, + { + sourceType: 'module', + ecmaVersion: 'latest', + locations: true + } +); +``` + +## SUPPORTED + +- Typescript normal syntax +- Support to parse TypeScript [Decorators](https://www.typescriptlang.org/docs/handbook/decorators.html) +- Support to parse JSX & TSX + +## CHANGELOG + +[click](./CHANGELOG.md) + +## Acknowledgments + +We want to thank [TyrealHu](https://github.com/TyrealHu) for his original work on this project. He maintained [`acorn-typescript`](https://github.com/TyrealHu/acorn-typescript) until early 2024. diff --git a/tools/ui/node_modules/@sveltejs/acorn-typescript/index.d.ts b/tools/ui/node_modules/@sveltejs/acorn-typescript/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f357ecf1bb1a5a1c4abdf951e0d71b65e2d2320 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/acorn-typescript/index.d.ts @@ -0,0 +1,12 @@ +import { Parser } from 'acorn'; + +export function tsPlugin(options?: { + dts?: boolean; + /** Whether to use JSX. Defaults to false */ + jsx?: + | boolean + | { + allowNamespaces?: boolean; + allowNamespacedObjects?: boolean; + }; +}): (BaseParser: typeof Parser) => typeof Parser; diff --git a/tools/ui/node_modules/@sveltejs/acorn-typescript/index.js b/tools/ui/node_modules/@sveltejs/acorn-typescript/index.js new file mode 100644 index 0000000000000000000000000000000000000000..eed0470be97b926d139ac3ecc1f0dea5bdde4530 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/acorn-typescript/index.js @@ -0,0 +1,5017 @@ +// src/index.ts +import * as acornNamespace from "acorn"; + +// src/tokenType.ts +var startsExpr = true; +var acornTypeScriptMap = /* @__PURE__ */ new WeakMap(); +function generateAcornTypeScript(_acorn) { + const acorn = _acorn.Parser.acorn || _acorn; + let acornTypeScript = acornTypeScriptMap.get(acorn); + if (!acornTypeScript) { + let tokenIsLiteralPropertyName = function(token) { + return token === tokTypes.name || token === tokTypes.string || token === tokTypes.num || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token); + }, tokenIsKeywordOrIdentifier = function(token) { + return token === tokTypes.name || keywordTypeValues.includes(token) || tsKwTokenTypeValues.includes(token); + }, tokenIsIdentifier = function(token) { + return token === tokTypes.name || tsKwTokenTypeValues.includes(token); + }, tokenIsTSDeclarationStart = function(token) { + return token === tsKwTokenType.abstract || token === tsKwTokenType.declare || token === tsKwTokenType.enum || token === tsKwTokenType.module || token === tsKwTokenType.namespace || token === tsKwTokenType.interface || token === tsKwTokenType.type; + }, tokenIsTSTypeOperator = function(token) { + return token === tsKwTokenType.keyof || token === tsKwTokenType.readonly || token === tsKwTokenType.unique; + }, tokenIsTemplate = function(token) { + return token === tokTypes.invalidTemplate; + }; + const { tokTypes, keywordTypes } = acorn; + const keywordTypeValues = Object.values(keywordTypes); + const tsKwTokenType = generateTsKwTokenType(); + const tsKwTokenTypeValues = Object.values(tsKwTokenType); + const tsTokenType = generateTsTokenType(); + const tsTokenContext = generateTsTokenContext(); + const tsKeywordsRegExp = new RegExp(`^(?:${Object.keys(tsKwTokenType).join("|")})$`); + tsTokenType.jsxTagStart.updateContext = function() { + this.context.push(tsTokenContext.tc_expr); + this.context.push(tsTokenContext.tc_oTag); + this.exprAllowed = false; + }; + tsTokenType.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tsTokenContext.tc_oTag && prevType === tokTypes.slash || out === tsTokenContext.tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tsTokenContext.tc_expr; + } else { + this.exprAllowed = true; + } + }; + acornTypeScript = { + tokTypes: { + ...tsKwTokenType, + ...tsTokenType + }, + tokContexts: { + ...tsTokenContext + }, + keywordsRegExp: tsKeywordsRegExp, + tokenIsLiteralPropertyName, + tokenIsKeywordOrIdentifier, + tokenIsIdentifier, + tokenIsTSDeclarationStart, + tokenIsTSTypeOperator, + tokenIsTemplate + }; + } + return acornTypeScript; + function kwLike(_name, options = {}) { + return new acorn.TokenType("name", options); + } + function generateTsTokenContext() { + return { + tc_oTag: new acorn.TokContext("...", true, true) + }; + } + function generateTsTokenType() { + return { + // @ts-expect-error + at: new acorn.TokenType("@"), + // @ts-expect-error + jsxName: new acorn.TokenType("jsxName"), + // @ts-expect-error + jsxText: new acorn.TokenType("jsxText", { beforeExpr: true }), + // @ts-expect-error + jsxTagStart: new acorn.TokenType("jsxTagStart", { startsExpr: true }), + // @ts-expect-error + jsxTagEnd: new acorn.TokenType("jsxTagEnd") + }; + } + function generateTsKwTokenType() { + return { + assert: kwLike("assert", { startsExpr }), + asserts: kwLike("asserts", { startsExpr }), + global: kwLike("global", { startsExpr }), + keyof: kwLike("keyof", { startsExpr }), + readonly: kwLike("readonly", { startsExpr }), + unique: kwLike("unique", { startsExpr }), + abstract: kwLike("abstract", { startsExpr }), + declare: kwLike("declare", { startsExpr }), + enum: kwLike("enum", { startsExpr }), + module: kwLike("module", { startsExpr }), + namespace: kwLike("namespace", { startsExpr }), + interface: kwLike("interface", { startsExpr }), + type: kwLike("type", { startsExpr }) + }; + } +} + +// src/scopeflags.ts +var TS_SCOPE_OTHER = 512; +var TS_SCOPE_TS_MODULE = 1024; +var BIND_KIND_VALUE = 1; +var BIND_KIND_TYPE = 2; +var BIND_SCOPE_VAR = 4; +var BIND_SCOPE_LEXICAL = 8; +var BIND_SCOPE_FUNCTION = 16; +var BIND_FLAGS_NONE = 64; +var BIND_FLAGS_CLASS = 128; +var BIND_FLAGS_TS_ENUM = 256; +var BIND_FLAGS_TS_CONST_ENUM = 512; +var BIND_FLAGS_TS_EXPORT_ONLY = 1024; +var BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS; +var BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0; +var BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0; +var BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0; +var BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS; +var BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0; +var BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM; +var BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; +var BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE; +var BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE; +var BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM; +var BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; +var CLASS_ELEMENT_FLAG_STATIC = 4; +var CLASS_ELEMENT_KIND_GETTER = 2; +var CLASS_ELEMENT_KIND_SETTER = 1; +var CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; +var CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC; +var CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC; + +// src/whitespace.ts +var skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; +var skipWhiteSpaceToLineBreak = new RegExp( + // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or + // possessive quantifiers, so we use a trick to prevent backtracking + // when the look-ahead for line terminator fails. + "(?=(" + // Capture the whitespace and comments that should be skipped inside + // a look-ahead assertion, and then re-match the group as a unit. + skipWhiteSpaceInLine.source + "))\\1" + // Look-ahead for either line terminator, start of multi-line comment, + // or end of string. + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, + "y" + // sticky +); + +// src/parseutil.ts +var DestructuringErrors = class { + constructor() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; + } +}; +function isPrivateNameConflicted(privateNameMap, element) { + const name = element.key.name; + const curr = privateNameMap[name]; + let next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name] = "true"; + return false; + } else if (!curr) { + privateNameMap[name] = next; + return false; + } else { + return true; + } +} +function checkKeyName(node, name) { + const { computed, key } = node; + return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name); +} + +// src/error.ts +var TypeScriptError = { + AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, + AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, + AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", + AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", + CannotFindName: ({ name }) => `Cannot find name '${name}'.`, + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", + ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", + ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", + ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", + DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, + DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", + DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", + DuplicateAccessibilityModifier: ( + // `Accessibility modifier already seen: ${modifier}` would be more helpful. + // eslint-disable-next-line @typescript-eslint/no-unused-vars + () => `Accessibility modifier already seen.` + ), + DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, + // `token` matches the terminology used by typescript: + // https://github.com/microsoft/TypeScript/blob/main/src/compiler/types.ts#L2915 + EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", + ImportAliasHasImportType: "An import alias can not use 'import type'.", + IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, + IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", + IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, + IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", + IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", + IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", + InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", + InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, + InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, + InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, + InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.", + InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", + MissingInterfaceName: "'interface' declarations must be followed by an identifier.", + NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", + NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", + OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", + OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", + PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", + PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", + PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, + PrivateMethodsHasAccessibility: ({ modifier }) => `Private methods cannot have an accessibility modifier ('${modifier}').`, + ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", + ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", + ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", + SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", + SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", + SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", + SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, + StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", + TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", + TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", + TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", + UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", + UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", + GenericsEndWithComma: `Trailing comma is not allowed at the end of generics.`, + UnexpectedTypeAnnotation: "Did not expect a type annotation here.", + UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", + UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", + UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", + UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, + LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." +}; +var DecoratorsError = { + UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", + DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", + TrailingDecorator: "Decorators must be attached to a class element.", + SpreadElementDecorator: `Decorators can't be used with SpreadElement` +}; + +// src/extentions/decorators.ts +function generateParseDecorators(Parse, acornTypeScript, acorn) { + const { tokTypes: tt } = acorn; + const { tokTypes } = acornTypeScript; + return class ParseDecorators extends Parse { + takeDecorators(node) { + const decorators = this.decoratorStack[this.decoratorStack.length - 1]; + if (decorators.length) { + node.decorators = decorators; + this.resetStartLocationFromNode(node, decorators[0]); + this.decoratorStack[this.decoratorStack.length - 1] = []; + } + } + parseDecorators(allowExport) { + const currentContextDecorators = this.decoratorStack[this.decoratorStack.length - 1]; + while (this.match(tokTypes.at)) { + const decorator = this.parseDecorator(); + currentContextDecorators.push(decorator); + } + if (this.match(tt._export)) { + if (!allowExport) { + this.unexpected(); + } + } else if (!this.canHaveLeadingDecorator()) { + this.raise(this.start, DecoratorsError.UnexpectedLeadingDecorator); + } + } + parseDecorator() { + const node = this.startNode(); + this.next(); + this.decoratorStack.push([]); + const startPos = this.start; + const startLoc = this.startLoc; + let expr; + if (this.match(tt.parenL)) { + const startPos2 = this.start; + const startLoc2 = this.startLoc; + this.next(); + expr = this.parseExpression(); + this.expect(tt.parenR); + if (this.options.preserveParens) { + let par = this.startNodeAt(startPos2, startLoc2); + par.expression = expr; + expr = this.finishNode(par, "ParenthesizedExpression"); + } + } else { + expr = this.parseIdent(false); + while (this.eat(tt.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.object = expr; + node2.property = this.parseIdent(true); + node2.computed = false; + expr = this.finishNode(node2, "MemberExpression"); + } + } + node.expression = this.parseMaybeDecoratorArguments(expr); + this.decoratorStack.pop(); + return this.finishNode(node, "Decorator"); + } + parseMaybeDecoratorArguments(expr) { + if (this.eat(tt.parenL)) { + const node = this.startNodeAtNode(expr); + node.callee = expr; + node.arguments = this.parseExprList(tt.parenR, false); + return this.finishNode(node, "CallExpression"); + } + return expr; + } + }; +} + +// src/extentions/jsx/xhtml.ts +var xhtml_default = { + quot: '"', + amp: "&", + apos: "'", + lt: "<", + gt: ">", + nbsp: "\xA0", + iexcl: "\xA1", + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + Agrave: "\xC0", + Aacute: "\xC1", + Acirc: "\xC2", + Atilde: "\xC3", + Auml: "\xC4", + Aring: "\xC5", + AElig: "\xC6", + Ccedil: "\xC7", + Egrave: "\xC8", + Eacute: "\xC9", + Ecirc: "\xCA", + Euml: "\xCB", + Igrave: "\xCC", + Iacute: "\xCD", + Icirc: "\xCE", + Iuml: "\xCF", + ETH: "\xD0", + Ntilde: "\xD1", + Ograve: "\xD2", + Oacute: "\xD3", + Ocirc: "\xD4", + Otilde: "\xD5", + Ouml: "\xD6", + times: "\xD7", + Oslash: "\xD8", + Ugrave: "\xD9", + Uacute: "\xDA", + Ucirc: "\xDB", + Uuml: "\xDC", + Yacute: "\xDD", + THORN: "\xDE", + szlig: "\xDF", + agrave: "\xE0", + aacute: "\xE1", + acirc: "\xE2", + atilde: "\xE3", + auml: "\xE4", + aring: "\xE5", + aelig: "\xE6", + ccedil: "\xE7", + egrave: "\xE8", + eacute: "\xE9", + ecirc: "\xEA", + euml: "\xEB", + igrave: "\xEC", + iacute: "\xED", + icirc: "\xEE", + iuml: "\xEF", + eth: "\xF0", + ntilde: "\xF1", + ograve: "\xF2", + oacute: "\xF3", + ocirc: "\xF4", + otilde: "\xF5", + ouml: "\xF6", + divide: "\xF7", + oslash: "\xF8", + ugrave: "\xF9", + uacute: "\xFA", + ucirc: "\xFB", + uuml: "\xFC", + yacute: "\xFD", + thorn: "\xFE", + yuml: "\xFF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" +}; + +// src/extentions/jsx/index.ts +var hexNumber = /^[\da-fA-F]+$/; +var decimalNumber = /^\d+$/; +function getQualifiedJSXName(object) { + if (!object) return object; + if (object.type === "JSXIdentifier") return object.name; + if (object.type === "JSXNamespacedName") return object.namespace.name + ":" + object.name.name; + if (object.type === "JSXMemberExpression") + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); +} +function generateJsxParser(acorn, acornTypeScript, Parser, jsxOptions) { + const tt = acorn.tokTypes; + const tok = acornTypeScript.tokTypes; + const isNewLine = acorn.isNewLine; + const isIdentifierChar = acorn.isIdentifierChar; + const options = Object.assign( + { + allowNamespaces: true, + allowNamespacedObjects: true + }, + jsxOptions || {} + ); + return class JsxParser extends Parser { + // Reads inline JSX contents token. + jsx_readToken() { + let out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) this.raise(this.start, "Unterminated JSX contents"); + let ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 60: + // '<' + case 123: + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + case 38: + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + case 62: + // '>' + case 125: + this.raise( + this.pos, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (ch === 62 ? ">" : "}") + '` or `{"' + this.input[this.pos] + '"}`?' + ); + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + return out; + } + jsx_readString(quote) { + let out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) this.raise(this.start, "Unterminated string constant"); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + jsx_readEntity() { + let str = "", count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== "&") this.raise(this.pos, "Entity must start with an ampersand"); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ";") { + if (str[0] === "#") { + if (str[1] === "x") { + str = str.substr(2); + if (hexNumber.test(str)) entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = xhtml_default[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return "&"; + } + return entity; + } + // Read a JSX identifier (valid tag or attribute name). + // + // Optimized version since JSX identifiers can't contain + // escape characters and so can be read as single slice. + // Also assumes that first character was already checked + // by isIdentifierStart in readToken. + jsx_readWord() { + let ch, start = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar(ch) || ch === 45); + return this.finishToken(tok.jsxName, this.input.slice(start, this.pos)); + } + // Parse next token as JSX identifier + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) node.name = this.value; + else if (this.type.keyword) node.name = this.type.keyword; + else this.unexpected(); + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + // Parse namespaced identifier. + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) return name; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + // Parses element name in any form - namespaced, member + // or single identifier. + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) return ""; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === "JSXNamespacedName" && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + // Parses any type of JSX attribute value. + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") + this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + return node; + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + default: + this.raise(this.start, "JSX value should be either an expression or a quoted JSX text"); + } + } + // JSXEmptyExpression is unique type since it doesn't actually parse anything, + // and so it should start at the end of last read token (left brace) and finish + // at the beginning of the next one (right brace). + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc); + } + // Parses JSX expression enclosed into curly brackets. + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXExpressionContainer"); + } + // Parses following JSX attribute name-value pair. + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + // Parses JSX opening tag starting after '<'. + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); + } + // Parses JSX closing tag starting after '" + ); + } + } + let fragmentOrElement = openingElement.name ? "Element" : "Fragment"; + node["opening" + fragmentOrElement] = openingElement; + node["closing" + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, "JSX" + fragmentOrElement); + } + // Parse JSX text + jsx_parseText() { + let node = this.parseLiteral(this.value); + node.type = "JSXText"; + return node; + } + // Parses entire JSX element from current position. + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + }; +} + +// src/extentions/import-assertions.ts +function generateParseImportAssertions(Parse, acornTypeScript, acorn) { + const { tokTypes } = acornTypeScript; + const { tokTypes: tt } = acorn; + return class ImportAttributes extends Parse { + parseMaybeImportAttributes(node) { + if (this.type === tt._with || this.type === tokTypes.assert) { + this.next(); + const attributes = this.parseImportAttributes(); + if (attributes) { + node.attributes = attributes; + } + } + } + parseImportAttributes() { + this.expect(tt.braceL); + const attrs = this.parseWithEntries(); + this.expect(tt.braceR); + return attrs; + } + parseWithEntries() { + const attrs = []; + const attrNames = /* @__PURE__ */ new Set(); + do { + if (this.type === tt.braceR) { + break; + } + const node = this.startNode(); + let withionKeyNode; + if (this.type === tt.string) { + withionKeyNode = this.parseLiteral(this.value); + } else { + withionKeyNode = this.parseIdent(true); + } + this.next(); + node.key = withionKeyNode; + if (attrNames.has(node.key.name)) { + this.raise(this.pos, "Duplicated key in attributes"); + } + attrNames.add(node.key.name); + if (this.type !== tt.string) { + this.raise(this.pos, "Only string is supported as an attribute value"); + } + node.value = this.parseLiteral(this.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(tt.comma)); + return attrs; + } + }; +} + +// src/index.ts +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +function assert(x) { + if (!x) { + throw new Error("Assert fail"); + } +} +function tsIsClassAccessor(modifier) { + return modifier === "accessor"; +} +function tsIsVarianceAnnotations(modifier) { + return modifier === "in" || modifier === "out"; +} +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; +var acornScope = { + SCOPE_TOP: 1, + SCOPE_FUNCTION: 2, + SCOPE_ASYNC: 4, + SCOPE_GENERATOR: 8, + SCOPE_ARROW: 16, + SCOPE_SIMPLE_CATCH: 32, + SCOPE_SUPER: 64, + SCOPE_DIRECT_SUPER: 128, + SCOPE_CLASS_STATIC_BLOCK: 256, + SCOPE_VAR: 256, + BIND_NONE: 0, + // Not a binding + BIND_VAR: 1, + // Var-style binding + BIND_LEXICAL: 2, + // Let- or const-style binding + BIND_FUNCTION: 3, + // Function declaration + BIND_SIMPLE_CATCH: 4, + // Simple (identifier pattern) catch binding + BIND_OUTSIDE: 5, + // Special case for function names as bound inside the + BIND_TS_TYPE: 6, + BIND_TS_INTERFACE: 7, + BIND_TS_NAMESPACE: 8 | 1024, + // includes BIND_FLAGS_TS_EXPORT_ONLY for declaration merging + BIND_FLAGS_TS_EXPORT_ONLY: 1024, + BIND_FLAGS_TS_IMPORT: 4096, + BIND_FLAGS_TS_ENUM: 256, + BIND_FLAGS_TS_CONST_ENUM: 512, + BIND_FLAGS_CLASS: 128 + // function +}; +function functionFlags(async, generator) { + return acornScope.SCOPE_FUNCTION | (async ? acornScope.SCOPE_ASYNC : 0) | (generator ? acornScope.SCOPE_GENERATOR : 0); +} +function isPossiblyLiteralEnum(expression) { + if (expression.type !== "MemberExpression") return false; + const { computed, property } = expression; + if (computed && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); +} +function isUncomputedMemberExpressionChain(expression) { + if (expression.type === "Identifier") return true; + if (expression.type !== "MemberExpression") return false; + if (expression.computed) return false; + return isUncomputedMemberExpressionChain(expression.object); +} +function tsIsAccessModifier(modifier) { + return modifier === "private" || modifier === "public" || modifier === "protected"; +} +function tokenCanStartExpression(token) { + return Boolean(token.startsExpr); +} +function nonNull(x) { + if (x == null) { + throw new Error(`Unexpected ${x} value.`); + } + return x; +} +function keywordTypeFromName(value) { + switch (value) { + case "any": + return "TSAnyKeyword"; + case "boolean": + return "TSBooleanKeyword"; + case "bigint": + return "TSBigIntKeyword"; + case "never": + return "TSNeverKeyword"; + case "number": + return "TSNumberKeyword"; + case "object": + return "TSObjectKeyword"; + case "string": + return "TSStringKeyword"; + case "symbol": + return "TSSymbolKeyword"; + case "undefined": + return "TSUndefinedKeyword"; + case "unknown": + return "TSUnknownKeyword"; + default: + return void 0; + } +} +function tsPlugin(options) { + const { dts = false } = options || {}; + const disallowAmbiguousJSXLike = !!options?.jsx; + return function(Parser) { + const _acorn = Parser.acorn || acornNamespace; + const acornTypeScript = generateAcornTypeScript(_acorn); + const tt = _acorn.tokTypes; + const keywordTypes = _acorn.keywordTypes; + const isIdentifierStart = _acorn.isIdentifierStart; + const lineBreak = _acorn.lineBreak; + const isNewLine = _acorn.isNewLine; + const tokContexts = _acorn.tokContexts; + const isIdentifierChar = _acorn.isIdentifierChar; + const { + tokTypes, + tokContexts: tsTokContexts, + keywordsRegExp, + tokenIsLiteralPropertyName, + tokenIsTemplate, + tokenIsTSDeclarationStart, + tokenIsIdentifier, + tokenIsKeywordOrIdentifier, + tokenIsTSTypeOperator + } = acornTypeScript; + function nextLineBreak(code, from, end = code.length) { + for (let i = from; i < end; i++) { + let next = code.charCodeAt(i); + if (isNewLine(next)) + return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; + } + return -1; + } + Parser = generateParseDecorators(Parser, acornTypeScript, _acorn); + if (options?.jsx) { + Parser = generateJsxParser( + _acorn, + acornTypeScript, + Parser, + typeof options.jsx === "boolean" ? {} : options.jsx + ); + } + Parser = generateParseImportAssertions(Parser, acornTypeScript, _acorn); + class TypeScriptParser extends Parser { + constructor(options2, input, startPos) { + super(options2, input, startPos); + this.preValue = null; + this.preToken = null; + this.isLookahead = false; + this.isAmbientContext = false; + this.inAbstractClass = false; + this.inType = false; + this.inDisallowConditionalTypesContext = false; + this.maybeInArrowParameters = false; + this.shouldParseArrowReturnType = void 0; + this.shouldParseAsyncArrowReturnType = void 0; + this.decoratorStack = [[]]; + this.importsStack = [[]]; + /** + * we will only parse one import node or export node at same time. + * default kind is undefined + * */ + this.importOrExportOuterKind = void 0; + this.tsParseConstModifier = (node) => { + this.tsParseModifiers({ + modified: node, + allowedModifiers: ["const"], + // for better error recovery + disallowedModifiers: ["in", "out"], + errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions + }); + }; + this.ecmaVersion = this.options.ecmaVersion; + } + // support in Class static + static get acornTypeScript() { + return acornTypeScript; + } + // support in runtime, get acornTypeScript be this + get acornTypeScript() { + return acornTypeScript; + } + getTokenFromCodeInType(code) { + if (code === 62) { + return this.finishOp(tt.relational, 1); + } + if (code === 60) { + return this.finishOp(tt.relational, 1); + } + return super.getTokenFromCode(code); + } + readToken(code) { + if (!this.inType) { + let context = this.curContext(); + if (context === tsTokContexts.tc_expr) return this.jsx_readToken(); + if (context === tsTokContexts.tc_oTag || context === tsTokContexts.tc_cTag) { + if (isIdentifierStart(code)) return this.jsx_readWord(); + if (code == 62) { + ++this.pos; + return this.finishToken(tokTypes.jsxTagEnd); + } + if ((code === 34 || code === 39) && context == tsTokContexts.tc_oTag) + return this.jsx_readString(code); + } + if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + if (options?.jsx) { + return this.finishToken(tokTypes.jsxTagStart); + } else { + return this.finishToken(tt.relational, "<"); + } + } + } + return super.readToken(code); + } + getTokenFromCode(code) { + if (this.inType) { + return this.getTokenFromCodeInType(code); + } + if (code === 64) { + ++this.pos; + return this.finishToken(tokTypes.at); + } + return super.getTokenFromCode(code); + } + isAbstractClass() { + return this.ts_isContextual(tokTypes.abstract) && this.lookahead().type === tt._class; + } + finishNode(node, type) { + if (node.type !== "" && node.end !== 0) { + return node; + } + return super.finishNode(node, type); + } + // tryParse will clone parser state. + // It is expensive and should be used with cautions + tryParse(fn, oldState = this.cloneCurLookaheadState()) { + const abortSignal = { node: null }; + try { + const node = fn((node2 = null) => { + abortSignal.node = node2; + throw abortSignal; + }); + return { + node, + error: null, + thrown: false, + aborted: false, + failState: null + }; + } catch (error) { + const failState = this.getCurLookaheadState(); + this.setLookaheadState(oldState); + if (error instanceof SyntaxError) { + return { + node: null, + error, + thrown: true, + aborted: false, + failState + }; + } + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + throw error; + } + } + setOptionalParametersError(refExpressionErrors, resultError) { + refExpressionErrors.optionalParametersLoc = resultError?.loc ?? this.startLoc; + } + // used after we have finished parsing types + reScan_lt_gt() { + if (this.type === tt.relational) { + this.pos -= 1; + this.readToken_lt_gt(this.fullCharCodeAtPos()); + } + } + reScan_lt() { + const { type } = this; + if (type === tt.bitShift) { + this.pos -= 2; + this.finishOp(tt.relational, 1); + return tt.relational; + } + return type; + } + resetEndLocation(node, endPos = this.lastTokEnd, endLoc = this.lastTokEndLoc) { + node.end = endPos; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endPos; + } + startNodeAtNode(type) { + return super.startNodeAt(type.start, type.loc.start); + } + nextTokenStart() { + return this.nextTokenStartSince(this.pos); + } + tsHasSomeModifiers(member, modifiers) { + return modifiers.some((modifier) => { + if (tsIsAccessModifier(modifier)) { + return member.accessibility === modifier; + } + return !!member[modifier]; + }); + } + tsIsStartOfStaticBlocks() { + return this.isContextual("static") && this.lookaheadCharCode() === 123; + } + tsCheckForInvalidTypeCasts(items) { + items.forEach((node) => { + if (node?.type === "TSTypeCastExpression") { + this.raise(node.typeAnnotation.start, TypeScriptError.UnexpectedTypeAnnotation); + } + }); + } + atPossibleAsyncArrow(base) { + return base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.potentialArrowAt; + } + tsIsIdentifier() { + return tokenIsIdentifier(this.type); + } + tsTryParseTypeOrTypePredicateAnnotation() { + return this.match(tt.colon) ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon) : void 0; + } + tsTryParseGenericAsyncArrowFunction(startPos, startLoc, forInit) { + if (!this.tsMatchLeftRelational()) { + return void 0; + } + const oldMaybeInArrowParameters = this.maybeInArrowParameters; + this.maybeInArrowParameters = true; + const res = this.tsTryParseAndCatch(() => { + const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + super.parseFunctionParams(node); + node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); + this.expect(tt.arrow); + return node; + }); + this.maybeInArrowParameters = oldMaybeInArrowParameters; + if (!res) { + return void 0; + } + return super.parseArrowExpression( + res, + /* params are already set */ + null, + /* async */ + true, + /* forInit */ + forInit + ); + } + // Used when parsing type arguments from ES productions, where the first token + // has been created without state.inType. Thus we need to rescan the lt token. + tsParseTypeArgumentsInExpression() { + if (this.reScan_lt() !== tt.relational) { + return void 0; + } + return this.tsParseTypeArguments(); + } + tsInNoContext(cb) { + const oldContext = this.context; + this.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.context = oldContext; + } + } + tsTryParseTypeAnnotation() { + return this.match(tt.colon) ? this.tsParseTypeAnnotation() : void 0; + } + isUnparsedContextual(nameStart, name) { + const nameEnd = nameStart + name.length; + if (this.input.slice(nameStart, nameEnd) === name) { + const nextCh = this.input.charCodeAt(nameEnd); + return !(isIdentifierChar(nextCh) || // check if `nextCh is between 0xd800 - 0xdbff, + // if `nextCh` is NaN, `NaN & 0xfc00` is 0, the function + // returns true + (nextCh & 64512) === 55296); + } + return false; + } + isAbstractConstructorSignature() { + return this.ts_isContextual(tokTypes.abstract) && this.lookahead().type === tt._new; + } + nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; + } + lookaheadCharCode() { + return this.input.charCodeAt(this.nextTokenStart()); + } + compareLookaheadState(state, state2) { + for (const key of Object.keys(state)) { + if (state[key] !== state2[key]) return false; + } + return true; + } + createLookaheadState() { + this.value = null; + this.context = [this.curContext()]; + } + getCurLookaheadState() { + return { + endLoc: this.endLoc, + lastTokEnd: this.lastTokEnd, + lastTokStart: this.lastTokStart, + lastTokStartLoc: this.lastTokStartLoc, + pos: this.pos, + value: this.value, + type: this.type, + start: this.start, + end: this.end, + context: this.context, + startLoc: this.startLoc, + lastTokEndLoc: this.lastTokEndLoc, + curLine: this.curLine, + lineStart: this.lineStart, + curPosition: this.curPosition, + containsEsc: this.containsEsc + }; + } + cloneCurLookaheadState() { + return { + pos: this.pos, + value: this.value, + type: this.type, + start: this.start, + end: this.end, + context: this.context && this.context.slice(), + startLoc: this.startLoc, + lastTokEndLoc: this.lastTokEndLoc, + endLoc: this.endLoc, + lastTokEnd: this.lastTokEnd, + lastTokStart: this.lastTokStart, + lastTokStartLoc: this.lastTokStartLoc, + curLine: this.curLine, + lineStart: this.lineStart, + curPosition: this.curPosition, + containsEsc: this.containsEsc + }; + } + setLookaheadState(state) { + this.pos = state.pos; + this.value = state.value; + this.endLoc = state.endLoc; + this.lastTokEnd = state.lastTokEnd; + this.lastTokStart = state.lastTokStart; + this.lastTokStartLoc = state.lastTokStartLoc; + this.type = state.type; + this.start = state.start; + this.end = state.end; + this.context = state.context; + this.startLoc = state.startLoc; + this.lastTokEndLoc = state.lastTokEndLoc; + this.curLine = state.curLine; + this.lineStart = state.lineStart; + this.curPosition = state.curPosition; + this.containsEsc = state.containsEsc; + } + // Utilities + tsLookAhead(f) { + const state = this.getCurLookaheadState(); + const res = f(); + this.setLookaheadState(state); + return res; + } + lookahead(number) { + const oldState = this.getCurLookaheadState(); + this.createLookaheadState(); + this.isLookahead = true; + if (number !== void 0) { + for (let i = 0; i < number; i++) { + this.nextToken(); + } + } else { + this.nextToken(); + } + this.isLookahead = false; + const curState = this.getCurLookaheadState(); + this.setLookaheadState(oldState); + return curState; + } + readWord() { + let word = this.readWord1(); + let type = tt.name; + if (this.keywords.test(word)) { + type = keywordTypes[word]; + } else if (new RegExp(keywordsRegExp).test(word)) { + type = tokTypes[word]; + } + return this.finishToken(type, word); + } + skipBlockComment() { + let startLoc; + if (!this.isLookahead) startLoc = this.options.onComment && this.curPosition(); + let start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) this.raise(this.pos - 2, "Unterminated comment"); + this.pos = end + 2; + if (this.options.locations) { + for (let nextBreak, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.isLookahead) return; + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start + 2, end), + start, + this.pos, + startLoc, + this.curPosition() + ); + } + } + skipLineComment(startSkip) { + let start = this.pos; + let startLoc; + if (!this.isLookahead) startLoc = this.options.onComment && this.curPosition(); + let ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.isLookahead) return; + if (this.options.onComment) + this.options.onComment( + false, + this.input.slice(start + startSkip, this.pos), + start, + this.pos, + startLoc, + this.curPosition() + ); + } + finishToken(type, val) { + this.preValue = this.value; + this.preToken = this.type; + this.end = this.pos; + if (this.options.locations) this.endLoc = this.curPosition(); + let prevType = this.type; + this.type = type; + this.value = val; + if (!this.isLookahead) { + this.updateContext(prevType); + } + } + resetStartLocation(node, start, startLoc) { + node.start = start; + node.loc.start = startLoc; + if (this.options.ranges) node.range[0] = start; + } + isLineTerminator() { + return this.eat(tt.semi) || super.canInsertSemicolon(); + } + hasFollowingLineBreak() { + skipWhiteSpaceToLineBreak.lastIndex = this.end; + return skipWhiteSpaceToLineBreak.test(this.input); + } + addExtra(node, key, value, enumerable = true) { + if (!node) return; + const extra = node.extra = node.extra || {}; + if (enumerable) { + extra[key] = value; + } else { + Object.defineProperty(extra, key, { enumerable, value }); + } + } + /** + * Test if current token is a literal property name + * https://tc39.es/ecma262/#prod-LiteralPropertyName + * LiteralPropertyName: + * IdentifierName + * StringLiteral + * NumericLiteral + * BigIntLiteral + */ + isLiteralPropertyName() { + return tokenIsLiteralPropertyName(this.type); + } + hasPrecedingLineBreak() { + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + } + createIdentifier(node, name) { + node.name = name; + return this.finishNode(node, "Identifier"); + } + /** + * Reset the start location of node to the start location of locationNode + */ + resetStartLocationFromNode(node, locationNode) { + this.resetStartLocation(node, locationNode.start, locationNode.loc.start); + } + // This is used in flow and typescript plugin + // Determine whether a parameter is a this param + isThisParam(param) { + return param.type === "Identifier" && param.name === "this"; + } + isLookaheadContextual(name) { + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); + } + /** + * ts type isContextual + * @param {TokenType} type + * @param {TokenType} token + * @returns {boolean} + * */ + ts_type_isContextual(type, token) { + return type === token && !this.containsEsc; + } + /** + * ts isContextual + * @param {TokenType} token + * @returns {boolean} + * */ + ts_isContextual(token) { + return this.type === token && !this.containsEsc; + } + ts_isContextualWithState(state, token) { + return state.type === token && !state.containsEsc; + } + isContextualWithState(keyword, state) { + return state.type === tt.name && state.value === keyword && !state.containsEsc; + } + tsIsStartOfMappedType() { + this.next(); + if (this.eat(tt.plusMin)) { + return this.ts_isContextual(tokTypes.readonly); + } + if (this.ts_isContextual(tokTypes.readonly)) { + this.next(); + } + if (!this.match(tt.bracketL)) { + return false; + } + this.next(); + if (!this.tsIsIdentifier()) { + return false; + } + this.next(); + return this.match(tt._in); + } + tsInDisallowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.inDisallowConditionalTypesContext; + this.inDisallowConditionalTypesContext = true; + try { + return cb(); + } finally { + this.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsTryParseType() { + return this.tsEatThenParseType(tt.colon); + } + /** + * Whether current token matches given type + * + * @param {TokenType} type + * @returns {boolean} + * @memberof Tokenizer + */ + match(type) { + return this.type === type; + } + matchJsx(type) { + return this.type === acornTypeScript.tokTypes[type]; + } + ts_eatWithState(type, nextCount, state) { + const targetType = state.type; + if (type === targetType) { + for (let i = 0; i < nextCount; i++) { + this.next(); + } + return true; + } else { + return false; + } + } + ts_eatContextualWithState(name, nextCount, state) { + if (keywordsRegExp.test(name)) { + if (this.ts_isContextualWithState(state, tokTypes[name])) { + for (let i = 0; i < nextCount; i++) { + this.next(); + } + return true; + } + return false; + } else { + if (!this.isContextualWithState(name, state)) return false; + for (let i = 0; i < nextCount; i++) { + this.next(); + } + return true; + } + } + canHaveLeadingDecorator() { + return this.match(tt._class) || this.isAbstractClass(); + } + eatContextual(name) { + if (keywordsRegExp.test(name)) { + if (this.ts_isContextual(tokTypes[name])) { + this.next(); + return true; + } + return false; + } else { + return super.eatContextual(name); + } + } + tsIsExternalModuleReference() { + return this.isContextual("require") && this.lookaheadCharCode() === 40; + } + tsParseExternalModuleReference() { + const node = this.startNode(); + this.expectContextual("require"); + this.expect(tt.parenL); + if (!this.match(tt.string)) { + this.unexpected(); + } + node.expression = this.parseExprAtom(); + this.expect(tt.parenR); + return this.finishNode(node, "TSExternalModuleReference"); + } + tsParseEntityName(allowReservedWords = true) { + let entity = this.parseIdent(allowReservedWords); + while (this.eat(tt.dot)) { + const node = this.startNodeAtNode(entity); + node.left = entity; + node.right = this.parseIdent(allowReservedWords); + entity = this.finishNode(node, "TSQualifiedName"); + } + return entity; + } + tsParseEnumMember() { + const node = this.startNode(); + node.id = this.match(tt.string) ? this.parseLiteral(this.value) : this.parseIdent( + /* liberal */ + true + ); + if (this.eat(tt.eq)) { + node.initializer = this.parseMaybeAssign(); + } + return this.finishNode(node, "TSEnumMember"); + } + tsParseEnumDeclaration(node, properties = {}) { + if (properties.const) node.const = true; + if (properties.declare) node.declare = true; + this.expectContextual("enum"); + node.id = this.parseIdent(); + this.checkLValSimple(node.id); + this.expect(tt.braceL); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(tt.braceR); + return this.finishNode(node, "TSEnumDeclaration"); + } + tsParseModuleBlock() { + const node = this.startNode(); + this.enterScope(TS_SCOPE_OTHER); + this.expect(tt.braceL); + node.body = []; + while (this.type !== tt.braceR) { + let stmt = this.parseStatement(null, true); + node.body.push(stmt); + } + this.next(); + super.exitScope(); + return this.finishNode(node, "TSModuleBlock"); + } + tsParseAmbientExternalModuleDeclaration(node) { + if (this.ts_isContextual(tokTypes.global)) { + node.global = true; + node.id = this.parseIdent(); + } else if (this.match(tt.string)) { + node.id = this.parseLiteral(this.value); + } else { + this.unexpected(); + } + if (this.match(tt.braceL)) { + this.enterScope(TS_SCOPE_TS_MODULE); + node.body = this.tsParseModuleBlock(); + super.exitScope(); + } else { + super.semicolon(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsTryParseDeclare(nany) { + if (this.isLineTerminator()) { + return; + } + let starttype = this.type; + let kind; + if (this.isContextual("let")) { + starttype = tt._var; + kind = "let"; + } + return this.tsInAmbientContext(() => { + if (starttype === tt._function) { + nany.declare = true; + return this.parseFunctionStatement( + nany, + /* async */ + false, + /* declarationPosition */ + true + ); + } + if (starttype === tt._class) { + nany.declare = true; + return this.parseClass(nany, true); + } + if (starttype === tokTypes.enum) { + return this.tsParseEnumDeclaration(nany, { declare: true }); + } + if (starttype === tokTypes.global) { + return this.tsParseAmbientExternalModuleDeclaration(nany); + } + if (starttype === tt._const || starttype === tt._var) { + if (!this.match(tt._const) || !this.isLookaheadContextual("enum")) { + nany.declare = true; + return this.parseVarStatement(nany, kind || this.value, true); + } + this.expect(tt._const); + return this.tsParseEnumDeclaration(nany, { + const: true, + declare: true + }); + } + if (starttype === tokTypes.interface) { + const result = this.tsParseInterfaceDeclaration(nany, { + declare: true + }); + if (result) return result; + } + if (tokenIsIdentifier(starttype)) { + return this.tsParseDeclaration( + nany, + this.value, + /* next */ + true + ); + } + }); + } + tsIsListTerminator(kind) { + switch (kind) { + case "EnumMembers": + case "TypeMembers": + return this.match(tt.braceR); + case "HeritageClauseElement": + return this.match(tt.braceL); + case "TupleElementTypes": + return this.match(tt.bracketR); + case "TypeParametersOrArguments": + return this.tsMatchRightRelational(); + } + } + /** + * If !expectSuccess, returns undefined instead of failing to parse. + * If expectSuccess, parseElement should always return a defined value. + */ + tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { + const result = []; + let trailingCommaPos = -1; + for (; ; ) { + if (this.tsIsListTerminator(kind)) { + break; + } + trailingCommaPos = -1; + const element = parseElement(); + if (element == null) { + return void 0; + } + result.push(element); + if (this.eat(tt.comma)) { + trailingCommaPos = this.lastTokStart; + continue; + } + if (this.tsIsListTerminator(kind)) { + break; + } + if (expectSuccess) { + this.expect(tt.comma); + } + return void 0; + } + if (refTrailingCommaPos) { + refTrailingCommaPos.value = trailingCommaPos; + } + return result; + } + tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { + return nonNull( + this.tsParseDelimitedListWorker( + kind, + parseElement, + /* expectSuccess */ + true, + refTrailingCommaPos + ) + ); + } + tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { + if (!skipFirstToken) { + if (bracket) { + this.expect(tt.bracketL); + } else { + this.expect(tt.relational); + } + } + const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); + if (bracket) { + this.expect(tt.bracketR); + } else { + this.expect(tt.relational); + } + return result; + } + tsParseTypeParameterName() { + const typeName = this.parseIdent(); + return typeName.name; + } + tsEatThenParseType(token) { + return !this.match(token) ? void 0 : this.tsNextThenParseType(); + } + tsExpectThenParseType(token) { + return this.tsDoThenParseType(() => this.expect(token)); + } + tsNextThenParseType() { + return this.tsDoThenParseType(() => this.next()); + } + tsDoThenParseType(cb) { + return this.tsInType(() => { + cb(); + return this.tsParseType(); + }); + } + tsSkipParameterStart() { + if (tokenIsIdentifier(this.type) || this.match(tt._this)) { + this.next(); + return true; + } + if (this.match(tt.braceL)) { + try { + this.parseObj(true); + return true; + } catch { + return false; + } + } + if (this.match(tt.bracketL)) { + this.next(); + try { + this.parseBindingList(tt.bracketR, true, true); + return true; + } catch { + return false; + } + } + return false; + } + tsIsUnambiguouslyStartOfFunctionType() { + this.next(); + if (this.match(tt.parenR) || this.match(tt.ellipsis)) { + return true; + } + if (this.tsSkipParameterStart()) { + if (this.match(tt.colon) || this.match(tt.comma) || this.match(tt.question) || this.match(tt.eq)) { + return true; + } + if (this.match(tt.parenR)) { + this.next(); + if (this.match(tt.arrow)) { + return true; + } + } + } + return false; + } + tsIsStartOfFunctionType() { + if (this.tsMatchLeftRelational()) { + return true; + } + return this.match(tt.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); + } + tsInAllowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.inDisallowConditionalTypesContext; + this.inDisallowConditionalTypesContext = false; + try { + return cb(); + } finally { + this.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsParseBindingListForSignature() { + return super.parseBindingList(tt.parenR, true, true).map((pattern) => { + if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { + this.raise( + pattern.start, + TypeScriptError.UnsupportedSignatureParameterKind({ type: pattern.type }) + ); + } + return pattern; + }); + } + tsParseTypePredicateAsserts() { + if (this.type !== tokTypes.asserts) { + return false; + } + const containsEsc = this.containsEsc; + this.next(); + if (!tokenIsIdentifier(this.type) && !this.match(tt._this)) { + return false; + } + if (containsEsc) { + this.raise(this.lastTokStart, "Escape sequence in keyword asserts"); + } + return true; + } + tsParseThisTypeNode() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSThisType"); + } + tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { + this.tsInType(() => { + if (eatColon) this.expect(tt.colon); + t.typeAnnotation = this.tsParseType(); + }); + return this.finishNode(t, "TSTypeAnnotation"); + } + tsParseThisTypePredicate(lhs) { + this.next(); + const node = this.startNodeAtNode(lhs); + node.parameterName = lhs; + node.typeAnnotation = this.tsParseTypeAnnotation( + /* eatColon */ + false + ); + node.asserts = false; + return this.finishNode(node, "TSTypePredicate"); + } + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + tsParseTypePredicatePrefix() { + const id = this.parseIdent(); + if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { + this.next(); + return id; + } + } + tsParseTypeOrTypePredicateAnnotation(returnToken) { + return this.tsInType(() => { + const t = this.startNode(); + this.expect(returnToken); + const node = this.startNode(); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + if (asserts && this.match(tt._this)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + if (thisTypePredicate.type === "TSThisType") { + node.parameterName = thisTypePredicate; + node.asserts = true; + node.typeAnnotation = null; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + this.resetStartLocationFromNode(thisTypePredicate, node); + thisTypePredicate.asserts = true; + } + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); + if (!typePredicateVariable) { + if (!asserts) { + return this.tsParseTypeAnnotation( + /* eatColon */ + false, + t + ); + } + node.parameterName = this.parseIdent(); + node.asserts = asserts; + node.typeAnnotation = null; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + } + const type = this.tsParseTypeAnnotation( + /* eatColon */ + false + ); + node.parameterName = typePredicateVariable; + node.typeAnnotation = type; + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + }); + } + // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, + // but here it's always false, because this is only used for types. + tsFillSignature(returnToken, signature) { + const returnTokenRequired = returnToken === tt.arrow; + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + signature.typeParameters = this.tsTryParseTypeParameters(); + this.expect(tt.parenL); + signature[paramsKey] = this.tsParseBindingListForSignature(); + if (returnTokenRequired) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (this.match(returnToken)) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } + } + tsTryNextParseConstantContext() { + if (this.lookahead().type !== tt._const) return null; + this.next(); + const typeReference = this.tsParseTypeReference(); + if (typeReference.typeParameters || typeReference.typeArguments) { + this.raise( + typeReference.typeName.start, + TypeScriptError.CannotFindName({ + name: "const" + }) + ); + } + return typeReference; + } + tsParseFunctionOrConstructorType(type, abstract) { + const node = this.startNode(); + if (type === "TSConstructorType") { + node.abstract = !!abstract; + if (abstract) this.next(); + this.next(); + } + this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(tt.arrow, node)); + return this.finishNode(node, type); + } + tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { + const node = this.startNode(); + const hasLeadingOperator = this.eat(operator); + const types = []; + do { + types.push(parseConstituentType()); + } while (this.eat(operator)); + if (types.length === 1 && !hasLeadingOperator) { + return types[0]; + } + node.types = types; + return this.finishNode(node, kind); + } + tsCheckTypeAnnotationForReadOnly(node) { + switch (node.typeAnnotation.type) { + case "TSTupleType": + case "TSArrayType": + return; + default: + this.raise(node.start, TypeScriptError.UnexpectedReadonly); + } + } + tsParseTypeOperator() { + const node = this.startNode(); + const operator = this.value; + this.next(); + node.operator = operator; + node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); + if (operator === "readonly") { + this.tsCheckTypeAnnotationForReadOnly(node); + } + return this.finishNode(node, "TSTypeOperator"); + } + tsParseConstraintForInferType() { + if (this.eat(tt._extends)) { + const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); + if (this.inDisallowConditionalTypesContext || !this.match(tt.question)) { + return constraint; + } + } + } + tsParseInferType() { + const node = this.startNode(); + this.expectContextual("infer"); + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + return this.finishNode(node, "TSInferType"); + } + tsParseLiteralTypeNode() { + const node = this.startNode(); + node.literal = (() => { + switch (this.type) { + case tt.num: + // we don't need bigint type here + // case tt.bigint: + case tt.string: + case tt._true: + case tt._false: + return this.parseExprAtom(); + default: + this.unexpected(); + } + })(); + return this.finishNode(node, "TSLiteralType"); + } + tsParseImportType() { + const node = this.startNode(); + this.expect(tt._import); + this.expect(tt.parenL); + if (!this.match(tt.string)) { + this.raise(this.start, TypeScriptError.UnsupportedImportTypeArgument); + } + node.argument = this.parseExprAtom(); + this.expect(tt.parenR); + if (this.eat(tt.dot)) { + node.qualifier = this.tsParseEntityName(); + } + if (this.tsMatchLeftRelational()) { + node.typeArguments = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSImportType"); + } + tsParseTypeQuery() { + const node = this.startNode(); + this.expect(tt._typeof); + if (this.match(tt._import)) { + node.exprName = this.tsParseImportType(); + } else { + node.exprName = this.tsParseEntityName(); + } + if (!this.hasPrecedingLineBreak() && this.tsMatchLeftRelational()) { + node.typeArguments = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeQuery"); + } + tsParseMappedTypeParameter() { + const node = this.startNode(); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsExpectThenParseType(tt._in); + return this.finishNode(node, "TSTypeParameter"); + } + tsParseMappedType() { + const node = this.startNode(); + this.expect(tt.braceL); + if (this.match(tt.plusMin)) { + node.readonly = this.value; + this.next(); + this.expectContextual("readonly"); + } else if (this.eatContextual("readonly")) { + node.readonly = true; + } + this.expect(tt.bracketL); + node.typeParameter = this.tsParseMappedTypeParameter(); + node.nameType = this.eatContextual("as") ? this.tsParseType() : null; + this.expect(tt.bracketR); + if (this.match(tt.plusMin)) { + node.optional = this.value; + this.next(); + this.expect(tt.question); + } else if (this.eat(tt.question)) { + node.optional = true; + } + node.typeAnnotation = this.tsTryParseType(); + this.semicolon(); + this.expect(tt.braceR); + return this.finishNode(node, "TSMappedType"); + } + tsParseTypeLiteral() { + const node = this.startNode(); + node.members = this.tsParseObjectTypeMembers(); + return this.finishNode(node, "TSTypeLiteral"); + } + tsParseTupleElementType() { + const startLoc = this.startLoc; + const startPos = this["start"]; + const rest = this.eat(tt.ellipsis); + let type = this.tsParseType(); + const optional = this.eat(tt.question); + const labeled = this.eat(tt.colon); + if (labeled) { + const labeledNode = this.startNodeAtNode(type); + labeledNode.optional = optional; + if (type.type === "TSTypeReference" && !type.typeArguments && type.typeName.type === "Identifier") { + labeledNode.label = type.typeName; + } else { + this.raise(type.start, TypeScriptError.InvalidTupleMemberLabel); + labeledNode.label = type; + } + labeledNode.elementType = this.tsParseType(); + type = this.finishNode(labeledNode, "TSNamedTupleMember"); + } else if (optional) { + const optionalTypeNode = this.startNodeAtNode(type); + optionalTypeNode.typeAnnotation = type; + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + if (rest) { + const restNode = this.startNodeAt(startPos, startLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); + } + return type; + } + tsParseTupleType() { + const node = this.startNode(); + node.elementTypes = this.tsParseBracketedList( + "TupleElementTypes", + this.tsParseTupleElementType.bind(this), + /* bracket */ + true, + /* skipFirstToken */ + false + ); + let seenOptionalElement = false; + node.elementTypes.forEach((elementNode) => { + const { type } = elementNode; + if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { + this.raise(elementNode.start, TypeScriptError.OptionalTypeBeforeRequired); + } + seenOptionalElement ||= type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"; + if (type === "TSRestType") { + elementNode = elementNode.typeAnnotation; + } + }); + return this.finishNode(node, "TSTupleType"); + } + tsParseTemplateLiteralType() { + const node = this.startNode(); + node.literal = this.parseTemplate({ isTagged: false }); + return this.finishNode(node, "TSLiteralType"); + } + tsParseTypeReference() { + const node = this.startNode(); + node.typeName = this.tsParseEntityName(); + if (!this.hasPrecedingLineBreak() && this.tsMatchLeftRelational()) { + node.typeArguments = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSTypeReference"); + } + tsMatchLeftRelational() { + return this.match(tt.relational) && this.value === "<"; + } + tsMatchRightRelational() { + return this.match(tt.relational) && this.value === ">"; + } + tsParseParenthesizedType() { + const node = this.startNode(); + this.expect(tt.parenL); + node.typeAnnotation = this.tsParseType(); + this.expect(tt.parenR); + return this.finishNode(node, "TSParenthesizedType"); + } + tsParseNonArrayType() { + switch (this.type) { + case tt.string: + case tt.num: + // we don't need bigint type here + // case tt.bigint: + case tt._true: + case tt._false: + return this.tsParseLiteralTypeNode(); + case tt.plusMin: + if (this.value === "-") { + const node = this.startNode(); + const nextToken = this.lookahead(); + if (nextToken.type !== tt.num) { + this.unexpected(); + } + node.literal = this.parseMaybeUnary(); + return this.finishNode(node, "TSLiteralType"); + } + break; + case tt._this: + return this.tsParseThisTypeOrThisTypePredicate(); + case tt._typeof: + return this.tsParseTypeQuery(); + case tt._import: + return this.tsParseImportType(); + case tt.braceL: + return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); + case tt.bracketL: + return this.tsParseTupleType(); + case tt.parenL: + return this.tsParseParenthesizedType(); + // parse template string here + case tt.backQuote: + case tt.dollarBraceL: + return this.tsParseTemplateLiteralType(); + default: { + const { type } = this; + if (tokenIsIdentifier(type) || type === tt._void || type === tt._null) { + const nodeType = type === tt._void ? "TSVoidKeyword" : type === tt._null ? "TSNullKeyword" : keywordTypeFromName(this.value); + if (nodeType !== void 0 && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, nodeType); + } + return this.tsParseTypeReference(); + } + } + } + this.unexpected(); + } + tsParseArrayTypeOrHigher() { + let type = this.tsParseNonArrayType(); + while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) { + if (this.match(tt.bracketR)) { + const node = this.startNodeAtNode(type); + node.elementType = type; + this.expect(tt.bracketR); + type = this.finishNode(node, "TSArrayType"); + } else { + const node = this.startNodeAtNode(type); + node.objectType = type; + node.indexType = this.tsParseType(); + this.expect(tt.bracketR); + type = this.finishNode(node, "TSIndexedAccessType"); + } + } + return type; + } + tsParseTypeOperatorOrHigher() { + const isTypeOperator = tokenIsTSTypeOperator(this.type) && !this.containsEsc; + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual("infer") ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); + } + tsParseIntersectionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType( + "TSIntersectionType", + this.tsParseTypeOperatorOrHigher.bind(this), + tt.bitwiseAND + ); + } + tsParseUnionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType( + "TSUnionType", + this.tsParseIntersectionTypeOrHigher.bind(this), + tt.bitwiseOR + ); + } + tsParseNonConditionalType() { + if (this.tsIsStartOfFunctionType()) { + return this.tsParseFunctionOrConstructorType("TSFunctionType"); + } + if (this.match(tt._new)) { + return this.tsParseFunctionOrConstructorType("TSConstructorType"); + } else if (this.isAbstractConstructorSignature()) { + return this.tsParseFunctionOrConstructorType( + "TSConstructorType", + /* abstract */ + true + ); + } + return this.tsParseUnionTypeOrHigher(); + } + /** Be sure to be in a type context before calling this, using `tsInType`. */ + tsParseType() { + assert(this.inType); + const type = this.tsParseNonConditionalType(); + if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(tt._extends)) { + return type; + } + const node = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsInDisallowConditionalTypesContext( + () => this.tsParseNonConditionalType() + ); + this.expect(tt.question); + node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + this.expect(tt.colon); + node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + return this.finishNode(node, "TSConditionalType"); + } + tsIsUnambiguouslyIndexSignature() { + this.next(); + if (tokenIsIdentifier(this.type)) { + this.next(); + return this.match(tt.colon); + } + return false; + } + /** + * Runs `cb` in a type context. + * This should be called one token *before* the first type token, + * so that the call to `next()` is run in type context. + */ + tsInType(cb) { + const oldInType = this.inType; + this.inType = true; + try { + return cb(); + } finally { + this.inType = oldInType; + } + } + tsTryParseIndexSignature(node) { + if (!(this.match(tt.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { + return void 0; + } + this.expect(tt.bracketL); + const id = this.parseIdent(); + id.typeAnnotation = this.tsParseTypeAnnotation(); + this.resetEndLocation(id); + this.expect(tt.bracketR); + node.parameters = [id]; + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, "TSIndexSignature"); + } + // for better error recover + tsParseNoneModifiers(node) { + this.tsParseModifiers({ + modified: node, + allowedModifiers: [], + disallowedModifiers: ["in", "out"], + errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions + }); + } + tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) { + const node = this.startNode(); + parseModifiers(node); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsEatThenParseType(tt._extends); + node.default = this.tsEatThenParseType(tt.eq); + return this.finishNode(node, "TSTypeParameter"); + } + tsParseTypeParameters(parseModifiers) { + const node = this.startNode(); + if (this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart")) { + this.next(); + } else { + this.unexpected(); + } + const refTrailingCommaPos = { value: -1 }; + node.params = this.tsParseBracketedList( + "TypeParametersOrArguments", + this.tsParseTypeParameter.bind(this, parseModifiers), + /* bracket */ + false, + /* skipFirstToken */ + true, + refTrailingCommaPos + ); + if (node.params.length === 0) { + this.raise(this.start, TypeScriptError.EmptyTypeParameters); + } + if (refTrailingCommaPos.value !== -1) { + this.addExtra(node, "trailingComma", refTrailingCommaPos.value); + } + return this.finishNode(node, "TSTypeParameterDeclaration"); + } + tsTryParseTypeParameters(parseModifiers) { + if (this.tsMatchLeftRelational()) { + return this.tsParseTypeParameters(parseModifiers); + } + } + tsTryParse(f) { + const state = this.getCurLookaheadState(); + const result = f(); + if (result !== void 0 && result !== false) { + return result; + } else { + this.setLookaheadState(state); + return void 0; + } + } + tsTokenCanFollowModifier() { + return (this.match(tt.bracketL) || this.match(tt.braceL) || this.match(tt.star) || this.match(tt.ellipsis) || this.match(tt.privateId) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); + } + tsNextTokenCanFollowModifier() { + this.next(true); + return this.tsTokenCanFollowModifier(); + } + /** Parses a modifier matching one the given modifier names. */ + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { + const modifier = this.value; + if (allowedModifiers.indexOf(modifier) !== -1 && !this.containsEsc) { + if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { + return void 0; + } + if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { + return modifier; + } + } + return void 0; + } + tsParseModifiersByMap({ + modified, + map + }) { + for (const key of Object.keys(map)) { + modified[key] = map[key]; + } + } + /** Parses a list of modifiers, in any order. + * If you need a specific order, you must call this function multiple times: + * this.tsParseModifiers({ modified: node, allowedModifiers: ['public'] }); + * this.tsParseModifiers({ modified: node, allowedModifiers: ["abstract", "readonly"] }); + */ + tsParseModifiers({ + modified, + allowedModifiers, + disallowedModifiers, + stopOnStartOfClassStaticBlock, + errorTemplate = TypeScriptError.InvalidModifierOnTypeMember + }) { + const modifiedMap = {}; + const enforceOrder = (loc, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise( + loc.column, + TypeScriptError.InvalidModifiersOrder({ orderedModifiers: [before, after] }) + ); + } + }; + const incompatible = (loc, modifier, mod1, mod2) => { + if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { + this.raise( + loc.column, + TypeScriptError.IncompatibleModifiers({ modifiers: [mod1, mod2] }) + ); + } + }; + for (; ; ) { + const startLoc = this.startLoc; + const modifier = this.tsParseModifier( + allowedModifiers.concat(disallowedModifiers ?? []), + stopOnStartOfClassStaticBlock + ); + if (!modifier) break; + if (tsIsAccessModifier(modifier)) { + if (modified.accessibility) { + this.raise(this.start, TypeScriptError.DuplicateAccessibilityModifier()); + } else { + enforceOrder(startLoc, modifier, modifier, "override"); + enforceOrder(startLoc, modifier, modifier, "static"); + enforceOrder(startLoc, modifier, modifier, "readonly"); + enforceOrder(startLoc, modifier, modifier, "accessor"); + modifiedMap.accessibility = modifier; + modified["accessibility"] = modifier; + } + } else if (tsIsVarianceAnnotations(modifier)) { + if (modified[modifier]) { + this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); + } else { + enforceOrder(startLoc, modifier, "in", "out"); + modifiedMap[modifier] = modifier; + modified[modifier] = true; + } + } else if (tsIsClassAccessor(modifier)) { + if (modified[modifier]) { + this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); + } else { + incompatible(startLoc, modifier, "accessor", "readonly"); + incompatible(startLoc, modifier, "accessor", "static"); + incompatible(startLoc, modifier, "accessor", "override"); + modifiedMap[modifier] = modifier; + modified[modifier] = true; + } + } else if (modifier === "const") { + if (modified[modifier]) { + this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); + } else { + modifiedMap[modifier] = modifier; + modified[modifier] = true; + } + } else { + if (Object.hasOwnProperty.call(modified, modifier)) { + this.raise(this.start, TypeScriptError.DuplicateModifier({ modifier })); + } else { + enforceOrder(startLoc, modifier, "static", "readonly"); + enforceOrder(startLoc, modifier, "static", "override"); + enforceOrder(startLoc, modifier, "override", "readonly"); + enforceOrder(startLoc, modifier, "abstract", "override"); + incompatible(startLoc, modifier, "declare", "override"); + incompatible(startLoc, modifier, "static", "abstract"); + modifiedMap[modifier] = modifier; + modified[modifier] = true; + } + } + if (disallowedModifiers?.includes(modifier)) { + this.raise(this.start, errorTemplate); + } + } + return modifiedMap; + } + tsParseInOutModifiers(node) { + this.tsParseModifiers({ + modified: node, + allowedModifiers: ["in", "out"], + disallowedModifiers: [ + "public", + "private", + "protected", + "readonly", + "declare", + "abstract", + "override" + ], + errorTemplate: TypeScriptError.InvalidModifierOnTypeParameter + }); + } + // Handle type assertions + parseMaybeUnary(refExpressionErrors, sawUnary, incDec, forInit) { + if (!options?.jsx && this.tsMatchLeftRelational()) { + return this.tsParseTypeAssertion(); + } else { + return super.parseMaybeUnary(refExpressionErrors, sawUnary, incDec, forInit); + } + } + tsParseTypeAssertion() { + if (disallowAmbiguousJSXLike) { + this.raise(this.start, TypeScriptError.ReservedTypeAssertion); + } + const result = this.tryParse(() => { + const node = this.startNode(); + const _const = this.tsTryNextParseConstantContext(); + node.typeAnnotation = _const || this.tsNextThenParseType(); + this.expect(tt.relational); + node.expression = this.parseMaybeUnary(); + return this.finishNode(node, "TSTypeAssertion"); + }); + if (result.error) { + return this.tsParseTypeParameters(this.tsParseConstModifier); + } else { + return result.node; + } + } + tsParseTypeArguments() { + const node = this.startNode(); + node.params = this.tsInType( + () => ( + // Temporarily remove a JSX parsing context, which makes us scan different tokens. + this.tsInNoContext(() => { + this.expect(tt.relational); + return this.tsParseDelimitedList( + "TypeParametersOrArguments", + this.tsParseType.bind(this) + ); + }) + ) + ); + if (node.params.length === 0) { + this.raise(this.start, TypeScriptError.EmptyTypeArguments); + } + this.exprAllowed = false; + this.expect(tt.relational); + return this.finishNode(node, "TSTypeParameterInstantiation"); + } + tsParseHeritageClause(token) { + const originalStart = this.start; + const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { + const node = this.startNode(); + node.expression = this.tsParseEntityName(); + if (this.tsMatchLeftRelational()) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSExpressionWithTypeArguments"); + }); + if (!delimitedList.length) { + this.raise(originalStart, TypeScriptError.EmptyHeritageClauseType({ token })); + } + return delimitedList; + } + tsParseTypeMemberSemicolon() { + if (!this.eat(tt.comma) && !this.isLineTerminator()) { + this.expect(tt.semi); + } + } + tsTryParseAndCatch(f) { + const result = this.tryParse( + (abort) => ( + // @ts-expect-error todo(flow->ts) + f() || abort() + ) + ); + if (result.aborted || !result.node) return void 0; + if (result.error) this.setLookaheadState(result.failState); + return result.node; + } + tsParseSignatureMember(kind, node) { + this.tsFillSignature(tt.colon, node); + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, kind); + } + tsParsePropertyOrMethodSignature(node, readonly) { + if (this.eat(tt.question)) node.optional = true; + const nodeAny = node; + if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { + if (readonly) { + this.raise(node.start, TypeScriptError.ReadonlyForMethodSignature); + } + const method = nodeAny; + if (method.kind && this.tsMatchLeftRelational()) { + this.raise(this.start, TypeScriptError.AccesorCannotHaveTypeParameters); + } + this.tsFillSignature(tt.colon, method); + this.tsParseTypeMemberSemicolon(); + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + if (method.kind === "get") { + if (method[paramsKey].length > 0) { + this.raise(this.start, "A 'get' accesor must not have any formal parameters."); + if (this.isThisParam(method[paramsKey][0])) { + this.raise(this.start, TypeScriptError.AccesorCannotDeclareThisParameter); + } + } + } else if (method.kind === "set") { + if (method[paramsKey].length !== 1) { + this.raise(this.start, "A 'get' accesor must not have any formal parameters."); + } else { + const firstParameter = method[paramsKey][0]; + if (this.isThisParam(firstParameter)) { + this.raise(this.start, TypeScriptError.AccesorCannotDeclareThisParameter); + } + if (firstParameter.type === "Identifier" && firstParameter.optional) { + this.raise(this.start, TypeScriptError.SetAccesorCannotHaveOptionalParameter); + } + if (firstParameter.type === "RestElement") { + this.raise(this.start, TypeScriptError.SetAccesorCannotHaveRestParameter); + } + } + if (method[returnTypeKey]) { + this.raise( + method[returnTypeKey].start, + TypeScriptError.SetAccesorCannotHaveReturnType + ); + } + } else { + method.kind = "method"; + } + return this.finishNode(method, "TSMethodSignature"); + } else { + const property = nodeAny; + if (readonly) property.readonly = true; + const type = this.tsTryParseTypeAnnotation(); + if (type) property.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(property, "TSPropertySignature"); + } + } + tsParseTypeMember() { + const node = this.startNode(); + if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { + return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); + } + if (this.match(tt._new)) { + const id = this.startNode(); + this.next(); + if (this.match(tt.parenL) || this.tsMatchLeftRelational()) { + return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); + } else { + node.key = this.createIdentifier(id, "new"); + return this.tsParsePropertyOrMethodSignature(node, false); + } + } + this.tsParseModifiers({ + modified: node, + allowedModifiers: ["readonly"], + disallowedModifiers: [ + "declare", + "abstract", + "private", + "protected", + "public", + "static", + "override" + ] + }); + const idx = this.tsTryParseIndexSignature(node); + if (idx) { + return idx; + } + this.parsePropertyName(node); + if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { + node.kind = node.key.name; + this.parsePropertyName(node); + } + return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); + } + tsParseList(kind, parseElement) { + const result = []; + while (!this.tsIsListTerminator(kind)) { + result.push(parseElement()); + } + return result; + } + tsParseObjectTypeMembers() { + this.expect(tt.braceL); + const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.expect(tt.braceR); + return members; + } + tsParseInterfaceDeclaration(node, properties = {}) { + if (this.hasFollowingLineBreak()) return null; + this.expectContextual("interface"); + if (properties.declare) node.declare = true; + if (tokenIsIdentifier(this.type)) { + node.id = this.parseIdent(); + this.checkLValSimple(node.id, acornScope.BIND_TS_INTERFACE); + } else { + node.id = null; + this.raise(this.start, TypeScriptError.MissingInterfaceName); + } + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); + if (this.eat(tt._extends)) { + node.extends = this.tsParseHeritageClause("extends"); + } + const body = this.startNode(); + body.body = this.tsParseInterfaceBody(); + node.body = this.finishNode(body, "TSInterfaceBody"); + return this.finishNode(node, "TSInterfaceDeclaration"); + } + /** + * Parse interface body, ensuring the closing brace is read outside of type context + * so that decorators following the interface are properly tokenized. + */ + tsParseInterfaceBody() { + this.expect(tt.braceL); + const oldInType = this.inType; + this.inType = true; + let members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.inType = oldInType; + this.expect(tt.braceR); + return members; + } + tsParseAbstractDeclaration(node) { + if (this.match(tt._class)) { + node.abstract = true; + return this.parseClass(node, true); + } else if (this.ts_isContextual(tokTypes.interface)) { + if (!this.hasFollowingLineBreak()) { + node.abstract = true; + return this.tsParseInterfaceDeclaration(node); + } + } else { + this.unexpected(node.start); + } + } + tsIsDeclarationStart() { + return tokenIsTSDeclarationStart(this.type); + } + tsParseExpressionStatement(node, expr) { + switch (expr.name) { + case "declare": { + const declaration = this.tsTryParseDeclare(node); + if (declaration) { + declaration.declare = true; + return declaration; + } + break; + } + case "global": + if (this.match(tt.braceL)) { + this.enterScope(TS_SCOPE_TS_MODULE); + const mod = node; + mod.global = true; + mod.id = expr; + mod.body = this.tsParseModuleBlock(); + super.exitScope(); + return this.finishNode(mod, "TSModuleDeclaration"); + } + break; + default: + return this.tsParseDeclaration( + node, + expr.name, + /* next */ + false + ); + } + } + tsParseModuleReference() { + return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName( + /* allowReservedWords */ + false + ); + } + tsIsExportDefaultSpecifier() { + const { type } = this; + const isAsync = this.isAsyncFunction(); + const isLet = this.isLet(); + if (tokenIsIdentifier(type)) { + if (isAsync && !this.containsEsc || isLet) { + return false; + } + if ((type === tokTypes.type || type === tokTypes.interface) && !this.containsEsc) { + const ahead = this.lookahead(); + if (tokenIsIdentifier(ahead.type) && !this.isContextualWithState("from", ahead) || ahead.type === tt.braceL) { + return false; + } + } + } else if (!this.match(tt._default)) { + return false; + } + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.type) && hasFrom) { + return true; + } + if (this.match(tt._default) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + return false; + } + tsInAmbientContext(cb) { + const oldIsAmbientContext = this.isAmbientContext; + this.isAmbientContext = true; + try { + return cb(); + } finally { + this.isAmbientContext = oldIsAmbientContext; + } + } + tsCheckLineTerminator(next) { + if (next) { + if (this.hasFollowingLineBreak()) return false; + this.next(); + return true; + } + return !this.isLineTerminator(); + } + tsParseModuleOrNamespaceDeclaration(node, nested = false) { + node.id = this.parseIdent(); + if (!nested) { + this.checkLValSimple(node.id, acornScope.BIND_TS_NAMESPACE); + } + if (this.eat(tt.dot)) { + const inner = this.startNode(); + this.tsParseModuleOrNamespaceDeclaration(inner, true); + node.body = inner; + } else { + this.enterScope(TS_SCOPE_TS_MODULE); + node.body = this.tsParseModuleBlock(); + super.exitScope(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + checkLValSimple(expr, bindingType = acornScope.BIND_NONE, checkClashes) { + if (expr.type === "TSNonNullExpression" || expr.type === "TSAsExpression") { + expr = expr.expression; + } + return super.checkLValSimple(expr, bindingType, checkClashes); + } + tsParseTypeAliasDeclaration(node) { + node.id = this.parseIdent(); + this.checkLValSimple(node.id, acornScope.BIND_TS_TYPE); + node.typeAnnotation = this.tsInType(() => { + node.typeParameters = this.tsTryParseTypeParameters( + this.tsParseInOutModifiers.bind(this) + ); + this.expect(tt.eq); + if (this.ts_isContextual(tokTypes.interface) && this.lookahead().type !== tt.dot) { + const node2 = this.startNode(); + this.next(); + return this.finishNode(node2, "TSIntrinsicKeyword"); + } + return this.tsParseType(); + }); + this.semicolon(); + return this.finishNode(node, "TSTypeAliasDeclaration"); + } + // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement. + tsParseDeclaration(node, value, next) { + switch (value) { + case "abstract": + if (this.tsCheckLineTerminator(next) && (this.match(tt._class) || tokenIsIdentifier(this.type))) { + return this.tsParseAbstractDeclaration(node); + } + break; + case "module": + if (this.tsCheckLineTerminator(next)) { + if (this.match(tt.string)) { + return this.tsParseAmbientExternalModuleDeclaration(node); + } else if (tokenIsIdentifier(this.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + } + break; + case "namespace": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + break; + case "type": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.type)) { + return this.tsParseTypeAliasDeclaration(node); + } + break; + } + } + // Note: this won't b·e called unless the keyword is allowed in + // `shouldParseExportDeclaration`. + tsTryParseExportDeclaration() { + return this.tsParseDeclaration( + this.startNode(), + this.value, + /* next */ + true + ); + } + tsParseImportEqualsDeclaration(node, isExport) { + node.isExport = isExport || false; + node.id = this.parseIdent(); + this.checkLValSimple(node.id, acornScope.BIND_LEXICAL); + super.expect(tt.eq); + const moduleReference = this.tsParseModuleReference(); + if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { + this.raise(moduleReference.start, TypeScriptError.ImportAliasHasImportType); + } + node.moduleReference = moduleReference; + super.semicolon(); + return this.finishNode(node, "TSImportEqualsDeclaration"); + } + isExportDefaultSpecifier() { + if (this.tsIsDeclarationStart()) return false; + const { type } = this; + if (tokenIsIdentifier(type)) { + if (this.isContextual("async") || this.isContextual("let")) { + return false; + } + if ((type === tokTypes.type || type === tokTypes.interface) && !this.containsEsc) { + const ahead = this.lookahead(); + if (tokenIsIdentifier(ahead.type) && !this.isContextualWithState("from", ahead) || ahead.type === tt.braceL) { + return false; + } + } + } else if (!this.match(tt._default)) { + return false; + } + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.type) && hasFrom) { + return true; + } + if (this.match(tt._default) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + return false; + } + parseTemplate({ isTagged = false } = {}) { + let node = this.startNode(); + this.next(); + node.expressions = []; + let curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === tt.eof) this.raise(this.pos, "Unterminated template literal"); + this.expect(tt.dollarBraceL); + node.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()); + this.expect(tt.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); + } + parseFunction(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.ecmaVersion >= 9 || this.ecmaVersion >= 6 && !isAsync) { + if (this.type === tt.star && statement & FUNC_HANGING_STATEMENT) { + this.unexpected(); + } + node.generator = this.eat(tt.star); + } + if (this.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT) { + node.id = statement & FUNC_NULLABLE_ID && this.type !== tt.name ? null : this.parseIdent(); + } + let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + const oldMaybeInArrowParameters = this.maybeInArrowParameters; + this.maybeInArrowParameters = false; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT)) { + node.id = this.type === tt.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + const isDeclaration = statement & FUNC_STATEMENT; + this.parseFunctionBody(node, allowExpressionBody, false, forInit, { + isFunctionDeclaration: isDeclaration + }); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + if (statement & FUNC_STATEMENT && node.id && !(statement & FUNC_HANGING_STATEMENT)) { + if (node.body) { + this.checkLValSimple( + node.id, + this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? acornScope.BIND_VAR : acornScope.BIND_LEXICAL : acornScope.BIND_FUNCTION + ); + } else { + this.checkLValSimple(node.id, acornScope.BIND_NONE); + } + } + this.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); + } + parseFunctionBody(node, isArrowFunction = false, isMethod = false, forInit = false, tsConfig) { + if (this.match(tt.colon)) { + node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); + } + const bodilessType = tsConfig?.isFunctionDeclaration ? "TSDeclareFunction" : tsConfig?.isClassMethod ? "TSDeclareMethod" : void 0; + if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) { + this.exitScope(); + return this.finishNode(node, bodilessType); + } + if (bodilessType === "TSDeclareFunction" && this.isAmbientContext) { + this.raise(node.start, TypeScriptError.DeclareFunctionHasImplementation); + if (node.declare) { + super.parseFunctionBody(node, isArrowFunction, isMethod, false); + return this.finishNode(node, bodilessType); + } + } + super.parseFunctionBody(node, isArrowFunction, isMethod, forInit); + return node; + } + parseNew() { + if (this.containsEsc) this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + let node = this.startNode(); + let meta = this.parseIdent(true); + if (this.ecmaVersion >= 6 && this.eat(tt.dot)) { + node.meta = meta; + let containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") + this.raiseRecoverable( + node.property.start, + "The only valid meta property for new is 'new.target'" + ); + if (containsEsc) + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + if (!this["allowNewDotTarget"]) + this.raiseRecoverable( + node.start, + "'new.target' can only be used in functions and class static block" + ); + return this.finishNode(node, "MetaProperty"); + } + let startPos = this.start, startLoc = this.startLoc, isImport = this.type === tt._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + const { callee } = node; + if (callee.type === "TSInstantiationExpression" && !callee.extra?.parenthesized) { + node.typeArguments = callee.typeArguments; + node.callee = callee.expression; + } + if (this.eat(tt.parenL)) + node.arguments = this.parseExprList(tt.parenR, this.ecmaVersion >= 8, false); + else node.arguments = []; + return this.finishNode(node, "NewExpression"); + } + parseExprOp(left, leftStartPos, leftStartLoc, minPrec, forInit) { + if (tt._in.binop > minPrec && !this.hasPrecedingLineBreak()) { + let nodeType; + if (this.isContextual("as")) { + nodeType = "TSAsExpression"; + } + if (this.isContextual("satisfies")) { + nodeType = "TSSatisfiesExpression"; + } + if (nodeType) { + const node = this.startNodeAt(leftStartPos, leftStartLoc); + node.expression = left; + const _const = this.tsTryNextParseConstantContext(); + if (_const) { + node.typeAnnotation = _const; + } else { + node.typeAnnotation = this.tsNextThenParseType(); + } + this.finishNode(node, nodeType); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, forInit); + } + parseImportSpecifiers() { + let nodes = [], first = true; + if (acornTypeScript.tokenIsIdentifier(this.type)) { + nodes.push(this.parseImportDefaultSpecifier()); + if (!this.eat(tt.comma)) return nodes; + } + if (this.type === tt.star) { + nodes.push(this.parseImportNamespaceSpecifier()); + return nodes; + } + this.expect(tt.braceL); + while (!this.eat(tt.braceR)) { + if (!first) { + this.expect(tt.comma); + if (this.afterTrailingComma(tt.braceR)) break; + } else first = false; + nodes.push(this.parseImportSpecifier()); + } + return nodes; + } + /** + * @param {Node} node this may be ImportDeclaration | + * TsImportEqualsDeclaration + * @returns AnyImport + * */ + parseImport(node) { + let enterHead = this.lookahead(); + node.importKind = "value"; + this.importOrExportOuterKind = "value"; + if (tokenIsIdentifier(enterHead.type) || this.match(tt.star) || this.match(tt.braceL)) { + let ahead = this.lookahead(2); + if ( + // import type, { a } from "b"; + ahead.type !== tt.comma && // import type from "a"; + !this.isContextualWithState("from", ahead) && // import type = require("a"); + ahead.type !== tt.eq && this.ts_eatContextualWithState("type", 1, enterHead) + ) { + this.importOrExportOuterKind = "type"; + node.importKind = "type"; + enterHead = this.lookahead(); + ahead = this.lookahead(2); + } + if (tokenIsIdentifier(enterHead.type) && ahead.type === tt.eq) { + this.next(); + const importNode = this.tsParseImportEqualsDeclaration(node); + this.importOrExportOuterKind = "value"; + return importNode; + } + } + this.next(); + if (this.type === tt.string) { + node.specifiers = []; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); + } + this.parseMaybeImportAttributes(node); + this.semicolon(); + this.finishNode(node, "ImportDeclaration"); + this.importOrExportOuterKind = "value"; + if (node.importKind === "type" && node.specifiers.length > 1 && node.specifiers[0].type === "ImportDefaultSpecifier") { + this.raise(node.start, TypeScriptError.TypeImportCannotSpecifyDefaultAndNamed); + } + return node; + } + parseExportDefaultDeclaration() { + if (this.isAbstractClass()) { + const cls = this.startNode(); + this.next(); + cls.abstract = true; + return this.parseClass(cls, true); + } + if (this.match(tokTypes.interface)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseExportDefaultDeclaration(); + } + parseExportAllDeclaration(node, exports) { + if (this.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== tt.string) this.unexpected(); + node.source = this.parseExprAtom(); + this.parseMaybeImportAttributes(node); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + parseDynamicImport(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (this.eat(tt.comma)) { + const expr = this.parseExpression(); + node.arguments = [expr]; + } + if (!this.eat(tt.parenR)) { + const errorPos = this.start; + if (this.eat(tt.comma) && this.eat(tt.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); + } + parseExport(node, exports) { + let enterHead = this.lookahead(); + if (this.ts_eatWithState(tt._import, 2, enterHead)) { + if (this.ts_isContextual(tokTypes.type) && this.lookaheadCharCode() !== 61) { + node.importKind = "type"; + this.importOrExportOuterKind = "type"; + this.next(); + } else { + node.importKind = "value"; + this.importOrExportOuterKind = "value"; + } + const exportEqualsNode = this.tsParseImportEqualsDeclaration( + node, + /* isExport */ + true + ); + this.importOrExportOuterKind = void 0; + return exportEqualsNode; + } else if (this.ts_eatWithState(tt.eq, 2, enterHead)) { + const assign = node; + assign.expression = this.parseExpression(); + this.semicolon(); + this.importOrExportOuterKind = void 0; + return this.finishNode(assign, "TSExportAssignment"); + } else if (this.ts_eatContextualWithState("as", 2, enterHead)) { + const decl = node; + this.expectContextual("namespace"); + decl.id = this.parseIdent(); + this.semicolon(); + this.importOrExportOuterKind = void 0; + return this.finishNode(decl, "TSNamespaceExportDeclaration"); + } else { + const lookahead2 = this.lookahead(2).type; + if (this.ts_isContextualWithState(enterHead, tokTypes.type) && (lookahead2 === tt.braceL || // export type { ... } + lookahead2 === tt.star)) { + this.next(); + this.importOrExportOuterKind = "type"; + node.exportKind = "type"; + } else { + this.importOrExportOuterKind = "value"; + node.exportKind = "value"; + } + this.next(); + if (this.eat(tt.star)) { + return this.parseExportAllDeclaration(node, exports); + } + if (this.eat(tt._default)) { + this.checkExport(exports, "default", this.lastTokStart); + node.declaration = this.parseExportDefaultDeclaration(); + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseExportDeclaration(node); + if (node.declaration.type === "VariableDeclaration") + this.checkVariableExport(exports, node.declaration.declarations); + else this.checkExport(exports, node.declaration.id, node.declaration.id.start); + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== tt.string) this.unexpected(); + node.source = this.parseExprAtom(); + this.parseMaybeImportAttributes(node); + } else { + for (let spec of node.specifiers) { + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise( + spec.local.start, + "A string literal cannot be used as an exported binding without `from`." + ); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); + } + } + checkExport(exports, name, _) { + if (!exports) { + return; + } + if (typeof name !== "string") { + name = name.type === "Identifier" ? name.name : name.value; + } + exports[name] = true; + } + parseMaybeDefault(startPos, startLoc, left) { + const node = super.parseMaybeDefault(startPos, startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(node.typeAnnotation.start, TypeScriptError.TypeAnnotationAfterAssign); + } + return node; + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation( + node.expression, + node.typeAnnotation.end, + node.typeAnnotation.loc?.end + ); + return node.expression; + } + toAssignableList(exprList, isBinding) { + if (!exprList) exprList = []; + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if (expr?.type === "TSTypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + return super.toAssignableList(exprList, isBinding); + } + reportReservedArrowTypeParam(node) { + if (node.params.length === 1 && !node.extra?.trailingComma && disallowAmbiguousJSXLike) { + this.raise(node.start, TypeScriptError.ReservedArrowTypeParam); + } + } + parseExprAtom(refDestructuringErrors, forInit, forNew) { + if (this.type === tokTypes.jsxText) { + return this.jsx_parseText(); + } else if (this.type === tokTypes.jsxTagStart) { + return this.jsx_parseElement(); + } else if (this.type === tokTypes.at) { + this.parseDecorators(); + return this.parseExprAtom(); + } else if (tokenIsIdentifier(this.type)) { + let canBeArrow = this.potentialArrowAt === this.start; + let startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + let id = this.parseIdent(false); + if (this.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(tt._function)) { + this.overrideContext(tokContexts.f_expr); + return this.parseFunction( + this.startNodeAt(startPos, startLoc), + 0, + false, + true, + forInit + ); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(tt.arrow)) + return this.parseArrowExpression( + this.startNodeAt(startPos, startLoc), + [id], + false, + forInit + ); + if (this.ecmaVersion >= 8 && id.name === "async" && this.type === tt.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(tt.arrow)) this.unexpected(); + return this.parseArrowExpression( + this.startNodeAt(startPos, startLoc), + [id], + true, + forInit + ); + } + } + return id; + } else { + return super.parseExprAtom(refDestructuringErrors, forInit, forNew); + } + } + parseExprAtomDefault() { + if (tokenIsIdentifier(this.type)) { + const canBeArrow = this["potentialArrowAt"] === this.start; + const containsEsc = this.containsEsc; + const id = this.parseIdent(); + if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { + const { type } = this; + if (type === tt._function) { + this.next(); + return this.parseFunction(this.startNodeAtNode(id), void 0, true, true); + } else if (tokenIsIdentifier(type)) { + if (this.lookaheadCharCode() === 61) { + const paramId = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(tt.arrow)) this.unexpected(); + return this.parseArrowExpression(this.startNodeAtNode(id), [paramId], true); + } else { + return id; + } + } + } + if (canBeArrow && this.match(tt.arrow) && !this.canInsertSemicolon()) { + this.next(); + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); + } + return id; + } else { + this.unexpected(); + } + } + parseIdentNode() { + let node = this.startNode(); + if (tokenIsKeywordOrIdentifier(this.type) && // Taken from super-class method + !((this.type.keyword === "class" || this.type.keyword === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46))) { + node.name = this.value; + } else { + return super.parseIdentNode(); + } + return node; + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + const { isAmbientContext } = this; + this.next(); + super.parseVar(node, false, kind, allowMissingInitializer || isAmbientContext); + this.semicolon(); + const declaration = this.finishNode(node, "VariableDeclaration"); + if (!isAmbientContext) return declaration; + for (const { id, init } of declaration.declarations) { + if (!init) continue; + if (kind !== "const" || !!id.typeAnnotation) { + this.raise(init.start, TypeScriptError.InitializerNotAllowedInAmbientContext); + } else if (init.type !== "StringLiteral" && init.type !== "BooleanLiteral" && init.type !== "NumericLiteral" && init.type !== "BigIntLiteral" && (init.type !== "TemplateLiteral" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) { + this.raise( + init.start, + TypeScriptError.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference + ); + } + } + return declaration; + } + parseStatement(context, topLevel, exports) { + if (this.match(tokTypes.at)) { + this.parseDecorators(true); + } + if (this.match(tt._const) && this.isLookaheadContextual("enum")) { + const node = this.startNode(); + this.expect(tt._const); + return this.tsParseEnumDeclaration(node, { const: true }); + } + if (this.ts_isContextual(tokTypes.enum)) { + return this.tsParseEnumDeclaration(this.startNode()); + } + if (this.ts_isContextual(tokTypes.interface)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseStatement(context, topLevel, exports); + } + // NOTE: unused function + parseAccessModifier() { + return this.tsParseModifier(["public", "protected", "private"]); + } + parsePostMemberNameModifiers(methodOrProp) { + const optional = this.eat(tt.question); + if (optional) methodOrProp.optional = true; + if (methodOrProp.readonly && this.match(tt.parenL)) { + this.raise(methodOrProp.start, TypeScriptError.ClassMethodHasReadonly); + } + if (methodOrProp.declare && this.match(tt.parenL)) { + this.raise(methodOrProp.start, TypeScriptError.ClassMethodHasDeclare); + } + } + // Note: The reason we do this in `parseExpressionStatement` and not `parseStatement` + // is that e.g. `type()` is valid JS, so we must try parsing that first. + // If it's really a type, we will parse `type` as the statement, and can correct it here + // by parsing the rest. + parseExpressionStatement(node, expr) { + const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : void 0; + return decl || super.parseExpressionStatement(node, expr); + } + shouldParseExportStatement() { + if (this.tsIsDeclarationStart()) return true; + if (this.match(tokTypes.at)) { + return true; + } + return super.shouldParseExportStatement(); + } + parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors) { + if (this.eat(tt.question)) { + let node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(tt.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + } + parseMaybeConditional(forInit, refDestructuringErrors) { + let startPos = this.start, startLoc = this.startLoc; + let expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) return expr; + if (!this.maybeInArrowParameters || !this.match(tt.question)) { + return this.parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors); + } + const result = this.tryParse( + () => this.parseConditional(expr, startPos, startLoc, forInit, refDestructuringErrors) + ); + if (!result.node) { + if (result.error) { + this.setOptionalParametersError(refDestructuringErrors, result.error); + } + return expr; + } + if (result.error) this.setLookaheadState(result.failState); + return result.node; + } + parseParenItem(node) { + const startPos = this.start; + const startLoc = this.startLoc; + node = super.parseParenItem(node); + if (this.eat(tt.question)) { + node.optional = true; + this.resetEndLocation(node); + } + if (this.match(tt.colon)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); + } + return node; + } + parseExportDeclaration(node) { + if (!this.isAmbientContext && this.ts_isContextual(tokTypes.declare)) { + return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); + } + const startPos = this.start; + const startLoc = this.startLoc; + const isDeclare = this.eatContextual("declare"); + if (isDeclare && (this.ts_isContextual(tokTypes.declare) || !this.shouldParseExportStatement())) { + this.raise(this.start, TypeScriptError.ExpectedAmbientAfterExportDeclare); + } + const isIdentifier = tokenIsIdentifier(this.type); + const declaration = isIdentifier && this.tsTryParseExportDeclaration() || this.parseStatement(null); + if (!declaration) return null; + if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { + node.exportKind = "type"; + } + if (isDeclare) { + this.resetStartLocation(declaration, startPos, startLoc); + declaration.declare = true; + } + return declaration; + } + parseClassId(node, isStatement) { + if (!isStatement && this.isContextual("implements")) { + return; + } + super.parseClassId(node, isStatement); + const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)); + if (typeParameters) node.typeParameters = typeParameters; + } + parseClassPropertyAnnotation(node) { + if (!node.optional) { + if (this.value === "!" && this.eat(tt.prefix)) { + node.definite = true; + } else if (this.eat(tt.question)) { + node.optional = true; + } + } + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + } + parseClassField(field) { + const isPrivate = field.key.type === "PrivateIdentifier"; + if (isPrivate) { + if (field.abstract) { + this.raise(field.start, TypeScriptError.PrivateElementHasAbstract); + } + if (field.accessibility) { + this.raise( + field.start, + TypeScriptError.PrivateElementHasAccessibility({ + modifier: field.accessibility + }) + ); + } + this.parseClassPropertyAnnotation(field); + } else { + this.parseClassPropertyAnnotation(field); + if (this.isAmbientContext && !(field.readonly && !field.typeAnnotation) && this.match(tt.eq)) { + this.raise(this.start, TypeScriptError.DeclareClassFieldHasInitializer); + } + if (field.abstract && this.match(tt.eq)) { + const { key } = field; + this.raise( + this.start, + TypeScriptError.AbstractPropertyHasInitializer({ + propertyName: key.type === "Identifier" && !field.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }) + ); + } + } + return super.parseClassField(field); + } + parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper) { + const isConstructor = method.kind === "constructor"; + const isPrivate = method.key.type === "PrivateIdentifier"; + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (isPrivate) { + if (typeParameters) method.typeParameters = typeParameters; + if (method.accessibility) { + this.raise( + method.start, + TypeScriptError.PrivateMethodsHasAccessibility({ + modifier: method.accessibility + }) + ); + } + } else { + if (typeParameters && isConstructor) { + this.raise(typeParameters.start, TypeScriptError.ConstructorHasTypeParameters); + } + } + const { declare = false, kind } = method; + if (declare && (kind === "get" || kind === "set")) { + this.raise(method.start, TypeScriptError.DeclareAccessor({ kind })); + } + if (typeParameters) method.typeParameters = typeParameters; + const key = method.key; + if (method.kind === "constructor") { + if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); + if (isAsync) this.raise(key.start, "Constructor can't be an async method"); + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + const value = method.value = this.parseMethod( + isGenerator, + isAsync, + allowsDirectSuper, + true, + method + ); + if (method.kind === "get" && value["params"].length !== 0) + this.raiseRecoverable(value.start, "getter should have no params"); + if (method.kind === "set" && value["params"].length !== 1) + this.raiseRecoverable(value.start, "setter should have exactly one param"); + if (method.kind === "set" && value["params"][0].type === "RestElement") + this.raiseRecoverable(value["params"][0].start, "Setter cannot use rest params"); + return this.finishNode(method, "MethodDefinition"); + } + isClassMethod() { + return this.match(tt.relational); + } + parseClassElement(constructorAllowsSuper) { + if (this.eat(tt.semi)) return null; + let node = this.startNode(); + let keyName = ""; + let isGenerator = false; + let isAsync = false; + let kind = "method"; + let isStatic = false; + const modifiers = [ + "declare", + "private", + "public", + "protected", + "accessor", + "override", + "abstract", + "readonly", + "static" + ]; + const modifierMap = this.tsParseModifiers({ + modified: node, + allowedModifiers: modifiers, + disallowedModifiers: ["in", "out"], + stopOnStartOfClassStaticBlock: true, + errorTemplate: TypeScriptError.InvalidModifierOnTypeParameterPositions + }); + isStatic = Boolean(modifierMap.static); + const callParseClassMemberWithIsStatic = () => { + if (this.tsIsStartOfStaticBlocks()) { + this.next(); + this.next(); + if (this.tsHasSomeModifiers(node, modifiers)) { + this.raise(this.start, TypeScriptError.StaticBlockCannotHaveModifier); + } + if (this.ecmaVersion >= 13) { + super.parseClassStaticBlock(node); + return node; + } + } else { + const idx = this.tsTryParseIndexSignature(node); + if (idx) { + if (node.abstract) { + this.raise(node.start, TypeScriptError.IndexSignatureHasAbstract); + } + if (node.accessibility) { + this.raise( + node.start, + TypeScriptError.IndexSignatureHasAccessibility({ + modifier: node.accessibility + }) + ); + } + if (node.declare) { + this.raise(node.start, TypeScriptError.IndexSignatureHasDeclare); + } + if (node.override) { + this.raise(node.start, TypeScriptError.IndexSignatureHasOverride); + } + return idx; + } + if (!this.inAbstractClass && node.abstract) { + this.raise(node.start, TypeScriptError.NonAbstractClassHasAbstractMethod); + } + if (node.override) { + if (!constructorAllowsSuper) { + this.raise(node.start, TypeScriptError.OverrideNotInSubClass); + } + } + node.static = isStatic; + if (isStatic) { + if (!(this.isClassElementNameStart() || this.type === tt.star)) { + keyName = "static"; + } + } + if (!keyName && this.ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === tt.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (this.ecmaVersion >= 9 || !isAsync) && this.eat(tt.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + const lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + this.parsePostMemberNameModifiers(node); + if (this.isClassMethod() || this.ecmaVersion < 13 || this.type === tt.parenL || kind !== "method" || isGenerator || isAsync) { + const isConstructor = !node.static && checkKeyName(node, "constructor"); + const allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") + this.raise(node.key.start, "Constructor can't have get/set modifier"); + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; + } + }; + if (node.declare) { + this.tsInAmbientContext(callParseClassMemberWithIsStatic); + } else { + callParseClassMemberWithIsStatic(); + } + return node; + } + isClassElementNameStart() { + if (this.tsIsIdentifier()) { + return true; + } + return super.isClassElementNameStart(); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.tsMatchLeftRelational() || this.match(tt.bitShift))) { + node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); + } + if (this.eatContextual("implements")) { + node.implements = this.tsParseHeritageClause("implements"); + } + } + parseFunctionParams(node) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) node.typeParameters = typeParameters; + super.parseFunctionParams(node); + } + // `let x: number;` + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(tt.prefix)) { + decl.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) { + decl.id.typeAnnotation = type; + this.resetEndLocation(decl.id); + } + } + // parse the return type of an async arrow function - let foo = (async (): number => {}); + parseArrowExpression(node, params, isAsync, forInit) { + if (this.match(tt.colon)) { + node.returnType = this.tsParseTypeAnnotation(); + } + let oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags(isAsync, false) | acornScope.SCOPE_ARROW); + this.initFunction(node); + const oldMaybeInArrowParameters = this.maybeInArrowParameters; + if (this.ecmaVersion >= 8) node.async = !!isAsync; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.maybeInArrowParameters = true; + node.params = this.toAssignableList(params, true); + this.maybeInArrowParameters = false; + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + this.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, "ArrowFunctionExpression"); + } + parseMaybeAssignOrigin(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) return this.parseYield(forInit); + else this.exprAllowed = false; + } + let ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors(); + ownDestructuringErrors = true; + } + let startPos = this.start, startLoc = this.startLoc; + if (this.type === tt.parenL || tokenIsIdentifier(this.type)) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + let left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + if (this.type.isAssign) { + let node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === tt.eq) left = this.toAssignable(left, true, refDestructuringErrors); + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) + refDestructuringErrors.shorthandAssign = -1; + if (!this.maybeInArrowParameters) { + if (this.type === tt.eq) this.checkLValPattern(left); + else this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) refDestructuringErrors.doubleProto = oldDoubleProto; + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true); + } + if (oldParenAssign > -1) refDestructuringErrors.parenthesizedAssign = oldParenAssign; + if (oldTrailingComma > -1) refDestructuringErrors.trailingComma = oldTrailingComma; + return left; + } + parseMaybeAssign(forInit, refExpressionErrors, afterLeftParse) { + let state; + let jsx; + let typeCast; + if (options?.jsx && (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational())) { + state = this.cloneCurLookaheadState(); + jsx = this.tryParse( + () => this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse), + state + ); + if (!jsx.error) return jsx.node; + const context = this.context; + const currentContext = context[context.length - 1]; + const lastCurrentContext = context[context.length - 2]; + if (currentContext === acornTypeScript.tokContexts.tc_oTag && lastCurrentContext === acornTypeScript.tokContexts.tc_expr) { + context.pop(); + context.pop(); + } else if (currentContext === acornTypeScript.tokContexts.tc_oTag || currentContext === acornTypeScript.tokContexts.tc_expr) { + context.pop(); + } + } + if (!jsx?.error && !this.tsMatchLeftRelational()) { + return this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse); + } + if (!state || this.compareLookaheadState(state, this.getCurLookaheadState())) { + state = this.cloneCurLookaheadState(); + } + let typeParameters; + const arrow = this.tryParse((abort) => { + typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + const expr = this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse); + if (expr.type !== "ArrowFunctionExpression" || expr.extra?.parenthesized) { + abort(); + } + if (typeParameters?.params.length !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); + } + expr.typeParameters = typeParameters; + return expr; + }, state); + if (!arrow.error && !arrow.aborted) { + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if (!jsx) { + assert(true); + typeCast = this.tryParse( + () => this.parseMaybeAssignOrigin(forInit, refExpressionErrors, afterLeftParse), + state + ); + if (!typeCast.error) return typeCast.node; + } + if (jsx?.node) { + this.setLookaheadState(jsx.failState); + return jsx.node; + } + if (arrow.node) { + this.setLookaheadState(arrow.failState); + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if (typeCast?.node) { + this.setLookaheadState(typeCast.failState); + return typeCast.node; + } + if (jsx?.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + if (typeCast?.thrown) throw typeCast.error; + throw jsx?.error || arrow.error || typeCast?.error; + } + parseAssignableListItem(allowModifiers) { + const decorators = []; + while (this.match(tokTypes.at)) { + decorators.push(this.parseDecorator()); + } + const startPos = this.start; + const startLoc = this.startLoc; + let accessibility; + let readonly = false; + let override = false; + if (allowModifiers !== void 0) { + const modified = {}; + this.tsParseModifiers({ + modified, + allowedModifiers: ["public", "private", "protected", "override", "readonly"] + }); + accessibility = modified.accessibility; + override = modified.override; + readonly = modified.readonly; + if (allowModifiers === false && (accessibility || readonly || override)) { + this.raise(startLoc.column, TypeScriptError.UnexpectedParameterModifier); + } + } + const left = this.parseMaybeDefault(startPos, startLoc); + this.parseBindingListItem(left); + const elt = this.parseMaybeDefault(left["start"], left["loc"].start, left); + if (decorators.length) { + elt.decorators = decorators; + } + if (accessibility || readonly || override) { + const pp = this.startNodeAt(startPos, startLoc); + if (accessibility) pp.accessibility = accessibility; + if (readonly) pp.readonly = readonly; + if (override) pp.override = override; + if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { + this.raise(pp.start, TypeScriptError.UnsupportedParameterPropertyKind); + } + pp.parameter = elt; + return this.finishNode(pp, "TSParameterProperty"); + } + return elt; + } + // AssignmentPattern + checkLValInnerPattern(expr, bindingType = acornScope.BIND_NONE, checkClashes) { + switch (expr.type) { + case "TSParameterProperty": + this.checkLValInnerPattern(expr.parameter, bindingType, checkClashes); + break; + default: { + super.checkLValInnerPattern(expr, bindingType, checkClashes); + break; + } + } + } + // Allow type annotations inside of a parameter list. + parseBindingListItem(param) { + if (this.eat(tt.question)) { + if (param.type !== "Identifier" && !this.isAmbientContext && !this.inType) { + this.raise(param.start, TypeScriptError.PatternIsOptional); + } + param.optional = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) param.typeAnnotation = type; + this.resetEndLocation(param); + return param; + } + isAssignable(node, isBinding) { + switch (node.type) { + case "TSTypeCastExpression": + return this.isAssignable(node.expression, isBinding); + case "TSParameterProperty": + return true; + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + return true; + case "ObjectExpression": { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); + }); + } + case "Property": + case "ObjectProperty": + return this.isAssignable(node.value); + case "SpreadElement": + return this.isAssignable(node.argument); + case "ArrayExpression": + return node.elements.every( + (element) => element === null || this.isAssignable(element) + ); + case "AssignmentExpression": + return node.operator === "="; + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + default: + return false; + } + } + toAssignable(node, isBinding = false, refDestructuringErrors = new DestructuringErrors()) { + switch (node.type) { + case "ParenthesizedExpression": + return this.toAssignableParenthesizedExpression( + node, + isBinding, + refDestructuringErrors + ); + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + if (isBinding) { + } else { + this.raise(node.start, TypeScriptError.UnexpectedTypeCastInParameter); + } + return this.toAssignable(node.expression, isBinding, refDestructuringErrors); + case "MemberExpression": + break; + case "AssignmentExpression": + if (!isBinding && node.left.type === "TSTypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + return super.toAssignable(node, isBinding, refDestructuringErrors); + case "TSTypeCastExpression": { + return this.typeCastToParameter(node); + } + default: + return super.toAssignable(node, isBinding, refDestructuringErrors); + } + return node; + } + toAssignableParenthesizedExpression(node, isBinding, refDestructuringErrors) { + switch (node.expression.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + case "ParenthesizedExpression": + return this.toAssignable(node.expression, isBinding, refDestructuringErrors); + default: + return super.toAssignable(node, isBinding, refDestructuringErrors); + } + } + parseBindingAtom() { + switch (this.type) { + case tt._this: + return this.parseIdent( + /* liberal */ + true + ); + default: + return super.parseBindingAtom(); + } + } + shouldParseArrow(exprList) { + let shouldParseArrowRes; + if (this.match(tt.colon)) { + shouldParseArrowRes = exprList.every((expr) => this.isAssignable(expr, true)); + } else { + shouldParseArrowRes = !this.canInsertSemicolon(); + } + if (shouldParseArrowRes) { + if (this.match(tt.colon)) { + const result = this.tryParse((abort) => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); + if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort(); + return returnType; + }); + if (result.aborted) { + this.shouldParseArrowReturnType = void 0; + return false; + } + if (!result.thrown) { + if (result.error) this.setLookaheadState(result.failState); + this.shouldParseArrowReturnType = result.node; + } + } + if (!this.match(tt.arrow)) { + this.shouldParseArrowReturnType = void 0; + return false; + } + return true; + } + this.shouldParseArrowReturnType = void 0; + return shouldParseArrowRes; + } + parseParenArrowList(startPos, startLoc, exprList, forInit) { + const node = this.startNodeAt(startPos, startLoc); + node.returnType = this.shouldParseArrowReturnType; + this.shouldParseArrowReturnType = void 0; + return this.parseArrowExpression(node, exprList, false, forInit); + } + parseParenAndDistinguishExpression(canBeArrow, forInit) { + let startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.ecmaVersion >= 8; + if (this.ecmaVersion >= 6) { + const oldMaybeInArrowParameters = this.maybeInArrowParameters; + this.maybeInArrowParameters = true; + this.next(); + let innerStartPos = this.start, innerStartLoc = this.startLoc; + let exprList = [], first = true, lastIsComma = false; + let refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== tt.parenR) { + first ? first = false : this.expect(tt.comma); + if (allowTrailingComma && this.afterTrailingComma(tt.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === tt.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === tt.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push( + this.parseMaybeAssign(forInit, refDestructuringErrors, this.parseParenItem) + ); + } + } + let innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(tt.parenR); + this.maybeInArrowParameters = oldMaybeInArrowParameters; + if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(tt.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart); + if (spreadStart) this.unexpected(spreadStart); + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + let par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } + } + parseTaggedTemplateExpression(base, startPos, startLoc, optionalChainMember) { + const node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate({ isTagged: true }); + if (optionalChainMember) { + this.raise( + startPos, + "Tagged Template Literals are not allowed in optionalChain." + ); + } + return this.finishNode(node, "TaggedTemplateExpression"); + } + shouldParseAsyncArrow() { + if (this.match(tt.colon)) { + const result = this.tryParse((abort) => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon); + if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort(); + return returnType; + }); + if (result.aborted) { + this.shouldParseAsyncArrowReturnType = void 0; + return false; + } + if (!result.thrown) { + if (result.error) this.setLookaheadState(result.failState); + this.shouldParseAsyncArrowReturnType = result.node; + return !this.canInsertSemicolon() && this.eat(tt.arrow); + } + } else { + return !this.canInsertSemicolon() && this.eat(tt.arrow); + } + } + parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit) { + const arrN = this.startNodeAt(startPos, startLoc); + arrN.returnType = this.shouldParseAsyncArrowReturnType; + this.shouldParseAsyncArrowReturnType = void 0; + return this.parseArrowExpression(arrN, exprList, true, forInit); + } + parseExprList(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + let elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(tt.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) break; + } else first = false; + let elt; + if (allowEmpty && this.type === tt.comma) elt = null; + else if (this.type === tt.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (this.maybeInArrowParameters && this.match(tt.colon)) { + elt.typeAnnotation = this.tsParseTypeAnnotation(); + } + if (refDestructuringErrors && this.type === tt.comma && refDestructuringErrors.trailingComma < 0) + refDestructuringErrors.trailingComma = this.start; + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem); + } + elts.push(elt); + } + return elts; + } + parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + let _optionalChained = optionalChained; + if (!this.hasPrecedingLineBreak() && // NODE: replace bang + this.value === "!" && this.match(tt.prefix)) { + this.exprAllowed = false; + this.next(); + const nonNullExpression = this.startNodeAt(startPos, startLoc); + nonNullExpression.expression = base; + base = this.finishNode(nonNullExpression, "TSNonNullExpression"); + return base; + } + let isOptionalCall = false; + if (this.match(tt.questionDot) && this.lookaheadCharCode() === 60) { + if (noCalls) { + return base; + } + base.optional = true; + _optionalChained = isOptionalCall = true; + this.next(); + } + if (this.tsMatchLeftRelational() || this.match(tt.bitShift)) { + let missingParenErrorLoc; + const result = this.tsTryParseAndCatch(() => { + if (!noCalls && this.atPossibleAsyncArrow(base)) { + const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction( + startPos, + startLoc, + forInit + ); + if (asyncArrowFn) { + base = asyncArrowFn; + return base; + } + } + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (!typeArguments) return base; + if (isOptionalCall && !this.match(tt.parenL)) { + missingParenErrorLoc = this.curPosition(); + return base; + } + if (tokenIsTemplate(this.type) || this.type === tt.backQuote) { + const result2 = this.parseTaggedTemplateExpression( + base, + startPos, + startLoc, + _optionalChained + ); + result2.typeArguments = typeArguments; + return result2; + } + if (!noCalls && this.eat(tt.parenL)) { + let refDestructuringErrors = new DestructuringErrors(); + const node2 = this.startNodeAt(startPos, startLoc); + node2.callee = base; + node2.arguments = this.parseExprList( + tt.parenR, + this.ecmaVersion >= 8, + false, + refDestructuringErrors + ); + this.tsCheckForInvalidTypeCasts(node2.arguments); + node2.typeArguments = typeArguments; + if (_optionalChained) { + node2.optional = isOptionalCall; + } + this.checkExpressionErrors(refDestructuringErrors, true); + base = this.finishNode(node2, "CallExpression"); + return base; + } + const tokenType = this.type; + if ( + // a>c is not (a)>c, but a<(b>>c) + this.tsMatchRightRelational() || // a>>c is not (a)>>c, but a<(b>>>c) + tokenType === tt.bitShift || // ac is (ac + tokenType !== tt.parenL && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak() + ) { + return; + } + const node = this.startNodeAt(startPos, startLoc); + node.expression = base; + node.typeArguments = typeArguments; + return this.finishNode(node, "TSInstantiationExpression"); + }); + if (missingParenErrorLoc) { + this.unexpected(missingParenErrorLoc); + } + if (result) { + if (result.type === "TSInstantiationExpression" && (this.match(tt.dot) || this.match(tt.questionDot) && this.lookaheadCharCode() !== 40)) { + this.raise( + this.start, + TypeScriptError.InvalidPropertyAccessAfterInstantiationExpression + ); + } + base = result; + return base; + } + } + let optionalSupported = this.ecmaVersion >= 11; + let optional = optionalSupported && this.eat(tt.questionDot); + if (noCalls && optional) + this.raise( + this.lastTokStart, + "Optional chaining cannot appear in the callee of new expressions" + ); + let computed = this.eat(tt.bracketL); + if (computed || optional && this.type !== tt.parenL && this.type !== tt.backQuote || this.eat(tt.dot)) { + let node = this.startNodeAt(startPos, startLoc); + node.object = base; + if (computed) { + node.property = this.parseExpression(); + this.expect(tt.bracketR); + } else if (this.type === tt.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(tt.parenL)) { + const oldMaybeInArrowParameters = this.maybeInArrowParameters; + this.maybeInArrowParameters = true; + let refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + let exprList = this.parseExprList( + tt.parenR, + this.ecmaVersion >= 8, + false, + refDestructuringErrors + ); + if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + this.raise( + this.awaitIdentPos, + "Cannot use 'await' as identifier inside an async function" + ); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + base = this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + let node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = exprList; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "CallExpression"); + } + this.maybeInArrowParameters = oldMaybeInArrowParameters; + } else if (this.type === tt.backQuote) { + if (optional || _optionalChained) { + this.raise( + this.start, + "Optional chaining cannot appear in the tag of tagged template expressions" + ); + } + let node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate({ isTagged: true }); + base = this.finishNode(node, "TaggedTemplateExpression"); + } + return base; + } + parseGetterSetter(prop) { + prop.kind = prop.key.name; + this.parsePropertyName(prop); + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + prop.value = this.parseMethod(false); + if (typeParameters) prop.value.typeParameters = typeParameters; + let paramCount = prop.kind === "get" ? 0 : 1; + const firstParam = prop.value.params[0]; + const hasContextParam = firstParam && this.isThisParam(firstParam); + paramCount = hasContextParam ? paramCount + 1 : paramCount; + if (prop.value.params.length !== paramCount) { + let start = prop.value.start; + if (prop.kind === "get") this.raiseRecoverable(start, "getter should have no params"); + else this.raiseRecoverable(start, "setter should have exactly one param"); + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if (this.tsMatchLeftRelational()) { + if (isPattern) this.unexpected(); + prop.kind = "init"; + prop.method = true; + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + prop.value = this.parseMethod(isGenerator, isAsync); + if (typeParameters) prop.value.typeParameters = typeParameters; + return; + } + return super.parsePropertyValue( + prop, + isPattern, + isGenerator, + isAsync, + startPos, + startLoc, + refDestructuringErrors, + containsEsc + ); + } + parseProperty(isPattern, refDestructuringErrors) { + if (!isPattern) { + let decorators = []; + if (this.match(tokTypes.at)) { + while (this.match(tokTypes.at)) { + decorators.push(this.parseDecorator()); + } + } + const property = super.parseProperty(isPattern, refDestructuringErrors); + if (property.type === "SpreadElement") { + if (decorators.length) + this.raise(property.start, DecoratorsError.SpreadElementDecorator); + } + if (decorators.length) { + property.decorators = decorators; + decorators = []; + } + return property; + } + return super.parseProperty(isPattern, refDestructuringErrors); + } + parseCatchClauseParam() { + const param = this.parseBindingAtom(); + let simple = param.type === "Identifier"; + this.enterScope(simple ? acornScope.SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern( + param, + simple ? acornScope.BIND_SIMPLE_CATCH : acornScope.BIND_LEXICAL + ); + const type = this.tsTryParseTypeAnnotation(); + if (type) { + param.typeAnnotation = type; + this.resetEndLocation(param); + } + this.expect(tt.parenR); + return param; + } + parseClass(node, isStatement) { + const oldInAbstractClass = this.inAbstractClass; + this.inAbstractClass = !!node.abstract; + try { + this.next(); + this.takeDecorators(node); + const oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + const privateNameMap = this.enterClassBody(); + const classBody = this.startNode(); + let hadConstructor = false; + classBody.body = []; + let decorators = []; + this.expect(tt.braceL); + while (this.type !== tt.braceR) { + if (this.match(tokTypes.at)) { + decorators.push(this.parseDecorator()); + continue; + } + const element = this.parseClassElement(node.superClass !== null); + if (decorators.length) { + element.decorators = decorators; + this.resetStartLocationFromNode(element, decorators[0]); + decorators = []; + } + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor" && element.value.type === "FunctionExpression") { + if (hadConstructor) { + this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + if (element.decorators && element.decorators.length > 0) { + this.raise(element.start, DecoratorsError.DecoratorConstructor); + } + } else if (element.key && element.key.type === "PrivateIdentifier" && element.value?.type !== "TSDeclareMethod" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable( + element.key.start, + `Identifier '#${element.key.name}' has already been declared` + ); + } + } + } + this.strict = oldStrict; + this.next(); + if (decorators.length) { + this.raise(this.start, DecoratorsError.TrailingDecorator); + } + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } finally { + this.inAbstractClass = oldInAbstractClass; + } + } + parseClassFunctionParams() { + const typeParameters = this.tsTryParseTypeParameters(); + let params = this.parseBindingList(tt.parenR, false, this.ecmaVersion >= 8, true); + if (typeParameters) params.typeParameters = typeParameters; + return params; + } + parseMethod(isGenerator, isAsync, allowDirectSuper, inClassScope, method) { + let node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.ecmaVersion >= 6) node.generator = isGenerator; + if (this.ecmaVersion >= 8) node.async = !!isAsync; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope( + functionFlags(isAsync, node.generator) | acornScope.SCOPE_SUPER | (allowDirectSuper ? acornScope.SCOPE_DIRECT_SUPER : 0) + ); + this.expect(tt.parenL); + node.params = this.parseClassFunctionParams(); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false, { + isClassMethod: inClassScope + }); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + if (method && method.abstract) { + const hasBody = !!node.body; + if (hasBody) { + const { key } = method; + this.raise( + method.start, + TypeScriptError.AbstractMethodHasImplementation({ + methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }) + ); + } + } + return this.finishNode(node, "FunctionExpression"); + } + static parse(input, options2) { + if (options2.locations === false) { + throw new Error(`You have to enable options.locations while using acorn-typescript`); + } else { + options2.locations = true; + } + const parser = new this(options2, input); + if (dts) { + parser.isAmbientContext = true; + } + return parser.parse(); + } + static parseExpressionAt(input, pos, options2) { + if (options2.locations === false) { + throw new Error(`You have to enable options.locations while using acorn-typescript`); + } else { + options2.locations = true; + } + const parser = new this(options2, input, pos); + if (dts) { + parser.isAmbientContext = true; + } + parser.nextToken(); + return parser.parseExpression(); + } + parseImportSpecifier() { + const isMaybeTypeOnly = this.ts_isContextual(tokTypes.type); + if (isMaybeTypeOnly) { + let node = this.startNode(); + node.imported = this.parseModuleExportName(); + this.parseTypeOnlyImportExportSpecifier( + node, + /* isImport */ + true, + this.importOrExportOuterKind === "type" + ); + return this.finishNode(node, "ImportSpecifier"); + } else { + const node = super.parseImportSpecifier(); + node.importKind = "value"; + return node; + } + } + parseExportSpecifier(exports) { + const isMaybeTypeOnly = this.ts_isContextual(tokTypes.type); + const isString = this.match(tt.string); + if (!isString && isMaybeTypeOnly) { + let node = this.startNode(); + node.local = this.parseModuleExportName(); + this.parseTypeOnlyImportExportSpecifier( + node, + /* isImport */ + false, + this.importOrExportOuterKind === "type" + ); + this.finishNode(node, "ExportSpecifier"); + this.checkExport(exports, node.exported, node.exported.start); + return node; + } else { + const node = super.parseExportSpecifier(exports); + node.exportKind = "value"; + return node; + } + } + parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { + const leftOfAsKey = isImport ? "imported" : "local"; + const rightOfAsKey = isImport ? "local" : "exported"; + let leftOfAs = node[leftOfAsKey]; + let rightOfAs; + let hasTypeSpecifier = false; + let canParseAsKeyword = true; + const loc = leftOfAs.start; + if (this.isContextual("as")) { + const firstAs = this.parseIdent(); + if (this.isContextual("as")) { + const secondAs = this.parseIdent(); + if (tokenIsKeywordOrIdentifier(this.type)) { + hasTypeSpecifier = true; + leftOfAs = firstAs; + rightOfAs = isImport ? this.parseIdent() : this.parseModuleExportName(); + canParseAsKeyword = false; + } else { + rightOfAs = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsKeywordOrIdentifier(this.type)) { + canParseAsKeyword = false; + rightOfAs = isImport ? this.parseIdent() : this.parseModuleExportName(); + } else { + hasTypeSpecifier = true; + leftOfAs = firstAs; + } + } else if (tokenIsKeywordOrIdentifier(this.type)) { + hasTypeSpecifier = true; + if (isImport) { + leftOfAs = super.parseIdent(true); + if (!this.isContextual("as")) { + this.checkUnreserved(leftOfAs); + } + } else { + leftOfAs = this.parseModuleExportName(); + } + } + if (hasTypeSpecifier && isInTypeOnlyImportExport) { + this.raise( + loc, + isImport ? TypeScriptError.TypeModifierIsUsedInTypeImports : TypeScriptError.TypeModifierIsUsedInTypeExports + ); + } + node[leftOfAsKey] = leftOfAs; + node[rightOfAsKey] = rightOfAs; + const kindKey = isImport ? "importKind" : "exportKind"; + node[kindKey] = hasTypeSpecifier ? "type" : "value"; + if (canParseAsKeyword && this.eatContextual("as")) { + node[rightOfAsKey] = isImport ? this.parseIdent() : this.parseModuleExportName(); + } + if (!node[rightOfAsKey]) { + node[rightOfAsKey] = this.copyNode(node[leftOfAsKey]); + } + if (isImport) { + this.checkLValSimple(node[rightOfAsKey], acornScope.BIND_LEXICAL); + } + } + raiseCommonCheck(pos, message, recoverable) { + switch (message) { + case "Comma is not permitted after the rest element": { + if (this.isAmbientContext && this.match(tt.comma) && this.lookaheadCharCode() === 41) { + this.next(); + return; + } else { + return super.raise(pos, message); + } + } + } + return recoverable ? super.raiseRecoverable(pos, message) : super.raise(pos, message); + } + raiseRecoverable(pos, message) { + return this.raiseCommonCheck(pos, message, true); + } + raise(pos, message) { + return this.raiseCommonCheck(pos, message, true); + } + updateContext(prevType) { + const { type } = this; + if (type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tsTokContexts.tc_oTag) this.context.push(tokContexts.b_expr); + else if (curContext == tsTokContexts.tc_expr) this.context.push(tokContexts.b_tmpl); + else super.updateContext(prevType); + this.exprAllowed = true; + } else if (type === tt.slash && prevType === tokTypes.jsxTagStart) { + this.context.length -= 2; + this.context.push(tsTokContexts.tc_cTag); + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + // Parses JSX opening tag starting after '<'. + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + let nodeName = this.jsx_parseElementName(); + if (nodeName) node.name = nodeName; + if (this.match(tt.relational) || this.match(tt.bitShift)) { + const typeArguments = this.tsTryParseAndCatch( + () => this.tsParseTypeArgumentsInExpression() + ); + if (typeArguments) node.typeArguments = typeArguments; + } + node.attributes = []; + while (this.type !== tt.slash && this.type !== tokTypes.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tokTypes.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); + } + enterScope(flags) { + if (flags === TS_SCOPE_TS_MODULE) { + this.importsStack.push([]); + } + super.enterScope(flags); + const scope = super.currentScope(); + scope.types = []; + scope.enums = []; + scope.constEnums = []; + scope.classes = []; + scope.exportOnlyBindings = []; + } + exitScope() { + const scope = super.currentScope(); + if (scope.flags === TS_SCOPE_TS_MODULE) { + this.importsStack.pop(); + } + super.exitScope(); + } + hasImport(name, allowShadow) { + const len = this.importsStack.length; + if (this.importsStack[len - 1].indexOf(name) > -1) { + return true; + } + if (!allowShadow && len > 1) { + for (let i = 0; i < len - 1; i++) { + if (this.importsStack[i].indexOf(name) > -1) return true; + } + } + return false; + } + maybeExportDefined(scope, name) { + if (this.inModule && scope.flags & acornScope.SCOPE_TOP) { + delete this.undefinedExports[name]; + } + } + declareName(name, bindingType, pos) { + if (bindingType & acornScope.BIND_FLAGS_TS_IMPORT) { + if (this.hasImport(name, true)) { + this.raise(pos, `Identifier '${name}' has already been declared.`); + } + this.importsStack[this.importsStack.length - 1].push(name); + return; + } + const scope = this.currentScope(); + if (bindingType & acornScope.BIND_FLAGS_TS_EXPORT_ONLY) { + this.maybeExportDefined(scope, name); + scope.exportOnlyBindings.push(name); + return; + } + if (bindingType === acornScope.BIND_TS_TYPE || bindingType === acornScope.BIND_TS_INTERFACE) { + if (bindingType === acornScope.BIND_TS_TYPE && scope.types.includes(name)) { + this.raise(pos, `type '${name}' has already been declared.`); + } + scope.types.push(name); + } else { + super.declareName(name, bindingType, pos); + } + if (bindingType & acornScope.BIND_FLAGS_TS_ENUM) scope.enums.push(name); + if (bindingType & acornScope.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name); + if (bindingType & acornScope.BIND_FLAGS_CLASS) scope.classes.push(name); + } + checkLocalExport(id) { + const { name } = id; + if (this.hasImport(name)) return; + const len = this.scopeStack.length; + for (let i = len - 1; i >= 0; i--) { + const scope = this.scopeStack[i]; + if (scope.types.indexOf(name) > -1 || scope.exportOnlyBindings.indexOf(name) > -1) return; + } + super.checkLocalExport(id); + } + } + return TypeScriptParser; + }; +} +export { + tsPlugin +}; diff --git a/tools/ui/node_modules/@sveltejs/acorn-typescript/package.json b/tools/ui/node_modules/@sveltejs/acorn-typescript/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d7bc01c99bb02c51426cfde30fdd25021eed91c9 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/acorn-typescript/package.json @@ -0,0 +1,55 @@ +{ + "name": "@sveltejs/acorn-typescript", + "version": "1.0.10", + "description": "Acorn plugin that parses TypeScript", + "type": "module", + "types": "index.d.ts", + "files": [ + "index.js", + "index.d.ts" + ], + "exports": { + ".": { + "types": "./index.d.ts", + "default": "./index.js" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/acorn-typescript.git" + }, + "author": "tyrealhu and the Svelte team", + "license": "MIT", + "bugs": { + "url": "https://github.com/sveltejs/acorn-typescript/issues" + }, + "homepage": "https://github.com/sveltejs/acorn-typescript#readme", + "devDependencies": { + "@changesets/cli": "^2.27.11", + "@svitejs/changesets-changelog-github-compact": "^1.1.0", + "acorn": "^8.14.0", + "acorn-jsx": "~5.3.2", + "cross-env": "^7.0.3", + "esbuild": "^0.25.0", + "prettier": "~3.5.2", + "test262": "git+https://github.com/tc39/test262.git#88ebb1e3755198cd08757bca1698effbbf360345", + "test262-parser-runner": "^0.5.0", + "typescript": "^5.7.3", + "vitest": "^3.0.7" + }, + "peerDependencies": { + "acorn": "^8.9.0" + }, + "scripts": { + "build": "esbuild src/index.ts --bundle --format=esm --outfile=index.js --platform=node --external:acorn", + "format": "prettier --write .", + "check": "tsc --noEmit", + "lint": "prettier --check .", + "test": "vitest run", + "test:update": "cross-env UPDATE_SNAPSHOT=true vitest run && pnpm run format", + "test:test262": "pnpm run build && node ./test/run_test262.js", + "changeset:version": "changeset version && git add --all", + "changeset:release": "changeset publish", + "playground": "pnpm build && node ./playground/index.js" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/LICENSE b/tools/ui/node_modules/@sveltejs/adapter-static/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..22efd0c0dfa3b3dae382a6faf87b40d3e9a23965 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/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. \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/README.md b/tools/ui/node_modules/@sveltejs/adapter-static/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b612f2aa6122dfdabf92dbf4cbc17167bf13514a --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/README.md @@ -0,0 +1,15 @@ +# @sveltejs/adapter-static + +[Adapter](https://svelte.dev/docs/kit/adapters) for SvelteKit apps that prerenders your entire site as a collection of static files. It's also possible to create an SPA with it by specifying a fallback page which renders an empty shell. If you'd like to prerender only some pages and not create an SPA for those left out, you will need to use a different adapter together with [the `prerender` option](https://svelte.dev/docs/kit/page-options#prerender). + +## Docs + +[Docs](https://svelte.dev/docs/kit/adapter-static) + +## Changelog + +[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/main/packages/adapter-static/CHANGELOG.md). + +## License + +[MIT](LICENSE) diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/index.d.ts b/tools/ui/node_modules/@sveltejs/adapter-static/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..101e02fdef12bd71756c656524cc7ee08f8b4380 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/index.d.ts @@ -0,0 +1,11 @@ +import { Adapter } from '@sveltejs/kit'; + +export interface AdapterOptions { + pages?: string; + assets?: string; + fallback?: string; + precompress?: boolean; + strict?: boolean; +} + +export default function plugin(options?: AdapterOptions): Adapter; diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/index.js b/tools/ui/node_modules/@sveltejs/adapter-static/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c2b87301c8a88126f804ed9a22c96b42df1df847 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/index.js @@ -0,0 +1,91 @@ +import path from 'node:path'; +import { platforms } from './platforms.js'; + +/** @type {import('./index.js').default} */ +export default function (options) { + return { + name: '@sveltejs/adapter-static', + /** @param {import('./internal.js').Builder2_0_0} builder */ + async adapt(builder) { + if (!options?.fallback && builder.config.kit.router?.type !== 'hash') { + const dynamic_routes = builder.routes.filter((route) => route.prerender !== true); + if (dynamic_routes.length > 0 && options?.strict !== false) { + const prefix = path.relative('.', builder.config.kit.files.routes); + const has_param_routes = builder.routes.some((route) => route.id.includes('[')); + const config_option = + has_param_routes || JSON.stringify(builder.config.kit.prerender.entries) !== '["*"]' + ? ` - adjust the \`prerender.entries\` config option ${ + has_param_routes + ? '(routes with parameters are not part of entry points by default)' + : '' + } — see https://svelte.dev/docs/kit/configuration#prerender for more info.` + : ''; + + builder.log.error( + `@sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic: +${dynamic_routes.map((route) => ` - ${path.posix.join(prefix, route.id)}`).join('\n')} + +You have the following options: + - set the \`fallback\` option — see https://svelte.dev/docs/kit/single-page-apps#usage for more info. + - add \`export const prerender = true\` to your root \`+layout.js/.ts\` or \`+layout.server.js/.ts\` file. This will try to prerender all pages. + - add \`export const prerender = true\` to any \`+server.js/ts\` files that are not fetched by page \`load\` functions. +${config_option} + - pass \`strict: false\` to \`adapter-static\` to ignore this error. Only do this if you are sure you don't need the routes in question in your final app, as they will be unavailable. See https://github.com/sveltejs/kit/tree/main/packages/adapter-static#strict for more info. + +If this doesn't help, you may need to use a different adapter. @sveltejs/adapter-static can only be used for sites that don't need a server for dynamic rendering, and can run on just a static file server. +See https://svelte.dev/docs/kit/page-options#prerender for more details` + ); + throw new Error('Encountered dynamic routes'); + } + } + + const platform = platforms.find((platform) => platform.test()); + + if (platform) { + if (options) { + builder.log.warn( + `Detected ${platform.name}. Please remove adapter-static options to enable zero-config mode` + ); + } else { + builder.log.info(`Detected ${platform.name}, using zero-config mode`); + } + } + + const { + // @ts-ignore + pages = 'build', + assets = pages, + fallback, + precompress + } = options ?? platform?.defaults ?? /** @type {import('./index.js').AdapterOptions} */ ({}); + + builder.rimraf(assets); + builder.rimraf(pages); + + builder.generateEnvModule(); + builder.writeClient(assets); + builder.writePrerendered(pages); + + if (fallback) { + await builder.generateFallback(path.join(pages, fallback)); + } + + if (precompress) { + builder.log.minor('Compressing assets and pages'); + if (pages === assets) { + await builder.compress(assets); + } else { + await Promise.all([builder.compress(assets), builder.compress(pages)]); + } + } + + if (pages === assets) { + builder.log(`Wrote site to "${pages}"`); + } else { + builder.log(`Wrote pages to "${pages}" and assets to "${assets}"`); + } + + if (!options) platform?.done(builder); + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/package.json b/tools/ui/node_modules/@sveltejs/adapter-static/package.json new file mode 100644 index 0000000000000000000000000000000000000000..42cc5e5a88b08749ffa37bc43a2adfe330092600 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/package.json @@ -0,0 +1,54 @@ +{ + "name": "@sveltejs/adapter-static", + "version": "3.0.10", + "description": "Adapter for SvelteKit apps that prerenders your entire site as a collection of static files", + "keywords": [ + "adapter", + "deploy", + "hosting", + "ssg", + "static site generation", + "svelte", + "sveltekit" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/kit.git", + "directory": "packages/adapter-static" + }, + "license": "MIT", + "homepage": "https://svelte.dev/docs/kit/adapter-static", + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.js" + }, + "./package.json": "./package.json" + }, + "types": "index.d.ts", + "files": [ + "index.js", + "index.d.ts", + "platforms.js" + ], + "devDependencies": { + "@playwright/test": "^1.51.1", + "@sveltejs/vite-plugin-svelte": "^6.0.0-next.3", + "@types/node": "^18.19.119", + "sirv": "^3.0.0", + "svelte": "^5.39.3", + "typescript": "^5.3.3", + "vite": "^6.3.5", + "@sveltejs/kit": "^2.43.7" + }, + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + }, + "scripts": { + "lint": "prettier --check .", + "check": "tsc", + "format": "pnpm lint --write", + "test": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/adapter-static/platforms.js b/tools/ui/node_modules/@sveltejs/adapter-static/platforms.js new file mode 100644 index 0000000000000000000000000000000000000000..6ed42162566865bab57a74149fb20333d0e74d9e --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/adapter-static/platforms.js @@ -0,0 +1,76 @@ +import fs from 'node:fs'; +import process from 'node:process'; + +/** + * @typedef {{ + * name: string; + * test: () => boolean; + * defaults: import('./index.js').AdapterOptions; + * done: (builder: import('./internal.js').Builder2_0_0) => void; + * }} + * Platform */ + +// This function is duplicated in adapter-vercel +/** @param {import('./internal.js').Builder2_0_0} builder */ +function static_vercel_config(builder) { + /** @type {any[]} */ + const prerendered_redirects = []; + + /** @type {Record} */ + const overrides = {}; + + for (const [src, redirect] of builder.prerendered.redirects) { + prerendered_redirects.push({ + src, + headers: { + Location: redirect.location + }, + status: redirect.status + }); + } + + for (const [path, page] of builder.prerendered.pages) { + if (path.endsWith('/') && path !== '/') { + prerendered_redirects.push( + { src: path, dest: path.slice(0, -1) }, + { src: path.slice(0, -1), status: 308, headers: { Location: path } } + ); + + overrides[page.file] = { path: path.slice(1, -1) }; + } else { + overrides[page.file] = { path: path.slice(1) }; + } + } + + return { + version: 3, + routes: [ + ...prerendered_redirects, + { + src: `/${builder.getAppPath()}/immutable/.+`, + headers: { + 'cache-control': 'public, immutable, max-age=31536000' + } + }, + { + handle: 'filesystem' + } + ], + overrides + }; +} + +/** @type {Platform[]} */ +export const platforms = [ + { + name: 'Vercel', + test: () => !!process.env.VERCEL, + defaults: { + pages: '.vercel/output/static' + }, + done: (builder) => { + const config = static_vercel_config(builder); + fs.writeFileSync('.vercel/output/config.json', JSON.stringify(config, null, ' ')); + } + } +]; diff --git a/tools/ui/node_modules/@sveltejs/kit/LICENSE b/tools/ui/node_modules/@sveltejs/kit/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..22efd0c0dfa3b3dae382a6faf87b40d3e9a23965 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/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. \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/kit/README.md b/tools/ui/node_modules/@sveltejs/kit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..372a92e71fa7f231433a339605392850b54bdb40 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/README.md @@ -0,0 +1,18 @@ +# The fastest way to build Svelte apps + +This is the [SvelteKit](https://svelte.dev/docs/kit) framework and CLI. + +The quickest way to get started is via the [sv](https://npmjs.com/package/sv) package: + +```sh +npx sv create my-app +cd my-app +npm install +npm run dev +``` + +See the [documentation](https://svelte.dev/docs/kit) to learn more. + +## Changelog + +[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md). diff --git a/tools/ui/node_modules/@sveltejs/kit/package.json b/tools/ui/node_modules/@sveltejs/kit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e11d962249a90ca844dfc0432ca6755b9456f83f --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/package.json @@ -0,0 +1,148 @@ +{ + "name": "@sveltejs/kit", + "version": "2.70.2", + "description": "SvelteKit is the fastest way to build Svelte apps", + "keywords": [ + "framework", + "official", + "svelte", + "sveltekit", + "vite" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/kit.git", + "directory": "packages/kit" + }, + "license": "MIT", + "homepage": "https://svelte.dev", + "type": "module", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@sveltejs/acorn-typescript": "^1.0.9", + "@types/cookie": "^0.6.0", + "acorn": "^8.16.0", + "cookie": "^0.6.0", + "devalue": "^5.8.1", + "esm-env": "^1.2.2", + "kleur": "^4.1.5", + "magic-string": "^0.30.5", + "mrmime": "^2.0.0", + "set-cookie-parser": "^3.0.0", + "sirv": "^3.0.0" + }, + "devDependencies": { + "@opentelemetry/api": "^1.0.0", + "@playwright/test": "^1.60.0", + "@sveltejs/vite-plugin-svelte": "^6.0.0-next.3", + "@types/connect": "^3.4.38", + "@types/node": "^18.19.130", + "@types/set-cookie-parser": "^2.4.7", + "dts-buddy": "^0.8.1", + "jsdom": "^26.1.0", + "rollup": "^4.59.0", + "svelte": "^5.56.3", + "typescript": "^5.3.3", + "vite": "^6.4.3", + "vitest": "^4.1.8" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": "^5.3.3 || ^6.0.0", + "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "typescript": { + "optional": true + } + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "files": [ + "src", + "!src/**/*.spec.js", + "!src/core/**/fixtures", + "!src/core/**/test", + "types", + "svelte-kit.js" + ], + "imports": { + "#app/paths": { + "browser": "./src/runtime/app/paths/client.js", + "default": "./src/runtime/app/paths/server.js" + }, + "#app/env/public": { + "browser": "./src/runtime/app/env/public/client.js", + "default": "./src/runtime/app/env/public/server.js" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./types/index.d.ts", + "import": "./src/exports/index.js" + }, + "./internal": { + "types": "./types/index.d.ts", + "import": "./src/exports/internal/index.js" + }, + "./internal/env": { + "types": "./types/index.d.ts", + "import": "./src/exports/internal/env.js" + }, + "./internal/types": { + "types": "./src/exports/internal/types.d.ts" + }, + "./internal/server": { + "types": "./types/index.d.ts", + "import": "./src/exports/internal/server.js" + }, + "./node": { + "types": "./types/index.d.ts", + "import": "./src/exports/node/index.js" + }, + "./node/polyfills": { + "types": "./types/index.d.ts", + "import": "./src/exports/node/polyfills.js" + }, + "./hooks": { + "types": "./types/index.d.ts", + "import": "./src/exports/hooks/index.js" + }, + "./env": { + "types": "./types/index.d.ts", + "import": "./src/exports/env/index.js" + }, + "./vite": { + "types": "./types/index.d.ts", + "import": "./src/exports/vite/index.js" + } + }, + "types": "types/index.d.ts", + "engines": { + "node": ">=18.13" + }, + "scripts": { + "lint": "prettier --config ../../.prettierrc --check .", + "check": "tsc && cd ./test/types && tsc", + "check:all": "tsc && pnpm -r --filter=\"./**\" check", + "format": "prettier --config ../../.prettierrc --write .", + "test": "pnpm test:unit && pnpm test:integration", + "test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test", + "test:cross-platform:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:dev", + "test:cross-platform:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:build", + "test:server-side-route-resolution:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:dev", + "test:server-side-route-resolution:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:build", + "test:svelte-async:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:svelte-async:dev", + "test:svelte-async:build": "pnpm test:unit && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:svelte-async:build", + "test:unit": "vitest --config kit.vitest.config.js run", + "generate:version": "node scripts/generate-version.js", + "generate:types": "node scripts/generate-dts.js" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/kit/src/cli.js b/tools/ui/node_modules/@sveltejs/kit/src/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..157c666f1255f96b6bc0e4bafe26cf48995bf636 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/cli.js @@ -0,0 +1,121 @@ +import fs from 'node:fs'; +import process from 'node:process'; +import { parseArgs } from 'node:util'; +import colors from 'kleur'; +import { load_config } from './core/config/index.js'; +import { coalesce_to_error } from './utils/error.js'; +import { resolve_explicit_env_entry } from './core/env.js'; + +/** @param {unknown} e */ +function handle_error(e) { + const error = coalesce_to_error(e); + + if (error.name === 'SyntaxError') throw error; + + console.error(colors.bold().red(`> ${error.message}`)); + if (error.stack) { + console.error(colors.gray(error.stack.split('\n').slice(1).join('\n'))); + } + + process.exit(1); +} + +const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8')); + +const help = ` + Usage: svelte-kit [options] + + Commands: + sync Synchronise generated type definitions + + Options: + --version, -v Show version number + --help, -h Show this help message + + Sync Options: + --mode Specify a mode for loading environment variables (default: development) +`; + +let parsed; +try { + parsed = parseArgs({ + options: { + version: { type: 'boolean', short: 'v' }, + help: { type: 'boolean', short: 'h' }, + mode: { type: 'string', default: 'development' } + }, + allowPositionals: true, + strict: true + }); +} catch (err) { + const error = /** @type {Error} */ (err); + console.error(colors.bold().red(`> ${error.message}`)); + console.log(help); + process.exit(1); +} + +const { values, positionals } = parsed; + +if (values.version) { + console.log(pkg.version); + process.exit(0); +} + +if (values.help) { + console.log(help); + process.exit(0); +} + +const command = positionals[0]; + +if (!command) { + console.log(help); + process.exit(0); +} + +if (command === 'sync') { + // create placeholder .svelte-kit/tsconfig.json if necessary, to squelch warnings. + // this isn't bulletproof — if someone has some esoteric config, it will continue + // to harmlessly warn — but we handle the 90% case and clean up after ourselves + const sveltekit_dir = '.svelte-kit'; + const base_tsconfig = `${sveltekit_dir}/tsconfig.json`; + const base_tsconfig_json = '{}'; + + const sveltekit_dir_exists = fs.existsSync(sveltekit_dir); + const base_tsconfig_exists = fs.existsSync(base_tsconfig); + + if (!base_tsconfig_exists) { + try { + fs.mkdirSync('.svelte-kit'); + } catch { + // ignore + } + + fs.writeFileSync(base_tsconfig, base_tsconfig_json); + } + + try { + const config = await load_config(); + const sync = await import('./core/sync/sync.js'); + sync.all_types(config, values.mode); + + const explicit_env_entry = resolve_explicit_env_entry(config.kit); + await sync.env(config.kit, explicit_env_entry, values.mode); + } catch (error) { + handle_error(error); + } finally { + // if we errored, or accidentally created the wrong file + // (could happen!) then clean up after ourselves + if (fs.readFileSync(base_tsconfig, 'utf-8') === base_tsconfig_json) { + fs.unlinkSync(base_tsconfig); + } + + if (!sveltekit_dir_exists && fs.readdirSync(sveltekit_dir).length === 0) { + fs.rmSync(sveltekit_dir, { recursive: true }); + } + } +} else { + console.error(colors.bold().red(`> Unknown command: ${command}`)); + console.log(help); + process.exit(1); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/constants.js b/tools/ui/node_modules/@sveltejs/kit/src/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..5a6795f3f58d3ace134436a0903d62cfe7e544fe --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/constants.js @@ -0,0 +1,13 @@ +/** + * A fake asset path used in `vite dev` and `vite preview`, so that we can + * serve local assets while verifying that requests are correctly prefixed + */ +export const SVELTE_KIT_ASSETS = '/_svelte_kit_assets'; + +export const GENERATED_COMMENT = '// this file is generated — do not edit it\n'; + +export const ENDPOINT_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD']; + +export const MUTATIVE_METHODS = ['POST', 'PUT', 'PATCH', 'DELETE']; + +export const PAGE_METHODS = ['GET', 'POST', 'HEAD']; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/builder.js b/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/builder.js new file mode 100644 index 0000000000000000000000000000000000000000..bf856b4b48b53ed1674210775b2ea9f58f7d7ce6 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/builder.js @@ -0,0 +1,422 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ +/** @import { Builder } from '@sveltejs/kit' */ +/** @import { ResolvedConfig } from 'vite' */ +/** @import { RouteDefinition, EnvVarConfig } from '@sveltejs/kit' */ +/** @import { RouteData, ValidatedConfig, BuildData, ServerMetadata, ServerMetadataRoute, Prerendered, PrerenderMap, Logger, RemoteChunk } from 'types' */ +import colors from 'kleur'; +import * as devalue from 'devalue'; +import { createReadStream, createWriteStream, existsSync, statSync } from 'node:fs'; +import { extname, resolve, join, dirname, relative } from 'node:path'; +import { pipeline } from 'node:stream'; +import { promisify } from 'node:util'; +import zlib from 'node:zlib'; +import { copy, rimraf, mkdirp, posixify } from '../../utils/filesystem.js'; +import { generate_manifest } from '../generate_manifest/index.js'; +import { get_route_segments } from '../../utils/routing.js'; +import { get_env } from '../../exports/vite/utils.js'; +import generate_fallback from '../postbuild/fallback.js'; +import { write } from '../sync/utils.js'; +import { list_files } from '../utils.js'; +import { find_server_assets } from '../generate_manifest/find_server_assets.js'; +import { reserved } from '../env.js'; +import { handle_issues, validate } from '../../exports/internal/env.js'; + +const pipe = promisify(pipeline); +const extensions = [ + '.html', + '.js', + '.mjs', + '.json', + '.css', + '.svg', + '.xml', + '.wasm', + '.txt', + '.md', + '.mdx' +]; + +/** + * Creates the Builder which is passed to adapters for building the application. + * @param {{ + * config: ValidatedConfig; + * build_data: BuildData; + * server_metadata: ServerMetadata; + * route_data: RouteData[]; + * prerendered: Prerendered; + * prerender_map: PrerenderMap; + * log: Logger; + * vite_config: ResolvedConfig; + * remotes: RemoteChunk[]; + * explicit_env_config: Record> | null; + * }} opts + * @returns {Builder} + */ +export function create_builder({ + config, + build_data, + server_metadata, + route_data, + prerendered, + prerender_map, + log, + vite_config, + remotes, + explicit_env_config +}) { + /** @type {Map} */ + const lookup = new Map(); + + /** + * Rather than exposing the internal `RouteData` type, which is subject to change, + * we expose a stable type that adapters can use to group/filter routes + */ + const routes = route_data.map((route) => { + const { config, methods, page, api } = /** @type {ServerMetadataRoute} */ ( + server_metadata.routes.get(route.id) + ); + + /** @type {RouteDefinition} */ + const facade = { + id: route.id, + api, + page, + segments: get_route_segments(route.id).map((segment) => ({ + dynamic: segment.includes('['), + rest: segment.includes('[...'), + content: segment + })), + pattern: route.pattern, + prerender: prerender_map.get(route.id) ?? false, + methods, + config + }; + + lookup.set(facade, route); + + return facade; + }); + + return { + log, + rimraf, + mkdirp, + copy, + + config, + prerendered, + routes, + + async compress(directory) { + if (!existsSync(directory)) { + return; + } + + const files = list_files(directory, (file) => extensions.includes(extname(file))).map( + (file) => resolve(directory, file) + ); + + await Promise.all( + files.flatMap((file) => [compress_file(file, 'gz'), compress_file(file, 'br')]) + ); + }, + + async createEntries(fn) { + const seen = new Set(); + + for (let i = 0; i < route_data.length; i += 1) { + const route = route_data[i]; + if (prerender_map.get(route.id) === true) continue; + const { id, filter, complete } = fn(routes[i]); + + if (seen.has(id)) continue; + seen.add(id); + + const group = [route]; + + // figure out which lower priority routes should be considered fallbacks + for (let j = i + 1; j < route_data.length; j += 1) { + if (prerender_map.get(routes[j].id) === true) continue; + if (filter(routes[j])) { + group.push(route_data[j]); + } + } + + const filtered = new Set(group); + + // heuristic: if /foo/[bar] is included, /foo/[bar].json should + // also be included, since the page likely needs the endpoint + // TODO is this still necessary, given the new way of doing things? + filtered.forEach((route) => { + if (route.page) { + const endpoint = route_data.find((candidate) => candidate.id === route.id + '.json'); + + if (endpoint) { + filtered.add(endpoint); + } + } + }); + + if (filtered.size > 0) { + await complete({ + generateManifest: ({ relativePath }) => + generate_manifest({ + build_data, + prerendered: [], + relative_path: relativePath, + routes: Array.from(filtered), + remotes + }) + }); + } + } + }, + + findServerAssets(route_data) { + return find_server_assets( + build_data, + route_data.map((route) => /** @type {import('types').RouteData} */ (lookup.get(route))) + ); + }, + + async generateFallback(dest) { + const manifest_path = `${config.kit.outDir}/output/server/manifest-full.js`; + const env = get_env(config.kit.env, vite_config.mode); + + const fallback = await generate_fallback({ + manifest_path, + env: env.all, + out_dir: config.kit.outDir, + origin: config.kit.prerender.origin, + assets: config.kit.files.assets + }); + + if (existsSync(dest)) { + console.log( + colors + .bold() + .yellow( + `Overwriting ${dest} with fallback page. Consider using a different name for the fallback.` + ) + ); + } + + write(dest, fallback); + }, + + generateEnvModule() { + const env = get_env(config.kit.env, vite_config.mode); + + const dest = `${config.kit.outDir}/output/prerendered/dependencies/${config.kit.appDir}`; + + /** @type {string} */ + let payload; + + if (config.kit.experimental.explicitEnvironmentVariables) { + const variables = explicit_env_config ?? {}; + + /** @type {Record} */ + const issues = {}; + + /** @type {Record} */ + const values = {}; + + for (const [name, config] of Object.entries(variables)) { + if (config.static || !config.public) continue; + values[name] = validate(variables, env.all[name], name, issues); + } + + handle_issues(issues); + + if (Object.keys(values).length === 0) return; + + payload = devalue.uneval(values); + + if (build_data.service_worker) { + write(`${dest}/env.script.js`, `globalThis.__sveltekit_sw={env:${payload}}`); + } + } else { + payload = devalue.uneval(env.public); + } + + if (build_data.client?.uses_env_dynamic_public) { + write(`${dest}/env.js`, `export const env=${payload}`); + } + }, + + generateManifest({ relativePath, routes: subset }) { + return generate_manifest({ + build_data, + prerendered: prerendered.paths, + relative_path: relativePath, + routes: subset + ? subset.map((route) => /** @type {import('types').RouteData} */ (lookup.get(route))) + : route_data.filter((route) => prerender_map.get(route.id) !== true), + remotes + }); + }, + + getBuildDirectory(name) { + return `${config.kit.outDir}/${name}`; + }, + + getClientDirectory() { + return `${config.kit.outDir}/output/client`; + }, + + getServerDirectory() { + return `${config.kit.outDir}/output/server`; + }, + + getAppPath() { + return build_data.app_path; + }, + + writeClient(dest) { + return copy(`${config.kit.outDir}/output/client`, dest, { + // avoid making vite build artefacts public + filter: (basename) => basename !== '.vite' + }); + }, + + writePrerendered(dest) { + const source = `${config.kit.outDir}/output/prerendered`; + + return [ + ...copy(`${source}/pages`, dest), + ...copy(`${source}/dependencies`, dest), + ...copy(`${source}/data`, dest) + ]; + }, + + writeServer(dest) { + return copy(`${config.kit.outDir}/output/server`, dest); + }, + + hasServerInstrumentationFile() { + return existsSync(`${config.kit.outDir}/output/server/instrumentation.server.js`); + }, + + instrument({ + entrypoint, + instrumentation, + start = join(dirname(entrypoint), 'start.js'), + module = { + exports: ['default'] + } + }) { + if (!existsSync(instrumentation)) { + throw new Error( + `Instrumentation file ${instrumentation} not found. This is probably a bug in your adapter.` + ); + } + if (!existsSync(entrypoint)) { + throw new Error( + `Entrypoint file ${entrypoint} not found. This is probably a bug in your adapter.` + ); + } + + copy(entrypoint, start); + if (existsSync(`${entrypoint}.map`)) { + copy(`${entrypoint}.map`, `${start}.map`); + } + + const relative_instrumentation = posixify(relative(dirname(entrypoint), instrumentation)); + const relative_start = posixify(relative(dirname(entrypoint), start)); + + const facade = + 'generateText' in module + ? module.generateText({ + instrumentation: relative_instrumentation, + start: relative_start + }) + : create_instrumentation_facade({ + instrumentation: relative_instrumentation, + start: relative_start, + exports: module.exports + }); + + rimraf(entrypoint); + write(entrypoint, facade); + } + }; +} + +/** + * @param {string} file + * @param {'gz' | 'br'} format + */ +async function compress_file(file, format = 'gz') { + const compress = + format == 'br' + ? zlib.createBrotliCompress({ + params: { + [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT, + [zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY, + [zlib.constants.BROTLI_PARAM_SIZE_HINT]: statSync(file).size + } + }) + : zlib.createGzip({ level: zlib.constants.Z_BEST_COMPRESSION }); + + const source = createReadStream(file); + const destination = createWriteStream(`${file}.${format}`); + + await pipe(source, compress, destination); +} + +/** + * Given a list of exports, generate a facade that: + * - Imports the instrumentation file + * - Imports `exports` from the entrypoint (dynamically, if `tla` is true) + * - Re-exports `exports` from the entrypoint + * + * `default` receives special treatment: It will be imported as `default` and exported with `export default`. + * + * @param {{ instrumentation: string; start: string; exports: string[] }} opts + * @returns {string} + */ +function create_instrumentation_facade({ instrumentation, start, exports }) { + const import_instrumentation = `import './${instrumentation}';`; + + let alias_index = 0; + const aliases = new Map(); + + for (const name of exports.filter((name) => reserved.has(name))) { + /* + * you can do evil things like `export { c as class }`. + * in order to import these, you need to alias them, and then un-alias them when re-exporting + * this map will allow us to generate the following: + * import { class as _1 } from 'entrypoint'; + * export { _1 as class }; + */ + let alias = `_${alias_index++}`; + while (exports.includes(alias)) { + alias = `_${alias_index++}`; + } + + aliases.set(name, alias); + } + + const import_statements = []; + const export_statements = []; + + for (const name of exports) { + const alias = aliases.get(name); + if (alias) { + import_statements.push(`${name}: ${alias}`); + export_statements.push(`${alias} as ${name}`); + } else { + import_statements.push(`${name}`); + export_statements.push(`${name}`); + } + } + + const entrypoint_facade = [ + `const { ${import_statements.join(', ')} } = await import('./${start}');`, + export_statements.length > 0 ? `export { ${export_statements.join(', ')} };` : '' + ] + .filter(Boolean) + .join('\n'); + + return `${import_instrumentation}\n${entrypoint_facade}`; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/index.js b/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c4a9ea2af613c80536fb981a6502a8fb62e7e1e7 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/adapt/index.js @@ -0,0 +1,47 @@ +import colors from 'kleur'; +import { create_builder } from './builder.js'; + +/** + * @param {import('types').ValidatedConfig} config + * @param {import('types').BuildData} build_data + * @param {import('types').ServerMetadata} server_metadata + * @param {import('types').Prerendered} prerendered + * @param {import('types').PrerenderMap} prerender_map + * @param {import('types').Logger} log + * @param {import('types').RemoteChunk[]} remotes + * @param {import('vite').ResolvedConfig} vite_config + * @param {Record> | null} explicit_env_config + */ +export async function adapt( + config, + build_data, + server_metadata, + prerendered, + prerender_map, + log, + remotes, + vite_config, + explicit_env_config +) { + // This is only called when adapter is truthy, so the cast is safe + const { name, adapt } = /** @type {import('@sveltejs/kit').Adapter} */ (config.kit.adapter); + + console.log(colors.bold().cyan(`\n> Using ${name}`)); + + const builder = create_builder({ + config, + build_data, + server_metadata, + route_data: build_data.manifest_data.routes.filter((route) => route.page || route.endpoint), + prerendered, + prerender_map, + log, + remotes, + vite_config, + explicit_env_config + }); + + await adapt(builder); + + log.success('done'); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/config/default-error.html b/tools/ui/node_modules/@sveltejs/kit/src/core/config/default-error.html new file mode 100644 index 0000000000000000000000000000000000000000..c322e1682478b1c60125f1cf29acc8e47a3043ee --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/config/default-error.html @@ -0,0 +1,80 @@ + + + + + %sveltekit.error.message% + + + + +
+ %sveltekit.status% +
+

%sveltekit.error.message%

+
+
+ + diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/config/index.js b/tools/ui/node_modules/@sveltejs/kit/src/core/config/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2c00f0702fd22731926cdd47cbe82b8477f0517f --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/config/index.js @@ -0,0 +1,297 @@ +/** @import { Config, KitConfig } from '@sveltejs/kit' */ +/** @import { Options, SvelteConfig } from '@sveltejs/vite-plugin-svelte' */ +/** @import { ValidatedConfig } from 'types' */ +/** @import { ResolvedConfig } from 'vite' */ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import * as url from 'node:url'; +import { options, kit_options, kit_experimental_options } from './options.js'; +import { resolve_entry } from '../../utils/filesystem.js'; +import { import_peer } from '../../utils/import.js'; + +/** + * Splits the config passed to the `sveltekit` Vite plugin into the options that + * SvelteKit processes itself and the options that are forwarded to + * `vite-plugin-svelte`. SvelteKit makes no assumptions about which options + * `vite-plugin-svelte` accepts — it plucks out its own options and passes + * everything else along (`vite-plugin-svelte` does its own validation). + * @param {KitConfig & Omit & Pick} config + * @returns {{ svelte_config: Config, vite_plugin_svelte_config: Record }} + */ +export function split_config(config) { + const { extensions, compilerOptions, vitePlugin, preprocess, ...rest } = config; + + /** @type {KitConfig} */ + const kit = {}; + + /** @type {Record} */ + const vite_plugin_svelte_config = {}; + + for (const key in rest) { + if (key === 'experimental') { + // `experimental` is a namespace that both SvelteKit and vite-plugin-svelte + // use, so pluck out the flags SvelteKit recognises and pass the rest along + const experimental = /** @type {Record} */ (rest[key]) ?? {}; + + /** @type {Record} */ + const kit_experimental = {}; + /** @type {Record} */ + const vps_experimental = {}; + + for (const flag in experimental) { + if (kit_experimental_options.includes(flag)) { + kit_experimental[flag] = experimental[flag]; + } else { + vps_experimental[flag] = experimental[flag]; + } + } + + if (Object.keys(kit_experimental).length > 0) { + kit.experimental = kit_experimental; + } + if (Object.keys(vps_experimental).length > 0) { + vite_plugin_svelte_config.experimental = vps_experimental; + } + } else if (kit_options.includes(key)) { + // @ts-expect-error - we've verified this is one of SvelteKit's own options + kit[key] = rest[key]; + } else { + vite_plugin_svelte_config[key] = /** @type {Record} */ (rest)[key]; + } + } + + return { + svelte_config: { extensions, compilerOptions, vitePlugin, preprocess, kit }, + vite_plugin_svelte_config + }; +} + +/** + * Loads the template (src/app.html by default) and validates that it has the + * required content. + * @param {string} cwd + * @param {ValidatedConfig} config + */ +export function load_template(cwd, { kit }) { + const { env, files } = kit; + + const relative = path.relative(cwd, files.appTemplate); + + if (!fs.existsSync(files.appTemplate)) { + throw new Error(`${relative} does not exist`); + } + + const contents = fs.readFileSync(files.appTemplate, 'utf8'); + + const expected_tags = ['%sveltekit.head%', '%sveltekit.body%']; + expected_tags.forEach((tag) => { + if (contents.indexOf(tag) === -1) { + throw new Error(`${relative} is missing ${tag}`); + } + }); + + if (!kit.experimental.explicitEnvironmentVariables) { + for (const match of contents.matchAll(/%sveltekit\.env\.([^%]+)%/g)) { + if (!match[1].startsWith(env.publicPrefix)) { + throw new Error( + `Environment variables in ${relative} must start with ${env.publicPrefix} (saw %sveltekit.env.${match[1]}%)` + ); + } + } + } + + return contents; +} + +/** + * Loads the error page (src/error.html by default) if it exists. + * Falls back to a generic error page content. + * @param {ValidatedConfig} config + */ +export function load_error_page(config) { + let { errorTemplate } = config.kit.files; + + // Don't do this inside resolving the config, because that would mean + // adding/removing error.html isn't detected and would require a restart. + if (!fs.existsSync(config.kit.files.errorTemplate)) { + errorTemplate = url.fileURLToPath(new URL('./default-error.html', import.meta.url)); + } + + return fs.readFileSync(errorTemplate, 'utf-8'); +} + +/** + * Loads and validates Svelte config file. Tries Vite config first, falls back to svelte.config.js + * @param {{ cwd?: string }} options + * @returns {Promise} + */ +export async function load_config({ cwd = process.cwd() } = {}) { + try { + const vite_config = await load_config_from_vite({ cwd }); + if (vite_config) { + return vite_config; + } + } catch (e) { + // TODO SvelteKit 3: fail completely instead + console.error( + 'Loading Svelte config from Vite config failed:', + e, + '\n\nFalling back to loading svelte.config.js' + ); + } + + return load_svelte_config(cwd); +} + +/** + * Loads and validates Svelte config file + * @param {string} [cwd] + * @returns {Promise} + */ +export async function load_svelte_config(cwd = process.cwd()) { + const config_files = ['js', 'ts'] + .map((ext) => path.join(cwd, `svelte.config.${ext}`)) + .filter((f) => fs.existsSync(f)); + + if (config_files.length === 0) { + console.log( + `No Svelte config file found in ${cwd} - using SvelteKit's default configuration without an adapter.` + ); + return process_config({}, { cwd }); + } + + const config_file = config_files[0]; + if (config_files.length > 1) { + console.log( + `Found multiple Svelte config files in ${cwd}: ${config_files.map((f) => path.basename(f)).join(', ')}. Using ${path.basename(config_file)}` + ); + } + + const config = await import(`${url.pathToFileURL(config_file).href}?ts=${Date.now()}`); + return process_config(config.default, { cwd, source: path.relative(cwd, config_file) }); +} + +/** + * Loads and validates Svelte config via Vite config resolution (if set that way). + * @param {{ cwd?: string; mode?: string }} options + * @returns {Promise} + */ +async function load_config_from_vite({ cwd = process.cwd(), mode } = {}) { + const { resolveConfig } = await import_peer('vite'); + const current_cwd = process.cwd(); + + if (cwd !== current_cwd) { + process.chdir(cwd); + } + + /** @type {ResolvedConfig} */ + let resolved; + + try { + resolved = await resolveConfig({}, 'build', mode ?? process.env.MODE ?? 'production'); + } finally { + if (cwd !== current_cwd) { + process.chdir(current_cwd); + } + } + + const plugin = resolved.plugins.find( + (plugin) => plugin.name === 'vite-plugin-sveltekit-setup' && plugin.api?.options + ); + + return plugin?.api.options; +} + +/** + * @param {Config} config + * @returns {ValidatedConfig} + */ +export function process_config(config, { cwd = process.cwd(), source = 'svelte.config.js' } = {}) { + try { + const validated = validate_config(config, cwd); + + validated.kit.outDir = path.resolve(cwd, validated.kit.outDir); + + for (const key in validated.kit.files) { + if (key === 'hooks') { + validated.kit.files.hooks.client = path.resolve(cwd, validated.kit.files.hooks.client); + validated.kit.files.hooks.server = path.resolve(cwd, validated.kit.files.hooks.server); + validated.kit.files.hooks.universal = path.resolve( + cwd, + validated.kit.files.hooks.universal + ); + } else { + // @ts-expect-error + validated.kit.files[key] = path.resolve(cwd, validated.kit.files[key]); + } + } + + return validated; + } catch (e) { + const error = /** @type {Error} */ (e); + + // redact the stack trace — it's not helpful to users + error.stack = `Error loading ${source}: ${error.message}\n`; + throw error; + } +} + +/** + * @param {Config} config + * @param {string} [cwd] + * @returns {ValidatedConfig} + */ +export function validate_config(config, cwd = process.cwd()) { + if (typeof config !== 'object') { + throw new Error( + 'The Svelte config file must have a configuration object as its default export. See https://svelte.dev/docs/kit/configuration' + ); + } + + /** @type {ValidatedConfig} */ + const validated = options(config, 'config'); + const files = validated.kit.files; + + files.hooks.client ??= path.join(files.src, 'hooks.client'); + files.hooks.server ??= path.join(files.src, 'hooks.server'); + files.hooks.universal ??= path.join(files.src, 'hooks'); + files.lib ??= path.join(files.src, 'lib'); + files.params ??= path.join(files.src, 'params'); + files.routes ??= path.join(files.src, 'routes'); + files.serviceWorker ??= path.join(files.src, 'service-worker'); + files.appTemplate ??= path.join(files.src, 'app.html'); + files.errorTemplate ??= path.join(files.src, 'error.html'); + + if (validated.kit.router.resolution === 'server') { + if (validated.kit.router.type === 'hash') { + throw new Error( + "The `router.resolution` option cannot be 'server' if `router.type` is 'hash'" + ); + } + if (validated.kit.output.bundleStrategy !== 'split') { + throw new Error( + "The `router.resolution` option cannot be 'server' if `output.bundleStrategy` is 'inline' or 'single'" + ); + } + } + + if (validated.kit.csp?.directives?.['require-trusted-types-for']?.includes('script')) { + if (!validated.kit.csp?.directives?.['trusted-types']?.includes('svelte-trusted-html')) { + throw new Error( + "The `csp.directives['trusted-types']` option must include 'svelte-trusted-html'" + ); + } + if ( + validated.kit.serviceWorker?.register && + resolve_entry(path.resolve(cwd, validated.kit.files.serviceWorker)) && + !validated.kit.csp?.directives?.['trusted-types']?.includes('sveltekit-trusted-url') + ) { + throw new Error( + "The `csp.directives['trusted-types']` option must include 'sveltekit-trusted-url' when `serviceWorker.register` is true" + ); + } + } + + return validated; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/config/options.js b/tools/ui/node_modules/@sveltejs/kit/src/core/config/options.js new file mode 100644 index 0000000000000000000000000000000000000000..f449898e53f0739b1a6db7ee50b540d5acc49b38 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/config/options.js @@ -0,0 +1,529 @@ +/** @import { Validator } from './types.js' */ + +import process from 'node:process'; +import colors from 'kleur'; +import { supportsTrustedTypes } from '../sync/utils.js'; + +const directives = object({ + 'child-src': string_array(), + 'default-src': string_array(), + 'frame-src': string_array(), + 'worker-src': string_array(), + 'connect-src': string_array(), + 'font-src': string_array(), + 'img-src': string_array(), + 'manifest-src': string_array(), + 'media-src': string_array(), + 'object-src': string_array(), + 'prefetch-src': string_array(), + 'script-src': string_array(), + 'script-src-elem': string_array(), + 'script-src-attr': string_array(), + 'style-src': string_array(), + 'style-src-elem': string_array(), + 'style-src-attr': string_array(), + 'base-uri': string_array(), + sandbox: string_array(), + 'form-action': string_array(), + 'frame-ancestors': string_array(), + 'navigate-to': string_array(), + 'report-uri': string_array(), + 'report-to': string_array(), + 'require-trusted-types-for': validate(undefined, (input, keypath) => { + assert_trusted_types_supported(keypath); + return string_array()(input, keypath); + }), + 'trusted-types': validate(undefined, (input, keypath) => { + assert_trusted_types_supported(keypath); + return string_array()(input, keypath); + }), + 'upgrade-insecure-requests': boolean(false), + 'require-sri-for': string_array(), + 'block-all-mixed-content': boolean(false), + 'plugin-types': string_array(), + referrer: string_array() +}); + +/** @type {Validator} */ +export const options = object( + { + extensions: validate(['.svelte'], (input, keypath) => { + if (!Array.isArray(input) || !input.every((page) => typeof page === 'string')) { + throw new Error(`${keypath} must be an array of strings`); + } + + input.forEach((extension) => { + if (extension[0] !== '.') { + throw new Error(`Each member of ${keypath} must start with '.' — saw '${extension}'`); + } + + if (!/^(\.[a-z0-9]+)+$/i.test(extension)) { + throw new Error(`File extensions must be alphanumeric — saw '${extension}'`); + } + }); + + return input; + }), + + kit: object({ + adapter: validate(null, (input, keypath) => { + if (typeof input !== 'object' || !input.adapt) { + let message = `${keypath} should be an object with an "adapt" method`; + + if (Array.isArray(input) || typeof input === 'string') { + // for the early adapter adopters + message += ', rather than the name of an adapter'; + } + + throw new Error(`${message}. See https://svelte.dev/docs/kit/adapters`); + } + + return input; + }), + + alias: validate({}, (input, keypath) => { + if (typeof input !== 'object') { + throw new Error(`${keypath} should be an object`); + } + + for (const key in input) { + assert_string(input[key], `${keypath}.${key}`); + } + + return input; + }), + + appDir: validate('_app', (input, keypath) => { + assert_string(input, keypath); + + if (input) { + if (input.startsWith('/') || input.endsWith('/')) { + throw new Error( + "config.kit.appDir cannot start or end with '/'. See https://svelte.dev/docs/kit/configuration" + ); + } + } else { + throw new Error(`${keypath} cannot be empty`); + } + + return input; + }), + + csp: object({ + mode: list(['auto', 'hash', 'nonce']), + directives, + reportOnly: directives + }), + + csrf: object({ + checkOrigin: deprecate( + boolean(true), + (keypath) => + `\`${keypath}\` has been deprecated in favour of \`csrf.trustedOrigins\`. It will be removed in a future version` + ), + trustedOrigins: string_array([]) + }), + + embedded: boolean(false), + + env: object({ + dir: string(process.cwd()), + publicPrefix: string('PUBLIC_'), + privatePrefix: string('') + }), + + experimental: object({ + tracing: object({ + server: boolean(false) + }), + instrumentation: object({ + server: boolean(false) + }), + explicitEnvironmentVariables: boolean(false), + remoteFunctions: boolean(false), + forkPreloads: boolean(false), + handleRenderingErrors: boolean(false) + }), + + files: object({ + src: string('src'), + assets: string('static'), + hooks: object({ + client: string(null), + server: string(null), + universal: string(null) + }), + lib: string(null), + params: string(null), + routes: string(null), + serviceWorker: string(null), + appTemplate: string(null), + errorTemplate: string(null) + }), + + inlineStyleThreshold: number(0), + + moduleExtensions: string_array(['.js', '.ts']), + + outDir: string('.svelte-kit'), + + output: object({ + preloadStrategy: list(['modulepreload', 'preload-js', 'preload-mjs']), + bundleStrategy: list(['split', 'single', 'inline']) + }), + + paths: object({ + base: validate('', (input, keypath) => { + assert_string(input, keypath); + + if (input !== '' && (input.endsWith('/') || !input.startsWith('/'))) { + throw new Error( + `${keypath} option must either be the empty string or a root-relative path that starts but doesn't end with '/'. See https://svelte.dev/docs/kit/configuration#paths` + ); + } + + return input; + }), + assets: validate('', (input, keypath) => { + assert_string(input, keypath); + + if (input) { + if (!/^[a-z]+:\/\//.test(input)) { + throw new Error( + `${keypath} option must be an absolute path, if specified. See https://svelte.dev/docs/kit/configuration#paths` + ); + } + + if (input.endsWith('/')) { + throw new Error( + `${keypath} option must not end with '/'. See https://svelte.dev/docs/kit/configuration#paths` + ); + } + } + + return input; + }), + relative: boolean(true) + }), + + prerender: object({ + concurrency: number(1), + crawl: boolean(true), + entries: validate(['*'], (input, keypath) => { + if (!Array.isArray(input) || !input.every((page) => typeof page === 'string')) { + throw new Error(`${keypath} must be an array of strings`); + } + + input.forEach((page) => { + if (page !== '*' && page[0] !== '/') { + throw new Error( + `Each member of ${keypath} must be either '*' or an absolute path beginning with '/' — saw '${page}'` + ); + } + }); + + return input; + }), + + handleHttpError: validate( + (/** @type {any} */ { message }) => { + throw new Error( + message + + '\nTo suppress or handle this error, implement `handleHttpError` in https://svelte.dev/docs/kit/configuration#prerender' + ); + }, + (input, keypath) => { + if (typeof input === 'function') return input; + if (['fail', 'warn', 'ignore'].includes(input)) return input; + throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); + } + ), + + handleMissingId: validate( + (/** @type {any} */ { message }) => { + throw new Error( + message + + '\nTo suppress or handle this error, implement `handleMissingId` in https://svelte.dev/docs/kit/configuration#prerender' + ); + }, + (input, keypath) => { + if (typeof input === 'function') return input; + if (['fail', 'warn', 'ignore'].includes(input)) return input; + throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); + } + ), + + handleEntryGeneratorMismatch: validate( + (/** @type {any} */ { message }) => { + throw new Error( + message + + '\nTo suppress or handle this error, implement `handleEntryGeneratorMismatch` in https://svelte.dev/docs/kit/configuration#prerender' + ); + }, + (input, keypath) => { + if (typeof input === 'function') return input; + if (['fail', 'warn', 'ignore'].includes(input)) return input; + throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); + } + ), + + handleUnseenRoutes: validate( + (/** @type {any} */ { message }) => { + throw new Error( + message + + '\nTo suppress or handle this error, implement `handleUnseenRoutes` in https://svelte.dev/docs/kit/configuration#prerender' + ); + }, + (input, keypath) => { + if (typeof input === 'function') return input; + if (['fail', 'warn', 'ignore'].includes(input)) return input; + throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); + } + ), + + handleInvalidUrl: validate( + (/** @type {any} */ { message }) => { + throw new Error( + message + + '\nTo suppress or handle this error, implement `handleInvalidUrl` in https://svelte.dev/docs/kit/configuration#prerender' + ); + }, + (input, keypath) => { + if (typeof input === 'function') return input; + if (['fail', 'warn', 'ignore'].includes(input)) return input; + throw new Error(`${keypath} should be "fail", "warn", "ignore" or a custom function`); + } + ), + + origin: validate('http://sveltekit-prerender', (input, keypath) => { + assert_string(input, keypath); + + let origin; + + try { + origin = new URL(input).origin; + } catch { + throw new Error(`${keypath} must be a valid origin`); + } + + if (input !== origin) { + throw new Error(`${keypath} must be a valid origin (${origin} rather than ${input})`); + } + + return origin; + }) + }), + + router: object({ + type: list(['pathname', 'hash']), + resolution: list(['client', 'server']) + }), + + serviceWorker: object({ + register: boolean(true), + // options could be undefined but if it is defined we only validate that + // it's an object since the type comes from the browser itself + options: validate(undefined, object({}, true)), + files: fun((filename) => !/\.DS_Store/.test(filename)) + }), + + typescript: object({ + config: fun((config) => config) + }), + + version: object({ + name: string(Date.now().toString()), + pollInterval: number(0) + }) + }) + }, + true +); + +// Derive the names of SvelteKit's own config options from the schema, so they +// stay in sync automatically. These are used to separate Kit's options from +// `vite-plugin-svelte`'s options when config is passed via the Vite plugin. +const defaults = /** @type {Record} */ (options({}, 'config')); + +/** The names of the options that live under the `kit` namespace */ +export const kit_options = Object.keys(defaults.kit); + +/** The names of the options that live under the `kit.experimental` namespace */ +export const kit_experimental_options = Object.keys(defaults.kit.experimental); + +/** + * @param {Validator} fn + * @param {(keypath: string) => string} get_message + * @returns {Validator} + */ +function deprecate( + fn, + get_message = (keypath) => + `The \`${keypath}\` option is deprecated, and will be removed in a future version` +) { + return (input, keypath) => { + if (input !== undefined) { + console.warn(colors.bold().yellow(get_message(keypath))); + } + + return fn(input, keypath); + }; +} + +/** + * @param {Record} children + * @param {boolean} [allow_unknown] + * @returns {Validator} + */ +function object(children, allow_unknown = false) { + return (input, keypath) => { + /** @type {Record} */ + const output = {}; + + if ((input && typeof input !== 'object') || Array.isArray(input)) { + throw new Error(`${keypath} should be an object`); + } + + for (const key in input) { + if (!(key in children)) { + if (allow_unknown) { + output[key] = input[key]; + } else { + let message = `Unexpected option ${keypath}.${key}`; + + // special case + if (keypath === 'config.kit' && key in options) { + message += ` (did you mean config.${key}?)`; + } + + throw new Error(message); + } + } + } + + for (const key in children) { + const validator = children[key]; + output[key] = validator(input && input[key], `${keypath}.${key}`); + } + + return output; + }; +} + +/** + * @param {any} fallback + * @param {(value: any, keypath: string) => any} fn + * @returns {Validator} + */ +function validate(fallback, fn) { + return (input, keypath) => { + return input === undefined ? fallback : fn(input, keypath); + }; +} + +/** + * @param {string | null} fallback + * @param {boolean} allow_empty + * @returns {Validator} + */ +function string(fallback, allow_empty = true) { + return validate(fallback, (input, keypath) => { + assert_string(input, keypath); + + if (!allow_empty && input === '') { + throw new Error(`${keypath} cannot be empty`); + } + + return input; + }); +} + +/** + * @param {string[] | undefined} [fallback] + * @returns {Validator} + */ +function string_array(fallback) { + return validate(fallback, (input, keypath) => { + if (!Array.isArray(input) || input.some((value) => typeof value !== 'string')) { + throw new Error(`${keypath} must be an array of strings, if specified`); + } + + return input; + }); +} + +/** + * @param {number} fallback + * @returns {Validator} + */ +function number(fallback) { + return validate(fallback, (input, keypath) => { + if (typeof input !== 'number') { + throw new Error(`${keypath} should be a number, if specified`); + } + return input; + }); +} + +/** + * @param {boolean} fallback + * @returns {Validator} + */ +function boolean(fallback) { + return validate(fallback, (input, keypath) => { + if (typeof input !== 'boolean') { + throw new Error(`${keypath} should be true or false, if specified`); + } + return input; + }); +} + +/** + * @param {string[]} options + * @returns {Validator} + */ +function list(options, fallback = options[0]) { + return validate(fallback, (input, keypath) => { + if (!options.includes(input)) { + // prettier-ignore + const msg = options.length > 2 + ? `${keypath} should be one of ${options.slice(0, -1).map(input => `"${input}"`).join(', ')} or "${options[options.length - 1]}"` + : `${keypath} should be either "${options[0]}" or "${options[1]}"`; + + throw new Error(msg); + } + return input; + }); +} + +/** + * @param {(...args: any) => any} fallback + * @returns {Validator} + */ +function fun(fallback) { + return validate(fallback, (input, keypath) => { + if (typeof input !== 'function') { + throw new Error(`${keypath} should be a function, if specified`); + } + return input; + }); +} + +/** + * @param {string} input + * @param {string} keypath + */ +function assert_string(input, keypath) { + if (typeof input !== 'string') { + throw new Error(`${keypath} should be a string, if specified`); + } +} + +/** @param {string} keypath */ +function assert_trusted_types_supported(keypath) { + if (!supportsTrustedTypes()) { + throw new Error( + `${keypath} is not supported by your version of Svelte. Please upgrade to Svelte 5.51.0 or later to use this directive.` + ); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/config/types.d.ts b/tools/ui/node_modules/@sveltejs/kit/src/core/config/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..00d005c32886025342e9c4a486eeffbe2ff85550 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/config/types.d.ts @@ -0,0 +1 @@ +export type Validator = (input: T, keypath: string) => T; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/env.js b/tools/ui/node_modules/@sveltejs/kit/src/core/env.js new file mode 100644 index 0000000000000000000000000000000000000000..73ce309a1a0d4c58c3de7a9ad6ff5f221eede717 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/env.js @@ -0,0 +1,461 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ +/** @import { ValidatedKitConfig } from 'types' */ +import path from 'node:path'; +import process from 'node:process'; +import * as vite from 'vite'; +import * as devalue from 'devalue'; +import { GENERATED_COMMENT } from '../constants.js'; +import { dedent } from './sync/utils.js'; +import { runtime_base, runtime_directory } from './utils.js'; +import { resolve_entry } from '../utils/filesystem.js'; +import { handle_issues, validate } from '../exports/internal/env.js'; +import { get_config_aliases } from '../exports/vite/utils.js'; + +/** + * @typedef {'public' | 'private'} EnvType + */ + +let warned = false; + +/** + * @param {import('types').ValidatedKitConfig} config + * @returns {string | null} + */ +export function resolve_explicit_env_entry(config) { + const resolved = resolve_entry(path.join(config.files.src, 'env')); + + if (resolved) { + if (config.experimental.explicitEnvironmentVariables) { + return resolved; + } + + if (!warned) { + console.warn( + `${path.relative(process.cwd(), resolved)} requires the \`experimental.explicitEnvironmentVariables\` flag to be set` + ); + warned = true; + } + } else if (config.experimental.explicitEnvironmentVariables) { + console.warn( + 'experimental.explicitEnvironmentVariables was set, but no src/env.ts or src/env.js file could be found' + ); + } + + return null; +} + +/** + * @param {ValidatedKitConfig} kit + * @param {string | null} file + * @param {string} mode + * @returns {Promise> | null>} + */ +export async function load_explicit_env(kit, file, mode) { + if (!file) return null; + + const server = await vite.createServer({ + configFile: false, + logLevel: 'silent', + mode, + define: { + __SVELTEKIT_APP_VERSION__: JSON.stringify(kit.version.name) // needed by $app/env + }, + resolve: { + alias: [ + { find: '$app/env', replacement: `${runtime_directory}/app/env` }, + ...get_config_aliases(kit) + ] + } + }); + + /** @type {Record>} */ + let variables; + + /** @type {import('../runtime/app/env/internal.js')} */ ( + await server.ssrLoadModule(`${runtime_directory}/app/env/internal.js`) + ).set_building(); + + try { + ({ variables } = await server.ssrLoadModule(file)); + + if (!variables || typeof variables !== 'object') { + throw new Error(`${file} must export a variables object`); + } + + // validate + for (const name of Object.keys(variables)) { + if (!valid_identifier.test(name) || reserved.has(name)) { + throw new Error(`Invalid environment variable name ${JSON.stringify(name)}`); + } + } + } catch (e) { + const error = /** @type {any} */ (e || {}); + + if ( + error.code === 'ERR_MODULE_NOT_FOUND' && + error.message?.includes(`Cannot find module '$app`) + ) { + throw new Error( + `Cannot import \`$app/*\` modules other than \`$app/env\` inside \`src/env\``, + { cause: e } + ); + } + + throw error; + } finally { + await server.close(); + } + + return variables; +} + +/** + * @param {string} id + * @param {Record} env + * @param {boolean} disabled + * @returns {string} + */ +export function create_static_module(id, env, disabled) { + /** @type {string[]} */ + const statements = []; + + if (disabled) { + statements.push( + `throw new Error('Cannot import \`${id}\` when \`experimental.explicitEnvironmentVariables\` is enabled. Use \`${id.replace('$env/static', '$app/env')}\` instead.');` + ); + } + + for (const key in env) { + if (!valid_identifier.test(key) || reserved.has(key)) { + continue; + } + + const comment = `/** @type {import('${id}').${key}} */`; + const declaration = `export const ${key} = ${JSON.stringify(env[key])};`; + + statements.push(`${comment}\n${declaration}`); + } + + return GENERATED_COMMENT + statements.join('\n\n'); +} + +/** + * @param {EnvType} type + * @param {Record | undefined} dev_values If in a development mode, values to pre-populate the module with. + * @param {boolean} disabled + */ +export function create_dynamic_module(type, dev_values, disabled) { + const prelude = disabled + ? `throw new Error('Cannot import \`$env/dynamic/${type}\` when \`experimental.explicitEnvironmentVariables\` is enabled. Use \`$app/env/${type}\` instead.');\n\n` + : ''; + + if (dev_values) { + const keys = Object.entries(dev_values).map( + ([k, v]) => `${JSON.stringify(k)}: ${JSON.stringify(v)}` + ); + return `${prelude}export const env = {\n${keys.join(',\n')}\n}`; + } + return `${prelude}export { ${type}_env as env } from '${runtime_base}/shared-server.js';`; +} + +/** + * Creates the `__sveltekit/env` module + * @param {Record | undefined> | null} variables + * @param {Record} env + * @param {string | null} entry + */ +export function create_sveltekit_env(variables, env, entry) { + const imports = entry + ? [ + `import { variables } from ${JSON.stringify(entry)};`, + `import { validate, handle_issues } from '@sveltejs/kit/internal/env';` + ] + : [`const variables = {};`, `const handle_issues = () => {};`]; + + const declarations = []; + const setters = []; + + /** @type {Record} */ + const issues = {}; + + for (const [name, config] of Object.entries(variables ?? {})) { + if (config?.static) { + if (config.public) { + const value = validate(variables ?? {}, env[name], name, issues); + declarations.push(`explicit_public_env.${name} = ${devalue.uneval(value)};`); + } + } else { + setters.push( + `const ${name} = validate(variables, env.${name}, ${JSON.stringify(name)}, issues);` + ); + + if (config?.public) { + setters.push(`explicit_public_env.${name} = ${name};`); + setters.push(`rendered_env.${name} = ${name};`); + } else { + setters.push(`dynamic_private_env.${name} = ${name};`); + } + } + } + + handle_issues(issues); + + const blocks = [ + GENERATED_COMMENT, + imports.join('\n'), + `const issues = {};`, + 'export { variables }', + 'export const dynamic_private_env = {};', + 'export const explicit_public_env = {};', + 'export const rendered_env = {};', + ...declarations, + `handle_issues(issues);`, + dedent` + export function set_env(env) { + const issues = {}; + ${setters.join('\n')} + handle_issues(issues); + }` + ]; + + const module = blocks.join('\n\n'); + + return module; +} + +/** + * Creates the `__sveltekit/env/private` module + * @param {Record> | null} variables + * @param {Record} env + */ +export function create_sveltekit_env_private(variables, env) { + if (!variables) { + return ''; + } + + /** @type {Record} */ + const issues = {}; + + /** @type {string[]} */ + const exports = []; + + for (const [name, config] of Object.entries(variables)) { + if (config.public) continue; + + const value = config.static + ? devalue.uneval(validate(variables, env[name], name, issues)) + : `env.${name}`; + + exports.push(`export const ${name} = ${value};\n`); + } + + handle_issues(issues); + + return `import { dynamic_private_env as env } from '__sveltekit/env';\n\n${exports.join('')}`; +} + +/** + * Creates the `__sveltekit/env/public/*` modules + * @param {Record> | null} variables + * @param {Record} env + * @param {string} prelude + */ +export function create_sveltekit_env_public(variables, env, prelude) { + if (!variables) { + return ''; + } + + /** @type {Record} */ + const issues = {}; + + /** @type {string[]} */ + const exports = []; + + for (const [name, config] of Object.entries(variables)) { + if (!config.public) continue; + + const value = config.static + ? devalue.uneval(validate(variables, env[name], name, issues)) + : `env.${name}`; + + exports.push(`export const ${name} = ${value};\n`); + } + + handle_issues(issues); + + return `${prelude}\n\n${exports.join('')}`; +} + +/** + * Creates the `__sveltekit/env/service-worker` module used in development + * (but not in prod, which goes through build_service_worker instead) + * @param {Record> | null} variables + * @param {Record} env + * @param {string} global + */ +export function create_sveltekit_env_service_worker_dev(variables, env, global) { + /** @type {string[]} */ + const properties = []; + + /** @type {Record} */ + const issues = {}; + + for (const [name, config] of Object.entries(variables ?? {})) { + if (!config.public) continue; + + const value = validate(variables ?? {}, env[name], name, issues); + properties.push(`${name}: ${devalue.uneval(value)}`); + } + + handle_issues(issues); + + return dedent` + globalThis.__SVELTEKIT_EXPERIMENTAL_EXPLICIT_ENVIRONMENT_VARIABLES__ = true; + + ${global} = { + env: { + ${properties.join(',\n\t\t') || '// empty'} + } + }; + `; +} + +/** @param {string} description */ +function create_jsdoc(description) { + return `/**\n${description + .split('\n') + .map((line) => ` * ${line.replaceAll('*/', '*\\/')}`) + .join('\n')}\n */`; +} + +/** + * @param {EnvType} id + * @param {import('types').Env} env + * @returns {string} + */ +export function create_static_types(id, env) { + const declarations = Object.keys(env[id]) + .filter((k) => valid_identifier.test(k)) + .map((k) => `export const ${k}: string;`); + + return dedent` + declare module '$env/static/${id}' { + ${declarations.join('\n')} + } + `; +} + +/** + * @param {EnvType} id + * @param {import('types').Env} env + * @param {{ + * public_prefix: string; + * private_prefix: string; + * }} prefixes + * @returns {string} + */ +export function create_dynamic_types(id, env, { public_prefix, private_prefix }) { + const properties = Object.keys(env[id]) + .filter((k) => valid_identifier.test(k)) + .map((k) => `${k}: string;`); + + const public_prefixed = `[key: \`${public_prefix}\${string}\`]`; + const private_prefixed = `[key: \`${private_prefix}\${string}\`]`; + + if (id === 'private') { + if (public_prefix) { + properties.push(`${public_prefixed}: undefined;`); + } + properties.push(`${private_prefixed}: string | undefined;`); + } else { + if (private_prefix) { + properties.push(`${private_prefixed}: undefined;`); + } + properties.push(`${public_prefixed}: string | undefined;`); + } + + return dedent` + declare module '$env/dynamic/${id}' { + export const env: { + ${properties.join('\n')} + } + } + `; +} + +/** + * @param {Record>} variables + * @param {string} relative + * @param {EnvType} type + */ +export function create_explicit_env_types(variables, relative, type) { + const declarations = Object.entries(variables) + .filter(([_, config]) => !!config.public === (type === 'public')) + .map(([name, config]) => { + const comment = config.description ? `${create_jsdoc(config.description)}\n` : ''; + const type = config.schema + ? `import('@sveltejs/kit/internal/types').StandardSchemaV1.InferOutput` + : 'string'; + return `${comment}export const ${name}: ${type};`; + }); + + return dedent` + declare module '$app/env/${type}' { + ${declarations.join('\n') || `// no ${type} environment variables were defined`} + } + `; +} + +export const reserved = new Set([ + 'do', + 'if', + 'in', + 'for', + 'let', + 'new', + 'try', + 'var', + 'case', + 'else', + 'enum', + 'eval', + 'null', + 'this', + 'true', + 'void', + 'with', + 'await', + 'break', + 'catch', + 'class', + 'const', + 'false', + 'super', + 'throw', + 'while', + 'yield', + 'delete', + 'export', + 'import', + 'public', + 'return', + 'static', + 'switch', + 'typeof', + 'default', + 'extends', + 'finally', + 'package', + 'private', + 'continue', + 'debugger', + 'function', + 'arguments', + 'interface', + 'protected', + 'implements', + 'instanceof' +]); + +export const valid_identifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js b/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js new file mode 100644 index 0000000000000000000000000000000000000000..044db841910701b9c0cfd9b445757a7e214c8f90 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/find_server_assets.js @@ -0,0 +1,56 @@ +import { find_deps } from '../../exports/vite/build/utils.js'; + +/** + * Finds all the assets that are imported by server files associated with `routes` + * @param {import('types').BuildData} build_data + * @param {import('types').RouteData[]} routes + */ +export function find_server_assets(build_data, routes) { + /** + * All nodes actually used in the routes definition (prerendered routes are omitted). + * Root layout/error is always included as they are needed for 404 and root errors. + * @type {Set} + */ + const used_nodes = new Set([0, 1]); + + /** @type {Set} */ + const server_assets = new Set(); + + /** @param {string} id */ + function add_assets(id) { + if (id in build_data.server_manifest) { + const deps = find_deps(build_data.server_manifest, id, false); + for (const asset of deps.assets) { + server_assets.add(asset); + } + } + } + + for (const route of routes) { + if (route.page) { + for (const i of route.page.layouts) used_nodes.add(i); + for (const i of route.page.errors) used_nodes.add(i); + used_nodes.add(route.page.leaf); + } + + if (route.endpoint) { + add_assets(route.endpoint.file); + } + } + + for (const n of used_nodes) { + const node = build_data.manifest_data.nodes[n]; + if (node?.universal) add_assets(node.universal); + if (node?.server) add_assets(node.server); + } + + if (build_data.manifest_data.hooks.server) { + add_assets(build_data.manifest_data.hooks.server); + } + + if (build_data.manifest_data.hooks.universal) { + add_assets(build_data.manifest_data.hooks.universal); + } + + return Array.from(server_assets); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js b/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6b2445aa2107986a231cf8a574d81b68bce26b73 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/generate_manifest/index.js @@ -0,0 +1,152 @@ +/** @import { RemoteChunk } from 'types' */ +import fs from 'node:fs'; +import path from 'node:path'; +import * as mime from 'mrmime'; +import { s } from '../../utils/misc.js'; +import { get_mime_lookup } from '../utils.js'; +import { resolve_symlinks } from '../../exports/vite/build/utils.js'; +import { compact } from '../../utils/array.js'; +import { join_relative } from '../../utils/filesystem.js'; +import { dedent } from '../sync/utils.js'; +import { find_server_assets } from './find_server_assets.js'; +import { uneval } from 'devalue'; + +/** + * Generates the data used to write the server-side manifest.js file. This data is used in the Vite + * build process, to power routing, etc. + * @param {{ + * build_data: import('types').BuildData; + * prerendered: string[]; + * relative_path: string; + * routes: import('types').RouteData[]; + * remotes: RemoteChunk[]; + * }} opts + */ +export function generate_manifest({ build_data, prerendered, relative_path, routes, remotes }) { + /** + * @type {Map} The new index of each node in the filtered nodes array + */ + const reindexed = new Map(); + /** + * All nodes actually used in the routes definition (prerendered routes are omitted). + * Root layout/error is always included as they are needed for 404 and root errors. + * @type {Set} + */ + const used_nodes = new Set([0, 1]); + + const server_assets = find_server_assets(build_data, routes); + + for (const route of routes) { + if (route.page) { + for (const i of route.page.layouts) used_nodes.add(i); + for (const i of route.page.errors) used_nodes.add(i); + used_nodes.add(route.page.leaf); + } + } + + const node_paths = compact( + build_data.manifest_data.nodes.map((_, i) => { + if (used_nodes.has(i)) { + reindexed.set(i, reindexed.size); + return join_relative(relative_path, `/nodes/${i}.js`); + } + }) + ); + + /** @type {(path: string) => string} */ + const loader = (path) => `__memo(() => import('${path}'))`; + + const assets = build_data.manifest_data.assets.map((asset) => asset.file); + if (build_data.service_worker) { + assets.push(build_data.service_worker); + } + + // In case of server-side route resolution, we need to include all matchers. Prerendered routes are not part + // of the server manifest, and they could reference matchers that then would not be included. + const matchers = new Set( + build_data.client?.nodes ? Object.keys(build_data.manifest_data.matchers) : undefined + ); + + /** @param {Array} indexes */ + function get_nodes(indexes) { + const string = indexes.map((n) => reindexed.get(n) ?? '').join(','); + + // since JavaScript ignores trailing commas, we need to insert a dummy + // comma so that the array has the correct length if the last item + // is undefined + return `[${string},]`; + } + + const mime_types = get_mime_lookup(build_data.manifest_data); + + /** @type {Record} */ + const files = {}; + for (const file of server_assets) { + files[file] = fs.statSync(path.resolve(build_data.out_dir, 'server', file)).size; + + const ext = path.extname(file); + mime_types[ext] ??= mime.lookup(ext) || ''; + } + + // prettier-ignore + // String representation of + /** @template {import('@sveltejs/kit').SSRManifest} T */ + const manifest_expr = dedent` + { + appDir: ${s(build_data.app_dir)}, + appPath: ${s(build_data.app_path)}, + assets: new Set(${s(assets)}), + mimeTypes: ${s(mime_types)}, + _: { + client: ${uneval(build_data.client)}, + nodes: [ + ${(node_paths).map(loader).join(',\n')} + ], + remotes: { + ${remotes.map((remote) => `'${remote.hash}': ${loader(join_relative(relative_path, `chunks/remote-${remote.hash}.js`))}`).join(',\n')} + }, + routes: [ + ${routes.map(route => { + if (!route.page && !route.endpoint) return; + + route.params.forEach(param => { + if (param.matcher) matchers.add(param.matcher); + }); + + return dedent` + { + id: ${s(route.id)}, + pattern: ${route.pattern}, + params: ${s(route.params)}, + page: ${route.page ? `{ layouts: ${get_nodes(route.page.layouts)}, errors: ${get_nodes(route.page.errors)}, leaf: ${reindexed.get(route.page.leaf)} }` : 'null'}, + endpoint: ${route.endpoint ? loader(join_relative(relative_path, resolve_symlinks(build_data.server_manifest, route.endpoint.file).chunk.file)) : 'null'} + } + `; + }).filter(Boolean).join(',\n')} + ], + prerendered_routes: new Set(${s(prerendered)}), + matchers: async () => { + ${Array.from( + matchers, + type => `const { match: ${type} } = await import ('${(join_relative(relative_path, `/entries/matchers/${type}.js`))}')` + ).join('\n')} + return { ${Array.from(matchers).join(', ')} }; + }, + server_assets: ${s(files)} + } + } + `; + + // Memoize the loaders to prevent Node from doing unnecessary work + // on every dynamic import call + return dedent` + (() => { + function __memo(fn) { + let value; + return () => value ??= (value = fn()); + } + + return ${manifest_expr} + })() + `; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js new file mode 100644 index 0000000000000000000000000000000000000000..69b3b5f50d2d90513a82dcc2a63270708856c23b --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js @@ -0,0 +1,282 @@ +/** @import { RemoteChunk } from 'types' */ +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { validate_server_exports } from '../../utils/exports.js'; +import { load_config } from '../config/index.js'; +import { forked } from '../../utils/fork.js'; +import { installPolyfills } from '../../exports/node/polyfills.js'; +import { ENDPOINT_METHODS } from '../../constants.js'; +import { filter_env } from '../../utils/env.js'; +import { has_server_load, resolve_route } from '../../utils/routing.js'; +import { check_feature } from '../../utils/features.js'; +import { createReadableStream } from '@sveltejs/kit/node'; +import { PageNodes } from '../../utils/page_nodes.js'; + +export default forked(import.meta.url, analyse); + +/** + * @param {{ + * hash: boolean; + * manifest_path: string; + * manifest_data: import('types').ManifestData; + * server_manifest: import('vite').Manifest; + * tracked_features: Record; + * env: Record; + * out: string; + * remotes: RemoteChunk[]; + * }} opts + */ +async function analyse({ + hash, + manifest_path, + manifest_data, + server_manifest, + tracked_features, + env, + remotes +}) { + /** @type {import('@sveltejs/kit').SSRManifest} */ + const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; + + /** @type {import('types').ValidatedKitConfig} */ + const config = (await load_config()).kit; + + const server_root = join(config.outDir, 'output'); + + /** @type {import('types').ServerInternalModule} */ + const internal = await import(pathToFileURL(`${server_root}/server/internal.js`).href); + + installPolyfills(); + + // configure `import { building } from '$app/environment'` and `$app/env` — + // essential we do this before analysing the code + internal.set_building(); + + // set env, `read`, and `manifest`, in case they're used in initialisation + const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; + const private_env = filter_env(env, private_prefix, public_prefix); + const public_env = filter_env(env, public_prefix, private_prefix); + internal.set_private_env(private_env); + internal.set_public_env(public_env); + internal.set_manifest(manifest); + internal.set_read_implementation((file) => createReadableStream(`${server_root}/server/${file}`)); + + /** @type {import('__sveltekit/env')} */ + const { set_env } = await import(pathToFileURL(`${server_root}/server/env.js`).href); + set_env(env); + + /** @type {import('types').ServerMetadata} */ + const metadata = { + nodes: [], + routes: new Map(), + remotes: new Map() + }; + + const nodes = await Promise.all(manifest._.nodes.map((loader) => loader())); + + // analyse nodes + for (const node of nodes) { + if (hash && node.universal) { + const options = Object.keys(node.universal).filter((o) => o !== 'load'); + if (options.length > 0) { + throw new Error( + `Page options are ignored when \`router.type === 'hash'\` (${node.universal_id} has ${options + .filter((o) => o !== 'load') + .map((o) => `'${o}'`) + .join(', ')})` + ); + } + } + + metadata.nodes[node.index] = { + has_server_load: has_server_load(node), + has_universal_load: node.universal?.load !== undefined + }; + } + + // analyse routes + for (const route of manifest._.routes) { + const page = + route.page && + analyse_page( + route.page.layouts.map((n) => (n === undefined ? n : nodes[n])), + nodes[route.page.leaf] + ); + + const endpoint = route.endpoint && analyse_endpoint(route, await route.endpoint()); + + if (page?.prerender && endpoint?.prerender) { + throw new Error(`Cannot prerender a route with both +page and +server files (${route.id})`); + } + + if (page?.config && endpoint?.config) { + for (const key in { ...page.config, ...endpoint.config }) { + if (JSON.stringify(page.config[key]) !== JSON.stringify(endpoint.config[key])) { + throw new Error( + `Mismatched route config for ${route.id} — the +page and +server files must export the same config, if any` + ); + } + } + } + + const route_config = page?.config ?? endpoint?.config ?? {}; + const prerender = page?.prerender ?? endpoint?.prerender; + + if (prerender !== true) { + for (const feature of list_features( + route, + manifest_data, + server_manifest, + tracked_features + )) { + check_feature(route.id, route_config, feature, config.adapter); + } + } + + const page_methods = page?.methods ?? []; + const api_methods = endpoint?.methods ?? []; + const entries = page?.entries ?? endpoint?.entries; + + metadata.routes.set(route.id, { + config: route_config, + methods: Array.from(new Set([...page_methods, ...api_methods])), + page: { + methods: page_methods + }, + api: { + methods: api_methods + }, + prerender, + entries: + entries && (await entries()).map((entry_object) => resolve_route(route.id, entry_object)) + }); + } + + // analyse remotes + for (const remote of remotes) { + const loader = manifest._.remotes[remote.hash]; + const { default: functions } = await loader(); + + const exports = new Map(); + + for (const name in functions) { + const internals = /** @type {import('types').RemoteInternals} */ (functions[name].__); + const type = internals.type; + + exports.set(name, { + type, + dynamic: type !== 'prerender' || internals.dynamic + }); + } + + metadata.remotes.set(remote.hash, exports); + } + + return { metadata }; +} + +/** + * @param {import('types').SSRRoute} route + * @param {import('types').SSREndpoint} mod + */ +function analyse_endpoint(route, mod) { + validate_server_exports(mod, route.id); + + if (mod.prerender && (mod.POST || mod.PATCH || mod.PUT || mod.DELETE)) { + throw new Error( + `Cannot prerender a +server file with POST, PATCH, PUT, or DELETE (${route.id})` + ); + } + + /** @type {Array} */ + const methods = []; + + for (const method of /** @type {import('types').HttpMethod[]} */ (ENDPOINT_METHODS)) { + if (mod[method]) methods.push(method); + } + + if (mod.fallback) { + methods.push('*'); + } + + return { + config: mod.config, + entries: mod.entries, + methods, + prerender: mod.prerender ?? false + }; +} + +/** + * @param {Array} layouts + * @param {import('types').SSRNode} leaf + */ +function analyse_page(layouts, leaf) { + /** @type {Array<'GET' | 'POST'>} */ + const methods = ['GET']; + if (leaf.server?.actions) methods.push('POST'); + + const nodes = new PageNodes([...layouts, leaf]); + nodes.validate(); + + return { + config: nodes.get_config(), + entries: leaf.universal?.entries ?? leaf.server?.entries, + methods, + prerender: nodes.prerender() + }; +} + +/** + * @param {import('types').SSRRoute} route + * @param {import('types').ManifestData} manifest_data + * @param {import('vite').Manifest} server_manifest + * @param {Record} tracked_features + */ +function list_features(route, manifest_data, server_manifest, tracked_features) { + const features = new Set(); + + const route_data = /** @type {import('types').RouteData} */ ( + manifest_data.routes.find((r) => r.id === route.id) + ); + + const visited = new Set(); + /** @param {string} id */ + function visit(id) { + if (visited.has(id)) return; + visited.add(id); + + const chunk = server_manifest[id]; + if (!chunk) return; + + if (chunk.file in tracked_features) { + for (const feature of tracked_features[chunk.file]) { + features.add(feature); + } + } + + if (chunk.imports) { + for (const id of chunk.imports) { + visit(id); + } + } + } + + let page_node = route_data?.leaf; + while (page_node) { + if (page_node.server) visit(page_node.server); + page_node = page_node.parent ?? null; + } + + if (route_data.endpoint) { + visit(route_data.endpoint.file); + } + + if (manifest_data.hooks.server) { + // TODO if hooks.server.js imports `read`, it will be in the entry chunk + // we don't currently account for that case + visit(manifest_data.hooks.server); + } + + return Array.from(features); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js new file mode 100644 index 0000000000000000000000000000000000000000..bd0f194ee460cf70d85a8457e45c51cd172a38da --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/crawl.js @@ -0,0 +1,259 @@ +import { resolve, decode_uri } from '../../utils/url.js'; +import { decode } from './entities.js'; + +const DOCTYPE = 'DOCTYPE'; +const CDATA_OPEN = '[CDATA['; +const CDATA_CLOSE = ']]>'; +const COMMENT_OPEN = '--'; +const COMMENT_CLOSE = '-->'; + +const TAG_OPEN = /[a-zA-Z]/; +const TAG_CHAR = /[a-zA-Z0-9]/; +const ATTRIBUTE_NAME = /[^\t\n\f />"'=]/; + +const WHITESPACE = /[\s\n\r]/; + +const CRAWLABLE_META_NAME_ATTRS = new Set([ + 'og:url', + 'og:image', + 'og:image:url', + 'og:image:secure_url', + 'og:video', + 'og:video:url', + 'og:video:secure_url', + 'og:audio', + 'og:audio:url', + 'og:audio:secure_url', + 'twitter:image' +]); + +/** + * @param {string} html + * @param {string} base + */ +export function crawl(html, base) { + /** @type {string[]} */ + const ids = []; + + /** @type {string[]} */ + const hrefs = []; + + /** @type {string[]} */ + const invalid = []; + + /** @param {string} url */ + const push_href = (url) => { + try { + hrefs.push(resolve(base, url)); + } catch { + invalid.push(url); + } + }; + + let i = 0; + main: while (i < html.length) { + const char = html[i]; + + if (char === '<') { + if (html[i + 1] === '!') { + i += 2; + + if (html.slice(i, i + DOCTYPE.length).toUpperCase() === DOCTYPE) { + i += DOCTYPE.length; + while (i < html.length) { + if (html[i++] === '>') { + continue main; + } + } + } + + // skip cdata + if (html.slice(i, i + CDATA_OPEN.length) === CDATA_OPEN) { + i += CDATA_OPEN.length; + while (i < html.length) { + if (html.slice(i, i + CDATA_CLOSE.length) === CDATA_CLOSE) { + i += CDATA_CLOSE.length; + continue main; + } + + i += 1; + } + } + + // skip comments + if (html.slice(i, i + COMMENT_OPEN.length) === COMMENT_OPEN) { + i += COMMENT_OPEN.length; + while (i < html.length) { + if (html.slice(i, i + COMMENT_CLOSE.length) === COMMENT_CLOSE) { + i += COMMENT_CLOSE.length; + continue main; + } + + i += 1; + } + } + } + + // parse opening tags + const start = ++i; + if (TAG_OPEN.test(html[start])) { + while (i < html.length) { + if (!TAG_CHAR.test(html[i])) { + break; + } + + i += 1; + } + + const tag = html.slice(start, i).toUpperCase(); + + /** @type {Record} */ + const attributes = {}; + + if (tag === 'SCRIPT' || tag === 'STYLE') { + while (i < html.length) { + if ( + html[i] === '<' && + html[i + 1] === '/' && + html.slice(i + 2, i + 2 + tag.length).toUpperCase() === tag + ) { + continue main; + } + + i += 1; + } + } + + while (i < html.length) { + const start = i; + + const char = html[start]; + if (char === '>') break; + + if (ATTRIBUTE_NAME.test(char)) { + i += 1; + + while (i < html.length) { + if (!ATTRIBUTE_NAME.test(html[i])) { + break; + } + + i += 1; + } + + const name = html.slice(start, i).toLowerCase(); + + while (WHITESPACE.test(html[i])) i += 1; + + if (html[i] === '=') { + i += 1; + while (WHITESPACE.test(html[i])) i += 1; + + let value; + + if (html[i] === "'" || html[i] === '"') { + const quote = html[i++]; + + const start = i; + let escaped = false; + + while (i < html.length) { + if (escaped) { + escaped = false; + } else { + const char = html[i]; + + if (html[i] === quote) { + break; + } + + if (char === '\\') { + escaped = true; + } + } + + i += 1; + } + + value = html.slice(start, i); + } else { + const start = i; + while (html[i] !== '>' && !WHITESPACE.test(html[i])) i += 1; + value = html.slice(start, i); + + i -= 1; + } + + value = decode(value); + attributes[name] = value; + } else { + i -= 1; + } + } + + i += 1; + } + + const { href, id, name, property, rel, src, srcset, content } = attributes; + + if (href) { + if (tag === 'BASE') { + try { + base = resolve(base, href); + } catch { + invalid.push(href); + } + } else if (!rel || !/\bexternal\b/i.test(rel)) { + push_href(href); + } + } + + if (id) { + ids.push(decode_uri(id)); + } + + if (name && tag === 'A') { + ids.push(decode_uri(name)); + } + + if (src) { + push_href(src); + } + + if (srcset) { + let value = srcset; + const candidates = []; + let insideURL = true; + value = value.trim(); + for (let i = 0; i < value.length; i++) { + if (value[i] === ',' && (!insideURL || (insideURL && WHITESPACE.test(value[i + 1])))) { + candidates.push(value.slice(0, i)); + value = value.substring(i + 1).trim(); + i = 0; + insideURL = true; + } else if (WHITESPACE.test(value[i])) { + insideURL = false; + } + } + candidates.push(value); + for (const candidate of candidates) { + const src = candidate.split(WHITESPACE)[0]; + if (src) push_href(src); + } + } + + if (tag === 'META' && content) { + const attr = name ?? property; + + if (attr && CRAWLABLE_META_NAME_ATTRS.has(attr)) { + push_href(content); + } + } + } + } + + i += 1; + } + + return { ids, hrefs, invalid }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/entities.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/entities.js new file mode 100644 index 0000000000000000000000000000000000000000..91888a95b73ee9d1bbe9ff32fab8ceac480ae7ed --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/entities.js @@ -0,0 +1,2252 @@ +/** + * A list of all named HTML entities, from https://html.spec.whatwg.org/multipage/named-characters.html + * @type {Record} + */ +const entities = { + AElig: 'Æ', + 'AElig;': 'Æ', + AMP: '&', + 'AMP;': '&', + Aacute: 'Á', + 'Aacute;': 'Á', + 'Abreve;': 'Ă', + Acirc: 'Â', + 'Acirc;': 'Â', + 'Acy;': 'А', + 'Afr;': '𝔄', + Agrave: 'À', + 'Agrave;': 'À', + 'Alpha;': 'Α', + 'Amacr;': 'Ā', + 'And;': '⩓', + 'Aogon;': 'Ą', + 'Aopf;': '𝔸', + 'ApplyFunction;': '⁡', + Aring: 'Å', + 'Aring;': 'Å', + 'Ascr;': '𝒜', + 'Assign;': '≔', + Atilde: 'Ã', + 'Atilde;': 'Ã', + Auml: 'Ä', + 'Auml;': 'Ä', + 'Backslash;': '∖', + 'Barv;': '⫧', + 'Barwed;': '⌆', + 'Bcy;': 'Б', + 'Because;': '∵', + 'Bernoullis;': 'ℬ', + 'Beta;': 'Β', + 'Bfr;': '𝔅', + 'Bopf;': '𝔹', + 'Breve;': '˘', + 'Bscr;': 'ℬ', + 'Bumpeq;': '≎', + 'CHcy;': 'Ч', + COPY: '©', + 'COPY;': '©', + 'Cacute;': 'Ć', + 'Cap;': '⋒', + 'CapitalDifferentialD;': 'ⅅ', + 'Cayleys;': 'ℭ', + 'Ccaron;': 'Č', + Ccedil: 'Ç', + 'Ccedil;': 'Ç', + 'Ccirc;': 'Ĉ', + 'Cconint;': '∰', + 'Cdot;': 'Ċ', + 'Cedilla;': '¸', + 'CenterDot;': '·', + 'Cfr;': 'ℭ', + 'Chi;': 'Χ', + 'CircleDot;': '⊙', + 'CircleMinus;': '⊖', + 'CirclePlus;': '⊕', + 'CircleTimes;': '⊗', + 'ClockwiseContourIntegral;': '∲', + 'CloseCurlyDoubleQuote;': '”', + 'CloseCurlyQuote;': '’', + 'Colon;': '∷', + 'Colone;': '⩴', + 'Congruent;': '≡', + 'Conint;': '∯', + 'ContourIntegral;': '∮', + 'Copf;': 'ℂ', + 'Coproduct;': '∐', + 'CounterClockwiseContourIntegral;': '∳', + 'Cross;': '⨯', + 'Cscr;': '𝒞', + 'Cup;': '⋓', + 'CupCap;': '≍', + 'DD;': 'ⅅ', + 'DDotrahd;': '⤑', + 'DJcy;': 'Ђ', + 'DScy;': 'Ѕ', + 'DZcy;': 'Џ', + 'Dagger;': '‡', + 'Darr;': '↡', + 'Dashv;': '⫤', + 'Dcaron;': 'Ď', + 'Dcy;': 'Д', + 'Del;': '∇', + 'Delta;': 'Δ', + 'Dfr;': '𝔇', + 'DiacriticalAcute;': '´', + 'DiacriticalDot;': '˙', + 'DiacriticalDoubleAcute;': '˝', + 'DiacriticalGrave;': '`', + 'DiacriticalTilde;': '˜', + 'Diamond;': '⋄', + 'DifferentialD;': 'ⅆ', + 'Dopf;': '𝔻', + 'Dot;': '¨', + 'DotDot;': '⃜', + 'DotEqual;': '≐', + 'DoubleContourIntegral;': '∯', + 'DoubleDot;': '¨', + 'DoubleDownArrow;': '⇓', + 'DoubleLeftArrow;': '⇐', + 'DoubleLeftRightArrow;': '⇔', + 'DoubleLeftTee;': '⫤', + 'DoubleLongLeftArrow;': '⟸', + 'DoubleLongLeftRightArrow;': '⟺', + 'DoubleLongRightArrow;': '⟹', + 'DoubleRightArrow;': '⇒', + 'DoubleRightTee;': '⊨', + 'DoubleUpArrow;': '⇑', + 'DoubleUpDownArrow;': '⇕', + 'DoubleVerticalBar;': '∥', + 'DownArrow;': '↓', + 'DownArrowBar;': '⤓', + 'DownArrowUpArrow;': '⇵', + 'DownBreve;': '̑', + 'DownLeftRightVector;': '⥐', + 'DownLeftTeeVector;': '⥞', + 'DownLeftVector;': '↽', + 'DownLeftVectorBar;': '⥖', + 'DownRightTeeVector;': '⥟', + 'DownRightVector;': '⇁', + 'DownRightVectorBar;': '⥗', + 'DownTee;': '⊤', + 'DownTeeArrow;': '↧', + 'Downarrow;': '⇓', + 'Dscr;': '𝒟', + 'Dstrok;': 'Đ', + 'ENG;': 'Ŋ', + ETH: 'Ð', + 'ETH;': 'Ð', + Eacute: 'É', + 'Eacute;': 'É', + 'Ecaron;': 'Ě', + Ecirc: 'Ê', + 'Ecirc;': 'Ê', + 'Ecy;': 'Э', + 'Edot;': 'Ė', + 'Efr;': '𝔈', + Egrave: 'È', + 'Egrave;': 'È', + 'Element;': '∈', + 'Emacr;': 'Ē', + 'EmptySmallSquare;': '◻', + 'EmptyVerySmallSquare;': '▫', + 'Eogon;': 'Ę', + 'Eopf;': '𝔼', + 'Epsilon;': 'Ε', + 'Equal;': '⩵', + 'EqualTilde;': '≂', + 'Equilibrium;': '⇌', + 'Escr;': 'ℰ', + 'Esim;': '⩳', + 'Eta;': 'Η', + Euml: 'Ë', + 'Euml;': 'Ë', + 'Exists;': '∃', + 'ExponentialE;': 'ⅇ', + 'Fcy;': 'Ф', + 'Ffr;': '𝔉', + 'FilledSmallSquare;': '◼', + 'FilledVerySmallSquare;': '▪', + 'Fopf;': '𝔽', + 'ForAll;': '∀', + 'Fouriertrf;': 'ℱ', + 'Fscr;': 'ℱ', + 'GJcy;': 'Ѓ', + GT: '>', + 'GT;': '>', + 'Gamma;': 'Γ', + 'Gammad;': 'Ϝ', + 'Gbreve;': 'Ğ', + 'Gcedil;': 'Ģ', + 'Gcirc;': 'Ĝ', + 'Gcy;': 'Г', + 'Gdot;': 'Ġ', + 'Gfr;': '𝔊', + 'Gg;': '⋙', + 'Gopf;': '𝔾', + 'GreaterEqual;': '≥', + 'GreaterEqualLess;': '⋛', + 'GreaterFullEqual;': '≧', + 'GreaterGreater;': '⪢', + 'GreaterLess;': '≷', + 'GreaterSlantEqual;': '⩾', + 'GreaterTilde;': '≳', + 'Gscr;': '𝒢', + 'Gt;': '≫', + 'HARDcy;': 'Ъ', + 'Hacek;': 'ˇ', + 'Hat;': '^', + 'Hcirc;': 'Ĥ', + 'Hfr;': 'ℌ', + 'HilbertSpace;': 'ℋ', + 'Hopf;': 'ℍ', + 'HorizontalLine;': '─', + 'Hscr;': 'ℋ', + 'Hstrok;': 'Ħ', + 'HumpDownHump;': '≎', + 'HumpEqual;': '≏', + 'IEcy;': 'Е', + 'IJlig;': 'IJ', + 'IOcy;': 'Ё', + Iacute: 'Í', + 'Iacute;': 'Í', + Icirc: 'Î', + 'Icirc;': 'Î', + 'Icy;': 'И', + 'Idot;': 'İ', + 'Ifr;': 'ℑ', + Igrave: 'Ì', + 'Igrave;': 'Ì', + 'Im;': 'ℑ', + 'Imacr;': 'Ī', + 'ImaginaryI;': 'ⅈ', + 'Implies;': '⇒', + 'Int;': '∬', + 'Integral;': '∫', + 'Intersection;': '⋂', + 'InvisibleComma;': '⁣', + 'InvisibleTimes;': '⁢', + 'Iogon;': 'Į', + 'Iopf;': '𝕀', + 'Iota;': 'Ι', + 'Iscr;': 'ℐ', + 'Itilde;': 'Ĩ', + 'Iukcy;': 'І', + Iuml: 'Ï', + 'Iuml;': 'Ï', + 'Jcirc;': 'Ĵ', + 'Jcy;': 'Й', + 'Jfr;': '𝔍', + 'Jopf;': '𝕁', + 'Jscr;': '𝒥', + 'Jsercy;': 'Ј', + 'Jukcy;': 'Є', + 'KHcy;': 'Х', + 'KJcy;': 'Ќ', + 'Kappa;': 'Κ', + 'Kcedil;': 'Ķ', + 'Kcy;': 'К', + 'Kfr;': '𝔎', + 'Kopf;': '𝕂', + 'Kscr;': '𝒦', + 'LJcy;': 'Љ', + LT: '<', + 'LT;': '<', + 'Lacute;': 'Ĺ', + 'Lambda;': 'Λ', + 'Lang;': '⟪', + 'Laplacetrf;': 'ℒ', + 'Larr;': '↞', + 'Lcaron;': 'Ľ', + 'Lcedil;': 'Ļ', + 'Lcy;': 'Л', + 'LeftAngleBracket;': '⟨', + 'LeftArrow;': '←', + 'LeftArrowBar;': '⇤', + 'LeftArrowRightArrow;': '⇆', + 'LeftCeiling;': '⌈', + 'LeftDoubleBracket;': '⟦', + 'LeftDownTeeVector;': '⥡', + 'LeftDownVector;': '⇃', + 'LeftDownVectorBar;': '⥙', + 'LeftFloor;': '⌊', + 'LeftRightArrow;': '↔', + 'LeftRightVector;': '⥎', + 'LeftTee;': '⊣', + 'LeftTeeArrow;': '↤', + 'LeftTeeVector;': '⥚', + 'LeftTriangle;': '⊲', + 'LeftTriangleBar;': '⧏', + 'LeftTriangleEqual;': '⊴', + 'LeftUpDownVector;': '⥑', + 'LeftUpTeeVector;': '⥠', + 'LeftUpVector;': '↿', + 'LeftUpVectorBar;': '⥘', + 'LeftVector;': '↼', + 'LeftVectorBar;': '⥒', + 'Leftarrow;': '⇐', + 'Leftrightarrow;': '⇔', + 'LessEqualGreater;': '⋚', + 'LessFullEqual;': '≦', + 'LessGreater;': '≶', + 'LessLess;': '⪡', + 'LessSlantEqual;': '⩽', + 'LessTilde;': '≲', + 'Lfr;': '𝔏', + 'Ll;': '⋘', + 'Lleftarrow;': '⇚', + 'Lmidot;': 'Ŀ', + 'LongLeftArrow;': '⟵', + 'LongLeftRightArrow;': '⟷', + 'LongRightArrow;': '⟶', + 'Longleftarrow;': '⟸', + 'Longleftrightarrow;': '⟺', + 'Longrightarrow;': '⟹', + 'Lopf;': '𝕃', + 'LowerLeftArrow;': '↙', + 'LowerRightArrow;': '↘', + 'Lscr;': 'ℒ', + 'Lsh;': '↰', + 'Lstrok;': 'Ł', + 'Lt;': '≪', + 'Map;': '⤅', + 'Mcy;': 'М', + 'MediumSpace;': ' ', + 'Mellintrf;': 'ℳ', + 'Mfr;': '𝔐', + 'MinusPlus;': '∓', + 'Mopf;': '𝕄', + 'Mscr;': 'ℳ', + 'Mu;': 'Μ', + 'NJcy;': 'Њ', + 'Nacute;': 'Ń', + 'Ncaron;': 'Ň', + 'Ncedil;': 'Ņ', + 'Ncy;': 'Н', + 'NegativeMediumSpace;': '​', + 'NegativeThickSpace;': '​', + 'NegativeThinSpace;': '​', + 'NegativeVeryThinSpace;': '​', + 'NestedGreaterGreater;': '≫', + 'NestedLessLess;': '≪', + 'NewLine;': '\n', + 'Nfr;': '𝔑', + 'NoBreak;': '⁠', + 'NonBreakingSpace;': ' ', + 'Nopf;': 'ℕ', + 'Not;': '⫬', + 'NotCongruent;': '≢', + 'NotCupCap;': '≭', + 'NotDoubleVerticalBar;': '∦', + 'NotElement;': '∉', + 'NotEqual;': '≠', + 'NotEqualTilde;': '≂̸', + 'NotExists;': '∄', + 'NotGreater;': '≯', + 'NotGreaterEqual;': '≱', + 'NotGreaterFullEqual;': '≧̸', + 'NotGreaterGreater;': '≫̸', + 'NotGreaterLess;': '≹', + 'NotGreaterSlantEqual;': '⩾̸', + 'NotGreaterTilde;': '≵', + 'NotHumpDownHump;': '≎̸', + 'NotHumpEqual;': '≏̸', + 'NotLeftTriangle;': '⋪', + 'NotLeftTriangleBar;': '⧏̸', + 'NotLeftTriangleEqual;': '⋬', + 'NotLess;': '≮', + 'NotLessEqual;': '≰', + 'NotLessGreater;': '≸', + 'NotLessLess;': '≪̸', + 'NotLessSlantEqual;': '⩽̸', + 'NotLessTilde;': '≴', + 'NotNestedGreaterGreater;': '⪢̸', + 'NotNestedLessLess;': '⪡̸', + 'NotPrecedes;': '⊀', + 'NotPrecedesEqual;': '⪯̸', + 'NotPrecedesSlantEqual;': '⋠', + 'NotReverseElement;': '∌', + 'NotRightTriangle;': '⋫', + 'NotRightTriangleBar;': '⧐̸', + 'NotRightTriangleEqual;': '⋭', + 'NotSquareSubset;': '⊏̸', + 'NotSquareSubsetEqual;': '⋢', + 'NotSquareSuperset;': '⊐̸', + 'NotSquareSupersetEqual;': '⋣', + 'NotSubset;': '⊂⃒', + 'NotSubsetEqual;': '⊈', + 'NotSucceeds;': '⊁', + 'NotSucceedsEqual;': '⪰̸', + 'NotSucceedsSlantEqual;': '⋡', + 'NotSucceedsTilde;': '≿̸', + 'NotSuperset;': '⊃⃒', + 'NotSupersetEqual;': '⊉', + 'NotTilde;': '≁', + 'NotTildeEqual;': '≄', + 'NotTildeFullEqual;': '≇', + 'NotTildeTilde;': '≉', + 'NotVerticalBar;': '∤', + 'Nscr;': '𝒩', + Ntilde: 'Ñ', + 'Ntilde;': 'Ñ', + 'Nu;': 'Ν', + 'OElig;': 'Œ', + Oacute: 'Ó', + 'Oacute;': 'Ó', + Ocirc: 'Ô', + 'Ocirc;': 'Ô', + 'Ocy;': 'О', + 'Odblac;': 'Ő', + 'Ofr;': '𝔒', + Ograve: 'Ò', + 'Ograve;': 'Ò', + 'Omacr;': 'Ō', + 'Omega;': 'Ω', + 'Omicron;': 'Ο', + 'Oopf;': '𝕆', + 'OpenCurlyDoubleQuote;': '“', + 'OpenCurlyQuote;': '‘', + 'Or;': '⩔', + 'Oscr;': '𝒪', + Oslash: 'Ø', + 'Oslash;': 'Ø', + Otilde: 'Õ', + 'Otilde;': 'Õ', + 'Otimes;': '⨷', + Ouml: 'Ö', + 'Ouml;': 'Ö', + 'OverBar;': '‾', + 'OverBrace;': '⏞', + 'OverBracket;': '⎴', + 'OverParenthesis;': '⏜', + 'PartialD;': '∂', + 'Pcy;': 'П', + 'Pfr;': '𝔓', + 'Phi;': 'Φ', + 'Pi;': 'Π', + 'PlusMinus;': '±', + 'Poincareplane;': 'ℌ', + 'Popf;': 'ℙ', + 'Pr;': '⪻', + 'Precedes;': '≺', + 'PrecedesEqual;': '⪯', + 'PrecedesSlantEqual;': '≼', + 'PrecedesTilde;': '≾', + 'Prime;': '″', + 'Product;': '∏', + 'Proportion;': '∷', + 'Proportional;': '∝', + 'Pscr;': '𝒫', + 'Psi;': 'Ψ', + QUOT: '"', + 'QUOT;': '"', + 'Qfr;': '𝔔', + 'Qopf;': 'ℚ', + 'Qscr;': '𝒬', + 'RBarr;': '⤐', + REG: '®', + 'REG;': '®', + 'Racute;': 'Ŕ', + 'Rang;': '⟫', + 'Rarr;': '↠', + 'Rarrtl;': '⤖', + 'Rcaron;': 'Ř', + 'Rcedil;': 'Ŗ', + 'Rcy;': 'Р', + 'Re;': 'ℜ', + 'ReverseElement;': '∋', + 'ReverseEquilibrium;': '⇋', + 'ReverseUpEquilibrium;': '⥯', + 'Rfr;': 'ℜ', + 'Rho;': 'Ρ', + 'RightAngleBracket;': '⟩', + 'RightArrow;': '→', + 'RightArrowBar;': '⇥', + 'RightArrowLeftArrow;': '⇄', + 'RightCeiling;': '⌉', + 'RightDoubleBracket;': '⟧', + 'RightDownTeeVector;': '⥝', + 'RightDownVector;': '⇂', + 'RightDownVectorBar;': '⥕', + 'RightFloor;': '⌋', + 'RightTee;': '⊢', + 'RightTeeArrow;': '↦', + 'RightTeeVector;': '⥛', + 'RightTriangle;': '⊳', + 'RightTriangleBar;': '⧐', + 'RightTriangleEqual;': '⊵', + 'RightUpDownVector;': '⥏', + 'RightUpTeeVector;': '⥜', + 'RightUpVector;': '↾', + 'RightUpVectorBar;': '⥔', + 'RightVector;': '⇀', + 'RightVectorBar;': '⥓', + 'Rightarrow;': '⇒', + 'Ropf;': 'ℝ', + 'RoundImplies;': '⥰', + 'Rrightarrow;': '⇛', + 'Rscr;': 'ℛ', + 'Rsh;': '↱', + 'RuleDelayed;': '⧴', + 'SHCHcy;': 'Щ', + 'SHcy;': 'Ш', + 'SOFTcy;': 'Ь', + 'Sacute;': 'Ś', + 'Sc;': '⪼', + 'Scaron;': 'Š', + 'Scedil;': 'Ş', + 'Scirc;': 'Ŝ', + 'Scy;': 'С', + 'Sfr;': '𝔖', + 'ShortDownArrow;': '↓', + 'ShortLeftArrow;': '←', + 'ShortRightArrow;': '→', + 'ShortUpArrow;': '↑', + 'Sigma;': 'Σ', + 'SmallCircle;': '∘', + 'Sopf;': '𝕊', + 'Sqrt;': '√', + 'Square;': '□', + 'SquareIntersection;': '⊓', + 'SquareSubset;': '⊏', + 'SquareSubsetEqual;': '⊑', + 'SquareSuperset;': '⊐', + 'SquareSupersetEqual;': '⊒', + 'SquareUnion;': '⊔', + 'Sscr;': '𝒮', + 'Star;': '⋆', + 'Sub;': '⋐', + 'Subset;': '⋐', + 'SubsetEqual;': '⊆', + 'Succeeds;': '≻', + 'SucceedsEqual;': '⪰', + 'SucceedsSlantEqual;': '≽', + 'SucceedsTilde;': '≿', + 'SuchThat;': '∋', + 'Sum;': '∑', + 'Sup;': '⋑', + 'Superset;': '⊃', + 'SupersetEqual;': '⊇', + 'Supset;': '⋑', + THORN: 'Þ', + 'THORN;': 'Þ', + 'TRADE;': '™', + 'TSHcy;': 'Ћ', + 'TScy;': 'Ц', + 'Tab;': '\t', + 'Tau;': 'Τ', + 'Tcaron;': 'Ť', + 'Tcedil;': 'Ţ', + 'Tcy;': 'Т', + 'Tfr;': '𝔗', + 'Therefore;': '∴', + 'Theta;': 'Θ', + 'ThickSpace;': '  ', + 'ThinSpace;': ' ', + 'Tilde;': '∼', + 'TildeEqual;': '≃', + 'TildeFullEqual;': '≅', + 'TildeTilde;': '≈', + 'Topf;': '𝕋', + 'TripleDot;': '⃛', + 'Tscr;': '𝒯', + 'Tstrok;': 'Ŧ', + Uacute: 'Ú', + 'Uacute;': 'Ú', + 'Uarr;': '↟', + 'Uarrocir;': '⥉', + 'Ubrcy;': 'Ў', + 'Ubreve;': 'Ŭ', + Ucirc: 'Û', + 'Ucirc;': 'Û', + 'Ucy;': 'У', + 'Udblac;': 'Ű', + 'Ufr;': '𝔘', + Ugrave: 'Ù', + 'Ugrave;': 'Ù', + 'Umacr;': 'Ū', + 'UnderBar;': '_', + 'UnderBrace;': '⏟', + 'UnderBracket;': '⎵', + 'UnderParenthesis;': '⏝', + 'Union;': '⋃', + 'UnionPlus;': '⊎', + 'Uogon;': 'Ų', + 'Uopf;': '𝕌', + 'UpArrow;': '↑', + 'UpArrowBar;': '⤒', + 'UpArrowDownArrow;': '⇅', + 'UpDownArrow;': '↕', + 'UpEquilibrium;': '⥮', + 'UpTee;': '⊥', + 'UpTeeArrow;': '↥', + 'Uparrow;': '⇑', + 'Updownarrow;': '⇕', + 'UpperLeftArrow;': '↖', + 'UpperRightArrow;': '↗', + 'Upsi;': 'ϒ', + 'Upsilon;': 'Υ', + 'Uring;': 'Ů', + 'Uscr;': '𝒰', + 'Utilde;': 'Ũ', + Uuml: 'Ü', + 'Uuml;': 'Ü', + 'VDash;': '⊫', + 'Vbar;': '⫫', + 'Vcy;': 'В', + 'Vdash;': '⊩', + 'Vdashl;': '⫦', + 'Vee;': '⋁', + 'Verbar;': '‖', + 'Vert;': '‖', + 'VerticalBar;': '∣', + 'VerticalLine;': '|', + 'VerticalSeparator;': '❘', + 'VerticalTilde;': '≀', + 'VeryThinSpace;': ' ', + 'Vfr;': '𝔙', + 'Vopf;': '𝕍', + 'Vscr;': '𝒱', + 'Vvdash;': '⊪', + 'Wcirc;': 'Ŵ', + 'Wedge;': '⋀', + 'Wfr;': '𝔚', + 'Wopf;': '𝕎', + 'Wscr;': '𝒲', + 'Xfr;': '𝔛', + 'Xi;': 'Ξ', + 'Xopf;': '𝕏', + 'Xscr;': '𝒳', + 'YAcy;': 'Я', + 'YIcy;': 'Ї', + 'YUcy;': 'Ю', + Yacute: 'Ý', + 'Yacute;': 'Ý', + 'Ycirc;': 'Ŷ', + 'Ycy;': 'Ы', + 'Yfr;': '𝔜', + 'Yopf;': '𝕐', + 'Yscr;': '𝒴', + 'Yuml;': 'Ÿ', + 'ZHcy;': 'Ж', + 'Zacute;': 'Ź', + 'Zcaron;': 'Ž', + 'Zcy;': 'З', + 'Zdot;': 'Ż', + 'ZeroWidthSpace;': '​', + 'Zeta;': 'Ζ', + 'Zfr;': 'ℨ', + 'Zopf;': 'ℤ', + 'Zscr;': '𝒵', + aacute: 'á', + 'aacute;': 'á', + 'abreve;': 'ă', + 'ac;': '∾', + 'acE;': '∾̳', + 'acd;': '∿', + acirc: 'â', + 'acirc;': 'â', + acute: '´', + 'acute;': '´', + 'acy;': 'а', + aelig: 'æ', + 'aelig;': 'æ', + 'af;': '⁡', + 'afr;': '𝔞', + agrave: 'à', + 'agrave;': 'à', + 'alefsym;': 'ℵ', + 'aleph;': 'ℵ', + 'alpha;': 'α', + 'amacr;': 'ā', + 'amalg;': '⨿', + amp: '&', + 'amp;': '&', + 'and;': '∧', + 'andand;': '⩕', + 'andd;': '⩜', + 'andslope;': '⩘', + 'andv;': '⩚', + 'ang;': '∠', + 'ange;': '⦤', + 'angle;': '∠', + 'angmsd;': '∡', + 'angmsdaa;': '⦨', + 'angmsdab;': '⦩', + 'angmsdac;': '⦪', + 'angmsdad;': '⦫', + 'angmsdae;': '⦬', + 'angmsdaf;': '⦭', + 'angmsdag;': '⦮', + 'angmsdah;': '⦯', + 'angrt;': '∟', + 'angrtvb;': '⊾', + 'angrtvbd;': '⦝', + 'angsph;': '∢', + 'angst;': 'Å', + 'angzarr;': '⍼', + 'aogon;': 'ą', + 'aopf;': '𝕒', + 'ap;': '≈', + 'apE;': '⩰', + 'apacir;': '⩯', + 'ape;': '≊', + 'apid;': '≋', + 'apos;': "'", + 'approx;': '≈', + 'approxeq;': '≊', + aring: 'å', + 'aring;': 'å', + 'ascr;': '𝒶', + 'ast;': '*', + 'asymp;': '≈', + 'asympeq;': '≍', + atilde: 'ã', + 'atilde;': 'ã', + auml: 'ä', + 'auml;': 'ä', + 'awconint;': '∳', + 'awint;': '⨑', + 'bNot;': '⫭', + 'backcong;': '≌', + 'backepsilon;': '϶', + 'backprime;': '‵', + 'backsim;': '∽', + 'backsimeq;': '⋍', + 'barvee;': '⊽', + 'barwed;': '⌅', + 'barwedge;': '⌅', + 'bbrk;': '⎵', + 'bbrktbrk;': '⎶', + 'bcong;': '≌', + 'bcy;': 'б', + 'bdquo;': '„', + 'becaus;': '∵', + 'because;': '∵', + 'bemptyv;': '⦰', + 'bepsi;': '϶', + 'bernou;': 'ℬ', + 'beta;': 'β', + 'beth;': 'ℶ', + 'between;': '≬', + 'bfr;': '𝔟', + 'bigcap;': '⋂', + 'bigcirc;': '◯', + 'bigcup;': '⋃', + 'bigodot;': '⨀', + 'bigoplus;': '⨁', + 'bigotimes;': '⨂', + 'bigsqcup;': '⨆', + 'bigstar;': '★', + 'bigtriangledown;': '▽', + 'bigtriangleup;': '△', + 'biguplus;': '⨄', + 'bigvee;': '⋁', + 'bigwedge;': '⋀', + 'bkarow;': '⤍', + 'blacklozenge;': '⧫', + 'blacksquare;': '▪', + 'blacktriangle;': '▴', + 'blacktriangledown;': '▾', + 'blacktriangleleft;': '◂', + 'blacktriangleright;': '▸', + 'blank;': '␣', + 'blk12;': '▒', + 'blk14;': '░', + 'blk34;': '▓', + 'block;': '█', + 'bne;': '=⃥', + 'bnequiv;': '≡⃥', + 'bnot;': '⌐', + 'bopf;': '𝕓', + 'bot;': '⊥', + 'bottom;': '⊥', + 'bowtie;': '⋈', + 'boxDL;': '╗', + 'boxDR;': '╔', + 'boxDl;': '╖', + 'boxDr;': '╓', + 'boxH;': '═', + 'boxHD;': '╦', + 'boxHU;': '╩', + 'boxHd;': '╤', + 'boxHu;': '╧', + 'boxUL;': '╝', + 'boxUR;': '╚', + 'boxUl;': '╜', + 'boxUr;': '╙', + 'boxV;': '║', + 'boxVH;': '╬', + 'boxVL;': '╣', + 'boxVR;': '╠', + 'boxVh;': '╫', + 'boxVl;': '╢', + 'boxVr;': '╟', + 'boxbox;': '⧉', + 'boxdL;': '╕', + 'boxdR;': '╒', + 'boxdl;': '┐', + 'boxdr;': '┌', + 'boxh;': '─', + 'boxhD;': '╥', + 'boxhU;': '╨', + 'boxhd;': '┬', + 'boxhu;': '┴', + 'boxminus;': '⊟', + 'boxplus;': '⊞', + 'boxtimes;': '⊠', + 'boxuL;': '╛', + 'boxuR;': '╘', + 'boxul;': '┘', + 'boxur;': '└', + 'boxv;': '│', + 'boxvH;': '╪', + 'boxvL;': '╡', + 'boxvR;': '╞', + 'boxvh;': '┼', + 'boxvl;': '┤', + 'boxvr;': '├', + 'bprime;': '‵', + 'breve;': '˘', + brvbar: '¦', + 'brvbar;': '¦', + 'bscr;': '𝒷', + 'bsemi;': '⁏', + 'bsim;': '∽', + 'bsime;': '⋍', + 'bsol;': '\\', + 'bsolb;': '⧅', + 'bsolhsub;': '⟈', + 'bull;': '•', + 'bullet;': '•', + 'bump;': '≎', + 'bumpE;': '⪮', + 'bumpe;': '≏', + 'bumpeq;': '≏', + 'cacute;': 'ć', + 'cap;': '∩', + 'capand;': '⩄', + 'capbrcup;': '⩉', + 'capcap;': '⩋', + 'capcup;': '⩇', + 'capdot;': '⩀', + 'caps;': '∩︀', + 'caret;': '⁁', + 'caron;': 'ˇ', + 'ccaps;': '⩍', + 'ccaron;': 'č', + ccedil: 'ç', + 'ccedil;': 'ç', + 'ccirc;': 'ĉ', + 'ccups;': '⩌', + 'ccupssm;': '⩐', + 'cdot;': 'ċ', + cedil: '¸', + 'cedil;': '¸', + 'cemptyv;': '⦲', + cent: '¢', + 'cent;': '¢', + 'centerdot;': '·', + 'cfr;': '𝔠', + 'chcy;': 'ч', + 'check;': '✓', + 'checkmark;': '✓', + 'chi;': 'χ', + 'cir;': '○', + 'cirE;': '⧃', + 'circ;': 'ˆ', + 'circeq;': '≗', + 'circlearrowleft;': '↺', + 'circlearrowright;': '↻', + 'circledR;': '®', + 'circledS;': 'Ⓢ', + 'circledast;': '⊛', + 'circledcirc;': '⊚', + 'circleddash;': '⊝', + 'cire;': '≗', + 'cirfnint;': '⨐', + 'cirmid;': '⫯', + 'cirscir;': '⧂', + 'clubs;': '♣', + 'clubsuit;': '♣', + 'colon;': ':', + 'colone;': '≔', + 'coloneq;': '≔', + 'comma;': ',', + 'commat;': '@', + 'comp;': '∁', + 'compfn;': '∘', + 'complement;': '∁', + 'complexes;': 'ℂ', + 'cong;': '≅', + 'congdot;': '⩭', + 'conint;': '∮', + 'copf;': '𝕔', + 'coprod;': '∐', + copy: '©', + 'copy;': '©', + 'copysr;': '℗', + 'crarr;': '↵', + 'cross;': '✗', + 'cscr;': '𝒸', + 'csub;': '⫏', + 'csube;': '⫑', + 'csup;': '⫐', + 'csupe;': '⫒', + 'ctdot;': '⋯', + 'cudarrl;': '⤸', + 'cudarrr;': '⤵', + 'cuepr;': '⋞', + 'cuesc;': '⋟', + 'cularr;': '↶', + 'cularrp;': '⤽', + 'cup;': '∪', + 'cupbrcap;': '⩈', + 'cupcap;': '⩆', + 'cupcup;': '⩊', + 'cupdot;': '⊍', + 'cupor;': '⩅', + 'cups;': '∪︀', + 'curarr;': '↷', + 'curarrm;': '⤼', + 'curlyeqprec;': '⋞', + 'curlyeqsucc;': '⋟', + 'curlyvee;': '⋎', + 'curlywedge;': '⋏', + curren: '¤', + 'curren;': '¤', + 'curvearrowleft;': '↶', + 'curvearrowright;': '↷', + 'cuvee;': '⋎', + 'cuwed;': '⋏', + 'cwconint;': '∲', + 'cwint;': '∱', + 'cylcty;': '⌭', + 'dArr;': '⇓', + 'dHar;': '⥥', + 'dagger;': '†', + 'daleth;': 'ℸ', + 'darr;': '↓', + 'dash;': '‐', + 'dashv;': '⊣', + 'dbkarow;': '⤏', + 'dblac;': '˝', + 'dcaron;': 'ď', + 'dcy;': 'д', + 'dd;': 'ⅆ', + 'ddagger;': '‡', + 'ddarr;': '⇊', + 'ddotseq;': '⩷', + deg: '°', + 'deg;': '°', + 'delta;': 'δ', + 'demptyv;': '⦱', + 'dfisht;': '⥿', + 'dfr;': '𝔡', + 'dharl;': '⇃', + 'dharr;': '⇂', + 'diam;': '⋄', + 'diamond;': '⋄', + 'diamondsuit;': '♦', + 'diams;': '♦', + 'die;': '¨', + 'digamma;': 'ϝ', + 'disin;': '⋲', + 'div;': '÷', + divide: '÷', + 'divide;': '÷', + 'divideontimes;': '⋇', + 'divonx;': '⋇', + 'djcy;': 'ђ', + 'dlcorn;': '⌞', + 'dlcrop;': '⌍', + 'dollar;': '$', + 'dopf;': '𝕕', + 'dot;': '˙', + 'doteq;': '≐', + 'doteqdot;': '≑', + 'dotminus;': '∸', + 'dotplus;': '∔', + 'dotsquare;': '⊡', + 'doublebarwedge;': '⌆', + 'downarrow;': '↓', + 'downdownarrows;': '⇊', + 'downharpoonleft;': '⇃', + 'downharpoonright;': '⇂', + 'drbkarow;': '⤐', + 'drcorn;': '⌟', + 'drcrop;': '⌌', + 'dscr;': '𝒹', + 'dscy;': 'ѕ', + 'dsol;': '⧶', + 'dstrok;': 'đ', + 'dtdot;': '⋱', + 'dtri;': '▿', + 'dtrif;': '▾', + 'duarr;': '⇵', + 'duhar;': '⥯', + 'dwangle;': '⦦', + 'dzcy;': 'џ', + 'dzigrarr;': '⟿', + 'eDDot;': '⩷', + 'eDot;': '≑', + eacute: 'é', + 'eacute;': 'é', + 'easter;': '⩮', + 'ecaron;': 'ě', + 'ecir;': '≖', + ecirc: 'ê', + 'ecirc;': 'ê', + 'ecolon;': '≕', + 'ecy;': 'э', + 'edot;': 'ė', + 'ee;': 'ⅇ', + 'efDot;': '≒', + 'efr;': '𝔢', + 'eg;': '⪚', + egrave: 'è', + 'egrave;': 'è', + 'egs;': '⪖', + 'egsdot;': '⪘', + 'el;': '⪙', + 'elinters;': '⏧', + 'ell;': 'ℓ', + 'els;': '⪕', + 'elsdot;': '⪗', + 'emacr;': 'ē', + 'empty;': '∅', + 'emptyset;': '∅', + 'emptyv;': '∅', + 'emsp13;': ' ', + 'emsp14;': ' ', + 'emsp;': ' ', + 'eng;': 'ŋ', + 'ensp;': ' ', + 'eogon;': 'ę', + 'eopf;': '𝕖', + 'epar;': '⋕', + 'eparsl;': '⧣', + 'eplus;': '⩱', + 'epsi;': 'ε', + 'epsilon;': 'ε', + 'epsiv;': 'ϵ', + 'eqcirc;': '≖', + 'eqcolon;': '≕', + 'eqsim;': '≂', + 'eqslantgtr;': '⪖', + 'eqslantless;': '⪕', + 'equals;': '=', + 'equest;': '≟', + 'equiv;': '≡', + 'equivDD;': '⩸', + 'eqvparsl;': '⧥', + 'erDot;': '≓', + 'erarr;': '⥱', + 'escr;': 'ℯ', + 'esdot;': '≐', + 'esim;': '≂', + 'eta;': 'η', + eth: 'ð', + 'eth;': 'ð', + euml: 'ë', + 'euml;': 'ë', + 'euro;': '€', + 'excl;': '!', + 'exist;': '∃', + 'expectation;': 'ℰ', + 'exponentiale;': 'ⅇ', + 'fallingdotseq;': '≒', + 'fcy;': 'ф', + 'female;': '♀', + 'ffilig;': 'ffi', + 'fflig;': 'ff', + 'ffllig;': 'ffl', + 'ffr;': '𝔣', + 'filig;': 'fi', + 'fjlig;': 'fj', + 'flat;': '♭', + 'fllig;': 'fl', + 'fltns;': '▱', + 'fnof;': 'ƒ', + 'fopf;': '𝕗', + 'forall;': '∀', + 'fork;': '⋔', + 'forkv;': '⫙', + 'fpartint;': '⨍', + frac12: '½', + 'frac12;': '½', + 'frac13;': '⅓', + frac14: '¼', + 'frac14;': '¼', + 'frac15;': '⅕', + 'frac16;': '⅙', + 'frac18;': '⅛', + 'frac23;': '⅔', + 'frac25;': '⅖', + frac34: '¾', + 'frac34;': '¾', + 'frac35;': '⅗', + 'frac38;': '⅜', + 'frac45;': '⅘', + 'frac56;': '⅚', + 'frac58;': '⅝', + 'frac78;': '⅞', + 'frasl;': '⁄', + 'frown;': '⌢', + 'fscr;': '𝒻', + 'gE;': '≧', + 'gEl;': '⪌', + 'gacute;': 'ǵ', + 'gamma;': 'γ', + 'gammad;': 'ϝ', + 'gap;': '⪆', + 'gbreve;': 'ğ', + 'gcirc;': 'ĝ', + 'gcy;': 'г', + 'gdot;': 'ġ', + 'ge;': '≥', + 'gel;': '⋛', + 'geq;': '≥', + 'geqq;': '≧', + 'geqslant;': '⩾', + 'ges;': '⩾', + 'gescc;': '⪩', + 'gesdot;': '⪀', + 'gesdoto;': '⪂', + 'gesdotol;': '⪄', + 'gesl;': '⋛︀', + 'gesles;': '⪔', + 'gfr;': '𝔤', + 'gg;': '≫', + 'ggg;': '⋙', + 'gimel;': 'ℷ', + 'gjcy;': 'ѓ', + 'gl;': '≷', + 'glE;': '⪒', + 'gla;': '⪥', + 'glj;': '⪤', + 'gnE;': '≩', + 'gnap;': '⪊', + 'gnapprox;': '⪊', + 'gne;': '⪈', + 'gneq;': '⪈', + 'gneqq;': '≩', + 'gnsim;': '⋧', + 'gopf;': '𝕘', + 'grave;': '`', + 'gscr;': 'ℊ', + 'gsim;': '≳', + 'gsime;': '⪎', + 'gsiml;': '⪐', + gt: '>', + 'gt;': '>', + 'gtcc;': '⪧', + 'gtcir;': '⩺', + 'gtdot;': '⋗', + 'gtlPar;': '⦕', + 'gtquest;': '⩼', + 'gtrapprox;': '⪆', + 'gtrarr;': '⥸', + 'gtrdot;': '⋗', + 'gtreqless;': '⋛', + 'gtreqqless;': '⪌', + 'gtrless;': '≷', + 'gtrsim;': '≳', + 'gvertneqq;': '≩︀', + 'gvnE;': '≩︀', + 'hArr;': '⇔', + 'hairsp;': ' ', + 'half;': '½', + 'hamilt;': 'ℋ', + 'hardcy;': 'ъ', + 'harr;': '↔', + 'harrcir;': '⥈', + 'harrw;': '↭', + 'hbar;': 'ℏ', + 'hcirc;': 'ĥ', + 'hearts;': '♥', + 'heartsuit;': '♥', + 'hellip;': '…', + 'hercon;': '⊹', + 'hfr;': '𝔥', + 'hksearow;': '⤥', + 'hkswarow;': '⤦', + 'hoarr;': '⇿', + 'homtht;': '∻', + 'hookleftarrow;': '↩', + 'hookrightarrow;': '↪', + 'hopf;': '𝕙', + 'horbar;': '―', + 'hscr;': '𝒽', + 'hslash;': 'ℏ', + 'hstrok;': 'ħ', + 'hybull;': '⁃', + 'hyphen;': '‐', + iacute: 'í', + 'iacute;': 'í', + 'ic;': '⁣', + icirc: 'î', + 'icirc;': 'î', + 'icy;': 'и', + 'iecy;': 'е', + iexcl: '¡', + 'iexcl;': '¡', + 'iff;': '⇔', + 'ifr;': '𝔦', + igrave: 'ì', + 'igrave;': 'ì', + 'ii;': 'ⅈ', + 'iiiint;': '⨌', + 'iiint;': '∭', + 'iinfin;': '⧜', + 'iiota;': '℩', + 'ijlig;': 'ij', + 'imacr;': 'ī', + 'image;': 'ℑ', + 'imagline;': 'ℐ', + 'imagpart;': 'ℑ', + 'imath;': 'ı', + 'imof;': '⊷', + 'imped;': 'Ƶ', + 'in;': '∈', + 'incare;': '℅', + 'infin;': '∞', + 'infintie;': '⧝', + 'inodot;': 'ı', + 'int;': '∫', + 'intcal;': '⊺', + 'integers;': 'ℤ', + 'intercal;': '⊺', + 'intlarhk;': '⨗', + 'intprod;': '⨼', + 'iocy;': 'ё', + 'iogon;': 'į', + 'iopf;': '𝕚', + 'iota;': 'ι', + 'iprod;': '⨼', + iquest: '¿', + 'iquest;': '¿', + 'iscr;': '𝒾', + 'isin;': '∈', + 'isinE;': '⋹', + 'isindot;': '⋵', + 'isins;': '⋴', + 'isinsv;': '⋳', + 'isinv;': '∈', + 'it;': '⁢', + 'itilde;': 'ĩ', + 'iukcy;': 'і', + iuml: 'ï', + 'iuml;': 'ï', + 'jcirc;': 'ĵ', + 'jcy;': 'й', + 'jfr;': '𝔧', + 'jmath;': 'ȷ', + 'jopf;': '𝕛', + 'jscr;': '𝒿', + 'jsercy;': 'ј', + 'jukcy;': 'є', + 'kappa;': 'κ', + 'kappav;': 'ϰ', + 'kcedil;': 'ķ', + 'kcy;': 'к', + 'kfr;': '𝔨', + 'kgreen;': 'ĸ', + 'khcy;': 'х', + 'kjcy;': 'ќ', + 'kopf;': '𝕜', + 'kscr;': '𝓀', + 'lAarr;': '⇚', + 'lArr;': '⇐', + 'lAtail;': '⤛', + 'lBarr;': '⤎', + 'lE;': '≦', + 'lEg;': '⪋', + 'lHar;': '⥢', + 'lacute;': 'ĺ', + 'laemptyv;': '⦴', + 'lagran;': 'ℒ', + 'lambda;': 'λ', + 'lang;': '⟨', + 'langd;': '⦑', + 'langle;': '⟨', + 'lap;': '⪅', + laquo: '«', + 'laquo;': '«', + 'larr;': '←', + 'larrb;': '⇤', + 'larrbfs;': '⤟', + 'larrfs;': '⤝', + 'larrhk;': '↩', + 'larrlp;': '↫', + 'larrpl;': '⤹', + 'larrsim;': '⥳', + 'larrtl;': '↢', + 'lat;': '⪫', + 'latail;': '⤙', + 'late;': '⪭', + 'lates;': '⪭︀', + 'lbarr;': '⤌', + 'lbbrk;': '❲', + 'lbrace;': '{', + 'lbrack;': '[', + 'lbrke;': '⦋', + 'lbrksld;': '⦏', + 'lbrkslu;': '⦍', + 'lcaron;': 'ľ', + 'lcedil;': 'ļ', + 'lceil;': '⌈', + 'lcub;': '{', + 'lcy;': 'л', + 'ldca;': '⤶', + 'ldquo;': '“', + 'ldquor;': '„', + 'ldrdhar;': '⥧', + 'ldrushar;': '⥋', + 'ldsh;': '↲', + 'le;': '≤', + 'leftarrow;': '←', + 'leftarrowtail;': '↢', + 'leftharpoondown;': '↽', + 'leftharpoonup;': '↼', + 'leftleftarrows;': '⇇', + 'leftrightarrow;': '↔', + 'leftrightarrows;': '⇆', + 'leftrightharpoons;': '⇋', + 'leftrightsquigarrow;': '↭', + 'leftthreetimes;': '⋋', + 'leg;': '⋚', + 'leq;': '≤', + 'leqq;': '≦', + 'leqslant;': '⩽', + 'les;': '⩽', + 'lescc;': '⪨', + 'lesdot;': '⩿', + 'lesdoto;': '⪁', + 'lesdotor;': '⪃', + 'lesg;': '⋚︀', + 'lesges;': '⪓', + 'lessapprox;': '⪅', + 'lessdot;': '⋖', + 'lesseqgtr;': '⋚', + 'lesseqqgtr;': '⪋', + 'lessgtr;': '≶', + 'lesssim;': '≲', + 'lfisht;': '⥼', + 'lfloor;': '⌊', + 'lfr;': '𝔩', + 'lg;': '≶', + 'lgE;': '⪑', + 'lhard;': '↽', + 'lharu;': '↼', + 'lharul;': '⥪', + 'lhblk;': '▄', + 'ljcy;': 'љ', + 'll;': '≪', + 'llarr;': '⇇', + 'llcorner;': '⌞', + 'llhard;': '⥫', + 'lltri;': '◺', + 'lmidot;': 'ŀ', + 'lmoust;': '⎰', + 'lmoustache;': '⎰', + 'lnE;': '≨', + 'lnap;': '⪉', + 'lnapprox;': '⪉', + 'lne;': '⪇', + 'lneq;': '⪇', + 'lneqq;': '≨', + 'lnsim;': '⋦', + 'loang;': '⟬', + 'loarr;': '⇽', + 'lobrk;': '⟦', + 'longleftarrow;': '⟵', + 'longleftrightarrow;': '⟷', + 'longmapsto;': '⟼', + 'longrightarrow;': '⟶', + 'looparrowleft;': '↫', + 'looparrowright;': '↬', + 'lopar;': '⦅', + 'lopf;': '𝕝', + 'loplus;': '⨭', + 'lotimes;': '⨴', + 'lowast;': '∗', + 'lowbar;': '_', + 'loz;': '◊', + 'lozenge;': '◊', + 'lozf;': '⧫', + 'lpar;': '(', + 'lparlt;': '⦓', + 'lrarr;': '⇆', + 'lrcorner;': '⌟', + 'lrhar;': '⇋', + 'lrhard;': '⥭', + 'lrm;': '‎', + 'lrtri;': '⊿', + 'lsaquo;': '‹', + 'lscr;': '𝓁', + 'lsh;': '↰', + 'lsim;': '≲', + 'lsime;': '⪍', + 'lsimg;': '⪏', + 'lsqb;': '[', + 'lsquo;': '‘', + 'lsquor;': '‚', + 'lstrok;': 'ł', + lt: '<', + 'lt;': '<', + 'ltcc;': '⪦', + 'ltcir;': '⩹', + 'ltdot;': '⋖', + 'lthree;': '⋋', + 'ltimes;': '⋉', + 'ltlarr;': '⥶', + 'ltquest;': '⩻', + 'ltrPar;': '⦖', + 'ltri;': '◃', + 'ltrie;': '⊴', + 'ltrif;': '◂', + 'lurdshar;': '⥊', + 'luruhar;': '⥦', + 'lvertneqq;': '≨︀', + 'lvnE;': '≨︀', + 'mDDot;': '∺', + macr: '¯', + 'macr;': '¯', + 'male;': '♂', + 'malt;': '✠', + 'maltese;': '✠', + 'map;': '↦', + 'mapsto;': '↦', + 'mapstodown;': '↧', + 'mapstoleft;': '↤', + 'mapstoup;': '↥', + 'marker;': '▮', + 'mcomma;': '⨩', + 'mcy;': 'м', + 'mdash;': '—', + 'measuredangle;': '∡', + 'mfr;': '𝔪', + 'mho;': '℧', + micro: 'µ', + 'micro;': 'µ', + 'mid;': '∣', + 'midast;': '*', + 'midcir;': '⫰', + middot: '·', + 'middot;': '·', + 'minus;': '−', + 'minusb;': '⊟', + 'minusd;': '∸', + 'minusdu;': '⨪', + 'mlcp;': '⫛', + 'mldr;': '…', + 'mnplus;': '∓', + 'models;': '⊧', + 'mopf;': '𝕞', + 'mp;': '∓', + 'mscr;': '𝓂', + 'mstpos;': '∾', + 'mu;': 'μ', + 'multimap;': '⊸', + 'mumap;': '⊸', + 'nGg;': '⋙̸', + 'nGt;': '≫⃒', + 'nGtv;': '≫̸', + 'nLeftarrow;': '⇍', + 'nLeftrightarrow;': '⇎', + 'nLl;': '⋘̸', + 'nLt;': '≪⃒', + 'nLtv;': '≪̸', + 'nRightarrow;': '⇏', + 'nVDash;': '⊯', + 'nVdash;': '⊮', + 'nabla;': '∇', + 'nacute;': 'ń', + 'nang;': '∠⃒', + 'nap;': '≉', + 'napE;': '⩰̸', + 'napid;': '≋̸', + 'napos;': 'ʼn', + 'napprox;': '≉', + 'natur;': '♮', + 'natural;': '♮', + 'naturals;': 'ℕ', + nbsp: ' ', + 'nbsp;': ' ', + 'nbump;': '≎̸', + 'nbumpe;': '≏̸', + 'ncap;': '⩃', + 'ncaron;': 'ň', + 'ncedil;': 'ņ', + 'ncong;': '≇', + 'ncongdot;': '⩭̸', + 'ncup;': '⩂', + 'ncy;': 'н', + 'ndash;': '–', + 'ne;': '≠', + 'neArr;': '⇗', + 'nearhk;': '⤤', + 'nearr;': '↗', + 'nearrow;': '↗', + 'nedot;': '≐̸', + 'nequiv;': '≢', + 'nesear;': '⤨', + 'nesim;': '≂̸', + 'nexist;': '∄', + 'nexists;': '∄', + 'nfr;': '𝔫', + 'ngE;': '≧̸', + 'nge;': '≱', + 'ngeq;': '≱', + 'ngeqq;': '≧̸', + 'ngeqslant;': '⩾̸', + 'nges;': '⩾̸', + 'ngsim;': '≵', + 'ngt;': '≯', + 'ngtr;': '≯', + 'nhArr;': '⇎', + 'nharr;': '↮', + 'nhpar;': '⫲', + 'ni;': '∋', + 'nis;': '⋼', + 'nisd;': '⋺', + 'niv;': '∋', + 'njcy;': 'њ', + 'nlArr;': '⇍', + 'nlE;': '≦̸', + 'nlarr;': '↚', + 'nldr;': '‥', + 'nle;': '≰', + 'nleftarrow;': '↚', + 'nleftrightarrow;': '↮', + 'nleq;': '≰', + 'nleqq;': '≦̸', + 'nleqslant;': '⩽̸', + 'nles;': '⩽̸', + 'nless;': '≮', + 'nlsim;': '≴', + 'nlt;': '≮', + 'nltri;': '⋪', + 'nltrie;': '⋬', + 'nmid;': '∤', + 'nopf;': '𝕟', + not: '¬', + 'not;': '¬', + 'notin;': '∉', + 'notinE;': '⋹̸', + 'notindot;': '⋵̸', + 'notinva;': '∉', + 'notinvb;': '⋷', + 'notinvc;': '⋶', + 'notni;': '∌', + 'notniva;': '∌', + 'notnivb;': '⋾', + 'notnivc;': '⋽', + 'npar;': '∦', + 'nparallel;': '∦', + 'nparsl;': '⫽⃥', + 'npart;': '∂̸', + 'npolint;': '⨔', + 'npr;': '⊀', + 'nprcue;': '⋠', + 'npre;': '⪯̸', + 'nprec;': '⊀', + 'npreceq;': '⪯̸', + 'nrArr;': '⇏', + 'nrarr;': '↛', + 'nrarrc;': '⤳̸', + 'nrarrw;': '↝̸', + 'nrightarrow;': '↛', + 'nrtri;': '⋫', + 'nrtrie;': '⋭', + 'nsc;': '⊁', + 'nsccue;': '⋡', + 'nsce;': '⪰̸', + 'nscr;': '𝓃', + 'nshortmid;': '∤', + 'nshortparallel;': '∦', + 'nsim;': '≁', + 'nsime;': '≄', + 'nsimeq;': '≄', + 'nsmid;': '∤', + 'nspar;': '∦', + 'nsqsube;': '⋢', + 'nsqsupe;': '⋣', + 'nsub;': '⊄', + 'nsubE;': '⫅̸', + 'nsube;': '⊈', + 'nsubset;': '⊂⃒', + 'nsubseteq;': '⊈', + 'nsubseteqq;': '⫅̸', + 'nsucc;': '⊁', + 'nsucceq;': '⪰̸', + 'nsup;': '⊅', + 'nsupE;': '⫆̸', + 'nsupe;': '⊉', + 'nsupset;': '⊃⃒', + 'nsupseteq;': '⊉', + 'nsupseteqq;': '⫆̸', + 'ntgl;': '≹', + ntilde: 'ñ', + 'ntilde;': 'ñ', + 'ntlg;': '≸', + 'ntriangleleft;': '⋪', + 'ntrianglelefteq;': '⋬', + 'ntriangleright;': '⋫', + 'ntrianglerighteq;': '⋭', + 'nu;': 'ν', + 'num;': '#', + 'numero;': '№', + 'numsp;': ' ', + 'nvDash;': '⊭', + 'nvHarr;': '⤄', + 'nvap;': '≍⃒', + 'nvdash;': '⊬', + 'nvge;': '≥⃒', + 'nvgt;': '>⃒', + 'nvinfin;': '⧞', + 'nvlArr;': '⤂', + 'nvle;': '≤⃒', + 'nvlt;': '<⃒', + 'nvltrie;': '⊴⃒', + 'nvrArr;': '⤃', + 'nvrtrie;': '⊵⃒', + 'nvsim;': '∼⃒', + 'nwArr;': '⇖', + 'nwarhk;': '⤣', + 'nwarr;': '↖', + 'nwarrow;': '↖', + 'nwnear;': '⤧', + 'oS;': 'Ⓢ', + oacute: 'ó', + 'oacute;': 'ó', + 'oast;': '⊛', + 'ocir;': '⊚', + ocirc: 'ô', + 'ocirc;': 'ô', + 'ocy;': 'о', + 'odash;': '⊝', + 'odblac;': 'ő', + 'odiv;': '⨸', + 'odot;': '⊙', + 'odsold;': '⦼', + 'oelig;': 'œ', + 'ofcir;': '⦿', + 'ofr;': '𝔬', + 'ogon;': '˛', + ograve: 'ò', + 'ograve;': 'ò', + 'ogt;': '⧁', + 'ohbar;': '⦵', + 'ohm;': 'Ω', + 'oint;': '∮', + 'olarr;': '↺', + 'olcir;': '⦾', + 'olcross;': '⦻', + 'oline;': '‾', + 'olt;': '⧀', + 'omacr;': 'ō', + 'omega;': 'ω', + 'omicron;': 'ο', + 'omid;': '⦶', + 'ominus;': '⊖', + 'oopf;': '𝕠', + 'opar;': '⦷', + 'operp;': '⦹', + 'oplus;': '⊕', + 'or;': '∨', + 'orarr;': '↻', + 'ord;': '⩝', + 'order;': 'ℴ', + 'orderof;': 'ℴ', + ordf: 'ª', + 'ordf;': 'ª', + ordm: 'º', + 'ordm;': 'º', + 'origof;': '⊶', + 'oror;': '⩖', + 'orslope;': '⩗', + 'orv;': '⩛', + 'oscr;': 'ℴ', + oslash: 'ø', + 'oslash;': 'ø', + 'osol;': '⊘', + otilde: 'õ', + 'otilde;': 'õ', + 'otimes;': '⊗', + 'otimesas;': '⨶', + ouml: 'ö', + 'ouml;': 'ö', + 'ovbar;': '⌽', + 'par;': '∥', + para: '¶', + 'para;': '¶', + 'parallel;': '∥', + 'parsim;': '⫳', + 'parsl;': '⫽', + 'part;': '∂', + 'pcy;': 'п', + 'percnt;': '%', + 'period;': '.', + 'permil;': '‰', + 'perp;': '⊥', + 'pertenk;': '‱', + 'pfr;': '𝔭', + 'phi;': 'φ', + 'phiv;': 'ϕ', + 'phmmat;': 'ℳ', + 'phone;': '☎', + 'pi;': 'π', + 'pitchfork;': '⋔', + 'piv;': 'ϖ', + 'planck;': 'ℏ', + 'planckh;': 'ℎ', + 'plankv;': 'ℏ', + 'plus;': '+', + 'plusacir;': '⨣', + 'plusb;': '⊞', + 'pluscir;': '⨢', + 'plusdo;': '∔', + 'plusdu;': '⨥', + 'pluse;': '⩲', + plusmn: '±', + 'plusmn;': '±', + 'plussim;': '⨦', + 'plustwo;': '⨧', + 'pm;': '±', + 'pointint;': '⨕', + 'popf;': '𝕡', + pound: '£', + 'pound;': '£', + 'pr;': '≺', + 'prE;': '⪳', + 'prap;': '⪷', + 'prcue;': '≼', + 'pre;': '⪯', + 'prec;': '≺', + 'precapprox;': '⪷', + 'preccurlyeq;': '≼', + 'preceq;': '⪯', + 'precnapprox;': '⪹', + 'precneqq;': '⪵', + 'precnsim;': '⋨', + 'precsim;': '≾', + 'prime;': '′', + 'primes;': 'ℙ', + 'prnE;': '⪵', + 'prnap;': '⪹', + 'prnsim;': '⋨', + 'prod;': '∏', + 'profalar;': '⌮', + 'profline;': '⌒', + 'profsurf;': '⌓', + 'prop;': '∝', + 'propto;': '∝', + 'prsim;': '≾', + 'prurel;': '⊰', + 'pscr;': '𝓅', + 'psi;': 'ψ', + 'puncsp;': ' ', + 'qfr;': '𝔮', + 'qint;': '⨌', + 'qopf;': '𝕢', + 'qprime;': '⁗', + 'qscr;': '𝓆', + 'quaternions;': 'ℍ', + 'quatint;': '⨖', + 'quest;': '?', + 'questeq;': '≟', + quot: '"', + 'quot;': '"', + 'rAarr;': '⇛', + 'rArr;': '⇒', + 'rAtail;': '⤜', + 'rBarr;': '⤏', + 'rHar;': '⥤', + 'race;': '∽̱', + 'racute;': 'ŕ', + 'radic;': '√', + 'raemptyv;': '⦳', + 'rang;': '⟩', + 'rangd;': '⦒', + 'range;': '⦥', + 'rangle;': '⟩', + raquo: '»', + 'raquo;': '»', + 'rarr;': '→', + 'rarrap;': '⥵', + 'rarrb;': '⇥', + 'rarrbfs;': '⤠', + 'rarrc;': '⤳', + 'rarrfs;': '⤞', + 'rarrhk;': '↪', + 'rarrlp;': '↬', + 'rarrpl;': '⥅', + 'rarrsim;': '⥴', + 'rarrtl;': '↣', + 'rarrw;': '↝', + 'ratail;': '⤚', + 'ratio;': '∶', + 'rationals;': 'ℚ', + 'rbarr;': '⤍', + 'rbbrk;': '❳', + 'rbrace;': '}', + 'rbrack;': ']', + 'rbrke;': '⦌', + 'rbrksld;': '⦎', + 'rbrkslu;': '⦐', + 'rcaron;': 'ř', + 'rcedil;': 'ŗ', + 'rceil;': '⌉', + 'rcub;': '}', + 'rcy;': 'р', + 'rdca;': '⤷', + 'rdldhar;': '⥩', + 'rdquo;': '”', + 'rdquor;': '”', + 'rdsh;': '↳', + 'real;': 'ℜ', + 'realine;': 'ℛ', + 'realpart;': 'ℜ', + 'reals;': 'ℝ', + 'rect;': '▭', + reg: '®', + 'reg;': '®', + 'rfisht;': '⥽', + 'rfloor;': '⌋', + 'rfr;': '𝔯', + 'rhard;': '⇁', + 'rharu;': '⇀', + 'rharul;': '⥬', + 'rho;': 'ρ', + 'rhov;': 'ϱ', + 'rightarrow;': '→', + 'rightarrowtail;': '↣', + 'rightharpoondown;': '⇁', + 'rightharpoonup;': '⇀', + 'rightleftarrows;': '⇄', + 'rightleftharpoons;': '⇌', + 'rightrightarrows;': '⇉', + 'rightsquigarrow;': '↝', + 'rightthreetimes;': '⋌', + 'ring;': '˚', + 'risingdotseq;': '≓', + 'rlarr;': '⇄', + 'rlhar;': '⇌', + 'rlm;': '‏', + 'rmoust;': '⎱', + 'rmoustache;': '⎱', + 'rnmid;': '⫮', + 'roang;': '⟭', + 'roarr;': '⇾', + 'robrk;': '⟧', + 'ropar;': '⦆', + 'ropf;': '𝕣', + 'roplus;': '⨮', + 'rotimes;': '⨵', + 'rpar;': ')', + 'rpargt;': '⦔', + 'rppolint;': '⨒', + 'rrarr;': '⇉', + 'rsaquo;': '›', + 'rscr;': '𝓇', + 'rsh;': '↱', + 'rsqb;': ']', + 'rsquo;': '’', + 'rsquor;': '’', + 'rthree;': '⋌', + 'rtimes;': '⋊', + 'rtri;': '▹', + 'rtrie;': '⊵', + 'rtrif;': '▸', + 'rtriltri;': '⧎', + 'ruluhar;': '⥨', + 'rx;': '℞', + 'sacute;': 'ś', + 'sbquo;': '‚', + 'sc;': '≻', + 'scE;': '⪴', + 'scap;': '⪸', + 'scaron;': 'š', + 'sccue;': '≽', + 'sce;': '⪰', + 'scedil;': 'ş', + 'scirc;': 'ŝ', + 'scnE;': '⪶', + 'scnap;': '⪺', + 'scnsim;': '⋩', + 'scpolint;': '⨓', + 'scsim;': '≿', + 'scy;': 'с', + 'sdot;': '⋅', + 'sdotb;': '⊡', + 'sdote;': '⩦', + 'seArr;': '⇘', + 'searhk;': '⤥', + 'searr;': '↘', + 'searrow;': '↘', + sect: '§', + 'sect;': '§', + 'semi;': ';', + 'seswar;': '⤩', + 'setminus;': '∖', + 'setmn;': '∖', + 'sext;': '✶', + 'sfr;': '𝔰', + 'sfrown;': '⌢', + 'sharp;': '♯', + 'shchcy;': 'щ', + 'shcy;': 'ш', + 'shortmid;': '∣', + 'shortparallel;': '∥', + shy: '­', + 'shy;': '­', + 'sigma;': 'σ', + 'sigmaf;': 'ς', + 'sigmav;': 'ς', + 'sim;': '∼', + 'simdot;': '⩪', + 'sime;': '≃', + 'simeq;': '≃', + 'simg;': '⪞', + 'simgE;': '⪠', + 'siml;': '⪝', + 'simlE;': '⪟', + 'simne;': '≆', + 'simplus;': '⨤', + 'simrarr;': '⥲', + 'slarr;': '←', + 'smallsetminus;': '∖', + 'smashp;': '⨳', + 'smeparsl;': '⧤', + 'smid;': '∣', + 'smile;': '⌣', + 'smt;': '⪪', + 'smte;': '⪬', + 'smtes;': '⪬︀', + 'softcy;': 'ь', + 'sol;': '/', + 'solb;': '⧄', + 'solbar;': '⌿', + 'sopf;': '𝕤', + 'spades;': '♠', + 'spadesuit;': '♠', + 'spar;': '∥', + 'sqcap;': '⊓', + 'sqcaps;': '⊓︀', + 'sqcup;': '⊔', + 'sqcups;': '⊔︀', + 'sqsub;': '⊏', + 'sqsube;': '⊑', + 'sqsubset;': '⊏', + 'sqsubseteq;': '⊑', + 'sqsup;': '⊐', + 'sqsupe;': '⊒', + 'sqsupset;': '⊐', + 'sqsupseteq;': '⊒', + 'squ;': '□', + 'square;': '□', + 'squarf;': '▪', + 'squf;': '▪', + 'srarr;': '→', + 'sscr;': '𝓈', + 'ssetmn;': '∖', + 'ssmile;': '⌣', + 'sstarf;': '⋆', + 'star;': '☆', + 'starf;': '★', + 'straightepsilon;': 'ϵ', + 'straightphi;': 'ϕ', + 'strns;': '¯', + 'sub;': '⊂', + 'subE;': '⫅', + 'subdot;': '⪽', + 'sube;': '⊆', + 'subedot;': '⫃', + 'submult;': '⫁', + 'subnE;': '⫋', + 'subne;': '⊊', + 'subplus;': '⪿', + 'subrarr;': '⥹', + 'subset;': '⊂', + 'subseteq;': '⊆', + 'subseteqq;': '⫅', + 'subsetneq;': '⊊', + 'subsetneqq;': '⫋', + 'subsim;': '⫇', + 'subsub;': '⫕', + 'subsup;': '⫓', + 'succ;': '≻', + 'succapprox;': '⪸', + 'succcurlyeq;': '≽', + 'succeq;': '⪰', + 'succnapprox;': '⪺', + 'succneqq;': '⪶', + 'succnsim;': '⋩', + 'succsim;': '≿', + 'sum;': '∑', + 'sung;': '♪', + sup1: '¹', + 'sup1;': '¹', + sup2: '²', + 'sup2;': '²', + sup3: '³', + 'sup3;': '³', + 'sup;': '⊃', + 'supE;': '⫆', + 'supdot;': '⪾', + 'supdsub;': '⫘', + 'supe;': '⊇', + 'supedot;': '⫄', + 'suphsol;': '⟉', + 'suphsub;': '⫗', + 'suplarr;': '⥻', + 'supmult;': '⫂', + 'supnE;': '⫌', + 'supne;': '⊋', + 'supplus;': '⫀', + 'supset;': '⊃', + 'supseteq;': '⊇', + 'supseteqq;': '⫆', + 'supsetneq;': '⊋', + 'supsetneqq;': '⫌', + 'supsim;': '⫈', + 'supsub;': '⫔', + 'supsup;': '⫖', + 'swArr;': '⇙', + 'swarhk;': '⤦', + 'swarr;': '↙', + 'swarrow;': '↙', + 'swnwar;': '⤪', + szlig: 'ß', + 'szlig;': 'ß', + 'target;': '⌖', + 'tau;': 'τ', + 'tbrk;': '⎴', + 'tcaron;': 'ť', + 'tcedil;': 'ţ', + 'tcy;': 'т', + 'tdot;': '⃛', + 'telrec;': '⌕', + 'tfr;': '𝔱', + 'there4;': '∴', + 'therefore;': '∴', + 'theta;': 'θ', + 'thetasym;': 'ϑ', + 'thetav;': 'ϑ', + 'thickapprox;': '≈', + 'thicksim;': '∼', + 'thinsp;': ' ', + 'thkap;': '≈', + 'thksim;': '∼', + thorn: 'þ', + 'thorn;': 'þ', + 'tilde;': '˜', + times: '×', + 'times;': '×', + 'timesb;': '⊠', + 'timesbar;': '⨱', + 'timesd;': '⨰', + 'tint;': '∭', + 'toea;': '⤨', + 'top;': '⊤', + 'topbot;': '⌶', + 'topcir;': '⫱', + 'topf;': '𝕥', + 'topfork;': '⫚', + 'tosa;': '⤩', + 'tprime;': '‴', + 'trade;': '™', + 'triangle;': '▵', + 'triangledown;': '▿', + 'triangleleft;': '◃', + 'trianglelefteq;': '⊴', + 'triangleq;': '≜', + 'triangleright;': '▹', + 'trianglerighteq;': '⊵', + 'tridot;': '◬', + 'trie;': '≜', + 'triminus;': '⨺', + 'triplus;': '⨹', + 'trisb;': '⧍', + 'tritime;': '⨻', + 'trpezium;': '⏢', + 'tscr;': '𝓉', + 'tscy;': 'ц', + 'tshcy;': 'ћ', + 'tstrok;': 'ŧ', + 'twixt;': '≬', + 'twoheadleftarrow;': '↞', + 'twoheadrightarrow;': '↠', + 'uArr;': '⇑', + 'uHar;': '⥣', + uacute: 'ú', + 'uacute;': 'ú', + 'uarr;': '↑', + 'ubrcy;': 'ў', + 'ubreve;': 'ŭ', + ucirc: 'û', + 'ucirc;': 'û', + 'ucy;': 'у', + 'udarr;': '⇅', + 'udblac;': 'ű', + 'udhar;': '⥮', + 'ufisht;': '⥾', + 'ufr;': '𝔲', + ugrave: 'ù', + 'ugrave;': 'ù', + 'uharl;': '↿', + 'uharr;': '↾', + 'uhblk;': '▀', + 'ulcorn;': '⌜', + 'ulcorner;': '⌜', + 'ulcrop;': '⌏', + 'ultri;': '◸', + 'umacr;': 'ū', + uml: '¨', + 'uml;': '¨', + 'uogon;': 'ų', + 'uopf;': '𝕦', + 'uparrow;': '↑', + 'updownarrow;': '↕', + 'upharpoonleft;': '↿', + 'upharpoonright;': '↾', + 'uplus;': '⊎', + 'upsi;': 'υ', + 'upsih;': 'ϒ', + 'upsilon;': 'υ', + 'upuparrows;': '⇈', + 'urcorn;': '⌝', + 'urcorner;': '⌝', + 'urcrop;': '⌎', + 'uring;': 'ů', + 'urtri;': '◹', + 'uscr;': '𝓊', + 'utdot;': '⋰', + 'utilde;': 'ũ', + 'utri;': '▵', + 'utrif;': '▴', + 'uuarr;': '⇈', + uuml: 'ü', + 'uuml;': 'ü', + 'uwangle;': '⦧', + 'vArr;': '⇕', + 'vBar;': '⫨', + 'vBarv;': '⫩', + 'vDash;': '⊨', + 'vangrt;': '⦜', + 'varepsilon;': 'ϵ', + 'varkappa;': 'ϰ', + 'varnothing;': '∅', + 'varphi;': 'ϕ', + 'varpi;': 'ϖ', + 'varpropto;': '∝', + 'varr;': '↕', + 'varrho;': 'ϱ', + 'varsigma;': 'ς', + 'varsubsetneq;': '⊊︀', + 'varsubsetneqq;': '⫋︀', + 'varsupsetneq;': '⊋︀', + 'varsupsetneqq;': '⫌︀', + 'vartheta;': 'ϑ', + 'vartriangleleft;': '⊲', + 'vartriangleright;': '⊳', + 'vcy;': 'в', + 'vdash;': '⊢', + 'vee;': '∨', + 'veebar;': '⊻', + 'veeeq;': '≚', + 'vellip;': '⋮', + 'verbar;': '|', + 'vert;': '|', + 'vfr;': '𝔳', + 'vltri;': '⊲', + 'vnsub;': '⊂⃒', + 'vnsup;': '⊃⃒', + 'vopf;': '𝕧', + 'vprop;': '∝', + 'vrtri;': '⊳', + 'vscr;': '𝓋', + 'vsubnE;': '⫋︀', + 'vsubne;': '⊊︀', + 'vsupnE;': '⫌︀', + 'vsupne;': '⊋︀', + 'vzigzag;': '⦚', + 'wcirc;': 'ŵ', + 'wedbar;': '⩟', + 'wedge;': '∧', + 'wedgeq;': '≙', + 'weierp;': '℘', + 'wfr;': '𝔴', + 'wopf;': '𝕨', + 'wp;': '℘', + 'wr;': '≀', + 'wreath;': '≀', + 'wscr;': '𝓌', + 'xcap;': '⋂', + 'xcirc;': '◯', + 'xcup;': '⋃', + 'xdtri;': '▽', + 'xfr;': '𝔵', + 'xhArr;': '⟺', + 'xharr;': '⟷', + 'xi;': 'ξ', + 'xlArr;': '⟸', + 'xlarr;': '⟵', + 'xmap;': '⟼', + 'xnis;': '⋻', + 'xodot;': '⨀', + 'xopf;': '𝕩', + 'xoplus;': '⨁', + 'xotime;': '⨂', + 'xrArr;': '⟹', + 'xrarr;': '⟶', + 'xscr;': '𝓍', + 'xsqcup;': '⨆', + 'xuplus;': '⨄', + 'xutri;': '△', + 'xvee;': '⋁', + 'xwedge;': '⋀', + yacute: 'ý', + 'yacute;': 'ý', + 'yacy;': 'я', + 'ycirc;': 'ŷ', + 'ycy;': 'ы', + yen: '¥', + 'yen;': '¥', + 'yfr;': '𝔶', + 'yicy;': 'ї', + 'yopf;': '𝕪', + 'yscr;': '𝓎', + 'yucy;': 'ю', + yuml: 'ÿ', + 'yuml;': 'ÿ', + 'zacute;': 'ź', + 'zcaron;': 'ž', + 'zcy;': 'з', + 'zdot;': 'ż', + 'zeetrf;': 'ℨ', + 'zeta;': 'ζ', + 'zfr;': '𝔷', + 'zhcy;': 'ж', + 'zigrarr;': '⇝', + 'zopf;': '𝕫', + 'zscr;': '𝓏', + 'zwj;': '‍', + 'zwnj;': '‌' +}; + +const numeric = /&#(x)?([0-9a-f]+);/i; +const named = new RegExp( + `&(${Object.keys(entities) + .sort((a, b) => b.length - a.length) + .join('|')})`, + 'g' +); + +/** @param {string} str */ +export function decode(str) { + return str + .replace(numeric, (_match, hex, code) => String.fromCharCode(hex ? parseInt(code, 16) : +code)) + .replace(named, (_match, entity) => entities[entity]); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js new file mode 100644 index 0000000000000000000000000000000000000000..02e4daabc41ff4389675af5ff6cc6019057a6d14 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/fallback.js @@ -0,0 +1,54 @@ +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { installPolyfills } from '../../exports/node/polyfills.js'; +import { forked } from '../../utils/fork.js'; + +export default forked(import.meta.url, generate_fallback); + +/** + * @param {{ + * manifest_path: string; + * env: Record + * out_dir: string; + * origin: string; + * assets: string; + * }} opts + */ +async function generate_fallback({ manifest_path, env, out_dir, origin, assets }) { + installPolyfills(); + + const server_root = join(out_dir, 'output'); + + /** @type {import('types').ServerInternalModule} */ + const { set_building } = await import(pathToFileURL(`${server_root}/server/internal.js`).href); + + /** @type {import('types').ServerModule} */ + const { Server } = await import(pathToFileURL(`${server_root}/server/index.js`).href); + + /** @type {import('@sveltejs/kit').SSRManifest} */ + const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; + + set_building(); + + const server = new Server(manifest); + await server.init({ env }); + + const response = await server.respond(new Request(origin + '/[fallback]'), { + getClientAddress: () => { + throw new Error('Cannot read clientAddress during prerendering'); + }, + prerendering: { + fallback: true, + dependencies: new Map(), + remote_responses: new Map() + }, + read: (file) => readFileSync(join(assets, file)) + }); + + if (response.ok) { + return await response.text(); + } + + throw new Error(`Could not create a fallback page — failed with status ${response.status}`); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js new file mode 100644 index 0000000000000000000000000000000000000000..f03e80cd7e8f3b5cf24573a39c73d861a2d9e3c6 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js @@ -0,0 +1,624 @@ +import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { installPolyfills } from '../../exports/node/polyfills.js'; +import { mkdirp, posixify, walk } from '../../utils/filesystem.js'; +import { noop } from '../../utils/functions.js'; +import { decode_uri, is_root_relative, resolve } from '../../utils/url.js'; +import { escape_html } from '../../utils/escape.js'; +import { logger } from '../utils.js'; +import { load_config } from '../config/index.js'; +import { get_route_segments } from '../../utils/routing.js'; +import { queue } from './queue.js'; +import { crawl } from './crawl.js'; +import { forked } from '../../utils/fork.js'; +import * as devalue from 'devalue'; +import { createReadableStream } from '@sveltejs/kit/node'; +import generate_fallback from './fallback.js'; +import { stringify_remote_arg } from '../../runtime/shared.js'; +import { filter_env } from '../../utils/env.js'; + +export default forked(import.meta.url, prerender); + +// https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment +// "If fragment is the empty string, then return the special value top of the document." +// ...and +// "If decodedFragment is an ASCII case-insensitive match for the string 'top', then return the top of the document." +const SPECIAL_HASHLINKS = new Set(['', 'top']); + +/** + * @param {{ + * hash: boolean; + * out: string; + * manifest_path: string; + * metadata: import('types').ServerMetadata; + * verbose: boolean; + * env: Record + * }} opts + */ +async function prerender({ hash, out, manifest_path, metadata, verbose, env }) { + /** @type {import('@sveltejs/kit').SSRManifest} */ + const manifest = (await import(pathToFileURL(manifest_path).href)).manifest; + + /** @type {import('types').ServerInternalModule} */ + const internal = await import(pathToFileURL(`${out}/server/internal.js`).href); + + // configure `import { building } from '$app/environment'` and `$app/env` — + // essential we do this before analysing the code + internal.set_building(); + internal.set_prerendering(); + + /** @type {import('__sveltekit/env')} */ + const { set_env } = await import(pathToFileURL(`${out}/server/env.js`).href); + set_env(env); + + /** @type {import('types').ServerModule} */ + const { Server } = await import(pathToFileURL(`${out}/server/index.js`).href); + + /** + * @template {{message: string}} T + * @template {Omit} K + * @param {import('types').Logger} log + * @param {'fail' | 'warn' | 'ignore' | ((details: T) => void)} input + * @param {(details: K) => string} format + * @returns {(details: K) => void} + */ + function normalise_error_handler(log, input, format) { + switch (input) { + case 'fail': + return (details) => { + throw new Error(format(details)); + }; + case 'warn': + return (details) => { + log.error(format(details)); + }; + case 'ignore': + return noop; + default: + // @ts-expect-error TS thinks T might be of a different kind, but it's not + return (details) => input({ ...details, message: format(details) }); + } + } + + const OK = 2; + const REDIRECT = 3; + + /** @type {import('types').Prerendered} */ + const prerendered = { + pages: new Map(), + assets: new Map(), + redirects: new Map(), + paths: [] + }; + + /** @type {import('types').PrerenderMap} */ + const prerender_map = new Map(); + + for (const [id, { prerender }] of metadata.routes) { + if (prerender !== undefined) { + prerender_map.set(id, prerender); + } + } + + /** @type {Set} */ + const prerendered_routes = new Set(); + + /** @type {import('types').ValidatedKitConfig} */ + const config = (await load_config()).kit; + + if (hash) { + const fallback = await generate_fallback({ + manifest_path, + env, + out_dir: config.outDir, + origin: config.prerender.origin, + assets: config.files.assets + }); + + const file = output_filename('/', true); + const dest = `${config.outDir}/output/prerendered/pages/${file}`; + + mkdirp(dirname(dest)); + writeFileSync(dest, fallback); + + prerendered.pages.set('/', { file }); + + return { prerendered, prerender_map }; + } + + const emulator = await config.adapter?.emulate?.(); + + /** @type {import('types').Logger} */ + const log = logger({ verbose }); + + installPolyfills(); + + /** @type {Map} */ + const saved = new Map(); + + const handle_http_error = normalise_error_handler( + log, + config.prerender.handleHttpError, + ({ status, path, referrer, referenceType }) => { + const message = + status === 404 && !path.startsWith(config.paths.base) + ? `${path} does not begin with \`base\`, which is configured in \`paths.base\` and can be imported from \`$app/paths\` - see https://svelte.dev/docs/kit/configuration#paths for more info` + : path; + + return `${status} ${message}${referrer ? ` (${referenceType} from ${referrer})` : ''}`; + } + ); + + const handle_missing_id = normalise_error_handler( + log, + config.prerender.handleMissingId, + ({ path, id, referrers }) => { + return ( + `The following pages contain links to ${path}#${id}, but no element with id="${id}" exists on ${path} - see the \`handleMissingId\` option in https://svelte.dev/docs/kit/configuration#prerender for more info:` + + referrers.map((l) => `\n - ${l}`).join('') + ); + } + ); + + const handle_entry_generator_mismatch = normalise_error_handler( + log, + config.prerender.handleEntryGeneratorMismatch, + ({ generatedFromId, entry, matchedId }) => { + return `The entries export from ${generatedFromId} generated entry ${entry}, which was matched by ${matchedId} - see the \`handleEntryGeneratorMismatch\` option in https://svelte.dev/docs/kit/configuration#prerender for more info.`; + } + ); + + const handle_not_prerendered_route = normalise_error_handler( + log, + config.prerender.handleUnseenRoutes, + ({ routes }) => { + const list = routes.map((id) => ` - ${id}`).join('\n'); + return `The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:\n${list}\n\nSee the \`handleUnseenRoutes\` option in https://svelte.dev/docs/kit/configuration#prerender for more info.`; + } + ); + + const handle_invalid_url = normalise_error_handler( + log, + config.prerender.handleInvalidUrl, + ({ href, referrer }) => { + return `Invalid URL ${href}${referrer ? ` (linked from ${referrer})` : ''}`; + } + ); + + const q = queue(config.prerender.concurrency); + + /** + * @param {string} path + * @param {boolean} is_html + */ + function output_filename(path, is_html) { + const file = path.slice(config.paths.base.length + 1) || 'index.html'; + + if (is_html && !file.endsWith('.html')) { + return file + (file.endsWith('/') ? 'index.html' : '.html'); + } + + return file; + } + + const files = new Set(walk(`${out}/client`).map(posixify)); + files.add(`${config.appDir}/env.js`); + + const immutable = `${config.appDir}/immutable`; + if (existsSync(`${out}/server/${immutable}`)) { + for (const file of walk(`${out}/server/${immutable}`)) { + files.add(posixify(`${config.appDir}/immutable/${file}`)); + } + } + + const remote_prefix = `${config.paths.base}/${config.appDir}/remote/`; + + const seen = new Set(); + const written = new Set(); + + /** @type {Map>} */ + const remote_responses = new Map(); + + /** @type {Map>} */ + const expected_hashlinks = new Map(); + + /** @type {Map} */ + const actual_hashlinks = new Map(); + + /** + * @param {string | null} referrer + * @param {string} decoded + * @param {string} [encoded] + * @param {string} [generated_from_id] + */ + function enqueue(referrer, decoded, encoded, generated_from_id) { + if (seen.has(decoded)) return; + seen.add(decoded); + + const file = decoded.slice(config.paths.base.length + 1); + if (files.has(file)) return; + + return q.add(() => visit(decoded, encoded || encodeURI(decoded), referrer, generated_from_id)); + } + + /** + * @param {string} decoded + * @param {string} encoded + * @param {string?} referrer + * @param {string} [generated_from_id] + */ + async function visit(decoded, encoded, referrer, generated_from_id) { + if (!decoded.startsWith(config.paths.base)) { + handle_http_error({ status: 404, path: decoded, referrer, referenceType: 'linked' }); + return; + } + + /** @type {Map} */ + const dependencies = new Map(); + + const response = await server.respond(new Request(config.prerender.origin + encoded), { + getClientAddress() { + throw new Error('Cannot read clientAddress during prerendering'); + }, + prerendering: { + dependencies, + remote_responses + }, + read: (file) => { + // stuff we just wrote + const filepath = saved.get(file); + if (filepath) return readFileSync(filepath); + + // Static assets emitted during build + if (file.startsWith(config.appDir)) { + return readFileSync(`${out}/server/${file}`); + } + + // stuff in `static` + return readFileSync(join(config.files.assets, file)); + }, + emulator + }); + + const encoded_id = response.headers.get('x-sveltekit-routeid'); + const decoded_id = encoded_id && decode_uri(encoded_id); + if ( + decoded_id !== null && + generated_from_id !== undefined && + decoded_id !== generated_from_id + ) { + handle_entry_generator_mismatch({ + generatedFromId: generated_from_id, + entry: decoded, + matchedId: decoded_id + }); + } + + const body = Buffer.from(await response.arrayBuffer()); + + const category = decoded.startsWith(remote_prefix) ? 'data' : 'pages'; + save(category, response, body, decoded, encoded, referrer, 'linked'); + + for (const [dependency_path, result] of dependencies) { + // this seems circuitous, but using new URL allows us to not care + // whether dependency_path is encoded or not + const encoded_dependency_path = new URL(dependency_path, 'http://localhost').pathname; + const decoded_dependency_path = decode_uri(encoded_dependency_path); + + const headers = Object.fromEntries(result.response.headers); + + const prerender = headers['x-sveltekit-prerender']; + if (prerender) { + const encoded_route_id = headers['x-sveltekit-routeid']; + if (encoded_route_id != null) { + const route_id = decode_uri(encoded_route_id); + const existing_value = prerender_map.get(route_id); + if (existing_value !== 'auto') { + prerender_map.set(route_id, prerender === 'true' ? true : 'auto'); + } + } + } + + const body = result.body ?? new Uint8Array(await result.response.arrayBuffer()); + + const category = decoded_dependency_path.startsWith(remote_prefix) ? 'data' : 'dependencies'; + + save( + category, + result.response, + body, + decoded_dependency_path, + encoded_dependency_path, + decoded, + 'fetched' + ); + } + + // avoid triggering `filterSerializeResponseHeaders` guard + const headers = Object.fromEntries(response.headers); + + // if it's a 200 HTML response, crawl it. Skip error responses, as we don't save those + if (response.ok && config.prerender.crawl && headers['content-type'] === 'text/html') { + const { ids, hrefs, invalid } = crawl(body.toString(), decoded); + + for (const href of invalid) { + handle_invalid_url({ href, referrer: decoded }); + } + + actual_hashlinks.set(decoded, ids); + + /** @param {string} href */ + const removePrerenderOrigin = (href) => { + if (href.startsWith(config.prerender.origin)) { + if (href === config.prerender.origin) return '/'; + if (href.at(config.prerender.origin.length) !== '/') return href; + return href.slice(config.prerender.origin.length); + } + return href; + }; + + for (const href of hrefs.map(removePrerenderOrigin)) { + if (!is_root_relative(href)) continue; + + const { pathname, search, hash } = new URL(href, 'http://localhost'); + + if (search) { + // TODO warn that query strings have no effect on statically-exported pages + } + + if (hash) { + const key = decode_uri(pathname + hash); + + if (!expected_hashlinks.has(key)) { + expected_hashlinks.set(key, new Set()); + } + + /** @type {Set} */ (expected_hashlinks.get(key)).add(decoded); + } + + void enqueue(decoded, decode_uri(pathname), pathname); + } + } + } + + /** + * @param {'pages' | 'dependencies' | 'data'} category + * @param {Response} response + * @param {string | Uint8Array} body + * @param {string} decoded + * @param {string} encoded + * @param {string | null} referrer + * @param {'linked' | 'fetched'} referenceType + */ + function save(category, response, body, decoded, encoded, referrer, referenceType) { + const response_type = Math.floor(response.status / 100); + const headers = Object.fromEntries(response.headers); + + const type = headers['content-type']; + const is_html = response_type === REDIRECT || type === 'text/html'; + + if (!is_html && response.status === 200 && decoded.slice(config.paths.base.length + 1) === '') { + throw new Error( + `Cannot prerender a root +server.js that returns a non-HTML response - static hosts always serve an HTML file for \`${config.paths.base || '/'}\`` + ); + } + + const file = output_filename(decoded, is_html); + const dest = `${config.outDir}/output/prerendered/${category}/${file}`; + + if (written.has(file)) return; + + const encoded_route_id = response.headers.get('x-sveltekit-routeid'); + const route_id = encoded_route_id != null ? decode_uri(encoded_route_id) : null; + if (route_id !== null) prerendered_routes.add(route_id); + + if (response_type === REDIRECT) { + const location = headers['location']; + + if (location) { + const resolved = resolve(encoded, location); + if (is_root_relative(resolved)) { + void enqueue(decoded, decode_uri(resolved), resolved); + } + + if (!headers['x-sveltekit-normalize']) { + mkdirp(dirname(dest)); + + log.warn(`${response.status} ${decoded} -> ${location}`); + + writeFileSync( + dest, + `` + ); + + written.add(file); + + if (!prerendered.redirects.has(decoded)) { + prerendered.redirects.set(decoded, { + status: response.status, + location: resolved + }); + + prerendered.paths.push(decoded); + } + } + } else { + log.warn(`location header missing on redirect received from ${decoded}`); + } + + return; + } + + if (response.status === 200) { + if (existsSync(dest) && statSync(dest).isDirectory()) { + throw new Error( + `Cannot save ${decoded} as it is already a directory. See https://svelte.dev/docs/kit/page-options#prerender-route-conflicts for more information` + ); + } + + const dir = dirname(dest); + + if (existsSync(dir) && !statSync(dir).isDirectory()) { + const parent = decoded.split('/').slice(0, -1).join('/'); + throw new Error( + `Cannot save ${decoded} as ${parent} is already a file. See https://svelte.dev/docs/kit/page-options#prerender-route-conflicts for more information` + ); + } + + mkdirp(dir); + + log.info(`${response.status} ${decoded}`); + writeFileSync(dest, body); + written.add(file); + + if (is_html) { + prerendered.pages.set(decoded, { + file + }); + } else { + prerendered.assets.set(decoded, { + type + }); + } + + prerendered.paths.push(decoded); + } else if (response_type !== OK) { + handle_http_error({ status: response.status, path: decoded, referrer, referenceType }); + } + + manifest.assets.add(file); + saved.set(file, dest); + } + + /** @type {Array<{ id: string, entries: Array}>} */ + const route_level_entries = []; + for (const [id, { entries }] of metadata.routes.entries()) { + if (entries) { + route_level_entries.push({ id, entries }); + } + } + + let should_prerender = false; + + for (const value of prerender_map.values()) { + if (value) { + should_prerender = true; + break; + } + } + + // the user's remote function modules may reference environment variables, + // `read` or the `manifest` at the top-level so we need to set them before + // evaluating those modules to avoid potential runtime errors + const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; + const private_env = filter_env(env, private_prefix, public_prefix); + const public_env = filter_env(env, public_prefix, private_prefix); + internal.set_private_env(private_env); + internal.set_public_env(public_env); + internal.set_manifest(manifest); + internal.set_read_implementation((file) => createReadableStream(`${out}/server/${file}`)); + + /** @type {Array} */ + const prerender_functions = []; + + for (const loader of Object.values(manifest._.remotes)) { + const module = await loader(); + + for (const fn of Object.values(module.default)) { + if (fn?.__?.type === 'prerender') { + prerender_functions.push(fn.__); + should_prerender = true; + } + } + } + + if (!should_prerender) { + return { prerendered, prerender_map }; + } + + // only run the server after the `should_prerender` check so that we + // don't run the user's init hook unnecessarily + const server = new Server(manifest); + await server.init({ + env, + read: (file) => createReadableStream(`${config.outDir}/output/server/${file}`) + }); + + log.info('Prerendering'); + + for (const entry of config.prerender.entries) { + if (entry === '*') { + for (const [id, prerender] of prerender_map) { + if (prerender) { + // remove optional parameters from the route + const segments = get_route_segments(id).filter((segment) => !segment.startsWith('[[')); + const processed_id = '/' + segments.join('/'); + + if (processed_id.includes('[')) continue; + const path = `/${get_route_segments(processed_id).join('/')}`; + void enqueue(null, config.paths.base + path); + } + } + } else { + void enqueue(null, config.paths.base + entry); + } + } + + for (const { id, entries } of route_level_entries) { + for (const entry of entries) { + void enqueue(null, config.paths.base + entry, undefined, id); + } + } + + const transport = (await internal.get_hooks()).transport ?? {}; + for (const internals of prerender_functions) { + if (internals.has_arg) { + for (const arg of (await internals.inputs?.()) ?? []) { + void enqueue( + null, + remote_prefix + internals.id + '/' + stringify_remote_arg(arg, transport) + ); + } + } else { + void enqueue(null, remote_prefix + internals.id); + } + } + + await q.done(); + + // handle invalid fragment links + for (const [key, referrers] of expected_hashlinks) { + const index = key.indexOf('#'); + const path = key.slice(0, index); + const id = key.slice(index + 1); + + const hashlinks = actual_hashlinks.get(path); + // ignore fragment links to pages that were not prerendered + if (!hashlinks) continue; + + if (!hashlinks.includes(id) && !SPECIAL_HASHLINKS.has(id)) { + handle_missing_id({ id, path, referrers: Array.from(referrers) }); + } + } + + /** @type {string[]} */ + const not_prerendered = []; + + for (const [route_id, prerender] of prerender_map) { + if (prerender === true && !prerendered_routes.has(route_id)) { + not_prerendered.push(route_id); + } + } + + if (not_prerendered.length > 0) { + handle_not_prerendered_route({ routes: not_prerendered }); + } + + return { prerendered, prerender_map }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/queue.js b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/queue.js new file mode 100644 index 0000000000000000000000000000000000000000..a816e6eb2350c16835e99509e0c4bca2b116640d --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/postbuild/queue.js @@ -0,0 +1,72 @@ +/** @import { PromiseWithResolvers } from '../../utils/promise.js' */ +import { with_resolvers } from '../../utils/promise.js'; + +/** + * @typedef {{ + * fn: () => Promise, + * fulfil: (value: any) => void, + * reject: (error: Error) => void + * }} Task + */ + +/** @param {number} concurrency */ +export function queue(concurrency) { + /** @type {Task[]} */ + const tasks = []; + const { promise, resolve, reject } = /** @type {PromiseWithResolvers} */ (with_resolvers()); + + let current = 0; + let closed = false; + + promise.catch(() => { + // this is necessary in case a catch handler is never added + // to the done promise by the user + }); + + function dequeue() { + if (current < concurrency) { + const task = tasks.shift(); + + if (task) { + current += 1; + const promise = Promise.resolve(task.fn()); + + void promise + .then(task.fulfil, (err) => { + task.reject(err); + reject(err); + }) + .then(() => { + current -= 1; + dequeue(); + }); + } else if (current === 0) { + closed = true; + resolve(); + } + } + } + + return { + /** @param {() => any} fn */ + add: (fn) => { + if (closed) throw new Error('Cannot add tasks to a queue that has ended'); + + const promise = new Promise((fulfil, reject) => { + tasks.push({ fn, fulfil, reject }); + }); + + dequeue(); + return promise; + }, + + done: () => { + if (current === 0) { + closed = true; + resolve(); + } + + return promise; + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/conflict.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/conflict.js new file mode 100644 index 0000000000000000000000000000000000000000..64a374491e76e2eefbb1d366b1258fd161d30710 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/conflict.js @@ -0,0 +1,72 @@ +/** @param {import('types').RouteData[]} routes */ +export function prevent_conflicts(routes) { + /** @type {Map} */ + const lookup = new Map(); + + for (const route of routes) { + if (!route.leaf && !route.endpoint) continue; + + /** @type {string[]} */ + let permutations; + + const normalized = normalize_route_id(route.id); + + const ends_with_optional = /<\?.+?>$/.test(normalized); + if (!ends_with_optional && Array.from(normalized.matchAll(/<\?.+?>/g)).length) { + // find all permutations created by optional parameters + const split = normalized.split(/<\?(.+?)>/g); + + permutations = [/** @type {string} */ (split[0])]; + + // turn `x/[[optional]]/y` into `x/y` and `x/[required]/y` + for (let i = 1; i < split.length; i += 2) { + const matcher = split[i]; + const next = split[i + 1]; + + permutations = permutations.reduce((a, b) => { + a.push(b + next); + if (!(matcher === '*' && b.endsWith('//'))) a.push(b + `<${matcher}>${next}`); + return a; + }, /** @type {string[]} */ ([])); + } + } else { + permutations = [normalized]; + } + + for (const permutation of permutations) { + // remove leading/trailing/duplicated slashes caused by prior + // manipulation of optional parameters and (groups) + const key = permutation + .replace(/\/{2,}/, '/') + .replace(/^\//, '') + .replace(/\/$/, ''); + + if (lookup.has(key)) { + throw new Error( + `The "${lookup.get(key)}" and "${route.id}" routes conflict with each other` + ); + } + + lookup.set(key, route.id); + } + } +} + +/** @param {string} id */ +function normalize_route_id(id) { + return ( + id + // remove groups + .replace(/(?<=^|\/)\(.+?\)(?=$|\/)/g, '') + + .replace(/\[[ux]\+([0-9a-f]+)\]/g, (_, x) => + String.fromCharCode(parseInt(x, 16)).replace(/\//g, '%2f') + ) + + // replace `[param]` with `<*>`, `[param=x]` with ``, and `[[param]]` with `` + .replace( + /\[(?:(\[)|(\.\.\.))?.+?(=.+?)?\]\]?/g, + (_, optional, rest, matcher) => `<${optional ? '?' : ''}${rest ?? ''}${matcher ?? '*'}>` + ) + ); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6e97903682f448a9c95a01527530bd0bdb545174 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/index.js @@ -0,0 +1,583 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import colors from 'kleur'; +import { lookup } from 'mrmime'; +import { list_files, runtime_directory } from '../../utils.js'; +import { posixify, resolve_entry } from '../../../utils/filesystem.js'; +import { parse_route_id } from '../../../utils/routing.js'; +import { prevent_conflicts } from './conflict.js'; +import { sort_routes } from './sort.js'; +import { isSvelte5Plus } from '../utils.js'; +import { + create_node_analyser, + get_page_options +} from '../../../exports/vite/static_analysis/index.js'; + +/** + * Generates the manifest data used for the client-side manifest and types generation. + * @param {{ + * config: import('types').ValidatedConfig; + * fallback?: string; + * cwd?: string; + * }} opts + * @returns {import('types').ManifestData} + */ +export default function create_manifest_data({ + config, + fallback = `${runtime_directory}/components/${isSvelte5Plus() ? 'svelte-5' : 'svelte-4'}`, + cwd = process.cwd() +}) { + const assets = create_assets(config); + const hooks = create_hooks(config, cwd); + const matchers = create_matchers(config, cwd); + const { nodes, routes } = create_routes_and_nodes(cwd, config, fallback); + + // validate matcher names used in parameterised routes + for (const route of routes) { + for (const param of route.params) { + if (param.matcher && !matchers[param.matcher]) { + throw new Error(`No matcher found for parameter '${param.matcher}' in route ${route.id}`); + } + } + } + + return { + assets, + hooks, + matchers, + nodes, + routes + }; +} + +/** + * Returns a list of files in the `static` directory. + * @param {import('types').ValidatedConfig} config + */ +export function create_assets(config) { + return list_files(config.kit.files.assets).map((file) => ({ + file, + size: fs.statSync(path.resolve(config.kit.files.assets, file)).size, + type: lookup(file) || null + })); +} + +/** + * @param {import('types').ValidatedConfig} config + * @param {string} cwd + */ +function create_hooks(config, cwd) { + const client = resolve_entry(config.kit.files.hooks.client); + const server = resolve_entry(config.kit.files.hooks.server); + const universal = resolve_entry(config.kit.files.hooks.universal); + + return { + client: client && posixify(path.relative(cwd, client)), + server: server && posixify(path.relative(cwd, server)), + universal: universal && posixify(path.relative(cwd, universal)) + }; +} + +/** + * @param {import('types').ValidatedConfig} config + * @param {string} cwd + */ +function create_matchers(config, cwd) { + const params_base = path.relative(cwd, config.kit.files.params); + + /** @type {Record} */ + const matchers = {}; + if (fs.existsSync(config.kit.files.params)) { + for (const file of fs.readdirSync(config.kit.files.params)) { + const ext = path.extname(file); + if (!config.kit.moduleExtensions.includes(ext)) continue; + const type = file.slice(0, -ext.length); + + if (/^\w+$/.test(type)) { + const matcher_file = path.join(params_base, file); + + // Disallow same matcher with different extensions + if (matchers[type]) { + throw new Error(`Duplicate matchers: ${matcher_file} and ${matchers[type]}`); + } else { + matchers[type] = matcher_file; + } + } else { + // Allow for matcher test collocation + if (type.endsWith('.test') || type.endsWith('.spec')) continue; + + throw new Error( + `Matcher names can only have underscores and alphanumeric characters — "${file}" is invalid` + ); + } + } + } + + return matchers; +} + +/** + * @param {import('types').ValidatedConfig} config + * @param {string} cwd + * @param {string} fallback + */ +function create_routes_and_nodes(cwd, config, fallback) { + /** @type {import('types').RouteData[]} */ + const routes = []; + + const routes_base = posixify(path.relative(cwd, config.kit.files.routes)); + + const valid_extensions = [...config.extensions, ...config.kit.moduleExtensions]; + + /** @type {import('types').PageNode[]} */ + const nodes = []; + + // create route data by processing files in `src/routes` + if (fs.existsSync(config.kit.files.routes)) { + /** + * @param {number} depth + * @param {string} id + * @param {string} segment + * @param {import('types').RouteData | null} parent + */ + const walk = (depth, id, segment, parent) => { + const unescaped = id.replace(/\[([ux])\+([^\]]+)\]/gi, (match, type, code) => { + if (match !== match.toLowerCase()) { + throw new Error(`Character escape sequence in ${id} must be lowercase`); + } + + if (!/[0-9a-f]+/.test(code)) { + throw new Error(`Invalid character escape sequence in ${id}`); + } + + if (type === 'x') { + if (code.length !== 2) { + throw new Error(`Hexadecimal escape sequence in ${id} must be two characters`); + } + + return String.fromCharCode(parseInt(code, 16)); + } else { + if (code.length < 4 || code.length > 6) { + throw new Error( + `Unicode escape sequence in ${id} must be between four and six characters` + ); + } + + return String.fromCharCode(parseInt(code, 16)); + } + }); + + if (/\]\[/.test(unescaped)) { + throw new Error(`Invalid route ${id} — parameters must be separated`); + } + + if (count_occurrences('[', id) !== count_occurrences(']', id)) { + throw new Error(`Invalid route ${id} — brackets are unbalanced`); + } + + if (/#/.test(segment)) { + // Vite will barf on files with # in them + throw new Error(`Route ${id} should be renamed to ${id.replace(/#/g, '[x+23]')}`); + } + + if (/\[\.\.\.\w+\]\/\[\[/.test(id)) { + throw new Error( + `Invalid route ${id} — an [[optional]] route segment cannot follow a [...rest] route segment` + ); + } + + if (/\[\[\.\.\./.test(id)) { + throw new Error( + `Invalid route ${id} — a rest route segment is always optional, remove the outer square brackets` + ); + } + + const { pattern, params } = parse_route_id(id); + + /** @type {import('types').RouteData} */ + const route = { + id, + parent, + + segment, + pattern, + params, + + layout: null, + error: null, + leaf: null, + page: null, + endpoint: null + }; + + // important to do this before walking children, so that child + // routes appear later + routes.push(route); + + // if we don't do this, the route map becomes unwieldy to console.log + Object.defineProperty(route, 'parent', { enumerable: false }); + + const dir = path.join(cwd, routes_base, id); + + // We can't use withFileTypes because of a NodeJs bug which returns wrong results + // with isDirectory() in case of symlinks: https://github.com/nodejs/node/issues/30646 + const files = fs.readdirSync(dir).map((name) => ({ + is_dir: fs.statSync(path.join(dir, name)).isDirectory(), + name + })); + + // process files first + for (const file of files) { + if (file.is_dir) continue; + + const ext = valid_extensions.find((ext) => file.name.endsWith(ext)); + if (!ext) continue; + + if (!file.name.startsWith('+')) { + const name = file.name.slice(0, -ext.length); + // check if it is a valid route filename but missing the + prefix + const typo = + /^(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/.test(name) || + /^(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/.test( + name + ); + if (typo) { + console.log( + colors + .bold() + .yellow( + `Missing route file prefix. Did you mean +${file.name}?` + + ` at ${path.join(dir, file.name)}` + ) + ); + } + + continue; + } + + if (file.name.endsWith('.d.ts')) { + let name = file.name.slice(0, -5); + const ext = valid_extensions.find((ext) => name.endsWith(ext)); + if (ext) name = name.slice(0, -ext.length); + + const valid = + /^\+(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/.test(name) || + /^\+(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/.test( + name + ); + + if (valid) continue; + } + + const project_relative = posixify(path.relative(cwd, path.join(dir, file.name))); + + const item = analyze( + project_relative, + file.name, + config.extensions, + config.kit.moduleExtensions + ); + + if (config.kit.router.type === 'hash' && item.kind === 'server') { + throw new Error( + `Cannot use server-only files in an app with \`router.type === 'hash': ${project_relative}` + ); + } + + /** + * @param {string} type + * @param {string} existing_file + */ + function duplicate_files_error(type, existing_file) { + return new Error( + `Multiple ${type} files found in ${routes_base}${route.id} : ${path.basename( + existing_file + )} and ${file.name}` + ); + } + + if (item.kind === 'component') { + if (item.is_error) { + route.error = { + depth, + component: project_relative + }; + } else if (item.is_layout) { + if (!route.layout) { + route.layout = { depth, child_pages: [] }; + } else if (route.layout.component) { + throw duplicate_files_error('layout component', route.layout.component); + } + + route.layout.component = project_relative; + if (item.uses_layout !== undefined) route.layout.parent_id = item.uses_layout; + } else { + if (!route.leaf) { + route.leaf = { depth }; + } else if (route.leaf.component) { + throw duplicate_files_error('page component', route.leaf.component); + } + + route.leaf.component = project_relative; + if (item.uses_layout !== undefined) route.leaf.parent_id = item.uses_layout; + } + } else if (item.is_layout) { + if (!route.layout) { + route.layout = { depth, child_pages: [] }; + } else if (route.layout[item.kind]) { + throw duplicate_files_error( + item.kind + ' layout module', + /** @type {string} */ (route.layout[item.kind]) + ); + } + + route.layout[item.kind] = project_relative; + } else if (item.is_page) { + if (!route.leaf) { + route.leaf = { depth }; + } else if (route.leaf[item.kind]) { + throw duplicate_files_error( + item.kind + ' page module', + /** @type {string} */ (route.leaf[item.kind]) + ); + } + + route.leaf[item.kind] = project_relative; + } else { + if (route.endpoint) { + throw duplicate_files_error('endpoint', route.endpoint.file); + } + + route.endpoint = { + file: project_relative, + page_options: null // will be filled later + }; + } + } + + // then handle children + for (const file of files) { + if (file.is_dir) { + walk(depth + 1, path.posix.join(id, file.name), file.name, route); + } + } + }; + + walk(0, '/', '', null); + + if (routes.length === 1) { + const root = routes[0]; + if (!root.leaf && !root.error && !root.layout && !root.endpoint) { + throw new Error( + 'No routes found. If you are using a custom src/routes directory, make sure it is specified in your Svelte config file' + ); + } + } + } else { + // If there's no routes directory, we'll just create a single empty route. This ensures the root layout and + // error components are included in the manifest, which is needed for subsequent build/dev commands to work + routes.push({ + id: '/', + segment: '', + pattern: /^$/, + params: [], + parent: null, + layout: null, + error: null, + leaf: null, + page: null, + endpoint: null + }); + } + + prevent_conflicts(routes); + + // fallback root layout and root error components + const root = routes[0]; + + if (!root.layout?.component) { + if (!root.layout) root.layout = { depth: 0, child_pages: [] }; + root.layout.component = posixify(path.relative(cwd, `${fallback}/layout.svelte`)); + } + + if (!root.error?.component) { + if (!root.error) root.error = { depth: 0, parent: root.layout }; + root.error.component = posixify(path.relative(cwd, `${fallback}/error.svelte`)); + } + + // populate the page nodes list + // we do layouts/errors first as they are more likely to be reused, + // and smaller indexes take fewer bytes. also, this guarantees that + // the default error/layout are 0/1 + for (const route of routes) { + if (route.layout) { + if (!route.layout?.component) { + route.layout.component = posixify(path.relative(cwd, `${fallback}/layout.svelte`)); + } + nodes.push(route.layout); + } + if (route.error) nodes.push(route.error); + } + + for (const route of routes) { + if (route.leaf) nodes.push(route.leaf); + } + + const indexes = new Map(nodes.map((node, i) => [node, i])); + + const node_analyser = create_node_analyser(cwd); + + // add the related layout, page, and error nodes for a route + for (const route of routes) { + if (!route.leaf) continue; + + route.page = { + layouts: [], + errors: [], + leaf: /** @type {number} */ (indexes.get(route.leaf)) + }; + + /** @type {import('types').RouteData | null} */ + let current_route = route; + let current_node = route.leaf; + let parent_id = route.leaf.parent_id; + + while (current_route) { + if (parent_id === undefined || current_route.segment === parent_id) { + if (current_route.layout || current_route.error) { + route.page.layouts.unshift( + current_route.layout ? indexes.get(current_route.layout) : undefined + ); + route.page.errors.unshift( + current_route.error ? indexes.get(current_route.error) : undefined + ); + } + + if (current_route.layout) { + /** @type {import('types').PageNode[]} */ (current_route.layout.child_pages).push( + route.leaf + ); + current_node.parent = current_node = current_route.layout; + parent_id = current_node.parent_id; + } else { + parent_id = undefined; + } + } + + current_route = current_route.parent; + } + + if (parent_id !== undefined) { + throw new Error(`${current_node.component} references missing segment "${parent_id}"`); + } + } + + // add parents to error nodes so that we can compute which page options apply to them + for (const route of routes) { + if (!route.error) continue; + + /** @type {import('types').RouteData | null} */ + let current_route = route; + while (current_route) { + if (current_route.layout) { + route.error.parent = current_route.layout; + break; + } + current_route = current_route.parent; + } + } + + // compute the final page options for each page node + for (const node of nodes) { + node.page_options = node_analyser.get_page_options(node); + } + + for (const route of routes) { + if (route.endpoint) { + route.endpoint.page_options = get_page_options(path.join(cwd, route.endpoint.file)); + } + + if (route.page && route.endpoint) { + const page = nodes[route.page.leaf]; + if (page.page_options?.prerender || route.endpoint.page_options?.prerender) { + const endpoint_file = route.endpoint.file.split('/').pop(); + + throw new Error( + `Cannot prerender a route (${route.id}) with both a \`+page.svelte\` and a \`${endpoint_file}\`` + ); + } + } + } + + return { + nodes, + routes: sort_routes(routes) + }; +} + +/** + * Determine if and how the file is relevant to the routing system. + * @param {string} project_relative + * @param {string} file + * @param {string[]} component_extensions + * @param {string[]} module_extensions + * @returns {import('./types.js').RouteFile} + */ +function analyze(project_relative, file, component_extensions, module_extensions) { + const component_extension = component_extensions.find((ext) => file.endsWith(ext)); + if (component_extension) { + const name = file.slice(0, -component_extension.length); + const pattern = /^\+(?:(page(?:@(.*))?)|(layout(?:@(.*))?)|(error))$/; + const match = pattern.exec(name); + if (!match) { + throw new Error(`Files prefixed with + are reserved (saw ${project_relative})`); + } + + return { + kind: 'component', + is_page: !!match[1], + is_layout: !!match[3], + is_error: !!match[5], + uses_layout: match[2] ?? match[4] + }; + } + + const module_extension = module_extensions.find((ext) => file.endsWith(ext)); + if (module_extension) { + const name = file.slice(0, -module_extension.length); + const pattern = + /^\+(?:(server)|(page(?:(@[a-zA-Z0-9_-]*))?(\.server)?)|(layout(?:(@[a-zA-Z0-9_-]*))?(\.server)?))$/; + const match = pattern.exec(name); + if (!match) { + throw new Error(`Files prefixed with + are reserved (saw ${project_relative})`); + } else if (match[3] || match[6]) { + throw new Error( + // prettier-ignore + `Only Svelte files can reference named layouts. Remove '${match[3] || match[6]}' from ${file} (at ${project_relative})` + ); + } + + const kind = match[1] || match[4] || match[7] ? 'server' : 'universal'; + + return { + kind, + is_page: !!match[2], + is_layout: !!match[5] + }; + } + + throw new Error(`Files and directories prefixed with + are reserved (saw ${project_relative})`); +} + +/** + * @param {string} needle + * @param {string} haystack + */ +function count_occurrences(needle, haystack) { + let count = 0; + for (let i = 0; i < haystack.length; i += 1) { + if (haystack[i] === needle) count += 1; + } + return count; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js new file mode 100644 index 0000000000000000000000000000000000000000..1629d146bf3e9b6dc4cc63eb66fbc98d11323e40 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/sort.js @@ -0,0 +1,162 @@ +import { get_route_segments } from '../../../utils/routing.js'; + +/** + * @typedef {{ + * type: 'static' | 'required' | 'optional' | 'rest'; + * content: string; + * matched: boolean; + * }} Part + */ + +/** + * @typedef {Part[]} Segment + */ + +const EMPTY = { type: 'static', content: '', matched: false }; + +/** @param {import('types').RouteData[]} routes */ +export function sort_routes(routes) { + /** @type {Map} */ + const segment_cache = new Map(); + + /** @param {string} segment */ + function get_parts(segment) { + if (!segment_cache.has(segment)) { + segment_cache.set(segment, split(segment)); + } + + return segment_cache.get(segment); + } + + /** @param {string} id */ + function split(id) { + /** @type {Part[]} */ + const parts = []; + + let i = 0; + while (i <= id.length) { + const start = id.indexOf('[', i); + if (start === -1) { + parts.push({ type: 'static', content: id.slice(i), matched: false }); + break; + } + + parts.push({ type: 'static', content: id.slice(i, start), matched: false }); + + const type = id[start + 1] === '[' ? 'optional' : id[start + 1] === '.' ? 'rest' : 'required'; + const delimiter = type === 'optional' ? ']]' : ']'; + const end = id.indexOf(delimiter, start); + + if (end === -1) { + throw new Error(`Invalid route ID ${id}`); + } + + const content = id.slice(start, (i = end + delimiter.length)); + + parts.push({ + type, + content, + matched: content.includes('=') + }); + } + + return parts; + } + + return routes.sort((route_a, route_b) => { + const segments_a = split_route_id(route_a.id).map(get_parts); + const segments_b = split_route_id(route_b.id).map(get_parts); + + for (let i = 0; i < Math.max(segments_a.length, segments_b.length); i += 1) { + const segment_a = segments_a[i] ?? [EMPTY]; + const segment_b = segments_b[i] ?? [EMPTY]; + + for (let j = 0; j < Math.max(segment_a.length, segment_b.length); j += 1) { + const a = segment_a[j]; + const b = segment_b[j]; + + // first part of each segment is always static + // (though it may be the empty string), then + // it alternates between dynamic and static + // (i.e. [foo][bar] is disallowed) + const dynamic = j % 2 === 1; + + if (dynamic) { + if (!a) return -1; + if (!b) return +1; + + // get the next static chunk, so we can handle [...rest] edge cases + const next_a = segment_a[j + 1].content || segments_a[i + 1]?.[0].content; + const next_b = segment_b[j + 1].content || segments_b[i + 1]?.[0].content; + + // `[...rest]/x` outranks `[...rest]` + if (a.type === 'rest' && b.type === 'rest') { + if (next_a && next_b) continue; + if (next_a) return -1; + if (next_b) return +1; + } + + // `[...rest]/x` outranks `[required]` or `[required]/[required]` + // but not `[required]/x` + if (a.type === 'rest') { + return next_a && !next_b ? -1 : +1; + } + + if (b.type === 'rest') { + return next_b && !next_a ? +1 : -1; + } + + // part with matcher outranks one without + if (a.matched !== b.matched) { + return a.matched ? -1 : +1; + } + + if (a.type !== b.type) { + // `[...rest]` has already been accounted for, so here + // we're comparing between `[required]` and `[[optional]]` + if (a.type === 'required') return -1; + if (b.type === 'required') return +1; + } + } else if (a.content !== b.content) { + // shallower path outranks deeper path + if (a === EMPTY) return -1; + if (b === EMPTY) return +1; + + return sort_static(a.content, b.content); + } + } + } + + return route_a.id < route_b.id ? +1 : -1; + }); +} + +/** @param {string} id */ +function split_route_id(id) { + return get_route_segments( + id + // remove all [[optional]] parts unless they're at the very end + // or it ends with a route group + .replace(/\[\[[^\]]+\]\](?!(?:\/\([^/]+\))*$)/g, '') + ).filter(Boolean); +} + +/** + * Sort two strings lexicographically, except `foobar` outranks `foo` + * @param {string} a + * @param {string} b + */ +function sort_static(a, b) { + if (a === b) return 0; + + for (let i = 0; true; i += 1) { + const char_a = a[i]; + const char_b = b[i]; + + if (char_a !== char_b) { + if (char_a === undefined) return +1; + if (char_b === undefined) return -1; + return char_a < char_b ? -1 : +1; + } + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec5c01b8e9d421acdcc7cd0fbec06c353c06acab --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/create_manifest_data/types.d.ts @@ -0,0 +1,37 @@ +import { PageNode } from 'types'; + +interface Part { + dynamic: boolean; + optional: boolean; + rest: boolean; + type: string | null; +} + +interface RouteTreeNode { + error: PageNode | undefined; + layout: PageNode | undefined; +} + +export type RouteTree = Map; + +interface RouteComponent { + kind: 'component'; + is_page: boolean; + is_layout: boolean; + is_error: boolean; + uses_layout: string | undefined; +} + +interface RouteSharedModule { + kind: 'universal'; + is_page: boolean; + is_layout: boolean; +} + +interface RouteServerModule { + kind: 'server'; + is_page: boolean; + is_layout: boolean; +} + +export type RouteFile = RouteComponent | RouteSharedModule | RouteServerModule; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/sync.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/sync.js new file mode 100644 index 0000000000000000000000000000000000000000..643f04341dad466a9a876504db0c780c47285978 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/sync.js @@ -0,0 +1,112 @@ +import path from 'node:path'; +import create_manifest_data from './create_manifest_data/index.js'; +import { write_client_manifest } from './write_client_manifest.js'; +import { write_root } from './write_root.js'; +import { write_tsconfig } from './write_tsconfig.js'; +import { write_types, write_all_types } from './write_types/index.js'; +import { write_ambient } from './write_ambient.js'; +import { write_non_ambient } from './write_non_ambient.js'; +import { write_server } from './write_server.js'; +import { + create_node_analyser, + get_page_options +} from '../../exports/vite/static_analysis/index.js'; +import { load_explicit_env } from '../env.js'; +import { write_env } from './write_env.js'; + +/** + * Initialize SvelteKit's generated files that only depend on the config and mode. + * @param {import('types').ValidatedConfig} config + * @param {string} mode + */ +export function init(config, mode) { + write_tsconfig(config.kit); + write_ambient(config.kit, mode); +} + +/** + * Update SvelteKit's generated files + * @param {import('types').ValidatedConfig} config + */ +export function create(config) { + const manifest_data = create_manifest_data({ config }); + + const output = path.join(config.kit.outDir, 'generated'); + + write_client_manifest(config.kit, manifest_data, `${output}/client`); + write_server(config, output); + write_root(manifest_data, config, output); + write_all_types(config, manifest_data); + write_non_ambient(config.kit, manifest_data); + + return { manifest_data }; +} + +/** + * Update SvelteKit's generated files in response to a single file content update. + * Do not call this when the file in question was created/deleted. + * + * @param {import('types').ValidatedConfig} config + * @param {import('types').ManifestData} manifest_data + * @param {string} file + */ +export function update(config, manifest_data, file) { + const node_analyser = create_node_analyser(); + + for (const node of manifest_data.nodes) { + node.page_options = node_analyser.get_page_options(node); + } + + for (const route of manifest_data.routes) { + if (route.endpoint) { + route.endpoint.page_options = get_page_options(route.endpoint.file); + } + } + + write_types(config, manifest_data, file); + write_non_ambient(config.kit, manifest_data); +} + +/** + * Run sync.init and sync.create in series, returning the result from sync.create. + * @param {import('types').ValidatedConfig} config + * @param {string} mode The Vite mode + */ +export function all(config, mode) { + init(config, mode); + return create(config); +} + +/** + * Run sync.init and then generate all type files. + * @param {import('types').ValidatedConfig} config + * @param {string} mode The Vite mode + */ +export function all_types(config, mode) { + init(config, mode); + const manifest_data = create_manifest_data({ config }); + write_all_types(config, manifest_data); + write_non_ambient(config.kit, manifest_data); +} + +/** + * Generate modules and types for explicit env vars + * @param {import('types').ValidatedKitConfig} kit + * @param {string | null} entry + * @param {string} mode The Vite mode + */ +export async function env(kit, entry, mode) { + const env_config = await load_explicit_env(kit, entry, mode); + + write_env(kit, entry, env_config); + + return env_config; +} + +/** + * Regenerate __SERVER__/internal.js in response to src/{app.html,error.html,service-worker.js} changing + * @param {import('types').ValidatedConfig} config + */ +export function server(config) { + write_server(config, path.join(config.kit.outDir, 'generated')); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/ts.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/ts.js new file mode 100644 index 0000000000000000000000000000000000000000..61c79e37f882d09bf3063934d1d61cdde13c5b84 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/ts.js @@ -0,0 +1,6 @@ +/** @type {import('typescript')} */ +// @ts-ignore +export let ts = undefined; +try { + ts = (await import('typescript')).default; +} catch {} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/utils.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..106360654b1f192cd5d6b5123a618f9ad88fb516 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/utils.js @@ -0,0 +1,85 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { mkdirp } from '../../utils/filesystem.js'; +import { import_peer } from '../../utils/import.js'; + +/** @type {{ VERSION: string }} */ +const { VERSION } = await import_peer('svelte/compiler'); + +const [MAJOR, MINOR] = VERSION.split('.').map(Number); + +/** @type {Map} */ +const previous_contents = new Map(); + +/** + * @param {string} file + * @param {string} code + */ +export function write_if_changed(file, code) { + if (code !== previous_contents.get(file)) { + write(file, code); + } +} + +/** + * @param {string} file + * @param {string} code + */ +export function write(file, code) { + previous_contents.set(file, code); + mkdirp(path.dirname(file)); + fs.writeFileSync(file, code); +} + +/** @type {WeakMap} */ +const dedent_map = new WeakMap(); + +/** + * Allows indenting template strings without the extra indentation ending up in the result. + * Still allows indentation of lines relative to one another in the template string. + * @param {TemplateStringsArray} strings + * @param {any[]} values + */ +export function dedent(strings, ...values) { + let dedented = dedent_map.get(strings); + + if (!dedented) { + const indentation = /** @type {RegExpExecArray} */ (/\n?([ \t]*)/.exec(strings[0]))[1]; + const pattern = new RegExp(`^${indentation}`, 'gm'); + + dedented = { + strings: strings.map((str) => str.replace(pattern, '')), + indents: [] + }; + + let current = '\n'; + + for (let i = 0; i < values.length; i += 1) { + const string = dedented.strings[i]; + const match = /\n([ \t]*)$/.exec(string); + + if (match) current = match[0]; + dedented.indents[i] = current; + } + + dedent_map.set(strings, dedented); + } + + let str = dedented.strings[0]; + for (let i = 0; i < values.length; i += 1) { + str += String(values[i]).replace(/\n/g, dedented.indents[i]) + dedented.strings[i + 1]; + } + + str = str.trim(); + + return str; +} + +export function isSvelte5Plus() { + return MAJOR >= 5; +} + +// TODO 3.0 remove this once we can bump the peerDep range +export function supportsTrustedTypes() { + return (MAJOR === 5 && MINOR >= 51) || MAJOR > 5; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js new file mode 100644 index 0000000000000000000000000000000000000000..dd798178c86fd6ac4a055269c7d80147b0a7bbb3 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_ambient.js @@ -0,0 +1,69 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { get_env } from '../../exports/vite/utils.js'; +import { GENERATED_COMMENT } from '../../constants.js'; +import { create_dynamic_types, create_static_types } from '../env.js'; +import { write_if_changed } from './utils.js'; + +// TODO these types should be described in a neutral place, rather than +// inside either `packages/kit` or `svelte.dev/docs/kit` +const descriptions_dir = fileURLToPath(new URL('../../../src/types/synthetic', import.meta.url)); + +/** @param {string} filename */ +function read_description(filename) { + const content = fs.readFileSync(`${descriptions_dir}/${filename}`, 'utf8'); + return `/**\n${content + .trim() + .split('\n') + .map((line) => ` * ${line}`) + .join('\n')}\n */`; +} + +/** + * @param {import('types').Env} env + * @param {{ + * public_prefix: string; + * private_prefix: string; + * }} prefixes + */ +const template = (env, prefixes) => ` +${GENERATED_COMMENT} + +/// + +${read_description('$env+static+private.md')} +${create_static_types('private', env)} + +${read_description('$env+static+public.md')} +${create_static_types('public', env)} + +${read_description('$env+dynamic+private.md')} +${create_dynamic_types('private', env, prefixes)} + +${read_description('$env+dynamic+public.md')} +${create_dynamic_types('public', env, prefixes)} +`; + +/** + * Writes ambient declarations including types reference to @sveltejs/kit, + * and the existing environment variables in process.env to + * $env/static/private and $env/static/public + * @param {import('types').ValidatedKitConfig} config + * @param {string} mode The Vite mode + */ +export function write_ambient(config, mode) { + /** @type {string} */ + let content; + + if (config.experimental.explicitEnvironmentVariables) { + content = `${GENERATED_COMMENT}\n/// `; + } else { + const env = get_env(config.env, mode); + const { publicPrefix: public_prefix, privatePrefix: private_prefix } = config.env; + + content = template(env, { public_prefix, private_prefix }); + } + + write_if_changed(path.join(config.outDir, 'ambient.d.ts'), content); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js new file mode 100644 index 0000000000000000000000000000000000000000..2dcb9dfed0bfd4b8c520952eb7da572b01ce79b1 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_client_manifest.js @@ -0,0 +1,210 @@ +import path from 'node:path'; +import { relative_path, resolve_entry } from '../../utils/filesystem.js'; +import { s } from '../../utils/misc.js'; +import { dedent, isSvelte5Plus, write_if_changed } from './utils.js'; +import colors from 'kleur'; + +/** + * Writes the client manifest to disk. The manifest is used to power the router. It contains the + * list of routes and corresponding Svelte components (i.e. pages and layouts). + * @param {import('types').ValidatedKitConfig} kit + * @param {import('types').ManifestData} manifest_data + * @param {string} output + * @param {import('types').ServerMetadata['nodes']} [metadata] If this is omitted, we have to assume that all routes with a `+layout/page.server.js` file have a server load function + */ +export function write_client_manifest(kit, manifest_data, output, metadata) { + const client_routing = kit.router.resolution === 'client'; + + /** + * Creates a module that exports a `CSRPageNode` + * @param {import('types').PageNode} node + */ + function generate_node(node) { + const declarations = []; + + if (node.universal) { + declarations.push( + `import * as universal from ${s(relative_path(`${output}/nodes`, node.universal))};`, + 'export { universal };' + ); + } + + if (node.component) { + declarations.push( + `export { default as component } from ${s( + relative_path(`${output}/nodes`, node.component) + )};` + ); + } + + return declarations.join('\n'); + } + + /** @type {Map} */ + const indices = new Map(); + const nodes = manifest_data.nodes + .map((node, i) => { + indices.set(node, i); + + write_if_changed(`${output}/nodes/${i}.js`, generate_node(node)); + return `() => import('./nodes/${i}')`; + }) + // If route resolution happens on the server, we only need the root layout and root error page + // upfront, the rest is loaded on demand as the user navigates the app + .slice(0, client_routing ? manifest_data.nodes.length : 2) + .join(',\n'); + + const layouts_with_server_load = new Set(); + + let dictionary = dedent` + { + ${manifest_data.routes + .map((route) => { + if (route.page) { + const errors = route.page.errors.slice(1).map((n) => n ?? ''); + const layouts = route.page.layouts.slice(1).map((n) => n ?? ''); + + while (layouts.at(-1) === '') layouts.pop(); + while (errors.at(-1) === '') errors.pop(); + + let leaf_has_server_load = false; + if (route.leaf) { + if (metadata) { + const i = /** @type {number} */ (indices.get(route.leaf)); + + leaf_has_server_load = metadata[i].has_server_load; + } else if (route.leaf.server) { + leaf_has_server_load = true; + } + } + + // Encode whether or not the route uses server data + // using the ones' complement, to save space + const array = [`${leaf_has_server_load ? '~' : ''}${route.page.leaf}`]; + + // Encode whether or not the layout uses server data. + // It's a different method compared to pages because layouts + // are reused across pages, so we save space by doing it this way. + route.page.layouts.forEach((layout) => { + if (layout == undefined) return; + + let layout_has_server_load = false; + + if (metadata) { + layout_has_server_load = metadata[layout].has_server_load; + } else if (manifest_data.nodes[layout].server) { + layout_has_server_load = true; + } + + if (layout_has_server_load) { + layouts_with_server_load.add(layout); + } + }); + + // only include non-root layout/error nodes if they exist + if (layouts.length > 0 || errors.length > 0) array.push(`[${layouts.join(',')}]`); + if (errors.length > 0) array.push(`[${errors.join(',')}]`); + + return `${s(route.id)}: [${array.join(',')}]`; + } + }) + .filter(Boolean) + .join(',\n')} + } + `; + + if (!client_routing) { + dictionary = '{}'; + const root_layout = layouts_with_server_load.has(0); + layouts_with_server_load.clear(); + if (root_layout) layouts_with_server_load.add(0); + } + + const client_hooks_file = resolve_entry(kit.files.hooks.client); + const universal_hooks_file = resolve_entry(kit.files.hooks.universal); + + const typo = resolve_entry('src/+hooks.client'); + if (typo) { + console.log( + colors + .bold() + .yellow( + `Unexpected + prefix. Did you mean ${typo.split('/').at(-1)?.slice(1)}?` + + ` at ${path.resolve(typo)}` + ) + ); + } + + // Stringified version of + /** @type {import('../../runtime/client/types.js').SvelteKitApp} */ + write_if_changed( + `${output}/app.js`, + dedent` + // in dev, this makes Vite inject its client as this module's first dependency, + // so that global constant replacements are installed before any other module + // (including user hooks) evaluates. In build it's inert. + import.meta.hot; + + ${ + client_hooks_file + ? `import * as client_hooks from '${relative_path(output, client_hooks_file)}';` + : '' + } + ${ + universal_hooks_file + ? `import * as universal_hooks from '${relative_path(output, universal_hooks_file)}';` + : '' + } + + ${client_routing ? "export { matchers } from './matchers.js';" : 'export const matchers = {};'} + + export const nodes = [ + ${nodes} + ]; + + export const server_loads = [${[...layouts_with_server_load].join(',')}]; + + export const dictionary = ${dictionary}; + + export const hooks = { + handleError: ${ + client_hooks_file ? 'client_hooks.handleError || ' : '' + }(({ error }) => { console.error(error) }), + ${client_hooks_file ? 'init: client_hooks.init,' : ''} + reroute: ${universal_hooks_file ? 'universal_hooks.reroute || ' : ''}(() => {}), + transport: ${universal_hooks_file ? 'universal_hooks.transport || ' : ''}{} + }; + + export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode])); + export const encoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.encode])); + + export const hash = ${s(kit.router.type === 'hash')}; + + export const decode = (type, value) => decoders[type](value); + + export { default as root } from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}'; + + export const get_error_template = () => import('../shared/error-template.js').then(m => m.default); + ` + ); + + if (client_routing) { + // write matchers to a separate module so that we don't + // need to worry about name conflicts + const imports = []; + const matchers = []; + + for (const key in manifest_data.matchers) { + const src = manifest_data.matchers[key]; + + imports.push(`import { match as ${key} } from ${s(relative_path(output, src))};`); + matchers.push(key); + } + + const module = imports.length + ? `${imports.join('\n')}\n\nexport const matchers = { ${matchers.join(', ')} };` + : 'export const matchers = {};'; + + write_if_changed(`${output}/matchers.js`, module); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_env.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_env.js new file mode 100644 index 0000000000000000000000000000000000000000..ac886067721870015cd1249b431cedb143021b5c --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_env.js @@ -0,0 +1,33 @@ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ +import path from 'node:path'; +import { create_explicit_env_types } from '../env.js'; +import { posixify } from '../../utils/filesystem.js'; +import { write_if_changed } from './utils.js'; + +const DOCS = '// See https://svelte.dev/docs/kit/environment-variables for more information'; + +/** + * Writes ambient declarations including types reference to @sveltejs/kit, + * and the existing environment variables in process.env to + * $env/static/private and $env/static/public + * @param {import('types').ValidatedKitConfig} kit + * @param {string | null} entry + * @param {Record> | null} env_config + */ +export function write_env(kit, entry, env_config) { + const content = []; + const out = path.join(kit.outDir, 'env.d.ts'); + + if (entry && env_config) { + const relative = posixify(path.relative(kit.outDir, entry)); + content.push( + `// This file is generated from ${relative}.\n${DOCS}`, + create_explicit_env_types(env_config, relative, 'private'), + create_explicit_env_types(env_config, relative, 'public') + ); + } else { + content.push(DOCS); + } + + write_if_changed(out, content.join('\n\n')); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js new file mode 100644 index 0000000000000000000000000000000000000000..68094064f773f8e7e5ca1fc0771fa564966d0a9e --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_non_ambient.js @@ -0,0 +1,266 @@ +import path from 'node:path'; +import { GENERATED_COMMENT } from '../../constants.js'; +import { posixify } from '../../utils/filesystem.js'; +import { write_if_changed } from './utils.js'; +import { s } from '../../utils/misc.js'; +import { get_route_segments } from '../../utils/routing.js'; + +const replace_optional_params = (/** @type {string} */ id) => + id.replace(/\/\[\[[^\]]+\]\]/g, '${string}'); +const replace_required_params = (/** @type {string} */ id) => + id.replace(/\/\[[^\]]+\]/g, '/${string}'); +/** Convert route ID to pathname by removing layout groups */ +const remove_group_segments = (/** @type {string} */ id) => { + return '/' + get_route_segments(id).join('/'); +}; + +/** + * Get pathnames to add based on trailingSlash settings + * @param {string} pathname + * @param {import('types').RouteData} route + * @returns {string[]} + */ +function get_pathnames_for_trailing_slash(pathname, route) { + if (pathname === '/') { + return [pathname]; + } + + /** @type {Set} */ + const pathnames = new Set(); + + /** + * @param {{ trailingSlash?: import('types').TrailingSlash } | null | undefined} page_options + */ + const add_pathnames = (page_options) => { + if (page_options === null || page_options?.trailingSlash === 'ignore') { + pathnames.add(pathname); + pathnames.add(pathname + '/'); + } else if (page_options?.trailingSlash === 'always') { + pathnames.add(pathname + '/'); + } else { + pathnames.add(pathname); + } + }; + + if (route.leaf) add_pathnames(route.leaf.page_options ?? null); + if (route.endpoint) add_pathnames(route.endpoint.page_options); + + return Array.from(pathnames); +} + +// `declare module "svelte/elements"` needs to happen in a non-ambient module, and dts-buddy generates one big ambient module, +// so we can't add it there - therefore generate the typings ourselves here. +// We're not using the `declare namespace svelteHTML` variant because that one doesn't augment the HTMLAttributes interface +// people could use to type their own components. +// The T generic is needed or else there's a "all declarations must have identical type parameters" error. +const template = ` +${GENERATED_COMMENT} + +declare module "svelte/elements" { + export interface HTMLAttributes { + 'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null; + 'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null; + 'data-sveltekit-preload-code'?: + | true + | '' + | 'eager' + | 'viewport' + | 'hover' + | 'tap' + | 'off' + | undefined + | null; + 'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null; + 'data-sveltekit-reload'?: true | '' | 'off' | undefined | null; + 'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null; + } +} + +export {}; +`; + +/** + * Generate app types interface extension + * @param {import('types').ManifestData} manifest_data + * @param {import('types').ValidatedKitConfig} config + */ +function generate_app_types(manifest_data, config) { + /** @param {string} matcher */ + const path_to_matcher = (matcher) => + posixify(path.relative(config.outDir, path.join(config.files.params, matcher + '.js'))); + + /** @type {Map} */ + const matcher_types = new Map(); + + /** @param {string | undefined} matcher */ + const get_matcher_type = (matcher) => { + if (!matcher) return 'string'; + + let type = matcher_types.get(matcher); + if (!type) { + type = `MatcherParam`; + matcher_types.set(matcher, type); + } + + return type; + }; + + /** @param {Set | null} matchers */ + const get_matchers_type = (matchers) => { + if (matchers === null) return 'string'; + + return Array.from(matchers) + .map((matcher) => get_matcher_type(matcher)) + .join(' | '); + }; + + /** @type {Set} */ + const route_ids = new Set(manifest_data.routes.map((route) => route.id)); + + /** + * @param {string} id + * @returns {string[]} + */ + const get_ancestor_route_ids = (id) => { + /** @type {string[]} */ + const ancestors = []; + + if (route_ids.has('/')) { + ancestors.push('/'); + } + + let current = ''; + for (const segment of id.slice(1).split('/')) { + if (!segment) continue; + + current += '/' + segment; + if (route_ids.has(current)) { + ancestors.push(current); + } + } + + return ancestors; + }; + + /** @type {Set} */ + const pathnames = new Set(); + + /** @type {string[]} */ + const dynamic_routes = []; + + /** @type {string[]} */ + const layouts = []; + + /** @type {Map | null }>>} */ + const layout_params_by_route = new Map( + manifest_data.routes.map((route) => [ + route.id, + new Map( + route.params.map((p) => [ + p.name, + { optional: p.optional, matchers: p.matcher ? new Set([p.matcher]) : null } + ]) + ) + ]) + ); + + for (const route of manifest_data.routes) { + const ancestors = get_ancestor_route_ids(route.id); + + for (const ancestor_id of ancestors) { + const ancestor_params = layout_params_by_route.get(ancestor_id); + if (!ancestor_params) continue; + + for (const p of route.params) { + const matcher = p.matcher ?? null; + const entry = ancestor_params.get(p.name); + if (!entry) { + ancestor_params.set(p.name, { + optional: true, + matchers: matcher === null ? null : new Set([matcher]) + }); + continue; + } + + if (entry.matchers === null) continue; + + if (matcher === null) { + entry.matchers = null; + continue; + } + + entry.matchers.add(matcher); + } + } + } + + for (const route of manifest_data.routes) { + const pathname = remove_group_segments(route.id); + let normalized_pathname = pathname; + + /** @type {(path: string) => string} */ + let serialise = s; + + if (route.params.length > 0) { + const params = route.params.map((p) => { + const type = get_matcher_type(p.matcher); + return `${p.name}${p.optional ? '?:' : ':'} ${type}${p.optional ? ' | undefined' : ''}`; + }); + const route_type = `${s(route.id)}: { ${params.join('; ')} }`; + + dynamic_routes.push(route_type); + + normalized_pathname = replace_required_params(replace_optional_params(pathname)); + serialise = (p) => `\`${p}\` & {}`; + } + + for (const p of get_pathnames_for_trailing_slash(normalized_pathname, route)) { + pathnames.add(serialise(p)); + } + + let layout_type = 'Record'; + + const layout_params = layout_params_by_route.get(route.id); + if (layout_params) { + const params = Array.from(layout_params) + .map(([name, { optional, matchers }]) => { + const type = get_matchers_type(matchers); + return `${name}${optional ? '?:' : ':'} ${type}${optional ? ' | undefined' : ''}`; + }) + .join('; '); + + if (params.length > 0) layout_type = `{ ${params} }`; + } + + layouts.push(`${s(route.id)}: ${layout_type}`); + } + + const assets = manifest_data.assets.map((asset) => s('/' + asset.file)); + + return [ + 'declare module "$app/types" {', + '\ttype MatcherParam = M extends (param : string) => param is (infer U extends string) ? U : string;', + '', + '\texport interface AppTypes {', + `\t\tRouteId(): ${manifest_data.routes.map((r) => s(r.id)).join(' | ')};`, + `\t\tRouteParams(): {\n\t\t\t${dynamic_routes.join(';\n\t\t\t')}\n\t\t};`, + `\t\tLayoutParams(): {\n\t\t\t${layouts.join(';\n\t\t\t')}\n\t\t};`, + `\t\tPathname(): ${Array.from(pathnames).join(' | ')};`, + '\t\tResolvedPathname(): `${"" | `/${string}`}${ReturnType}`;', + `\t\tAsset(): ${assets.concat('string & {}').join(' | ')};`, + '\t}', + '}' + ].join('\n'); +} + +/** + * Writes non-ambient declarations to the output directory + * @param {import('types').ValidatedKitConfig} config + * @param {import('types').ManifestData} manifest_data + */ +export function write_non_ambient(config, manifest_data) { + const app_types = generate_app_types(manifest_data, config); + const content = [template, app_types].join('\n\n'); + + write_if_changed(path.join(config.outDir, 'non-ambient.d.ts'), content); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_root.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_root.js new file mode 100644 index 0000000000000000000000000000000000000000..213e5b88ddd567a4912fd0ed091411944efa07c1 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_root.js @@ -0,0 +1,196 @@ +import { dedent, isSvelte5Plus, write_if_changed } from './utils.js'; + +/** + * @param {import('types').ManifestData} manifest_data + * @param {import('types').ValidatedConfig} config + * @param {string} output + */ +export function write_root(manifest_data, config, output) { + // TODO remove default layout altogether + + const use_boundaries = config.kit.experimental.handleRenderingErrors && isSvelte5Plus(); + + const max_depth = Math.max( + ...manifest_data.routes.map((route) => + route.page ? route.page.layouts.filter(Boolean).length + 1 : 0 + ), + 1 + ); + + const levels = []; + for (let i = 0; i <= max_depth; i += 1) { + levels.push(i); + } + + let l = max_depth; + /** @type {string} */ + let pyramid; + + if (isSvelte5Plus() && use_boundaries) { + // with the @const we force the data[depth] access to be derived, which is important to not fire updates needlessly + // TODO in Svelte 5 we should rethink the client.js side, we can likely make data a $state and only update indexes that changed there, simplifying this a lot + pyramid = dedent` + {#snippet pyramid(depth)} + {@const Pyramid = constructors[depth]} + {#snippet failed(error)} + {@const ErrorPage = errors[depth]} + + {/snippet} + + {#if constructors[depth + 1]} + {@const d = data[depth]} + + + {@render pyramid(depth + 1)} + + {:else} + {@const d = data[depth]} + + + {/if} + + {/snippet} + + {@render pyramid(0)} + `; + } else { + pyramid = dedent` + ${ + isSvelte5Plus() + ? ` + ` + : `` + }`; + + while (l--) { + pyramid = dedent` + {#if constructors[${l + 1}]} + ${ + isSvelte5Plus() + ? dedent`{@const Pyramid_${l} = constructors[${l}]} + + + ${pyramid} + ` + : dedent` + ${pyramid} + ` + } + + {:else} + ${ + isSvelte5Plus() + ? dedent` + {@const Pyramid_${l} = constructors[${l}]} + + + ` + : dedent`` + } + + {/if} + `; + } + } + + write_if_changed( + `${output}/root.svelte`, + dedent` + + ${isSvelte5Plus() ? '' : ''} + + + ${pyramid} + + {#if mounted} +
+ {#if navigated} + {title} + {/if} +
+ {/if} + ` + ); + + if (isSvelte5Plus()) { + write_if_changed( + `${output}/root.js`, + dedent` + import { asClassComponent } from 'svelte/legacy'; + import Root from './root.svelte'; + export default asClassComponent(Root); + ` + ); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_server.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_server.js new file mode 100644 index 0000000000000000000000000000000000000000..764783f11f875ebf957e10f8b3f51607ee7e44dc --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_server.js @@ -0,0 +1,146 @@ +import path from 'node:path'; +import process from 'node:process'; +import { hash } from '../../utils/hash.js'; +import { posixify, resolve_entry } from '../../utils/filesystem.js'; +import { s } from '../../utils/misc.js'; +import { load_error_page, load_template } from '../config/index.js'; +import { runtime_directory } from '../utils.js'; +import { isSvelte5Plus, write_if_changed } from './utils.js'; +import colors from 'kleur'; +import { escape_html } from '../../utils/escape.js'; + +/** + * @param {{ + * server_hooks: string | null; + * universal_hooks: string | null; + * config: import('types').ValidatedConfig; + * has_service_worker: boolean; + * runtime_directory: string; + * template: string; + * }} opts + */ +const server_template = ({ + config, + server_hooks, + universal_hooks, + has_service_worker, + runtime_directory, + template +}) => ` +import root from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}'; +import { set_building, set_prerendering } from '$app/env/internal'; +import { set_assets } from '$app/paths/internal/server'; +import { set_manifest, set_read_implementation } from '__sveltekit/server'; +import { set_private_env, set_public_env } from '${runtime_directory}/shared-server.js'; +import error from '../shared/error-template.js'; + +export const options = { + app_template_contains_nonce: ${template.includes('%sveltekit.nonce%')}, + async: ${s(!!config.compilerOptions?.experimental?.async)}, + csp: ${s(config.kit.csp)}, + csrf_check_origin: ${s(config.kit.csrf.checkOrigin && !config.kit.csrf.trustedOrigins.includes('*'))}, + csrf_trusted_origins: ${s(config.kit.csrf.trustedOrigins)}, + embedded: ${config.kit.embedded}, + env_public_prefix: '${config.kit.env.publicPrefix}', + env_private_prefix: '${config.kit.env.privatePrefix}', + hash_routing: ${s(config.kit.router.type === 'hash')}, + hooks: null, // added lazily, via \`get_hooks\` + preload_strategy: ${s(config.kit.output.preloadStrategy)}, + root, + service_worker: ${has_service_worker}, + service_worker_options: ${config.kit.serviceWorker.register ? s(config.kit.serviceWorker.options) : 'null'}, + server_error_boundaries: ${s(!!config.kit.experimental.handleRenderingErrors)}, + templates: { + app: ({ head, body, assets, nonce, env }) => ${s(template) + .replace('%sveltekit.head%', '" + head + "') + .replace('%sveltekit.body%', '" + body + "') + .replace(/%sveltekit\.assets%/g, '" + assets + "') + .replace(/%sveltekit\.nonce%/g, '" + nonce + "') + .replace(/%sveltekit\.version%/g, escape_html(config.kit.version.name)) + .replace( + /%sveltekit\.env\.([^%]+)%/g, + (_match, capture) => `" + (env[${s(capture)}] ?? "") + "` + )}, + error + }, + version_hash: ${s(hash(config.kit.version.name))} +}; + +export async function get_hooks() { + let handle; + let handleFetch; + let handleError; + let handleValidationError; + let init; + ${server_hooks ? `({ handle, handleFetch, handleError, handleValidationError, init } = await import(${s(server_hooks)}));` : ''} + + let reroute; + let transport; + ${universal_hooks ? `({ reroute, transport } = await import(${s(universal_hooks)}));` : ''} + + return { + handle, + handleFetch, + handleError, + handleValidationError, + init, + reroute, + transport + }; +} + +export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation }; +`; + +// TODO need to re-run this whenever src/app.html or src/error.html are +// created or changed, or src/service-worker.js is created or deleted. +// Also, need to check that updating hooks.server.js works + +/** + * Write server configuration to disk + * @param {import('types').ValidatedConfig} config + * @param {string} output + */ +export function write_server(config, output) { + const server_hooks_file = resolve_entry(config.kit.files.hooks.server); + const universal_hooks_file = resolve_entry(config.kit.files.hooks.universal); + + const typo = resolve_entry('src/+hooks.server'); + if (typo) { + console.log( + colors + .bold() + .yellow( + `Unexpected + prefix. Did you mean ${typo.split('/').at(-1)?.slice(1)}?` + + ` at ${path.resolve(typo)}` + ) + ); + } + + /** @param {string} file */ + function relative(file) { + return posixify(path.relative(`${output}/server`, file)); + } + + write_if_changed( + `${output}/shared/error-template.js`, + `export default ({ status, message }) => ${s(load_error_page(config)) + .replace(/%sveltekit\.status%/g, '" + status + "') + .replace(/%sveltekit\.error\.message%/g, '" + message + "')};` + ); + + // Contains the stringified version of + /** @type {import('types').SSROptions} */ + write_if_changed( + `${output}/server/internal.js`, + server_template({ + config, + server_hooks: server_hooks_file ? relative(server_hooks_file) : null, + universal_hooks: universal_hooks_file ? relative(universal_hooks_file) : null, + has_service_worker: + config.kit.serviceWorker.register && !!resolve_entry(config.kit.files.serviceWorker), + runtime_directory: relative(runtime_directory), + template: load_template(process.cwd(), config) + }) + ); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js new file mode 100644 index 0000000000000000000000000000000000000000..a6f8a25102b05aed1e5d3678476f272781ca4f60 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js @@ -0,0 +1,245 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import colors from 'kleur'; +import { posixify } from '../../utils/filesystem.js'; +import { write_if_changed } from './utils.js'; + +/** + * @param {string} cwd + * @param {string} file + */ +function maybe_file(cwd, file) { + const resolved = path.resolve(cwd, file); + if (fs.existsSync(resolved)) { + return resolved; + } +} + +/** + * @param {string} file + */ +function project_relative(file) { + return posixify(path.relative('.', file)); +} + +/** + * @param {string} file + */ +function remove_trailing_slashstar(file) { + if (file.endsWith('/*')) { + return file.slice(0, -2); + } else { + return file; + } +} + +/** + * Generates the tsconfig that the user's tsconfig inherits from. + * @param {import('types').ValidatedKitConfig} kit + */ +export function write_tsconfig(kit, cwd = process.cwd()) { + const out = path.join(kit.outDir, 'tsconfig.json'); + + const user_config = load_user_tsconfig(cwd); + if (user_config) validate_user_config(cwd, out, user_config); + + write_if_changed(out, JSON.stringify(get_tsconfig(kit), null, '\t')); +} + +/** + * Generates the tsconfig that the user's tsconfig inherits from. + * @param {import('types').ValidatedKitConfig} kit + */ +export function get_tsconfig(kit) { + /** @param {string} file */ + const config_relative = (file) => posixify(path.relative(kit.outDir, file)); + + const include = new Set([ + 'ambient.d.ts', // careful: changing this name would be a breaking change, because it's referenced in the service-workers documentation + 'env.d.ts', + 'non-ambient.d.ts', + './types/**/$types.d.ts', + config_relative('vite.config.js'), + config_relative('vite.config.ts') + ]); + const src_includes = [kit.files.routes, kit.files.lib, kit.files.src].filter((dir) => { + const relative = path.relative(kit.files.src, dir); + return !relative || relative.startsWith('..'); + }); + for (const dir of src_includes) { + include.add(config_relative(`${dir}/**/*.js`)); + include.add(config_relative(`${dir}/**/*.ts`)); + include.add(config_relative(`${dir}/**/*.svelte`)); + } + + // Test folder is a special case - we advocate putting tests in a top-level test folder + // and it's not configurable (should we make it?) + const test_folder = project_relative('test'); + include.add(config_relative(`${test_folder}/**/*.js`)); + include.add(config_relative(`${test_folder}/**/*.ts`)); + include.add(config_relative(`${test_folder}/**/*.svelte`)); + const tests_folder = project_relative('tests'); + include.add(config_relative(`${tests_folder}/**/*.js`)); + include.add(config_relative(`${tests_folder}/**/*.ts`)); + include.add(config_relative(`${tests_folder}/**/*.svelte`)); + + const exclude = [config_relative('node_modules/**')]; + // Add service worker to exclude list so that worker types references in it don't spill over into the rest of the app + // (i.e. suddenly ServiceWorkerGlobalScope would be available throughout the app, and some types might even clash) + if (path.extname(kit.files.serviceWorker)) { + exclude.push(config_relative(kit.files.serviceWorker)); + } else { + exclude.push(config_relative(`${kit.files.serviceWorker}.js`)); + exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.js`)); + exclude.push(config_relative(`${kit.files.serviceWorker}.ts`)); + exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.ts`)); + exclude.push(config_relative(`${kit.files.serviceWorker}.d.ts`)); + exclude.push(config_relative(`${kit.files.serviceWorker}/**/*.d.ts`)); + } + + const config = { + compilerOptions: { + // generated options + paths: { + ...get_tsconfig_paths(kit), + '$app/types': ['./types/index.d.ts'] + }, + rootDirs: [config_relative('.'), './types'], + + // essential options + // svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript + // to enforce using \`import type\` instead of \`import\` for Types. + // Also, TypeScript doesn't know about import usages in the template because it only sees the + // script of a Svelte file. Therefore preserve all value imports. + verbatimModuleSyntax: true, + // Vite compiles modules one at a time + isolatedModules: true, + + // This is required for svelte-package to work as expected + // Can be overwritten + lib: ['esnext', 'DOM', 'DOM.Iterable'], + moduleResolution: 'bundler', + module: 'esnext', + noEmit: true, // prevent tsconfig error "overwriting input files" - Vite handles the build and ignores this + target: 'esnext' + }, + include: [...include], + exclude + }; + + return kit.typescript.config(config) ?? config; +} + +/** @param {string} cwd */ +function load_user_tsconfig(cwd) { + const file = maybe_file(cwd, 'tsconfig.json') || maybe_file(cwd, 'jsconfig.json'); + + if (!file) return; + + // we have to eval the file, since it's not parseable as JSON (contains comments) + const json = fs.readFileSync(file, 'utf-8'); + + return { + kind: path.basename(file), + options: (0, eval)(`(${json})`) + }; +} + +/** + * @param {string} cwd + * @param {string} out + * @param {{ kind: string, options: any }} config + */ +function validate_user_config(cwd, out, config) { + // we need to check that the user's tsconfig extends the framework config + const extend = config.options.extends; + const extends_framework_config = + typeof extend === 'string' + ? path.resolve(cwd, extend) === out + : Array.isArray(extend) + ? extend.some((e) => path.resolve(cwd, e) === out) + : false; + + const options = config.options.compilerOptions || {}; + + if (extends_framework_config) { + const { paths, baseUrl } = options; + + // TODO: baseUrl will be removed in TypeScript 7.0 + if (baseUrl || paths) { + console.warn( + colors + .bold() + .yellow( + `You have specified a baseUrl and/or paths in your ${config.kind} which interferes with SvelteKit's auto-generated tsconfig.json. ` + + 'Remove it to avoid problems with intellisense. For path aliases, use `kit.alias` instead: https://svelte.dev/docs/kit/configuration#alias' + ) + ); + } + } else { + let relative = posixify(path.relative('.', out)); + if (!relative.startsWith('./')) relative = './' + relative; + + console.warn( + colors + .bold() + .yellow(`Your ${config.kind} should extend the configuration generated by SvelteKit:`) + ); + console.warn(`{\n "extends": "${relative}"\n}`); + } +} + +// +const alias_regex = /^(.+?)(\/\*)?$/; +// +const value_regex = /^(.*?)((\/\*)|(\.\w+))?$/; + +/** + * Generates tsconfig path aliases from kit's aliases. + * Related to vite alias creation. + * + * @param {import('types').ValidatedKitConfig} config + */ +function get_tsconfig_paths(config) { + /** @param {string} file */ + const config_relative = (file) => { + let relative_path = path.relative(config.outDir, file); + if (!relative_path.startsWith('..')) { + relative_path = './' + relative_path; + } + return posixify(relative_path); + }; + + const alias = { ...config.alias }; + if (fs.existsSync(project_relative(config.files.lib))) { + alias['$lib'] = project_relative(config.files.lib); + } + + /** @type {Record} */ + const paths = {}; + + for (const [key, value] of Object.entries(alias)) { + const key_match = alias_regex.exec(key); + if (!key_match) throw new Error(`Invalid alias key: ${key}`); + + const value_match = value_regex.exec(value); + if (!value_match) throw new Error(`Invalid alias value: ${value}`); + + const rel_path = config_relative(remove_trailing_slashstar(value)); + const slashstar = key_match[2]; + + if (slashstar) { + paths[key] = [rel_path + '/*']; + } else { + paths[key] = [rel_path]; + const fileending = value_match[4]; + + if (!fileending && !(key + '/*' in alias)) { + paths[key + '/*'] = [rel_path + '/*']; + } + } + } + + return paths; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js new file mode 100644 index 0000000000000000000000000000000000000000..420453333135062d4746b14ba9b29eef1cec14e1 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js @@ -0,0 +1,877 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import MagicString from 'magic-string'; +import { posixify, rimraf, walk } from '../../../utils/filesystem.js'; +import { compact } from '../../../utils/array.js'; +import { ts } from '../ts.js'; +const remove_relative_parent_traversals = (/** @type {string} */ path) => + path.replace(/\.\.\//g, ''); +const is_whitespace = (/** @type {string} */ char) => /\s/.test(char); + +/** + * @typedef {{ + * file_name: string; + * modified: boolean; + * code: string; + * exports: any[]; + * } | null} Proxy + * + * @typedef {{ + * server: Proxy, + * universal: Proxy + * }} Proxies + * + * @typedef {Map} RoutesMap + */ + +const cwd = process.cwd(); + +/** + * Creates types for the whole manifest + * @param {import('types').ValidatedConfig} config + * @param {import('types').ManifestData} manifest_data + */ +export function write_all_types(config, manifest_data) { + if (!ts) return; + + const types_dir = `${config.kit.outDir}/types`; + + // empty out files that no longer need to exist + const routes_dir = remove_relative_parent_traversals( + posixify(path.relative('.', config.kit.files.routes)) + ); + const expected_directories = new Set( + manifest_data.routes.map((route) => path.join(routes_dir, route.id)) + ); + + if (fs.existsSync(types_dir)) { + for (const file of walk(types_dir)) { + const dir = path.dirname(file); + if (!expected_directories.has(dir)) { + rimraf(path.join(types_dir, file)); + } + } + } + + // Read/write meta data on each invocation, not once per node process, + // it could be invoked by another process in the meantime. + const meta_data_file = `${types_dir}/route_meta_data.json`; + const has_meta_data = fs.existsSync(meta_data_file); + const meta_data = has_meta_data + ? /** @type {Record} */ (JSON.parse(fs.readFileSync(meta_data_file, 'utf-8'))) + : {}; + const routes_map = create_routes_map(manifest_data); + // For each directory, write $types.d.ts + for (const route of manifest_data.routes) { + if (!route.leaf && !route.layout && !route.endpoint) continue; // nothing to do + + const outdir = path.join(config.kit.outDir, 'types', routes_dir, route.id); + + // check if the types are out of date + /** @type {string[]} */ + const input_files = []; + + /** @type {import('types').PageNode | null} */ + let node = route.leaf; + while (node) { + if (node.universal) input_files.push(node.universal); + if (node.server) input_files.push(node.server); + node = node.parent ?? null; + } + + /** @type {import('types').PageNode | null} */ + node = route.layout; + while (node) { + if (node.universal) input_files.push(node.universal); + if (node.server) input_files.push(node.server); + node = node.parent ?? null; + } + + if (route.endpoint) { + input_files.push(route.endpoint.file); + } + + try { + fs.mkdirSync(outdir, { recursive: true }); + } catch {} + + const output_files = compact( + fs.readdirSync(outdir).map((name) => { + const stats = fs.statSync(path.join(outdir, name)); + if (stats.isDirectory()) return; + return { + name, + updated: stats.mtimeMs + }; + }) + ); + + const source_last_updated = Math.max( + // ctimeMs includes move operations whereas mtimeMs does not + ...input_files.map((file) => fs.statSync(file).ctimeMs) + ); + const types_last_updated = Math.max(...output_files.map((file) => file.updated)); + + const should_generate = + // source files were generated more recently than the types + source_last_updated > types_last_updated || + // no meta data file exists yet + !has_meta_data || + // some file was deleted + !meta_data[route.id]?.every((file) => input_files.includes(file)); + + if (should_generate) { + // track which old files end up being surplus to requirements + const to_delete = new Set(output_files.map((file) => file.name)); + update_types(config, routes_map, route, to_delete); + meta_data[route.id] = input_files; + } + } + + fs.writeFileSync(meta_data_file, JSON.stringify(meta_data, null, '\t')); +} + +/** + * Creates types related to the given file. This should only be called + * if the file in question was edited, not if it was created/deleted/moved. + * @param {import('types').ValidatedConfig} config + * @param {import('types').ManifestData} manifest_data + * @param {string} file + */ +export function write_types(config, manifest_data, file) { + if (!ts) return; + + if (!path.basename(file).startsWith('+')) { + // Not a route file + return; + } + + const id = '/' + posixify(path.relative(config.kit.files.routes, path.dirname(file))); + + const route = manifest_data.routes.find((route) => route.id === id); + if (!route) return; + if (!route.leaf && !route.layout && !route.endpoint) return; // nothing to do + + update_types(config, create_routes_map(manifest_data), route); +} + +/** + * Collect all leafs into a leaf -> route map + * @param {import('types').ManifestData} manifest_data + */ +function create_routes_map(manifest_data) { + /** @type {RoutesMap} */ + const map = new Map(); + for (const route of manifest_data.routes) { + if (route.leaf) { + map.set(route.leaf, { route, proxies: { server: null, universal: null } }); + } + } + return map; +} + +/** + * Update types for a specific route + * @param {import('types').ValidatedConfig} config + * @param {RoutesMap} routes + * @param {import('types').RouteData} route + * @param {Set} [to_delete] + */ +function update_types(config, routes, route, to_delete = new Set()) { + const routes_dir = remove_relative_parent_traversals( + posixify(path.relative('.', config.kit.files.routes)) + ); + const outdir = path.join(config.kit.outDir, 'types', routes_dir, route.id); + + // now generate new types + const imports = ["import type * as Kit from '@sveltejs/kit';"]; + + /** @type {string[]} */ + const declarations = []; + + /** @type {string[]} */ + const exports = []; + + // add 'Expand' helper + // Makes sure a type is "repackaged" and therefore more readable + declarations.push('type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never;'); + + // returns the predicate of a matcher's type guard - or string if there is no type guard + declarations.push( + 'type MatcherParam = M extends (param : string) => param is (infer U extends string) ? U : string;' + ); + + declarations.push( + 'type RouteParams = ' + generate_params_type(route.params, outdir, config) + ';' + ); + + if (route.params.length > 0) { + exports.push( + 'export type EntryGenerator = () => Promise> | Array;' + ); + } + + declarations.push(`type RouteId = '${route.id}';`); + + // These could also be placed in our public types, but it would bloat them unnecessarily and we may want to change these in the future + if (route.layout || route.leaf) { + declarations.push( + // If T extends the empty object, void is also allowed as a return type + 'type MaybeWithVoid = {} extends T ? T | void : T;', + + // Returns the key of the object whose values are required. + 'export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];', + + // Helper type to get the correct output type for load functions. It should be passed the parent type to check what types from App.PageData are still required. + // If none, void is also allowed as a return type. + 'type OutputDataShape = MaybeWithVoid> & Partial> & Record>', + + // null & {} == null, we need to prevent that in some situations + 'type EnsureDefined = T extends null | undefined ? {} : T;', + + // Takes a union type and returns a union type where each type also has all properties + // of all possible types (typed as undefined), making accessing them more ergonomic + 'type OptionalUnion, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude]?: never } & U : never;', + + // Re-export `Snapshot` from @sveltejs/kit — in future we could use this to infer from the return type of `snapshot.capture` + 'export type Snapshot = Kit.Snapshot;' + ); + } + + if (route.leaf) { + let route_info = routes.get(route.leaf); + if (!route_info) { + // This should be defined, but belts and braces + route_info = { route, proxies: { server: null, universal: null } }; + routes.set(route.leaf, route_info); + } + + const { + declarations: d, + exports: e, + proxies + } = process_node(route.leaf, outdir, true, route_info.proxies); + + exports.push(...e); + declarations.push(...d); + + if (proxies.server) { + route_info.proxies.server = proxies.server; + if (proxies.server?.modified) to_delete.delete(proxies.server.file_name); + } + if (proxies.universal) { + route_info.proxies.universal = proxies.universal; + if (proxies.universal?.modified) to_delete.delete(proxies.universal.file_name); + } + + if (route.leaf.server) { + exports.push( + 'export type Action | void = Record | void> = Kit.Action' + ); + exports.push( + 'export type Actions | void = Record | void> = Kit.Actions' + ); + } + + if (route.leaf.server) { + exports.push( + 'export type PageProps = { params: RouteParams; data: PageData; form: ActionData }' + ); + } else { + exports.push('export type PageProps = { params: RouteParams; data: PageData }'); + } + } + + if (route.layout) { + let all_pages_have_load = true; + /** @type {import('types').RouteParam[]} */ + const layout_params = []; + const ids = ['RouteId']; + + route.layout.child_pages?.forEach((page) => { + const leaf = routes.get(page); + if (leaf) { + if (leaf.route.page) ids.push(`"${leaf.route.id}"`); + + for (const param of leaf.route.params) { + // skip if already added + if (layout_params.some((p) => p.name === param.name)) continue; + layout_params.push({ ...param, optional: true }); + } + + ensureProxies(page, leaf.proxies); + + if ( + // Be defensive - if a proxy doesn't exist (because it couldn't be created), assume a load function exists. + // If we didn't and it's a false negative, the user could wrongfully get a type error on layouts. + (leaf.proxies.server && !leaf.proxies.server.exports.includes('load')) || + (leaf.proxies.universal && !leaf.proxies.universal.exports.includes('load')) + ) { + all_pages_have_load = false; + } + } + if (!page.server && !page.universal) { + all_pages_have_load = false; + } + }); + + if (route.id === '/') { + // root layout is used for fallback error page, where ID can be null + ids.push('null'); + } + + declarations.push(`type LayoutRouteId = ${ids.join(' | ')}`); + + declarations.push( + 'type LayoutParams = RouteParams & ' + generate_params_type(layout_params, outdir, config) + ); + + const { + exports: e, + declarations: d, + proxies + } = process_node( + route.layout, + outdir, + false, + { server: null, universal: null }, + all_pages_have_load + ); + + exports.push(...e); + declarations.push(...d); + + if (proxies.server?.modified) to_delete.delete(proxies.server.file_name); + if (proxies.universal?.modified) to_delete.delete(proxies.universal.file_name); + + exports.push( + 'export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }' + ); + } + + if (route.endpoint) { + exports.push('export type RequestHandler = Kit.RequestHandler;'); + } + + if (route.leaf?.server || route.layout?.server || route.endpoint) { + exports.push('export type RequestEvent = Kit.RequestEvent;'); + } + + const output = [imports.join('\n'), declarations.join('\n'), exports.join('\n')] + .filter(Boolean) + .join('\n\n'); + + fs.writeFileSync(`${outdir}/$types.d.ts`, output); + to_delete.delete('$types.d.ts'); + + for (const file of to_delete) { + fs.unlinkSync(path.join(outdir, file)); + } +} + +/** + * @param {import('types').PageNode} node + * @param {string} outdir + * @param {boolean} is_page + * @param {Proxies} proxies + * @param {boolean} [all_pages_have_load] + */ +function process_node(node, outdir, is_page, proxies, all_pages_have_load = true) { + const params = `${is_page ? 'Route' : 'Layout'}Params`; + const prefix = is_page ? 'Page' : 'Layout'; + + const route_id = is_page ? 'RouteId' : 'LayoutRouteId'; + + /** @type {string[]} */ + const declarations = []; + /** @type {string[]} */ + const exports = []; + + /** @type {string} */ + let server_data; + /** @type {string} */ + let data; + + ensureProxies(node, proxies); + + if (node.server) { + const basename = path.basename(node.server); + const proxy = proxies.server; + if (proxy?.modified) { + fs.writeFileSync(`${outdir}/proxy${basename}`, proxy.code); + } + + server_data = get_data_type(node.server, 'null', proxy, true); + + const parent_type = `${prefix}ServerParentData`; + + declarations.push(`type ${parent_type} = ${get_parent_type(node, 'LayoutServerData')};`); + + // +page.js load present -> server can return all-optional data + const output_data_shape = + node.universal || (!is_page && all_pages_have_load) + ? 'Partial & Record | void' + : `OutputDataShape<${parent_type}>`; + exports.push( + `export type ${prefix}ServerLoad = Kit.ServerLoad<${params}, ${parent_type}, OutputData, ${route_id}>;` + ); + + exports.push(`export type ${prefix}ServerLoadEvent = Parameters<${prefix}ServerLoad>[0];`); + + if (is_page) { + let type = 'unknown'; + if (proxy && proxy.exports.includes('actions')) { + // If the file wasn't tweaked, we can use the return type of the original file. + // The advantage is that type updates are reflected without saving. + const from = proxy.modified + ? `./proxy${replace_ext_with_js(basename)}` + : path_to_original(outdir, node.server); + + exports.push( + 'type ExcludeActionFailure = T extends Kit.ActionFailure ? never : T extends void ? never : T;', + 'type ActionsSuccess any>> = { [Key in keyof T]: ExcludeActionFailure>>; }[keyof T];', + 'type ExtractActionFailure = T extends Kit.ActionFailure ? X extends void ? never : X : never;', + 'type ActionsFailure any>> = { [Key in keyof T]: Exclude>>, void>; }[keyof T];', + `type ActionsExport = typeof import('${from}').actions`, + 'export type SubmitFunction = Kit.SubmitFunction>, Expand>>' + ); + + type = 'Expand> | null'; + } + exports.push(`export type ActionData = ${type};`); + } + } else { + server_data = 'null'; + } + exports.push(`export type ${prefix}ServerData = ${server_data};`); + + const parent_type = `${prefix}ParentData`; + declarations.push(`type ${parent_type} = ${get_parent_type(node, 'LayoutData')};`); + + if (node.universal) { + const proxy = proxies.universal; + if (proxy?.modified) { + fs.writeFileSync(`${outdir}/proxy${path.basename(node.universal)}`, proxy.code); + } + + const type = get_data_type( + node.universal, + `${parent_type} & EnsureDefined<${prefix}ServerData>`, + proxy + ); + + data = `Expand & OptionalUnion>>`; + + const output_data_shape = + !is_page && all_pages_have_load + ? 'Partial & Record | void' + : `OutputDataShape<${parent_type}>`; + exports.push( + `export type ${prefix}Load = Kit.Load<${params}, ${prefix}ServerData, ${parent_type}, OutputData, ${route_id}>;` + ); + + exports.push(`export type ${prefix}LoadEvent = Parameters<${prefix}Load>[0];`); + } else if (server_data === 'null') { + data = `Expand<${parent_type}>`; + } else { + data = `Expand & EnsureDefined<${prefix}ServerData>>`; + } + + exports.push(`export type ${prefix}Data = ${data};`); + + return { declarations, exports, proxies }; + + /** + * @param {string} file_path + * @param {string} fallback + * @param {Proxy} proxy + * @param {boolean} expand + */ + function get_data_type(file_path, fallback, proxy, expand = false) { + if (proxy) { + if (proxy.exports.includes('load')) { + // If the file wasn't tweaked, we can use the return type of the original file. + // The advantage is that type updates are reflected without saving. + const from = proxy.modified + ? `./proxy${replace_ext_with_js(path.basename(file_path))}` + : path_to_original(outdir, file_path); + const type = `Kit.LoadProperties>>`; + return expand ? `Expand>>` : type; + } else { + return fallback; + } + } else { + return 'unknown'; + } + } +} + +/** + * This function populates the proxies object, if necessary and not already done. + * Proxies are used to tweak the code of a file before it's typechecked. + * They are needed in two places - when generating the types for a page or layout. + * To not do the same work twice, we generate the proxies once and pass them around. + * + * @param {import('types').PageNode} node + * @param {Proxies} proxies + */ +function ensureProxies(node, proxies) { + if (node.server && !proxies.server) { + proxies.server = createProxy(node.server, true); + } + + if (node.universal && !proxies.universal) { + proxies.universal = createProxy(node.universal, false); + } +} + +/** + * @param {string} file_path + * @param {boolean} is_server + * @returns {Proxy} + */ +function createProxy(file_path, is_server) { + const proxy = tweak_types(fs.readFileSync(file_path, 'utf8'), is_server); + if (proxy) { + return { + ...proxy, + file_name: `proxy${path.basename(file_path)}` + }; + } else { + return null; + } +} + +/** + * Get the parent type string by recursively looking up the parent layout and accumulate them to one type. + * @param {import('types').PageNode} node + * @param {string} type + */ +function get_parent_type(node, type) { + const parent_imports = []; + + let parent = node.parent; + + while (parent) { + const d = node.depth - parent.depth; + // unshift because we need it the other way round for the import string + parent_imports.unshift( + `${d === 0 ? '' : `import('${'../'.repeat(d)}${'$types.js'}').`}${type}` + ); + parent = parent.parent; + } + + let parent_str = `EnsureDefined<${parent_imports[0] || '{}'}>`; + for (let i = 1; i < parent_imports.length; i++) { + // Omit is necessary because a parent could have a property with the same key which would + // cause a type conflict. At runtime the child overwrites the parent property in this case, + // so reflect that in the type definition. + // EnsureDefined is necessary because {something: string} & null becomes null. + // Output types of server loads can be null but when passed in through the `parent` parameter they are the empty object instead. + parent_str = `Omit<${parent_str}, keyof ${parent_imports[i]}> & EnsureDefined<${parent_imports[i]}>`; + } + return parent_str; +} + +/** + * @param {string} outdir + * @param {string} file_path + */ +function path_to_original(outdir, file_path) { + return posixify(path.relative(outdir, path.join(cwd, replace_ext_with_js(file_path)))); +} + +/** + * @param {string} file_path + */ +function replace_ext_with_js(file_path) { + // Another extension than `.js` (or nothing, but that fails with node16 moduleResolution) + // will result in TS failing to lookup the file + const ext = path.extname(file_path); + return file_path.slice(0, -ext.length) + '.js'; +} + +/** + * @param {import('types').RouteParam[]} params + * @param {string} outdir + * @param {import('types').ValidatedConfig} config + */ +function generate_params_type(params, outdir, config) { + /** @param {string} matcher */ + const path_to_matcher = (matcher) => + posixify(path.relative(outdir, path.join(config.kit.files.params, matcher + '.js'))); + + return `{ ${params + .map( + (param) => + `${param.name}${param.optional ? '?' : ''}: ${ + param.matcher + ? `MatcherParam` + : 'string' + }${param.optional ? ' | undefined' : ''}` + ) + .join('; ')} }`; +} + +/** + * @param {string} content + * @param {boolean} is_server + * @returns {Omit, 'file_name'> | null} + */ +export function tweak_types(content, is_server) { + const names = new Set(is_server ? ['load', 'actions'] : ['load']); + + try { + let modified = false; + + const ast = ts.createSourceFile( + 'filename.ts', + content, + ts.ScriptTarget.Latest, + false, + ts.ScriptKind.TS + ); + + const code = new MagicString(content); + + const exports = new Map(); + /** @param {import('typescript').BindingName} name */ + function add_export(name) { + if (ts.isIdentifier(name)) { + if (names.has(name.text)) exports.set(name.text, name.text); + } else { + for (const element of name.elements) { + if (ts.isBindingElement(element)) add_export(element.name); + } + } + } + + ast.forEachChild((node) => { + if ( + ts.isExportDeclaration(node) && + node.exportClause && + ts.isNamedExports(node.exportClause) + ) { + node.exportClause.elements.forEach((element) => { + const exported = element.name; + if (names.has(element.name.text)) { + const local = element.propertyName || element.name; + exports.set(exported.text, local.text); + } + }); + } + + if ( + ts.canHaveModifiers(node) && + ts.getModifiers(node)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) + ) { + if (ts.isFunctionDeclaration(node) && node.name?.text && names.has(node.name?.text)) { + exports.set(node.name.text, node.name.text); + } + + if (ts.isVariableStatement(node)) { + node.declarationList.declarations.forEach((declaration) => { + add_export(declaration.name); + }); + } + } + }); + + /** + * @param {import('typescript').Node} node + * @param {import('typescript').Node} value + */ + function replace_jsdoc_type_tags(node, value) { + let _modified = false; + // @ts-ignore + if (node.jsDoc) { + // @ts-ignore + for (const comment of node.jsDoc) { + for (const tag of comment.tags ?? []) { + if (ts.isJSDocTypeTag(tag)) { + const is_fn = + ts.isFunctionDeclaration(value) || + ts.isFunctionExpression(value) || + ts.isArrowFunction(value); + + if (is_fn && value.parameters?.length > 0) { + const name = ts.isIdentifier(value.parameters[0].name) + ? value.parameters[0].name.text + : 'event'; + code.overwrite(tag.tagName.pos, tag.tagName.end, 'param'); + code.prependRight(tag.typeExpression.pos + 1, 'Parameters<'); + code.appendLeft(tag.typeExpression.end - 1, '>[0]'); + code.appendLeft(tag.typeExpression.end, ` ${name}`); + } else { + code.overwrite(tag.pos, tag.end, ''); + } + _modified = true; + } + } + } + } + modified = modified || _modified; + return _modified; + } + + ast.forEachChild((node) => { + if (ts.isFunctionDeclaration(node) && node.name?.text && node.name?.text === 'load') { + // remove JSDoc comment above `export function load ...` + replace_jsdoc_type_tags(node, node); + } + + if (ts.isVariableStatement(node)) { + // remove JSDoc comment above `export const load = ...` + if ( + ts.isIdentifier(node.declarationList.declarations[0].name) && + names.has(node.declarationList.declarations[0].name.text) && + node.declarationList.declarations[0].initializer + ) { + replace_jsdoc_type_tags(node, node.declarationList.declarations[0].initializer); + } + + for (const declaration of node.declarationList.declarations) { + if ( + ts.isIdentifier(declaration.name) && + declaration.name.text === 'load' && + declaration.initializer + ) { + // edge case — remove JSDoc comment above individual export + replace_jsdoc_type_tags(declaration, declaration.initializer); + + // remove type from `export const load: Load ...` + if (declaration.type) { + let a = declaration.type.pos; + const b = declaration.type.end; + while (is_whitespace(content[a])) a += 1; + + const type = content.slice(a, b); + code.remove(declaration.name.end, declaration.type.end); + + const rhs = declaration.initializer; + + if ( + rhs && + (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && + rhs.parameters.length + ) { + const arg = rhs.parameters[0]; + const add_parens = content[arg.pos - 1] !== '('; + + if (add_parens) code.prependRight(arg.pos, '('); + + if (arg && !arg.type) { + code.appendLeft( + arg.name.end, + `: Parameters<${type}>[0]` + (add_parens ? ')' : '') + ); + } else { + // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs + code.append(`;null as any as ${type};`); + } + } else { + // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs + code.append(`;null as any as ${type};`); + } + + modified = true; + } + } else if ( + is_server && + ts.isIdentifier(declaration.name) && + declaration.name?.text === 'actions' && + declaration.initializer + ) { + // remove JSDoc comment from `export const actions = ..` + const removed = replace_jsdoc_type_tags(node, declaration.initializer); + // ... and move type to each individual action + if (removed) { + const rhs = declaration.initializer; + if (ts.isObjectLiteralExpression(rhs)) { + for (const prop of rhs.properties) { + if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) { + const rhs = prop.initializer; + const replaced = replace_jsdoc_type_tags(prop, rhs); + if ( + !replaced && + rhs && + (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && + rhs.parameters?.[0] + ) { + const name = ts.isIdentifier(rhs.parameters[0].name) + ? rhs.parameters[0].name.text + : 'event'; + code.prependRight( + rhs.pos, + `/** @param {import('./$types').RequestEvent} ${name} */ ` + ); + } + } + } + } + } + + // remove type from `export const actions: Actions ...` + if (declaration.type) { + let a = declaration.type.pos; + const b = declaration.type.end; + while (is_whitespace(content[a])) a += 1; + + const type = content.slice(a, b); + code.remove(declaration.name.end, declaration.type.end); + code.append(`;null as any as ${type};`); + modified = true; + + // ... and move type to each individual action + const rhs = declaration.initializer; + if (ts.isObjectLiteralExpression(rhs)) { + for (const prop of rhs.properties) { + if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) { + const rhs = prop.initializer; + + if ( + rhs && + (ts.isArrowFunction(rhs) || ts.isFunctionExpression(rhs)) && + rhs.parameters.length + ) { + const arg = rhs.parameters[0]; + const add_parens = content[arg.pos - 1] !== '('; + + if (add_parens) code.prependRight(arg.pos, '('); + + if (arg && !arg.type) { + code.appendLeft( + arg.name.end, + ": import('./$types').RequestEvent" + (add_parens ? ')' : '') + ); + } + } + } + } + } + } + } + } + } + }); + + if (modified) { + // Ignore all type errors so they don't show up twice when svelte-check runs + // Account for possible @ts-check which would overwrite @ts-nocheck + if (code.original.startsWith('// @ts-check')) { + code.prependLeft('// @ts-check'.length, '\n// @ts-nocheck\n'); + } else { + code.prepend('// @ts-nocheck\n'); + } + } + + return { + modified, + code: code.toString(), + exports: Array.from(exports.keys()) + }; + } catch { + return null; + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/core/utils.js b/tools/ui/node_modules/@sveltejs/kit/src/core/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..3bbcdea712ff97e792265d64763a1caa17f2a160 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/core/utils.js @@ -0,0 +1,86 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import { fileURLToPath } from 'node:url'; +import colors from 'kleur'; +import { posixify, to_fs } from '../utils/filesystem.js'; +import { noop } from '../utils/functions.js'; + +/** + * Resolved path of the `runtime` directory + * + * TODO Windows issue: + * Vite or sth else somehow sets the driver letter inconsistently to lower or upper case depending on the run environment. + * In playwright debug mode run through VS Code this a root-to-lowercase conversion is needed in order for the tests to run. + * If we do this conversion in other cases it has the opposite effect though and fails. + */ +export const runtime_directory = posixify(fileURLToPath(new URL('../runtime', import.meta.url))); + +/** + * This allows us to import SvelteKit internals that aren't exposed via `pkg.exports` in a + * way that works whether `@sveltejs/kit` is installed inside the project's `node_modules` + * or in a workspace root + */ +export const runtime_base = runtime_directory.startsWith(process.cwd()) + ? `/${path.relative('.', runtime_directory)}` + : to_fs(runtime_directory); + +/** @param {{ verbose: boolean }} opts */ +export function logger({ verbose }) { + /** @type {import('types').Logger} */ + const log = (msg) => console.log(msg.replace(/^/gm, ' ')); + + /** @param {string} msg */ + const err = (msg) => console.error(msg.replace(/^/gm, ' ')); + + log.success = (msg) => log(colors.green(`✔ ${msg}`)); + log.error = (msg) => err(colors.bold().red(msg)); + log.warn = (msg) => log(colors.bold().yellow(msg)); + + log.minor = verbose ? (msg) => log(colors.grey(msg)) : noop; + log.info = verbose ? log : noop; + + return log; +} + +/** @param {import('types').ManifestData} manifest_data */ +export function get_mime_lookup(manifest_data) { + /** @type {Record} */ + const mime = {}; + + manifest_data.assets.forEach((asset) => { + if (asset.type) { + const ext = path.extname(asset.file); + mime[ext] = asset.type; + } + }); + + return mime; +} + +/** + * @param {string} dir + * @param {(file: string) => boolean} [filter] + */ +export function list_files(dir, filter) { + /** @type {string[]} */ + const files = []; + + /** @param {string} current */ + function walk(current) { + for (const file of fs.readdirSync(path.resolve(dir, current))) { + const child = path.posix.join(current, file); + if (fs.statSync(path.resolve(dir, child)).isDirectory()) { + walk(child); + } else { + if (!filter || filter(child)) { + files.push(child); + } + } + } + } + + if (fs.existsSync(dir)) walk(''); + + return files; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/env/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/env/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1f3e591e4b2095f76855393af3bf2b5b264b4bf4 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/env/index.js @@ -0,0 +1,12 @@ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ + +/** + * Utility for defining [environment variables](https://svelte.dev/docs/kit/environment-variables), + * which are made available via `$app/env/public` and `$app/env/private`. + * @template {Record>} T + * @param {T} variables + * @returns {T} + */ +export function defineEnvVars(variables) { + return variables; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..460c07b366c87ba5490a5bacf2829e8a79bc3665 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/index.js @@ -0,0 +1,16 @@ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ + +export { sequence } from './sequence.js'; + +/** + * Utility for defining [environment variables](https://svelte.dev/docs/kit/environment-variables), + * which are made available via `$app/env/public` and `$app/env/private`. + * @template {Record>} T + * @param {T} variables + * @returns {T} + * @deprecated Import `defineEnvVars` from `@sveltejs/kit/env` instead + */ +export function defineEnvVars(variables) { + console.warn(`\`defineEnvVars\` has moved — import it from \`@sveltejs/kit/env\` instead`); + return variables; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js new file mode 100644 index 0000000000000000000000000000000000000000..3668c500cebb19d78761db7f460143826cf220ac --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/hooks/sequence.js @@ -0,0 +1,145 @@ +/** @import { Handle, RequestEvent, ResolveOptions } from '@sveltejs/kit' */ +/** @import { MaybePromise } from 'types' */ +import { + merge_tracing, + get_request_store, + with_request_store +} from '@sveltejs/kit/internal/server'; + +/** + * A helper function for sequencing multiple `handle` calls in a middleware-like manner. + * The behavior for the `handle` options is as follows: + * - `transformPageChunk` is applied in reverse order and merged + * - `preload` is applied in forward order, the first option "wins" and no `preload` options after it are called + * - `filterSerializedResponseHeaders` behaves the same as `preload` + * + * ```js + * /// file: src/hooks.server.js + * import { sequence } from '@sveltejs/kit/hooks'; + * + * /// type: import('@sveltejs/kit').Handle + * async function first({ event, resolve }) { + * console.log('first pre-processing'); + * const result = await resolve(event, { + * transformPageChunk: ({ html }) => { + * // transforms are applied in reverse order + * console.log('first transform'); + * return html; + * }, + * preload: () => { + * // this one wins as it's the first defined in the chain + * console.log('first preload'); + * return true; + * } + * }); + * console.log('first post-processing'); + * return result; + * } + * + * /// type: import('@sveltejs/kit').Handle + * async function second({ event, resolve }) { + * console.log('second pre-processing'); + * const result = await resolve(event, { + * transformPageChunk: ({ html }) => { + * console.log('second transform'); + * return html; + * }, + * preload: () => { + * console.log('second preload'); + * return true; + * }, + * filterSerializedResponseHeaders: () => { + * // this one wins as it's the first defined in the chain + * console.log('second filterSerializedResponseHeaders'); + * return true; + * } + * }); + * console.log('second post-processing'); + * return result; + * } + * + * export const handle = sequence(first, second); + * ``` + * + * The example above would print: + * + * ``` + * first pre-processing + * first preload + * second pre-processing + * second filterSerializedResponseHeaders + * second transform + * first transform + * second post-processing + * first post-processing + * ``` + * + * @param {...Handle} handlers The chain of `handle` functions + * @returns {Handle} + */ +export function sequence(...handlers) { + const length = handlers.length; + if (!length) return ({ event, resolve }) => resolve(event); + + return ({ event, resolve }) => { + const { state } = get_request_store(); + return apply_handle(0, event, {}); + + /** + * @param {number} i + * @param {RequestEvent} event + * @param {ResolveOptions | undefined} parent_options + * @returns {MaybePromise} + */ + function apply_handle(i, event, parent_options) { + const handle = handlers[i]; + + return state.tracing.record_span({ + name: `sveltekit.handle.sequenced.${handle.name ? handle.name : i}`, + attributes: {}, + fn: async (current) => { + const traced_event = merge_tracing(event, current); + return await with_request_store({ event: traced_event, state }, () => + handle({ + event: traced_event, + resolve: (event, options) => { + /** @type {ResolveOptions['transformPageChunk']} */ + const transformPageChunk = async ({ html, done }) => { + if (options?.transformPageChunk) { + html = (await options.transformPageChunk({ html, done })) ?? ''; + } + + if (parent_options?.transformPageChunk) { + html = (await parent_options.transformPageChunk({ html, done })) ?? ''; + } + + return html; + }; + + /** @type {ResolveOptions['filterSerializedResponseHeaders']} */ + const filterSerializedResponseHeaders = + parent_options?.filterSerializedResponseHeaders ?? + options?.filterSerializedResponseHeaders; + + /** @type {ResolveOptions['preload']} */ + const preload = parent_options?.preload ?? options?.preload; + + return i < length - 1 + ? apply_handle(i + 1, event, { + transformPageChunk, + filterSerializedResponseHeaders, + preload + }) + : resolve(event, { + transformPageChunk, + filterSerializedResponseHeaders, + preload + }); + } + }) + ); + } + }); + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c6e2b7c465ff80d481fc5dfa69a081497faca529 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/index.js @@ -0,0 +1,308 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ + +import { HttpError, Redirect, ActionFailure, ValidationError } from './internal/index.js'; +import { BROWSER, DEV } from 'esm-env'; +import { + add_data_suffix, + add_resolution_suffix, + has_data_suffix, + has_resolution_suffix, + strip_data_suffix, + strip_resolution_suffix +} from '../runtime/pathname.js'; +import { text_encoder } from '../runtime/utils.js'; + +export { VERSION } from '../version.js'; + +// TODO 3.0: remove these types as they are not used anymore (we can't remove them yet because that would be a breaking change) +/** + * @template {number} TNumber + * @template {any[]} [TArray=[]] + * @typedef {TNumber extends TArray['length'] ? TArray[number] : LessThan} LessThan + */ + +/** + * @template {number} TStart + * @template {number} TEnd + * @typedef {Exclude, LessThan>} NumericRange + */ + +// Keep the status codes as `number` because restricting to certain numbers makes it unnecessarily hard to use compared to the benefits +// (we have runtime errors already to check for invalid codes). Also see https://github.com/sveltejs/kit/issues/11780 + +// we have to repeat the JSDoc because the display for function overloads is broken +// see https://github.com/microsoft/TypeScript/issues/55056 + +/** + * Throws an error with a HTTP status code and an optional message. + * When called during request handling, this will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + * @overload + * @param {number} status + * @param {App.Error} body + * @return {never} + * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. + * @throws {Error} If the provided status is invalid (not between 400 and 599). + */ +/** + * Throws an error with a HTTP status code and an optional message. + * When called during request handling, this will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + * @overload + * @param {number} status + * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] + * @return {never} + * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. + * @throws {Error} If the provided status is invalid (not between 400 and 599). + */ +/** + * Throws an error with a HTTP status code and an optional message. + * When called during request handling, this will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + * @return {never} + * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. + * @throws {Error} If the provided status is invalid (not between 400 and 599). + */ +export function error(status, body) { + if ((!BROWSER || DEV) && (isNaN(status) || status < 400 || status > 599)) { + throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`); + } + + throw new HttpError(status, body); +} + +/** + * Checks whether this is an error thrown by {@link error}. + * @template {number} T + * @param {unknown} e + * @param {T} [status] The status to filter for. + * @return {e is (HttpError & { status: T extends undefined ? never : T })} + */ +export function isHttpError(e, status) { + if (!(e instanceof HttpError)) return false; + return !status || e.status === status; +} + +/** + * Redirect a request. When called during request handling, SvelteKit will return a redirect response. + * Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it. + * + * Most common status codes: + * * `303 See Other`: redirect as a GET request (often used after a form POST request) + * * `307 Temporary Redirect`: redirect will keep the request method + * * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page + * + * [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages) + * + * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number)} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308. + * @param {string | URL} location The location to redirect to. + * @throws {Redirect} This error instructs SvelteKit to redirect to the specified location. + * @throws {Error} If the provided status is invalid or the location cannot be used as a header value. + * @return {never} + */ +export function redirect(status, location) { + if ((!BROWSER || DEV) && (isNaN(status) || status < 300 || status > 308)) { + throw new Error('Invalid status code'); + } + + throw new Redirect( + // @ts-ignore + status, + location.toString() + ); +} + +/** + * Checks whether this is a redirect thrown by {@link redirect}. + * @param {unknown} e The object to check. + * @return {e is Redirect} + */ +export function isRedirect(e) { + return e instanceof Redirect; +} + +/** + * Create a JSON `Response` object from the supplied data. + * @param {any} data The value that will be serialized as JSON. + * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically. + */ +export function json(data, init) { + // TODO deprecate this in favour of `Response.json` when it's + // more widely supported + const body = JSON.stringify(data); + + // we can't just do `text(JSON.stringify(data), init)` because + // it will set a default `content-type` header. duplicated code + // means less duplicated work + const headers = new Headers(init?.headers); + if (!headers.has('content-length')) { + headers.set('content-length', text_encoder.encode(body).byteLength.toString()); + } + + if (!headers.has('content-type')) { + headers.set('content-type', 'application/json'); + } + + return new Response(body, { + ...init, + headers + }); +} + +/** + * Create a `Response` object from the supplied body. + * @param {string} body The value that will be used as-is. + * @param {ResponseInit} [init] Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically. + */ +export function text(body, init) { + const headers = new Headers(init?.headers); + if (!headers.has('content-length')) { + const encoded = text_encoder.encode(body); + headers.set('content-length', encoded.byteLength.toString()); + return new Response(encoded, { + ...init, + headers + }); + } + + return new Response(body, { + ...init, + headers + }); +} + +/** + * Create an `ActionFailure` object. Call when form submission fails. + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @overload + * @param {number} status + * @returns {import('./public.js').ActionFailure} + */ +/** + * Create an `ActionFailure` object. Call when form submission fails. + * @template [T=undefined] + * @param {number} status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param {T} data Data associated with the failure (e.g. validation errors) + * @overload + * @param {number} status + * @param {T} data + * @returns {import('./public.js').ActionFailure} + */ +/** + * Create an `ActionFailure` object. Call when form submission fails. + * @param {number} status + * @param {any} [data] + * @returns {import('./public.js').ActionFailure} + */ +export function fail(status, data) { + // @ts-expect-error unique symbol missing + return new ActionFailure(status, data); +} + +/** + * Checks whether this is an action failure thrown by {@link fail}. + * @param {unknown} e The object to check. + * @return {e is import('./public.js').ActionFailure} + */ +export function isActionFailure(e) { + return e instanceof ActionFailure; +} + +/** + * Use this to throw a validation error to imperatively fail form validation. + * Can be used in combination with `issue` passed to form actions to create field-specific issues. + * + * @example + * ```ts + * import { invalid } from '@sveltejs/kit'; + * import { form } from '$app/server'; + * import { tryLogin } from '$lib/server/auth'; + * import * as v from 'valibot'; + * + * export const login = form( + * v.object({ name: v.string(), _password: v.string() }), + * async ({ name, _password }) => { + * const success = tryLogin(name, _password); + * if (!success) { + * invalid('Incorrect username or password'); + * } + * + * // ... + * } + * ); + * ``` + * @param {...(StandardSchemaV1.Issue | string)} issues + * @returns {never} + * @since 2.47.3 + */ +export function invalid(...issues) { + throw new ValidationError( + issues.map((issue) => (typeof issue === 'string' ? { message: issue } : issue)) + ); +} + +/** + * Checks whether this is an validation error thrown by {@link invalid}. + * @param {unknown} e The object to check. + * @return {e is import('./public.js').ActionFailure} + * @since 2.47.3 + */ +export function isValidationError(e) { + return e instanceof ValidationError; +} + +/** + * Strips possible SvelteKit-internal suffixes and trailing slashes from the URL pathname. + * Returns the normalized URL as well as a method for adding the potential suffix back + * based on a new pathname (possibly including search) or URL. + * ```js + * import { normalizeUrl } from '@sveltejs/kit'; + * + * const { url, denormalize } = normalizeUrl('/blog/post/__data.json'); + * console.log(url.pathname); // /blog/post + * console.log(denormalize('/blog/post/a')); // /blog/post/a/__data.json + * ``` + * @param {URL | string} url + * @returns {{ url: URL, wasNormalized: boolean, denormalize: (url?: string | URL) => URL }} + * @since 2.18.0 + */ +export function normalizeUrl(url) { + url = new URL(url, 'a://a'); + + const is_route_resolution = has_resolution_suffix(url.pathname); + const is_data_request = has_data_suffix(url.pathname); + const has_trailing_slash = url.pathname !== '/' && url.pathname.endsWith('/'); + + if (is_route_resolution) { + url.pathname = strip_resolution_suffix(url.pathname); + } else if (is_data_request) { + url.pathname = strip_data_suffix(url.pathname); + } else if (has_trailing_slash) { + url.pathname = url.pathname.slice(0, -1); + } + + return { + url, + wasNormalized: is_data_request || is_route_resolution || has_trailing_slash, + denormalize: (new_url = url) => { + new_url = new URL(new_url, url); + if (is_route_resolution) { + new_url.pathname = add_resolution_suffix(new_url.pathname); + } else if (is_data_request) { + new_url.pathname = add_data_suffix(new_url.pathname); + } else if (has_trailing_slash && !new_url.pathname.endsWith('/')) { + new_url.pathname += '/'; + } + return new_url; + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/env.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/env.js new file mode 100644 index 0000000000000000000000000000000000000000..b34a8636ef749629355f5f5cf24cf6f84c557d69 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/env.js @@ -0,0 +1,71 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ + +import { stackless } from '../../utils/error.js'; + +const MISSING = { + message: `Value is missing. If it is optional, add a Standard Schema validator declaring it as such.` +}; + +const BAD_VALIDATOR = { + message: 'Variable was configured with a validator that does not implement Standard Schema' +}; + +const ASYNC_VALIDATOR = { + message: 'Variable uses an async validator, which is not supported' +}; + +/** + * @param {Record | undefined>} variables + * @param {string | undefined} value + * @param {string} name + * @param {Record} issues + * @returns + */ +export function validate(variables, value, name, issues) { + const config = variables[name] ?? {}; + const validator = config.schema; + + if (!validator) { + if (!value) issues[name] = [MISSING]; + return value; + } + + if (!validator['~standard']) { + issues[name] = [BAD_VALIDATOR]; + return; + } + + const result = validator['~standard'].validate(value); + + if (result instanceof Promise) { + issues[name] = [ASYNC_VALIDATOR]; + return; + } + + if (result.issues) { + issues[name] = [...result.issues]; + return; + } + + return result.value; +} + +/** + * @param {Record} issues + */ +export function handle_issues(issues) { + const entries = Object.entries(issues); + + if (entries.length === 0) { + return; + } + + let message = 'Invalid environment variables\n'; + + for (const [name, issues] of entries) { + message += `\n${name}\n${issues.map((issue) => ` - ${issue.message}`).join('\n')}\n`; + } + + throw stackless(message); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/event.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/event.js new file mode 100644 index 0000000000000000000000000000000000000000..9d658494e1be2b3accd73610fc02698998d6dd10 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/event.js @@ -0,0 +1,85 @@ +/** @import { RequestEvent } from '@sveltejs/kit' */ +/** @import { RequestStore } from 'types' */ +/** @import { AsyncLocalStorage } from 'node:async_hooks' */ + +import { IN_WEBCONTAINER } from '../../runtime/server/constants.js'; + +/** @type {RequestStore | null} */ +let sync_store = null; + +/** @type {AsyncLocalStorage | null} */ +let als; + +import('node:async_hooks') + .then((hooks) => (als = new hooks.AsyncLocalStorage())) + .catch(() => { + // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously. + // this isn't behind `supports` because it's basically just StackBlitz (i.e. + // in-browser usage) that doesn't support it AFAICT + }); + +/** + * Returns the current `RequestEvent`. Can be used inside server hooks, server `load` functions, actions, and endpoints (and functions called by them). + * + * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). + * @since 2.20.0 + * + * @returns {RequestEvent} + */ +export function getRequestEvent() { + const event = try_get_request_store()?.event; + + if (!event) { + let message = + 'Can only read the current request event inside functions invoked during `handle`, such as server `load` functions, actions, endpoints, and other server hooks.'; + + if (!als) { + message += + ' In environments without `AsyncLocalStorage`, the event must be read synchronously, not after an `await`.'; + } + + throw new Error(message); + } + + return event; +} + +export function get_request_store() { + const result = try_get_request_store(); + if (!result) { + let message = 'Could not get the request store.'; + + if (als) { + message += ' This is an internal error.'; + } else { + message += + ' In environments without `AsyncLocalStorage`, the request store (used by e.g. remote functions) must be accessed synchronously, not after an `await`.' + + ' If it was accessed synchronously then this is an internal error.'; + } + + throw new Error(message); + } + return result; +} + +export function try_get_request_store() { + return sync_store ?? als?.getStore() ?? null; +} + +/** + * @template T + * @param {RequestStore | null} store + * @param {() => T} fn + */ +export function with_request_store(store, fn) { + try { + sync_store = store; + return als ? als.run(store, fn) : fn(); + } finally { + // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store` + // and handle only one request at a time in `src/runtime/server/index.js`. + if (!IN_WEBCONTAINER) { + sync_store = null; + } + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/index.js new file mode 100644 index 0000000000000000000000000000000000000000..eb9589c368d486ceec3820a5de92f72431ef8e0f --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/index.js @@ -0,0 +1,90 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ + +export class HttpError { + /** + * @param {number} status + * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body + */ + constructor(status, body) { + this.status = status; + if (typeof body === 'string') { + this.body = { message: body }; + } else if (body) { + this.body = body; + } else { + this.body = { message: `Error: ${status}` }; + } + } + + toString() { + return JSON.stringify(this.body); + } +} + +export class Redirect { + /** + * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status + * @param {string} location + */ + constructor(status, location) { + try { + new Headers({ location }); + } catch { + throw new Error( + `Invalid redirect location ${JSON.stringify(location)}: ` + + 'this string contains characters that cannot be used in HTTP headers' + ); + } + + this.status = status; + this.location = location; + } +} + +/** + * An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404. + * `SvelteKitError` goes through `handleError`. + * @extends Error + */ +export class SvelteKitError extends Error { + /** + * @param {number} status + * @param {string} text + * @param {string} message + */ + constructor(status, text, message) { + super(message); + this.status = status; + this.text = text; + } +} + +/** + * @template [T=undefined] + */ +export class ActionFailure { + /** + * @param {number} status + * @param {T} data + */ + constructor(status, data) { + this.status = status; + this.data = data; + } +} + +/** + * Error thrown when form validation fails imperatively + */ +export class ValidationError extends Error { + /** + * @param {StandardSchemaV1.Issue[]} issues + */ + constructor(issues) { + super('Validation failed'); + this.name = 'ValidationError'; + this.issues = issues; + } +} + +export { init_remote_functions } from './remote-functions.js'; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js new file mode 100644 index 0000000000000000000000000000000000000000..f7da7b41742d661928f03c7ac1a260fd8bf4a2ec --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/remote-functions.js @@ -0,0 +1,28 @@ +/** @import { RemoteInternals } from 'types' */ + +/** @type {RemoteInternals['type'][]} */ +const types = ['command', 'form', 'prerender', 'query', 'query_batch', 'query_live']; + +/** + * @param {Record} module + * @param {string} file + * @param {string} hash + */ +export function init_remote_functions(module, file, hash) { + if (module.default) { + throw new Error( + `Cannot export \`default\` from a remote module (${file}) — please use named exports instead` + ); + } + + for (const [name, fn] of Object.entries(module)) { + if (!types.includes(fn?.__?.type)) { + throw new Error( + `\`${name}\` exported from ${file} is invalid — all exports from this file must be remote functions` + ); + } + + fn.__.id = `${hash}/${name}`; + fn.__.name = name; + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/server.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/server.js new file mode 100644 index 0000000000000000000000000000000000000000..ed425062637fe3d74ea038d5bb2a685674e6c739 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/server.js @@ -0,0 +1,22 @@ +/** + * @template {{ tracing: { enabled: boolean, root: import('@opentelemetry/api').Span, current: import('@opentelemetry/api').Span } }} T + * @param {T} event_like + * @param {import('@opentelemetry/api').Span} current + * @returns {T} + */ +export function merge_tracing(event_like, current) { + return { + ...event_like, + tracing: { + ...event_like.tracing, + current + } + }; +} + +export { + with_request_store, + getRequestEvent, + get_request_store, + try_get_request_store +} from './event.js'; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/types.d.ts b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..040ed7928a07f4a74bd8b89a7d1ea2e01653f9a7 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/internal/types.d.ts @@ -0,0 +1,3 @@ +// We re-export this so we can use it in the `$app/env/*` module declarations +// without the app needing to depend on this package +export { StandardSchemaV1 } from '@standard-schema/spec'; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/node/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..87851e0c821c7a305071d75eb09c80ae6fbc21ed --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/node/index.js @@ -0,0 +1,243 @@ +import { createReadStream } from 'node:fs'; +import { Readable } from 'node:stream'; +import { SvelteKitError } from '../internal/index.js'; +import { noop } from '../../utils/functions.js'; +import { get_set_cookies } from '../../utils/http.js'; + +/** + * @param {import('http').IncomingMessage} req + * @param {number} [body_size_limit] + */ +function get_raw_body(req, body_size_limit) { + const h = req.headers; + + if (!h['content-type']) { + return null; + } + + const content_length = Number(h['content-length']); + const has_content_length = Number.isFinite(content_length); + + // check if no request body + if ( + (req.httpVersionMajor === 1 && !has_content_length && h['transfer-encoding'] == null) || + content_length === 0 + ) { + return null; + } + + if (req.destroyed) { + const readable = new ReadableStream(); + void readable.cancel(); + return readable; + } + + let size = 0; + let cancelled = false; + + return new ReadableStream({ + start(controller) { + if (body_size_limit !== undefined && has_content_length && content_length > body_size_limit) { + let message = `Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.`; + + if (body_size_limit === 0) { + // https://github.com/sveltejs/kit/pull/11589 + // TODO this exists to aid migration — remove in a future version + message += ' To disable body size limits, specify Infinity rather than 0.'; + } + + const error = new SvelteKitError(413, 'Payload Too Large', message); + + controller.error(error); + return; + } + + req.on('error', (error) => { + cancelled = true; + controller.error(error); + }); + + req.on('end', () => { + if (cancelled) return; + controller.close(); + }); + + req.on('data', (chunk) => { + if (cancelled) return; + + size += chunk.length; + + if (body_size_limit !== undefined && size > body_size_limit) { + cancelled = true; + + const message = `request body size exceeded BODY_SIZE_LIMIT of ${body_size_limit}`; + + const error = new SvelteKitError(413, 'Payload Too Large', message); + controller.error(error); + + return; + } + + if (has_content_length && size > content_length) { + cancelled = true; + + const message = `request body size exceeded content-length of ${content_length}`; + + const error = new SvelteKitError(413, 'Payload Too Large', message); + controller.error(error); + + return; + } + + controller.enqueue(chunk); + + if (controller.desiredSize === null || controller.desiredSize <= 0) { + req.pause(); + } + }); + }, + + pull() { + req.resume(); + }, + + cancel(reason) { + cancelled = true; + req.destroy(reason); + } + }); +} + +/** + * @param {{ + * request: import('http').IncomingMessage; + * base: string; + * bodySizeLimit?: number; + * }} options + * @returns {Promise} + */ +// TODO 3.0 make the signature synchronous? +// eslint-disable-next-line @typescript-eslint/require-await +export async function getRequest({ request, base, bodySizeLimit }) { + let headers = /** @type {Record} */ (request.headers); + if (request.httpVersionMajor >= 2) { + // the Request constructor rejects headers with ':' in the name + headers = Object.assign({}, headers); + // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5 + if (headers[':authority']) { + headers.host = headers[':authority']; + } + delete headers[':authority']; + delete headers[':method']; + delete headers[':path']; + delete headers[':scheme']; + } + + // TODO: Whenever Node >=22 is minimum supported version, we can use `request.readableAborted` + // @see https://github.com/nodejs/node/blob/5cf3c3e24c7257a0c6192ed8ef71efec8ddac22b/lib/internal/streams/readable.js#L1443-L1453 + const controller = new AbortController(); + let errored = false; + let end_emitted = false; + request.once('error', () => (errored = true)); + request.once('end', () => (end_emitted = true)); + request.once('close', () => { + if ((errored || request.destroyed) && !end_emitted) { + controller.abort(); + } + }); + + return new Request(base + request.url, { + // @ts-expect-error + duplex: 'half', + method: request.method, + headers: Object.entries(headers), + signal: controller.signal, + body: + request.method === 'GET' || request.method === 'HEAD' + ? undefined + : get_raw_body(request, bodySizeLimit) + }); +} + +/** + * @param {import('http').ServerResponse} res + * @param {Response} response + * @returns {Promise} + */ +// TODO 3.0 make the signature synchronous? +// eslint-disable-next-line @typescript-eslint/require-await +export async function setResponse(res, response) { + for (const [key, value] of response.headers) { + try { + res.setHeader(key, key === 'set-cookie' ? get_set_cookies(response.headers) : value); + } catch (error) { + res.getHeaderNames().forEach((name) => res.removeHeader(name)); + res.writeHead(500).end(String(error)); + return; + } + } + + res.writeHead(response.status); + + if (!response.body) { + res.end(); + return; + } + + if (response.body.locked) { + res.end( + 'Fatal error: Response body is locked. ' + + "This can happen when the response was already read (for example through 'response.json()' or 'response.text()')." + ); + return; + } + + const reader = response.body.getReader(); + + if (res.destroyed) { + void reader.cancel(); + return; + } + + const cancel = (/** @type {Error|undefined} */ error) => { + res.off('close', cancel); + res.off('error', cancel); + + // If the reader has already been interrupted with an error earlier, + // then it will appear here, it is useless, but it needs to be catch. + reader.cancel(error).catch(noop); + if (error) res.destroy(error); + }; + + res.on('close', cancel); + res.on('error', cancel); + + void next(); + async function next() { + try { + for (;;) { + const { done, value } = await reader.read(); + + if (done) break; + + if (!res.write(value)) { + res.once('drain', next); + return; + } + } + res.end(); + } catch (error) { + cancel(error instanceof Error ? error : new Error(String(error))); + } + } +} + +/** + * Converts a file on disk to a readable stream + * @param {string} file + * @returns {ReadableStream} + * @since 2.4.0 + */ +export function createReadableStream(file) { + return /** @type {ReadableStream} */ (Readable.toWeb(createReadStream(file))); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/node/polyfills.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/node/polyfills.js new file mode 100644 index 0000000000000000000000000000000000000000..347c68cea2e93c8d184d2ba8f5b9583ee1686b5c --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/node/polyfills.js @@ -0,0 +1,30 @@ +import buffer from 'node:buffer'; +import { webcrypto as crypto } from 'node:crypto'; + +// `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0 +const File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File; + +/** @type {Record} */ +const globals = { + crypto, + File +}; + +// exported for dev/preview and node environments +/** + * Make various web APIs available as globals: + * - `crypto` + * - `File` + */ +export function installPolyfills() { + for (const name in globals) { + if (name in globalThis) continue; + + Object.defineProperty(globalThis, name, { + enumerable: true, + configurable: true, + writable: true, + value: globals[name] + }); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/public.d.ts b/tools/ui/node_modules/@sveltejs/kit/src/exports/public.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80fd1b82b4d6f6c445d3b7d818eeff130967bbbe --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/public.d.ts @@ -0,0 +1,2400 @@ +import 'svelte'; // pick up `declare module "*.svelte"` +import 'vite/client'; // pick up `declare module "*.jpg"`, etc. +import '../types/ambient.js'; + +import { + AdapterEntry, + CspDirectives, + HttpMethod, + Logger, + MaybePromise, + Prerendered, + PrerenderEntryGeneratorMismatchHandlerValue, + PrerenderHttpErrorHandlerValue, + PrerenderInvalidUrlHandlerValue, + PrerenderMissingIdHandlerValue, + PrerenderUnseenRoutesHandlerValue, + PrerenderOption, + RequestOptions, + RouteSegment, + DeepPartial, + IsAny +} from '../types/private.js'; +import { BuildData, SSRNodeLoader, SSRRoute, ValidatedConfig } from 'types'; +import { SvelteConfig } from '@sveltejs/vite-plugin-svelte'; +import { StandardSchemaV1 } from '@standard-schema/spec'; +import { + RouteId as AppRouteId, + LayoutParams as AppLayoutParams, + ResolvedPathname +} from '$app/types'; + +export { PrerenderOption } from '../types/private.js'; + +// @ts-ignore this is an optional peer dependency so could be missing. Written like this so dts-buddy preserves the ts-ignore +type Span = import('@opentelemetry/api').Span; + +/** + * [Adapters](https://svelte.dev/docs/kit/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing. + */ +export interface Adapter { + /** + * The name of the adapter, using for logging. Will typically correspond to the package name. + */ + name: string; + /** + * This function is called after SvelteKit has built your app. + * @param builder An object provided by SvelteKit that contains methods for adapting the app + */ + adapt: (builder: Builder) => MaybePromise; + /** + * Checks called during dev and build to determine whether specific features will work in production with this adapter. + */ + supports?: { + /** + * Test support for `read` from `$app/server`. + * @param details.config The merged adapter-specific route config exported from the route with `export const config` + */ + read?: (details: { config: any; route: { id: string } }) => boolean; + + /** + * Test support for `instrumentation.server.js`. To pass, the adapter must support running `instrumentation.server.js` prior to the application code. + * @since 2.31.0 + */ + instrumentation?: () => boolean; + }; + /** + * Creates an `Emulator`, which allows the adapter to influence the environment + * during dev, build and prerendering. + */ + emulate?: () => MaybePromise; +} + +export type LoadProperties | void> = input extends void + ? undefined // needs to be undefined, because void will break intellisense + : input extends Record + ? input + : unknown; + +export type AwaitedActions any>> = OptionalUnion< + { + [Key in keyof T]: UnpackValidationError>>; + }[keyof T] +>; + +// Takes a union type and returns a union type where each type also has all properties +// of all possible types (typed as undefined), making accessing them more ergonomic +type OptionalUnion< + U extends Record, // not unknown, else interfaces don't satisfy this constraint + A extends keyof U = U extends U ? keyof U : never +> = U extends unknown ? { [P in Exclude]?: never } & U : never; + +declare const uniqueSymbol: unique symbol; + +export interface ActionFailure { + status: number; + data: T; + [uniqueSymbol]: true; // necessary or else UnpackValidationError could wrongly unpack objects with the same shape as ActionFailure +} + +type UnpackValidationError = + T extends ActionFailure + ? X + : T extends void + ? undefined // needs to be undefined, because void will corrupt union type + : T; + +/** + * This object is passed to the `adapt` function of adapters. + * It contains various methods and properties that are useful for adapting the app. + */ +export interface Builder { + /** Print messages to the console. `log.info` and `log.minor` are silent unless Vite's `logLevel` is `info`. */ + log: Logger; + /** Remove `dir` and all its contents. */ + rimraf: (dir: string) => void; + /** Create `dir` and any required parent directories. */ + mkdirp: (dir: string) => void; + + /** The fully resolved Svelte config. */ + config: ValidatedConfig; + /** Information about prerendered pages and assets, if any. */ + prerendered: Prerendered; + /** An array of all routes (including prerendered) */ + routes: RouteDefinition[]; + + // TODO 3.0 remove this method + /** + * Create separate functions that map to one or more routes of your app. + * @param fn A function that groups a set of routes into an entry point + * @deprecated Use `builder.routes` instead + */ + createEntries: (fn: (route: RouteDefinition) => AdapterEntry) => Promise; + + /** + * Find all the assets imported by server files belonging to `routes` + */ + findServerAssets: (routes: RouteDefinition[]) => string[]; + + /** + * Generate a fallback page for a static webserver to use when no route is matched. Useful for single-page apps. + */ + generateFallback: (dest: string) => Promise; + + /** + * Generate a module exposing build-time environment variables as `$env/dynamic/public` or `$app/env/public` if the app uses it. + */ + generateEnvModule: () => void; + + /** + * Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with. + * @param opts a relative path to the base directory of the app and optionally in which format (esm or cjs) the manifest should be generated + */ + generateManifest: (opts: { relativePath: string; routes?: RouteDefinition[] }) => string; + + /** + * Resolve a path to the `name` directory inside `outDir`, e.g. `/path/to/.svelte-kit/my-adapter`. + * @param name path to the file, relative to the build directory + */ + getBuildDirectory: (name: string) => string; + /** Get the fully resolved path to the directory containing client-side assets, including the contents of your `static` directory. */ + getClientDirectory: () => string; + /** Get the fully resolved path to the directory containing server-side code. */ + getServerDirectory: () => string; + /** Get the application path including any configured `base` path, e.g. `my-base-path/_app`. */ + getAppPath: () => string; + + /** + * Write client assets to `dest`. + * @param dest the destination folder + * @returns an array of files written to `dest` + */ + writeClient: (dest: string) => string[]; + /** + * Write prerendered files to `dest`. + * @param dest the destination folder + * @returns an array of files written to `dest` + */ + writePrerendered: (dest: string) => string[]; + /** + * Write server-side code to `dest`. + * @param dest the destination folder + * @returns an array of files written to `dest` + */ + writeServer: (dest: string) => string[]; + /** + * Copy a file or directory. + * @param from the source file or directory + * @param to the destination file or directory + * @param opts.filter a function to determine whether a file or directory should be copied + * @param opts.replace a map of strings to replace + * @returns an array of files that were copied + */ + copy: ( + from: string, + to: string, + opts?: { + filter?(basename: string): boolean; + replace?: Record; + } + ) => string[]; + + /** + * Check if the server instrumentation file exists. + * @returns true if the server instrumentation file exists, false otherwise + * @since 2.31.0 + */ + hasServerInstrumentationFile: () => boolean; + + /** + * Instrument `entrypoint` with `instrumentation`. + * + * Renames `entrypoint` to `start` and creates a new module at + * `entrypoint` which imports `instrumentation` and then dynamically imports `start`. This allows + * the module hooks necessary for instrumentation libraries to be loaded prior to any application code. + * + * Caveats: + * - "Live exports" will not work. If your adapter uses live exports, your users will need to manually import the server instrumentation on startup. + * - If `tla` is `false`, OTEL auto-instrumentation may not work properly. Use it if your environment supports it. + * - Use `hasServerInstrumentationFile` to check if the user has a server instrumentation file; if they don't, you shouldn't do this. + * + * @param options an object containing the following properties: + * @param options.entrypoint the path to the entrypoint to trace. + * @param options.instrumentation the path to the instrumentation file. + * @param options.start the name of the start file. This is what `entrypoint` will be renamed to. + * @param options.module configuration for the resulting entrypoint module. + * @param options.module.exports + * @param options.module.generateText a function that receives the relative paths to the instrumentation and start files, and generates the text of the module to be traced. If not provided, the default implementation will be used, which uses top-level await. + * @since 2.31.0 + */ + instrument: (args: { + entrypoint: string; + instrumentation: string; + start?: string; + module?: + | { + exports: string[]; + } + | { + generateText: (args: { instrumentation: string; start: string }) => string; + }; + }) => void; + + /** + * Compress files in `directory` with gzip and brotli, where appropriate. Generates `.gz` and `.br` files alongside the originals. + * @param {string} directory The directory containing the files to be compressed + */ + compress: (directory: string) => Promise; +} + +/** + * An extension of [`vite-plugin-svelte`'s options](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#svelte-options). + */ +export interface Config extends SvelteConfig { + /** + * SvelteKit options. + * + * @see https://svelte.dev/docs/kit/configuration + */ + kit?: KitConfig; + /** Any additional options required by tooling that integrates with Svelte. */ + [key: string]: any; +} + +export interface Cookies { + /** + * Gets a cookie that was previously set with `cookies.set`, or from the request headers. + * @param name the name of the cookie + * @param opts the options, passed directly to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options) + */ + get: (name: string, opts?: import('cookie').CookieParseOptions) => string | undefined; + + /** + * Gets all cookies that were previously set with `cookies.set`, or from the request headers. + * @param opts the options, passed directly to `cookie.parse`. See documentation [here](https://github.com/jshttp/cookie#cookieparsestr-options) + */ + getAll: (opts?: import('cookie').CookieParseOptions) => Array<{ name: string; value: string }>; + + /** + * Sets a cookie. This will add a `set-cookie` header to the response, but also make the cookie available via `cookies.get` or `cookies.getAll` during the current request. + * + * The `httpOnly` and `secure` options are `true` by default (except on http://localhost, where `secure` is `false`), and must be explicitly disabled if you want cookies to be readable by client-side JavaScript and/or transmitted over HTTP. The `sameSite` option defaults to `lax`. + * + * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children + * @param name the name of the cookie + * @param value the cookie value + * @param opts the options, passed directly to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) + */ + set: ( + name: string, + value: string, + opts: import('cookie').CookieSerializeOptions & { path: string } + ) => void; + + /** + * Deletes a cookie by setting its value to an empty string and setting the expiry date in the past. + * + * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children + * @param name the name of the cookie + * @param opts the options, passed directly to `cookie.serialize`. The `path` must match the path of the cookie you want to delete. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) + */ + delete: (name: string, opts: import('cookie').CookieSerializeOptions & { path: string }) => void; + + /** + * Serialize a cookie name-value pair into a `Set-Cookie` header string, but don't apply it to the response. + * + * The `httpOnly` and `secure` options are `true` by default (except on http://localhost, where `secure` is `false`), and must be explicitly disabled if you want cookies to be readable by client-side JavaScript and/or transmitted over HTTP. The `sameSite` option defaults to `lax`. + * + * You must specify a `path` for the cookie. In most cases you should explicitly set `path: '/'` to make the cookie available throughout your app. You can use relative paths, or set `path: ''` to make the cookie only available on the current path and its children + * + * @param name the name of the cookie + * @param value the cookie value + * @param opts the options, passed directly to `cookie.serialize`. See documentation [here](https://github.com/jshttp/cookie#cookieserializename-value-options) + */ + serialize: ( + name: string, + value: string, + opts: import('cookie').CookieSerializeOptions & { path: string } + ) => string; +} + +/** + * A collection of functions that influence the environment during dev, build and prerendering + */ +export interface Emulator { + /** + * A function that is called with the current route `config` and `prerender` option + * and returns an `App.Platform` object + */ + platform?(details: { config: any; prerender: PrerenderOption }): MaybePromise; +} + +export interface KitConfig { + /** + * Your [adapter](https://svelte.dev/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms. + * @default undefined + */ + adapter?: Adapter; + /** + * An object containing zero or more aliases used to replace values in `import` statements. These aliases are automatically passed to Vite and TypeScript. + * + * ```js + * /// file: svelte.config.js + * /// type: import('@sveltejs/kit').Config + * const config = { + * kit: { + * alias: { + * // this will match a file + * 'my-file': 'path/to/my-file.js', + * + * // this will match a directory and its contents + * // (`my-directory/x` resolves to `path/to/my-directory/x`) + * 'my-directory': 'path/to/my-directory', + * + * // an alias ending /* will only match + * // the contents of a directory, not the directory itself + * 'my-directory/*': 'path/to/my-directory/*' + * } + * } + * }; + * ``` + * + * > [!NOTE] You will need to run `npm run dev` to have SvelteKit automatically generate the required alias configuration in `jsconfig.json` or `tsconfig.json`. + * @default {} + */ + alias?: Record; + /** + * The directory where SvelteKit keeps its stuff, including static assets (such as JS and CSS) and internally-used routes. + * + * If `paths.assets` is specified, there will be two app directories — `${paths.assets}/${appDir}` and `${paths.base}/${appDir}`. + * @default "_app" + */ + appDir?: string; + /** + * [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) configuration. CSP helps to protect your users against cross-site scripting (XSS) attacks, by limiting the places resources can be loaded from. For example, a configuration like this... + * + * ```js + * /// file: svelte.config.js + * /// type: import('@sveltejs/kit').Config + * const config = { + * kit: { + * csp: { + * directives: { + * 'script-src': ['self'] + * }, + * // must be specified with either the `report-uri` or `report-to` directives, or both + * reportOnly: { + * 'script-src': ['self'], + * 'report-uri': ['/'] + * } + * } + * } + * }; + * + * export default config; + * ``` + * + * ...would prevent scripts loading from external sites. SvelteKit will augment the specified directives with nonces or hashes (depending on `mode`) for any inline styles and scripts it generates. + * + * To add a nonce for scripts and links manually included in `src/app.html`, you may use the placeholder `%sveltekit.nonce%` (for example ` + * + * + * + * + * + * ``` + * @default 'split' + * @since 2.13.0 + */ + bundleStrategy?: 'split' | 'single' | 'inline'; + }; + paths?: { + /** + * An absolute path that your app's files are served from. This is useful if your files are served from a storage bucket of some kind. + * @default "" + */ + assets?: '' | `http://${string}` | `https://${string}`; + /** + * A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/$app-paths#base) for that: `Link`. If you find yourself writing this often, it may make sense to extract this into a reusable component. + * @default "" + */ + base?: '' | `/${string}`; + /** + * Whether to use relative asset paths. + * + * If `true`, `base` and `assets` imported from `$app/paths` will be replaced with relative asset paths during server-side rendering, resulting in more portable HTML. + * If `false`, `%sveltekit.assets%` and references to build artifacts will always be root-relative paths, unless `paths.assets` is an external URL + * + * [Single-page app](https://svelte.dev/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting. + * + * If your app uses a `` element, you should set this to `false`, otherwise asset URLs will incorrectly be resolved against the `` URL rather than the current page. + * + * In 1.0, `undefined` was a valid value, which was set by default. In that case, if `paths.assets` was not external, SvelteKit would replace `%sveltekit.assets%` with a relative path and use relative paths to reference build artifacts, but `base` and `assets` imported from `$app/paths` would be as specified in your config. + * + * @default true + * @since 1.9.0 + */ + relative?: boolean; + }; + /** + * See [Prerendering](https://svelte.dev/docs/kit/page-options#prerender). + */ + prerender?: { + /** + * How many pages can be prerendered simultaneously. JS is single-threaded, but in cases where prerendering performance is network-bound (for example loading content from a remote CMS) this can speed things up by processing other tasks while waiting on the network response. + * @default 1 + */ + concurrency?: number; + /** + * Whether SvelteKit should find pages to prerender by following links from `entries`. + * @default true + */ + crawl?: boolean; + /** + * An array of pages to prerender, or start crawling from (if `crawl: true`). The `*` string includes all routes containing no required `[parameters]` with optional parameters included as being empty (since SvelteKit doesn't know what value any parameters should have). + * @default ["*"] + */ + entries?: Array<'*' | `/${string}`>; + /** + * How to respond to HTTP errors encountered while prerendering the app. + * + * - `'fail'` — fail the build + * - `'ignore'` - silently ignore the failure and continue + * - `'warn'` — continue, but print a warning + * - `(details) => void` — a custom error handler that takes a `details` object with `status`, `path`, `referrer`, `referenceType` and `message` properties. If you `throw` from this function, the build will fail + * + * ```js + * /// file: svelte.config.js + * /// type: import('@sveltejs/kit').Config + * const config = { + * kit: { + * prerender: { + * handleHttpError: ({ path, referrer, message }) => { + * // ignore deliberate link to shiny 404 page + * if (path === '/not-found' && referrer === '/blog/how-we-built-our-404-page') { + * return; + * } + * + * // otherwise fail the build + * throw new Error(message); + * } + * } + * } + * }; + * ``` + * + * @default "fail" + * @since 1.15.7 + */ + handleHttpError?: PrerenderHttpErrorHandlerValue; + /** + * How to respond when hash links from one prerendered page to another don't correspond to an `id` on the destination page. + * + * - `'fail'` — fail the build + * - `'ignore'` - silently ignore the failure and continue + * - `'warn'` — continue, but print a warning + * - `(details) => void` — a custom error handler that takes a `details` object with `path`, `id`, `referrers` and `message` properties. If you `throw` from this function, the build will fail + * + * @default "fail" + * @since 1.15.7 + */ + handleMissingId?: PrerenderMissingIdHandlerValue; + /** + * How to respond when an entry generated by the `entries` export doesn't match the route it was generated from. + * + * - `'fail'` — fail the build + * - `'ignore'` - silently ignore the failure and continue + * - `'warn'` — continue, but print a warning + * - `(details) => void` — a custom error handler that takes a `details` object with `generatedFromId`, `entry`, `matchedId` and `message` properties. If you `throw` from this function, the build will fail + * + * @default "fail" + * @since 1.16.0 + */ + handleEntryGeneratorMismatch?: PrerenderEntryGeneratorMismatchHandlerValue; + /** + * How to respond when a route is marked as prerenderable but has not been prerendered. + * + * - `'fail'` — fail the build + * - `'ignore'` - silently ignore the failure and continue + * - `'warn'` — continue, but print a warning + * - `(details) => void` — a custom error handler that takes a `details` object with a `routes` property which contains all routes that haven't been prerendered. If you `throw` from this function, the build will fail + * + * The default behavior is to fail the build. This may be undesirable when you know that some of your routes may never be reached under certain + * circumstances such as a CMS not returning data for a specific area, resulting in certain routes never being reached. + * + * @default "fail" + * @since 2.16.0 + */ + handleUnseenRoutes?: PrerenderUnseenRoutesHandlerValue; + /** + * How to respond when SvelteKit encounters a URL it cannot parse while crawling prerendered HTML (for example, an AT Protocol URL such as `at://did:plc:...`). + * + * - `'fail'` — fail the build + * - `'ignore'` - silently ignore the failure and continue + * - `'warn'` — continue, but print a warning + * - `(details) => void` — a custom error handler that takes a `details` object with `href`, `referrer` and `message` properties. If you `throw` from this function, the build will fail + * + * @default "fail" + * @since 2.67.0 + */ + handleInvalidUrl?: PrerenderInvalidUrlHandlerValue; + /** + * The value of `url.origin` during prerendering; useful if it is included in rendered content. + * @default "http://sveltekit-prerender" + */ + origin?: string; + }; + router?: { + /** + * What type of client-side router to use. + * - `'pathname'` is the default and means the current URL pathname determines the route + * - `'hash'` means the route is determined by `location.hash`. In this case, SSR and prerendering are disabled. This is only recommended if `pathname` is not an option, for example because you don't control the webserver where your app is deployed. + * It comes with some caveats: you can't use server-side rendering (or indeed any server logic), and you have to make sure that the links in your app all start with #/, or they won't work. Beyond that, everything works exactly like a normal SvelteKit app. + * + * @default "pathname" + * @since 2.14.0 + */ + type?: 'pathname' | 'hash'; + /** + * How to determine which route to load when navigating to a new page. + * + * By default, SvelteKit will serve a route manifest to the browser. + * When navigating, this manifest is used (along with the `reroute` hook, if it exists) to determine which components to load and which `load` functions to run. + * Because everything happens on the client, this decision can be made immediately. The drawback is that the manifest needs to be + * loaded and parsed before the first navigation can happen, which may have an impact if your app contains many routes. + * + * Alternatively, SvelteKit can determine the route on the server. This means that for every navigation to a path that has not yet been visited, the server will be asked to determine the route. + * This has several advantages: + * - The client does not need to load the routing manifest upfront, which can lead to faster initial page loads + * - The list of routes is hidden from public view + * - The server has an opportunity to intercept each navigation (for example through a middleware), enabling (for example) A/B testing opaque to SvelteKit + + * The drawback is that for unvisited paths, resolution will take slightly longer (though this is mitigated by [preloading](https://svelte.dev/docs/kit/link-options#data-sveltekit-preload-data)). + * + * > [!NOTE] When using server-side route resolution and prerendering, the resolution is prerendered along with the route itself. + * + * @default "client" + * @since 2.17.0 + */ + resolution?: 'client' | 'server'; + }; + serviceWorker?: { + /** + * Determine which files in your `static` directory will be available in `$service-worker.files`. + * @default (filename) => !/\.DS_Store/.test(filename) + */ + files?: (file: string) => boolean; + } & ( + | { + /** + * Whether to automatically register the service worker, if it exists. + * @default true + */ + register: true; + /** + * Options for serviceWorker.register("...", options); + */ + options?: RegistrationOptions; + } + | { + /** + * Whether to automatically register the service worker, if it exists. + * @default true + */ + register?: false; + } + ); + typescript?: { + /** + * A function that allows you to edit the generated `tsconfig.json`. You can mutate the config (recommended) or return a new one. + * This is useful for extending a shared `tsconfig.json` in a monorepo root, for example. + * + * Note that any paths configured here should be relative to the generated config file, which is written to `.svelte-kit/tsconfig.json`. + * + * @default (config) => config + * @since 1.3.0 + */ + config?: (config: Record) => Record | void; + }; + /** + * Client-side navigation can be buggy if you deploy a new version of your app while people are using it. If the code for the new page is already loaded, it may have stale content; if it isn't, the app's route manifest may point to a JavaScript file that no longer exists. + * SvelteKit helps you solve this problem through version management. + * If SvelteKit encounters an error while loading the page and detects that a new version has been deployed (using the `name` specified here, which defaults to a timestamp of the build) it will fall back to traditional full-page navigation. + * Not all navigations will result in an error though, for example if the JavaScript for the next page is already loaded. If you still want to force a full-page navigation in these cases, use techniques such as setting the `pollInterval` and then using `beforeNavigate`: + * ```html + * /// file: +layout.svelte + * + * ``` + * + * If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](https://svelte.dev/docs/kit/$app-state#updated) `true` when it detects one. + */ + version?: { + /** + * The current app version string. If specified, this must be deterministic (e.g. a commit ref rather than `Math.random()` or `Date.now().toString()`), otherwise defaults to a timestamp of the build. + * + * For example, to use the current commit hash, you could do use `git rev-parse HEAD`: + * + * ```js + * /// file: svelte.config.js + * import * as child_process from 'node:child_process'; + * + * export default { + * kit: { + * version: { + * name: child_process.execSync('git rev-parse HEAD').toString().trim() + * } + * } + * }; + * ``` + */ + name?: string; + /** + * The interval in milliseconds to poll for version changes. If this is `0`, no polling occurs. + * @default 0 + */ + pollInterval?: number; + }; +} + +/** + * The [`handle`](https://svelte.dev/docs/kit/hooks#handle) hook runs every time the SvelteKit server receives a [request](https://svelte.dev/docs/kit/web-standards#Fetch-APIs-Request) and + * determines the [response](https://svelte.dev/docs/kit/web-standards#Fetch-APIs-Response). + * It receives an `event` object representing the request and a function called `resolve`, which renders the route and generates a `Response`. + * This allows you to modify response headers or bodies, or bypass SvelteKit entirely (for implementing routes programmatically, for example). + */ +export type Handle = (input: { + event: RequestEvent; + resolve: (event: RequestEvent, opts?: ResolveOptions) => MaybePromise; +}) => MaybePromise; + +/** + * The server-side [`handleError`](https://svelte.dev/docs/kit/hooks#handleError) hook runs when an unexpected error is thrown while responding to a request. + * + * If an unexpected error is thrown during loading or rendering, this function will be called with the error and the event. + * Make sure that this function _never_ throws an error. + */ +export type HandleServerError = (input: { + error: unknown; + event: RequestEvent; + status: number; + message: string; +}) => MaybePromise; + +/** + * The [`handleValidationError`](https://svelte.dev/docs/kit/hooks#handleValidationError) hook runs when the argument to a remote function fails validation. + * + * It will be called with the validation issues and the event, and must return an object shape that matches `App.Error`. + */ +export type HandleValidationError = + (input: { issues: Issue[]; event: RequestEvent }) => MaybePromise; + +/** + * The client-side [`handleError`](https://svelte.dev/docs/kit/hooks#handleError) hook runs when an unexpected error is thrown while navigating. + * + * If an unexpected error is thrown during loading or the following render, this function will be called with the error and the event. + * Make sure that this function _never_ throws an error. + */ +export type HandleClientError = (input: { + error: unknown; + event: NavigationEvent; + status: number; + message: string; +}) => MaybePromise; + +/** + * The [`handleFetch`](https://svelte.dev/docs/kit/hooks#handleFetch) hook allows you to modify (or replace) the result of an [`event.fetch`](https://svelte.dev/docs/kit/load#Making-fetch-requests) call that runs on the server (or during prerendering) inside an endpoint, `load`, `action`, `handle`, `handleError` or `reroute`. + */ +export type HandleFetch = (input: { + event: RequestEvent; + request: Request; + fetch: typeof fetch; +}) => MaybePromise; + +/** + * The [`init`](https://svelte.dev/docs/kit/hooks#init) will be invoked before the server responds to its first request + * @since 2.10.0 + */ +export type ServerInit = () => MaybePromise; + +/** + * The [`init`](https://svelte.dev/docs/kit/hooks#init) will be invoked once the app starts in the browser + * @since 2.10.0 + */ +export type ClientInit = () => MaybePromise; + +/** + * The [`reroute`](https://svelte.dev/docs/kit/hooks#reroute) hook allows you to modify the URL before it is used to determine which route to render. + * @since 2.3.0 + */ +export type Reroute = (event: { url: URL; fetch: typeof fetch }) => MaybePromise; + +/** + * The [`transport`](https://svelte.dev/docs/kit/hooks#transport) hook allows you to transport custom types across the server/client boundary. + * + * Each transporter has a pair of `encode` and `decode` functions. On the server, `encode` determines whether a value is an instance of the custom type and, if so, returns a non-falsy encoding of the value which can be an object or an array (or `false` otherwise). + * + * In the browser, `decode` turns the encoding back into an instance of the custom type. + * + * ```ts + * import type { Transport } from '@sveltejs/kit'; + * + * declare class MyCustomType { + * data: any + * } + * + * // hooks.js + * export const transport: Transport = { + * MyCustomType: { + * encode: (value) => value instanceof MyCustomType && [value.data], + * decode: ([data]) => new MyCustomType(data) + * } + * }; + * ``` + * @since 2.11.0 + */ +export type Transport = Record; + +/** + * A member of the [`transport`](https://svelte.dev/docs/kit/hooks#transport) hook. + */ +export interface Transporter< + T = any, + U = Exclude +> { + encode: (value: T) => false | U; + decode: (data: U) => T; +} + +/** + * The generic form of `PageLoad` and `LayoutLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) + * rather than using `Load` directly. + */ +export type Load< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + InputData extends Record | null = Record | null, + ParentData extends Record = Record, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null +> = (event: LoadEvent) => MaybePromise; + +/** + * The generic form of `PageLoadEvent` and `LayoutLoadEvent`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) + * rather than using `LoadEvent` directly. + */ +export interface LoadEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + Data extends Record | null = Record | null, + ParentData extends Record = Record, + RouteId extends AppRouteId | null = AppRouteId | null +> extends NavigationEvent { + /** + * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: + * + * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. + * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). + * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. + * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#handle) + * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. + * + * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies) + */ + fetch: typeof fetch; + /** + * Contains the data returned by the route's server `load` function (in `+layout.server.js` or `+page.server.js`), if any. + */ + data: Data; + /** + * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: + * + * ```js + * /// file: src/routes/blog/+page.js + * export async function load({ fetch, setHeaders }) { + * const url = `https://cms.example.com/articles.json`; + * const response = await fetch(url); + * + * setHeaders({ + * age: response.headers.get('age'), + * 'cache-control': response.headers.get('cache-control') + * }); + * + * return response.json(); + * } + * ``` + * + * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. + * + * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead. + * + * `setHeaders` has no effect when a `load` function runs in the browser. + */ + setHeaders: (headers: Record) => void; + /** + * `await parent()` returns data from parent `+layout.js` `load` functions. + * Implicitly, a missing `+layout.js` is treated as a `({ data }) => data` function, meaning that it will return and forward data from parent `+layout.server.js` files. + * + * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. + */ + parent: () => Promise; + /** + * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. + * + * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. + * + * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). + * + * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). + * + * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. + * + * ```js + * /// file: src/routes/+page.js + * let count = 0; + * export async function load({ depends }) { + * depends('increase:count'); + * + * return { count: count++ }; + * } + * ``` + * + * ```html + * /// file: src/routes/+page.svelte + * + * + *

{data.count}

+ * + * ``` + */ + depends: (...deps: Array<`${string}:${string}`>) => void; + /** + * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: + * + * ```js + * /// file: src/routes/+page.server.js + * export async function load({ untrack, url }) { + * // Untrack url.pathname so that path changes don't trigger a rerun + * if (untrack(() => url.pathname === '/')) { + * return { message: 'Welcome!' }; + * } + * } + * ``` + */ + untrack: (fn: () => T) => T; + + /** + * Access to spans for tracing. If tracing is not enabled or the function is being run in the browser, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current `load` function. */ + current: Span; + }; +} + +export interface NavigationEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> { + /** + * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object + */ + params: Params; + /** + * Info about the current route + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId; + }; + /** + * The URL of the current page + */ + url: URL; +} + +/** + * Information about the target of a specific navigation. + */ +export interface NavigationTarget< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> { + /** + * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route). + */ + params: Params | null; + /** + * Info about the target route + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId | null; + }; + /** + * The URL that is navigated to + */ + url: URL; + /** + * The scroll position associated with this navigation. + * + * For the `from` target, this is the scroll position at the moment of navigation. + * + * For the `to` target, this represents the scroll position that will be or was restored: + * - In `beforeNavigate` and `onNavigate`, this is only available for `popstate` navigations (back/forward button) + * and will be `null` for other navigation types, since the final scroll position isn't known + * ahead of time. + * - In `afterNavigate`, this is always the scroll position that was applied after the navigation + * completed. + */ + scroll: { x: number; y: number } | null; +} + +/** + * - `enter`: The app has hydrated/started + * - `form`: The user submitted a `

` + * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring + * - `link`: Navigation was triggered by a link click + * - `popstate`: Navigation was triggered by back/forward navigation + */ +export type NavigationType = 'enter' | 'form' | 'leave' | 'link' | 'goto' | 'popstate'; + +export interface NavigationBase { + /** + * The type of navigation: + * - `enter`: The app has hydrated/started + * - `form`: The user submitted a `` + * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring + * - `link`: Navigation was triggered by a link click + * - `popstate`: Navigation was triggered by back/forward navigation + */ + type: NavigationType; + /** + * Where navigation was triggered from + */ + from: NavigationTarget | null; + /** + * Where navigation is going to/has gone to + */ + to: NavigationTarget | null; + /** + * Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation). + */ + willUnload: boolean; + /** + * A promise that resolves once the navigation is complete, and rejects if the navigation + * fails or is aborted. In the case of a `willUnload` navigation, the promise will never resolve + */ + complete: Promise; +} + +/** + * The navigation that occurs when the app starts/hydrates + */ +export interface NavigationEnter extends NavigationBase { + type: 'enter'; + + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + + /** + * Dispatched `Event` object when navigation occurred by `popstate` or `link`. + */ + event?: undefined; +} + +export type NavigationExternal = NavigationGoto | NavigationLeave; + +/** + * A navigation triggered by a `goto(...)` call or a redirect + */ +export interface NavigationGoto extends NavigationBase { + type: 'goto'; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; +} + +/** + * A navigation triggered by the tab being closed, or the user navigating to a different document + */ +export interface NavigationLeave extends NavigationBase { + type: 'leave'; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; +} + +/** + * A navigation triggered by a `` + */ +export interface NavigationFormSubmit extends NavigationBase { + type: 'form'; + + /** + * The `SubmitEvent` that caused the navigation + */ + event: SubmitEvent; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; +} + +/** + * A navigation triggered by back/forward navigation + */ +export interface NavigationPopState extends NavigationBase { + type: 'popstate'; + + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta: number; + + /** + * The `PopStateEvent` that caused the navigation + */ + event: PopStateEvent; +} + +/** + * A navigation triggered by a link click + */ +export interface NavigationLink extends NavigationBase { + type: 'link'; + + /** + * The `PointerEvent` that caused the navigation + */ + event: PointerEvent; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; +} + +export type Navigation = + | NavigationExternal + | NavigationFormSubmit + | NavigationPopState + | NavigationLink; + +/** + * The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/$app-navigation#beforeNavigate) callbacks. + */ +export type BeforeNavigate = Navigation & { + /** + * Call this to prevent the navigation from starting. + */ + cancel: () => void; +}; + +/** + * The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/$app-navigation#onNavigate) callbacks. + */ +export type OnNavigate = Navigation & { + type: Exclude; + /** + * Since `onNavigate` callbacks are called immediately before a client-side navigation, they will never be called with a navigation that unloads the page. + */ + willUnload: false; +}; + +/** + * The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/$app-navigation#afterNavigate) callbacks. + */ +export type AfterNavigate = (Navigation | NavigationEnter) & { + type: Exclude; + /** + * Since `afterNavigate` callbacks are called after a navigation completes, they will never be called with a navigation that unloads the page. + */ + willUnload: false; +}; + +/** + * The shape of the [`page`](https://svelte.dev/docs/kit/$app-state#page) reactive object and the [`$page`](https://svelte.dev/docs/kit/$app-stores) store. + */ +export interface Page< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> { + /** + * The URL of the current page. + */ + url: URL & { pathname: ResolvedPathname }; + /** + * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + */ + params: Params; + /** + * Info about the current route. + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId; + }; + /** + * HTTP status code of the current page. + */ + status: number; + /** + * The error object of the current page, if any. Filled from the `handleError` hooks. + */ + error: App.Error | null; + /** + * The merged result of all data from all `load` functions on the current page. You can type a common denominator through `App.PageData`. + */ + data: App.PageData & Record; + /** + * The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. + */ + state: App.PageState; + /** + * Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info. + */ + form: any; +} + +/** + * The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#Matching) for more info. + */ +export type ParamMatcher = (param: string) => boolean; + +/** + * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested) + * when called with a regular `query`. `arg` is the validated argument (the input *after* + * the query's schema validated and transformed it, if applicable); `query` is a + * `RemoteQuery` bound to the client's original cache key, so `refresh()` / `set()` will + * update the correct client entry. + */ +export type RequestedEntry = { + arg: Validated; + query: RemoteQuery; +}; + +/** + * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested) + * when called with a `query.live`. `arg` is the validated argument; `query` is a + * `RemoteLiveQuery` bound to the client's original cache key, so `reconnect()` targets + * the correct client subscription. + */ +export type LiveRequestedEntry = { + arg: Validated; + query: RemoteLiveQuery; +}; + +export type QueryRequestedResult = Iterable> & + AsyncIterable> & { + /** + * Call `refresh` on all queries selected by this `requested` invocation. + * This is identical to: + * ```ts + * import { requested } from '$app/server'; + * + * for await (const { query } of requested(getPost, ...)) { + * void query.refresh(); + * } + * ``` + */ + refreshAll: () => Promise; + }; + +export type LiveQueryRequestedResult = Iterable< + LiveRequestedEntry +> & + AsyncIterable> & { + /** + * Call `reconnect` on all live queries selected by this `requested` invocation. + * This is identical to: + * ```ts + * import { requested } from '$app/server'; + * + * for await (const { query } of requested(liveQuery, ...)) { + * void query.reconnect(); + * } + * ``` + */ + reconnectAll: () => Promise; + }; + +export type RequestedResult = + | QueryRequestedResult + | LiveQueryRequestedResult; + +export interface RequestEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> { + /** + * Get or set cookies related to the current request + */ + cookies: Cookies; + /** + * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: + * + * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. + * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). + * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. + * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#handle) + * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. + * + * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies). + */ + fetch: typeof fetch; + /** + * The client's IP address, set by the adapter. + */ + getClientAddress: () => string; + /** + * Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#handle). + */ + locals: App.Locals; + /** + * The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + params: Params; + /** + * Additional data made available through the adapter. + */ + platform: Readonly | undefined; + /** + * The original request object. + */ + request: Request; + /** + * Info about the current route. + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + id: RouteId; + }; + /** + * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: + * + * ```js + * /// file: src/routes/blog/+page.js + * export async function load({ fetch, setHeaders }) { + * const url = `https://cms.example.com/articles.json`; + * const response = await fetch(url); + * + * setHeaders({ + * age: response.headers.get('age'), + * 'cache-control': response.headers.get('cache-control') + * }); + * + * return response.json(); + * } + * ``` + * + * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. + * + * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead. + */ + setHeaders: (headers: Record) => void; + /** + * The requested URL. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + url: URL; + /** + * `true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information + * related to the data request in this case. Use this property instead if the distinction is important to you. + */ + isDataRequest: boolean; + /** + * `true` for `+server.js` calls coming from SvelteKit without the overhead of actually making an HTTP request. This happens when you make same-origin `fetch` requests on the server. + */ + isSubRequest: boolean; + + /** + * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current `handle` hook, `load` function, or form action. */ + current: Span; + }; + + /** + * `true` if the request comes from the client via a remote function. The `url` property will be stripped of the internal information + * related to the data request in this case. Use this property instead if the distinction is important to you. + */ + isRemoteRequest: boolean; +} + +/** + * A `(event: RequestEvent) => Response` function exported from a `+server.js` file that corresponds to an HTTP verb (`GET`, `PUT`, `PATCH`, etc) and handles requests with that method. + * + * It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#Generated-types) instead. + */ +export type RequestHandler< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> = (event: RequestEvent) => MaybePromise; + +export interface ResolveOptions { + /** + * Applies custom transforms to HTML. If `done` is true, it's the final chunk. Chunks are not guaranteed to be well-formed HTML + * (they could include an element's opening tag but not its closing tag, for example) + * but they will always be split at sensible boundaries such as `%sveltekit.head%` or layout/page components. + * @param input the html chunk and the info if this is the last chunk + */ + transformPageChunk?: (input: { html: string; done: boolean }) => MaybePromise; + /** + * Determines which headers should be included in serialized responses when a `load` function loads a resource with `fetch`. + * By default, none will be included. + * @param name header name + * @param value header value + */ + filterSerializedResponseHeaders?: (name: string, value: string) => boolean; + /** + * Determines what should be added to the `` tag to preload it. + * By default, `js` and `css` files will be preloaded. + * @param input the type of the file and its path + */ + preload?: (input: { type: 'font' | 'css' | 'js' | 'asset'; path: string }) => boolean; +} + +export interface RouteDefinition { + id: string; + api: { + methods: Array; + }; + page: { + methods: Array>; + }; + pattern: RegExp; + prerender: PrerenderOption; + segments: RouteSegment[]; + methods: Array; + config: Config; +} + +export class Server { + constructor(manifest: SSRManifest); + init(options: ServerInitOptions): Promise; + respond(request: Request, options: RequestOptions): Promise; +} + +export interface ServerInitOptions { + /** A map of environment variables. */ + env: Record; + /** A function that turns an asset filename into a `ReadableStream`. Required for the `read` export from `$app/server` to work. */ + read?: (file: string) => MaybePromise; +} + +export interface SSRManifest { + appDir: string; + appPath: string; + /** Static files from `kit.config.files.assets` and the service worker (if any). */ + assets: Set; + mimeTypes: Record; + + /** private fields */ + _: { + client: BuildData['client']; + nodes: SSRNodeLoader[]; + /** hashed filename -> import to that file */ + remotes: Record Promise>; + routes: SSRRoute[]; + prerendered_routes: Set; + matchers: () => Promise>; + /** A `[file]: size` map of all assets imported by server code. */ + server_assets: Record; + }; +} + +/** + * The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) + * rather than using `ServerLoad` directly. + */ +export type ServerLoad< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + ParentData extends Record = Record, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null +> = (event: ServerLoadEvent) => MaybePromise; + +export interface ServerLoadEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + ParentData extends Record = Record, + RouteId extends AppRouteId | null = AppRouteId | null +> extends RequestEvent { + /** + * `await parent()` returns data from parent `+layout.server.js` `load` functions. + * + * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. + */ + parent: () => Promise; + /** + * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. + * + * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. + * + * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). + * + * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). + * + * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. + * + * ```js + * /// file: src/routes/+page.js + * let count = 0; + * export async function load({ depends }) { + * depends('increase:count'); + * + * return { count: count++ }; + * } + * ``` + * + * ```html + * /// file: src/routes/+page.svelte + * + * + *

{data.count}

+ * + * ``` + */ + depends: (...deps: string[]) => void; + /** + * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: + * + * ```js + * /// file: src/routes/+page.js + * export async function load({ untrack, url }) { + * // Untrack url.pathname so that path changes don't trigger a rerun + * if (untrack(() => url.pathname === '/')) { + * return { message: 'Welcome!' }; + * } + * } + * ``` + */ + untrack: (fn: () => T) => T; + + /** + * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current server `load` function. */ + current: Span; + }; +} + +/** + * Shape of a form action method that is part of `export const actions = {...}` in `+page.server.js`. + * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. + */ +export type Action< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null +> = (event: RequestEvent) => MaybePromise; + +/** + * Shape of the `export const actions = {...}` object in `+page.server.js`. + * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. + */ +export type Actions< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null +> = Record>; + +/** + * When calling a form action via fetch, the response will be one of these shapes. + * ```svelte + * { + * return ({ result }) => { + * // result is of type ActionResult + * }; + * }} + * ``` + */ +export type ActionResult< + Success extends Record | undefined = Record, + Failure extends Record | undefined = Record +> = + | { type: 'success'; status: number; data?: Success } + | { type: 'failure'; status: number; data?: Failure } + | { type: 'redirect'; status: number; location: string } + | { type: 'error'; status?: number; error: any }; + +/** + * The object returned by the [`error`](https://svelte.dev/docs/kit/@sveltejs-kit#error) function. + */ +export interface HttpError { + /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses), in the range 400-599. */ + status: number; + /** The content of the error. */ + body: App.Error; +} + +/** + * The object returned by the [`redirect`](https://svelte.dev/docs/kit/@sveltejs-kit#redirect) function. + */ +export interface Redirect { + /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages), in the range 300-308. */ + status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; + /** The location to redirect to. */ + location: string; +} + +export type SubmitFunction< + Success extends Record | undefined = Record, + Failure extends Record | undefined = Record +> = (input: { + action: URL; + formData: FormData; + formElement: HTMLFormElement; + controller: AbortController; + submitter: HTMLElement | null; + cancel: () => void; +}) => MaybePromise< + | void + | ((opts: { + formData: FormData; + formElement: HTMLFormElement; + action: URL; + result: ActionResult; + /** + * Call this to get the default behavior of a form submission response. + * @param options Set `reset: false` if you don't want the `` values to be reset after a successful submission. + * @param invalidateAll Set `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission. + */ + update: (options?: { reset?: boolean; invalidateAll?: boolean }) => Promise; + }) => MaybePromise) +>; + +/** + * The type of `export const snapshot` exported from a page or layout component. + */ +export interface Snapshot { + capture: () => T; + restore: (snapshot: T) => void; +} + +// If T is unknown or has an index signature, the types below will recurse indefinitely and create giant unions that TS can't handle +type WillRecurseIndefinitely = unknown extends T ? true : string extends keyof T ? true : false; + +// Input type mappings for form fields +type InputTypeMap = { + text: string; + email: string; + password: string; + url: string; + tel: string; + search: string; + number: number; + range: number; + date: string; + 'datetime-local': string; + time: string; + month: string; + week: string; + color: string; + checkbox: boolean | string[]; + radio: string; + file: File; + hidden: string | number | boolean; + submit: string | number | boolean; + button: string; + reset: string; + image: string; + select: string; + 'select multiple': string[]; + 'file multiple': File[]; +}; + +// Valid input types for a given value type +export type RemoteFormFieldType = { + [K in keyof InputTypeMap]: T extends InputTypeMap[K] ? K : never; +}[keyof InputTypeMap]; + +// Input element properties based on type +type InputElementProps = T extends 'checkbox' | 'radio' + ? { + name: string; + type: T; + value?: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get checked(): boolean; + set checked(value: boolean); + readonly defaultChecked?: boolean; + } + : T extends 'file' + ? { + name: string; + type: 'file'; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get files(): FileList | null; + set files(v: FileList | null); + } + : T extends 'select' + ? { + name: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string; + set value(v: string); + } + : T extends 'select multiple' + ? { + name: string; + multiple: true; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string[]; + set value(v: string[]); + } + : T extends 'text' + ? { + name: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string | number; + set value(v: string | number); + readonly defaultValue?: string | number; + } + : { + name: string; + type: T; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string | number; + set value(v: string | number); + readonly defaultValue?: string | number; + }; + +type RemoteFormFieldMethods = { + /** The values that will be submitted */ + value(): DeepPartial; + /** Set the values that will be submitted */ + set(input: DeepPartial): DeepPartial; + /** Validation issues, if any */ + issues(): RemoteFormIssue[] | undefined; +}; + +// These two types use "T extends unknown ? .. : .." to distribute over unions. +// Example: if "type T = A | b" then "keyof T" only contains keys that both A and B have, with "KeysOfUnion" we get the keys of both A and B +type KeysOfUnion = T extends unknown ? keyof T : never; +type ValueOfUnionKey = T extends unknown + ? K extends keyof T + ? T[K] + : never + : never; + +export type RemoteFormFieldValue = string | string[] | number | boolean | File | File[]; + +type AsArgs = Type extends 'checkbox' + ? Value extends string[] + ? [type: Type, value: Value[number] | (string & {})] + : Value extends boolean + ? [type: Type] | [type: Type, value: boolean] + : [type: Type] | [type: Type, value: Value | (string & {})] + : Type extends 'submit' | 'hidden' + ? Value extends string + ? [type: Type, value: Value | (string & {})] + : [type: Type, value: Value] + : Type extends 'radio' + ? [type: Type, value: Value | (string & {})] + : Type extends 'file' | 'file multiple' + ? [type: Type] + : [type: Type] | [type: Type, value: Value | (string & {})]; + +/** + * Form field accessor type that provides name(), value(), and issues() methods + */ +export type RemoteFormField = RemoteFormFieldMethods & { + /** + * Returns an object that can be spread onto an input element with the correct type attribute, + * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. + * @example + * ```svelte + * + * + * + * ``` + */ + as>(...args: AsArgs): InputElementProps; +}; + +type RemoteFormFieldContainer = RemoteFormFieldMethods & { + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; +}; + +type UnknownField = RemoteFormFieldMethods & { + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; + /** + * Returns an object that can be spread onto an input element with the correct type attribute, + * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. + * @example + * ```svelte + * + * + * + * ``` + */ + as>(...args: AsArgs): InputElementProps; +} & { + [key: string | number]: UnknownField; +}; + +type RemoteFormFieldsRoot = + IsAny extends true + ? RecursiveFormFields + : Input extends void + ? { + /** Validation issues, if any */ + issues(): RemoteFormIssue[] | undefined; + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; + } + : RemoteFormFields; + +/** + * Recursive type to build form fields structure with proxy access + */ +export type RemoteFormFields = + WillRecurseIndefinitely extends true + ? RecursiveFormFields + : NonNullable extends string | number | boolean | File + ? RemoteFormField> + : // [NonNullable] is used to prevent distributing over union while still allowing + // nullable wrappers (e.g. `string[] | undefined` from a schema with `.default([])`) + // to be treated as arrays; only the last condition should distribute over unions + [NonNullable] extends [string[] | File[]] + ? RemoteFormField> & { + [K in number]: RemoteFormField[number]>; + } + : [NonNullable] extends [Array] + ? RemoteFormFieldContainer> & { + [K in number]: RemoteFormFields; + } + : RemoteFormFieldContainer & { + [K in KeysOfUnion]-?: RemoteFormFields>; + }; + +// By breaking this out into its own type, we avoid the TS recursion depth limit +type RecursiveFormFields = RemoteFormFieldContainer & { + [key: string | number]: UnknownField; +}; + +type MaybeArray = T | T[]; + +export interface RemoteFormInput { + [key: string]: MaybeArray | undefined; +} + +export interface RemoteFormIssue { + message: string; + path: Array; +} + +// If the schema specifies `id` as a string or number, ensure that `for(...)` +// only accepts that type. Otherwise, accept `string | number` +type ExtractId = Input extends { id: infer Id } + ? Id extends string | number + ? Id + : string | number + : string | number; + +/** + * A function and proxy object used to imperatively create validation errors in form handlers. + * + * Access properties to create field-specific issues: `issue.fieldName('message')`. + * The type structure mirrors the input data structure for type-safe field access. + * Call `invalid(issue.foo(...), issue.nested.bar(...))` to throw a validation error. + */ +export type InvalidField = + WillRecurseIndefinitely extends true + ? Record + : NonNullable extends string | number | boolean | File + ? (message: string) => StandardSchemaV1.Issue + : NonNullable extends Array + ? { + [K in number]: InvalidField; + } & ((message: string) => StandardSchemaV1.Issue) + : NonNullable extends RemoteFormInput + ? { + [K in keyof T]-?: InvalidField; + } & ((message: string) => StandardSchemaV1.Issue) + : Record; + +/** + * A validation error thrown by `invalid`. + */ +export interface ValidationError { + /** The validation issues */ + issues: StandardSchemaV1.Issue[]; +} + +/** + * The form instance as received inside an `enhance` callback. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ +export type RemoteFormEnhanceInstance< + Input extends RemoteFormInput | void = RemoteFormInput | void, + Output = any +> = Omit, 'enhance' | 'element'> & { + readonly element: HTMLFormElement; +}; + +/** + * The callback passed to a remote form's `enhance` method. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ +export type RemoteFormEnhanceCallback< + Input extends RemoteFormInput | void = RemoteFormInput | void, + Output = any +> = (form: RemoteFormEnhanceInstance) => MaybePromise; + +/** + * The type of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ +export type RemoteForm = { + /** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */ + [attachment: symbol]: (node: HTMLFormElement) => void; + method: 'POST'; + /** The URL to send the form to. */ + action: string; + /** The `` element this instance is currently attached to, if any. */ + get element(): HTMLFormElement | null; + /** Submit the currently attached form programmatically. */ + submit(): Promise & { + updates: (...updates: RemoteQueryUpdate[]) => Promise; + }; + /** Use the `enhance` method to influence what happens when the form is submitted. */ + enhance(callback: RemoteFormEnhanceCallback): { + method: 'POST'; + action: string; + [attachment: symbol]: (node: HTMLFormElement) => void; + }; + /** + * Create an instance of the form for the given `id`. + * The `id` is stringified and used for deduplication to potentially reuse existing instances. + * Useful when you have multiple forms that use the same remote form action, for example in a loop. + * ```svelte + * {#each todos as todo} + * {@const todoForm = updateTodo.for(todo.id)} + * + * {#if todoForm.result?.invalid}

Invalid data

{/if} + * ... + * + * {/each} + * ``` + */ + for(id: ExtractId): Omit, 'for'>; + /** Preflight checks */ + preflight(schema: StandardSchemaV1): RemoteForm; + /** Validate the form contents programmatically */ + validate(options?: { + /** Set this to `true` to also show validation issues of fields that haven't been touched yet. */ + includeUntouched?: boolean; + /** Set this to `true` to only run the `preflight` validation. */ + preflightOnly?: boolean; + }): Promise; + /** The result of the form submission */ + get result(): Output | undefined; + /** The number of pending submissions */ + get pending(): number; + /** True if the form has been submitted at least once */ + get submitted(): boolean; + /** Access form fields using object notation */ + fields: RemoteFormFieldsRoot; +}; + +/** + * The type of a remote `command` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. + */ +export type RemoteCommand = { + (arg: undefined extends Input ? Input | void : Input): Promise & { + updates(...updates: RemoteQueryUpdate[]): Promise; + }; + /** The number of pending command executions */ + get pending(): number; +}; + +export type RemoteQueryUpdate = + | RemoteQuery + | RemoteLiveQuery + | RemoteQueryFunction + | RemoteLiveQueryFunction + | RemoteQueryOverride; + +export type RemoteResource = Promise & { + /** The error in case the query fails. Most often this is a [`HttpError`](https://svelte.dev/docs/kit/@sveltejs-kit#HttpError) but it isn't guaranteed to be. */ + get error(): any; + /** `true` before the first result is available and during refreshes */ + get loading(): boolean; +} & ( + | { + /** The current value of the query. Undefined until `ready` is `true` */ + get current(): undefined; + ready: false; + } + | { + /** The current value of the query. Undefined until `ready` is `true` */ + get current(): T; + ready: true; + } + ); + +export type RemoteQuery = RemoteResource & { + /** + * On the client, this function will update the value of the query without re-fetching it. + * + * On the server, this can be called in the context of a `command` or `form` and the specified data will accompany the action response back to the client. + * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. + */ + set(value: T): void; + /** + * On the client, this function will re-fetch the query from the server. + * + * On the server, this can be called in the context of a `command` or `form` and the refreshed data will accompany the action response back to the client. + * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. + */ + refresh(): Promise; + /** + * Temporarily override a query's value during a [single-flight mutation](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations) to provide optimistic updates. + * + * ```svelte + * + * + *
{ + * await form.submit().updates( + * todos.withOverride((todos) => [...todos, { text: form.fields.text.value() }]) + * ); + * })}> + * + * + *
+ * ``` + */ + withOverride(update: (current: T) => T): RemoteQueryOverride; +}; + +export type RemoteLiveQuery = RemoteResource & + AsyncIterable & { + /** `true` if the live stream is currently connected. */ + readonly connected: boolean; + /** `true` once the current live stream iterator is done. */ + readonly done: boolean; + /** Reconnects the live stream immediately. */ + reconnect(): Promise; + }; + +export type RemoteQueryOverride = () => void; + +/** + * The type of a remote `prerender` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. + */ +export type RemotePrerenderFunction = ( + arg: undefined extends Input ? Input | void : Input +) => RemoteResource; + +/** + * The return value of a remote `query` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. + * + * The optional `Validated` generic parameter represents the argument type *after* the + * query's schema has validated and (optionally) transformed it — this is the type the + * query's implementation function receives on the server, and the type yielded by + * [`requested`](https://svelte.dev/docs/kit/$app-server#requested). For queries declared + * with [Standard Schema](https://standardschema.dev/) it differs from `Input` when the + * schema contains a transform (e.g. `v.pipe(v.number(), v.transform(String))` has + * `Input = number` but `Validated = string`). For `'unchecked'` validators and queries + * without arguments it defaults to `Input`. + */ +export type RemoteQueryFunction = ( + arg: undefined extends Input ? Input | void : Input +) => RemoteQuery; + +/** + * The type of a remote `query.live` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.live) for full documentation. + * + * The optional `Validated` generic parameter represents the argument type *after* the + * query's schema has validated and (optionally) transformed it, and matches the type + * yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested). + */ +export type RemoteLiveQueryFunction = ( + arg: undefined extends Input ? Input | void : Input +) => RemoteLiveQuery; + +/** + * [Environment variables](https://svelte.dev/docs/kit/environment-variables) can be configured by exporting + * a `variables` object from `src/env.ts`, using [`defineEnvVars`](https://svelte.dev/docs/kit/@sveltejs-kit-env#defineEnvVars). + */ +export interface EnvVarConfig { + /** + * Whether the environment variable can be accessed by client-side code. + * - if `true`, it can be imported from `$app/env/public` + * - if `false`, it can be imported from `$app/env/private`, which is a [server-only module](https://svelte.dev/docs/kit/server-only-modules) + * @default false + */ + public?: boolean; + /** + * Whether the value is determined at build time or when the app runs. + * - if `true`, the build time value is inlined into the bundle. This enables optimisations like dead-code elimination + * - if `false`, the value is read from the environment when the app starts + * @default false + */ + static?: boolean; + /** + * A [Standard Schema](https://standardschema.dev/) validator that is applied to the value when the app starts. + * The validator can output any value — not necessarily a string — but public, non-static values must be + * serializable by [devalue](https://github.com/sveltejs/devalue) so that they can be sent to the browser. + * + * If omitted, the value must be a non-empty string. + */ + schema?: StandardSchemaV1; + /** + * A description of the variable that will be used for inline documentation on hover. + */ + description?: string; +} + +export * from './index.js'; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js new file mode 100644 index 0000000000000000000000000000000000000000..3dd6ed7b6e0930ad204d6f21787d383b67109070 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js @@ -0,0 +1,278 @@ +/** @import { AssetDependencies, ManifestData, SSRNode, ValidatedKitConfig } from 'types' */ +/** @import { Manifest, Rollup } from 'vite' */ +import fs from 'node:fs'; +import { mkdirp } from '../../../utils/filesystem.js'; +import { + create_function_as_string, + filter_fonts, + find_deps, + generate_placeholder, + resolve_symlinks +} from './utils.js'; +import { s } from '../../../utils/misc.js'; +import { normalizePath } from 'vite'; +import { basename } from 'node:path'; +import { fix_css_urls } from '../../../utils/css.js'; +import { escape_for_interpolation } from '../../../utils/escape.js'; + +/** + * @param {string} out + * @param {ValidatedKitConfig} kit + * @param {ManifestData} manifest_data + * @param {Manifest} server_manifest + * @param {Manifest | null} client_manifest + * @param {string} assets_path + * @param {(Rollup.OutputAsset | Rollup.OutputChunk)[]} chunks + * @returns {void} + */ +export function build_server_nodes( + out, + kit, + manifest_data, + server_manifest, + client_manifest, + assets_path, + chunks +) { + mkdirp(`${out}/server/nodes`); + mkdirp(`${out}/server/stylesheets`); + + /** + * Stylesheet names and their contents which are below the inline threshold + * @type {Map} + */ + const stylesheets_to_inline = new Map(); + + /** + * For CSS inlining, we either store a string or a function that returns the + * styles with the correct relative URLs + * @type {(css: string, eager_assets: Set) => string} + */ + let prepare_css_for_inlining = (css) => s(css); + + if (chunks && kit.inlineStyleThreshold > 0 && kit.output.bundleStrategy === 'split') { + for (const chunk of chunks) { + if (chunk.type !== 'asset' || !chunk.fileName.endsWith('.css')) { + continue; + } + + const source = chunk.source.toString(); + if (source.length < kit.inlineStyleThreshold) { + stylesheets_to_inline.set(chunk.fileName, source); + } + } + + // If the client CSS has URL references to assets, we need to adjust the + // relative path so that they are correct when inlined into the document. + // Although `paths.assets` is static, we need to pass in a fake path + // `/_svelte_kit_assets` at runtime when running `vite preview` + if (kit.paths.assets || kit.paths.relative) { + const static_assets = new Set( + manifest_data.assets.map((asset) => decodeURIComponent(asset.file)) + ); + + const segments = /** @type {string} */ (assets_path).split('/'); + const static_asset_prefix = segments.map(() => '..').join('/') + '/'; + + prepare_css_for_inlining = (css, eager_assets) => { + const assets_placeholder = generate_placeholder(css, 'ASSETS'); + const base_placeholder = generate_placeholder(css, 'BASE'); + + const transformed_css = fix_css_urls({ + css, + vite_assets: eager_assets, + static_assets, + paths_assets: assets_placeholder, + base: base_placeholder, + static_asset_prefix + }); + + // only convert to a function if we have adjusted any URLs + if (css !== transformed_css) { + const escaped = escape_for_interpolation(transformed_css, [ + { + placeholder: assets_placeholder, + replacement: '${assets}' + }, + { + placeholder: base_placeholder, + replacement: '${base}' + } + ]); + return create_function_as_string('css', ['assets', 'base'], escaped); + } + + return s(css); + }; + } + } + + /** path to the `.svelte-kit` directory */ + const out_dir = normalizePath(kit.outDir); + + for (let i = 0; i < manifest_data.nodes.length; i++) { + const node = manifest_data.nodes[i]; + + /** @type {string[]} */ + const imports = []; + + // String representation of + /** @type {SSRNode} */ + /** @type {string[]} */ + const exports = [`export const index = ${i};`]; + + /** @type {string[]} */ + let imported = []; + + /** @type {string[]} */ + let stylesheets = []; + + /** @type {string[]} */ + let fonts = []; + + /** @type {Set} */ + const eager_assets = new Set(); + + const uses_server_component = node.child_pages + ? node.child_pages.some((child) => child.page_options?.ssr !== false) + : node.page_options?.ssr !== false; + + if (node.component && uses_server_component) { + exports.push( + 'let component_cache;', + `export const component = async () => component_cache ??= (await import('../${ + resolve_symlinks(server_manifest, node.component).chunk.file + }')).default;` + ); + } + + if (node.universal) { + if ( + (kit.router.type === 'hash' && + node.page_options !== null && + node.page_options?.ssr === undefined) || + (node.page_options && node.page_options.ssr === false) + ) { + exports.push(`export const universal = ${s(node.page_options, null, 2)};`); + } else { + imports.push( + `import * as universal from '../${resolve_symlinks(server_manifest, node.universal).chunk.file}';` + ); + // TODO: when building for analysis, explain why the file was loaded on the server if we fail to load it + exports.push('export { universal };'); + } + exports.push(`export const universal_id = ${s(node.universal)};`); + } + + if (node.server) { + imports.push( + `import * as server from '../${resolve_symlinks(server_manifest, node.server).chunk.file}';` + ); + exports.push('export { server };'); + exports.push(`export const server_id = ${s(node.server)};`); + } + + if ((node.universal || node.component) && kit.output.bundleStrategy === 'split') { + /** @type {AssetDependencies | undefined} */ + let component; + if (node.component) { + component = find_deps(server_manifest, node.component, true); + } + + /** @type {AssetDependencies | undefined} */ + let universal; + if (node.universal) { + universal = find_deps(server_manifest, node.universal, true); + } + + if (client_manifest) { + const entry_path = `${out_dir}/generated/client-optimized/nodes/${i}.js`; + const entry = find_deps(client_manifest, entry_path, true); + + // Eagerly load client stylesheets and fonts imported by the SSR-ed page to avoid FOUC. + // However, if it is not used during SSR (not present in the server manifest), + // then it can be lazily loaded in the browser. + + /** @type {Set} */ + const eager_css = new Set(); + + entry.stylesheet_map.forEach((value, filepath) => { + // pages and layouts are renamed to node indexes when optimised for the client + // so we use the original filename instead to check against the server manifest + if (filepath === entry_path) { + filepath = node.component ?? filepath; + } + + if (component?.stylesheet_map.has(filepath) || universal?.stylesheet_map.has(filepath)) { + value.css.forEach((file) => eager_css.add(file)); + value.assets.forEach((file) => eager_assets.add(file)); + } + }); + + imported = entry.imports; + stylesheets = Array.from(eager_css); + fonts = filter_fonts(Array.from(eager_assets)); + } else { + for (const entry of [component, universal]) { + if (!entry) continue; + imported.push(...entry.imports); + stylesheets.push(...entry.stylesheets); + fonts.push(...entry.fonts); + } + } + } + + exports.push( + `export const imports = ${s(imported)};`, + `export const stylesheets = ${s(stylesheets)};`, + `export const fonts = ${s(fonts)};` + ); + + /** + * Assets that have been processed by Vite (decoded and with the asset path stripped) + * @type {Set} + */ + let vite_assets = new Set(); + + // Keep track of Vite asset filenames so that we avoid touching unrelated ones + // when adjusting the inlined CSS + if (stylesheets_to_inline.size && eager_assets.size) { + vite_assets = new Set( + Array.from(eager_assets).map((asset) => { + return decodeURIComponent(asset.replace(`${assets_path}/`, '')); + }) + ); + } + + if (stylesheets_to_inline.size) { + /** @type {string[]} */ + const inline_styles = []; + + stylesheets.forEach((file, i) => { + if (stylesheets_to_inline.has(file)) { + const filename = basename(file); + const dest = `${out}/server/stylesheets/${filename}.js`; + + const css = /** @type {string} */ (stylesheets_to_inline.get(file)); + + fs.writeFileSync( + dest, + `// ${filename}\nexport default ${prepare_css_for_inlining(css, vite_assets)};` + ); + const name = `stylesheet_${i}`; + imports.push(`import ${name} from '../stylesheets/${filename}.js';`); + inline_styles.push(`\t${s(file)}: ${name}`); + } + }); + + if (inline_styles.length > 0) { + exports.push(`export const inline_styles = () => ({\n${inline_styles.join(',\n')}\n});`); + } + } + + fs.writeFileSync( + `${out}/server/nodes/${i}.js`, + `${imports.join('\n')}\n\n${exports.join('\n')}\n` + ); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js new file mode 100644 index 0000000000000000000000000000000000000000..f859c0e29bad0101d3e6cbf5c3f3ab97436a6d83 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/build_service_worker.js @@ -0,0 +1,174 @@ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ +import fs from 'node:fs'; +import process from 'node:process'; +import * as vite from 'vite'; +import { dedent } from '../../../core/sync/utils.js'; +import { s } from '../../../utils/misc.js'; +import { get_config_aliases, strip_virtual_prefix, get_env, normalize_id } from '../utils.js'; +import { create_static_module, create_sveltekit_env_public } from '../../../core/env.js'; +import { env_static_public, service_worker } from '../module_ids.js'; + +// @ts-ignore `vite.rolldownVersion` only exists in `rolldown-vite` +const is_rolldown = !!vite.rolldownVersion; + +/** + * @param {string} out + * @param {import('types').ValidatedKitConfig} kit + * @param {import('vite').ResolvedConfig} vite_config + * @param {import('types').ManifestData} manifest_data + * @param {string} service_worker_entry_file + * @param {import('types').Prerendered} prerendered + * @param {import('vite').Manifest} client_manifest + * @param {Record> | null} env_config + */ +export async function build_service_worker( + out, + kit, + vite_config, + manifest_data, + service_worker_entry_file, + prerendered, + client_manifest, + env_config +) { + const build = new Set(); + for (const key in client_manifest) { + const { file, css = [], assets = [] } = client_manifest[key]; + build.add(file); + css.forEach((file) => build.add(file)); + assets.forEach((file) => build.add(file)); + } + + if (kit.output.bundleStrategy === 'inline') { + // the bundle and stylesheet are inlined into the page and their files + // deleted, so they must not appear in the list of cacheable assets + for (const file of build) { + if (!fs.existsSync(`${out}/client/${file}`)) { + build.delete(file); + } + } + } + + // in a service worker, `location` is the location of the service worker itself, + // which is guaranteed to be `/service-worker.js` + const base = "location.pathname.split('/').slice(0, -1).join('/')"; + + const service_worker_code = dedent` + export const base = /*@__PURE__*/ ${base}; + + export const build = [ + ${Array.from(build) + .map((file) => `base + ${s(`/${file}`)}`) + .join(',\n')} + ]; + + export const files = [ + ${manifest_data.assets + .filter((asset) => kit.serviceWorker.files(asset.file)) + .map((asset) => `base + ${s(`/${asset.file}`)}`) + .join(',\n')} + ]; + + export const prerendered = [ + ${prerendered.paths.map((path) => `base + ${s(path.replace(kit.paths.base, ''))}`).join(',\n')} + ]; + + export const version = ${s(kit.version.name)}; + `; + + const env = get_env(kit.env, vite_config.mode); + + /** + * @type {import('vite').Plugin} + */ + const sw_virtual_modules = { + name: 'service-worker-build-virtual-modules', + resolveId(id) { + if (id.startsWith('$env/') || id.startsWith('$app/') || id === '$service-worker') { + // ids with :$ don't work with reverse proxies like nginx + return `\0virtual:${id.substring(1)}`; + } + }, + + load(id) { + if (!id.startsWith('\0virtual:')) return; + + if (id === service_worker) { + return service_worker_code; + } + + if (id === env_static_public) { + return create_static_module( + '$env/static/public', + env.public, + kit.experimental.explicitEnvironmentVariables + ); + } + + if (id === '\0virtual:app/env/public') { + const has_dynamic_public_env = Object.values(env_config ?? {}).some( + (variable) => variable.public && !variable.static + ); + + return create_sveltekit_env_public( + env_config, + env.all, + has_dynamic_public_env + ? // the service worker isn't registered as ESM yet, so we need to use `importScripts` + `importScripts('${kit.paths.base}/${kit.appDir}/env.script.js'); const env = globalThis.__sveltekit_sw.env;` + : '' + ); + } + + const normalized_cwd = vite.normalizePath(process.cwd()); + const normalized_lib = vite.normalizePath(kit.files.lib); + const relative = normalize_id(id, normalized_lib, normalized_cwd); + const stripped = strip_virtual_prefix(relative); + throw new Error( + `Cannot import ${stripped} into service-worker code. Only the modules $service-worker, $env/static/public and $app/env/public are available in service workers.` + ); + } + }; + + /** @type {import('vite').InlineConfig} */ + const config = { + build: { + modulePreload: false, + rollupOptions: { + input: { + 'service-worker': service_worker_entry_file + }, + output: { + // .mjs so that esbuild doesn't incorrectly inject `export` https://github.com/vitejs/vite/issues/15379 + entryFileNames: `service-worker.${is_rolldown ? 'js' : 'mjs'}`, + assetFileNames: `${kit.appDir}/immutable/assets/[name].[hash][extname]`, + inlineDynamicImports: !is_rolldown ? true : undefined + } + }, + outDir: `${out}/client`, + emptyOutDir: false, + minify: vite_config.build.minify + }, + configFile: false, + define: vite_config.define, + publicDir: false, + plugins: [sw_virtual_modules], + resolve: { + alias: [...get_config_aliases(kit)] + }, + experimental: { + renderBuiltUrl(filename) { + return { + runtime: `new URL(${JSON.stringify(filename)}, location.href).pathname` + }; + } + } + }; + + await vite.build(config); + + // rename .mjs to .js to avoid incorrect MIME types with ancient webservers + if (!is_rolldown) { + fs.renameSync(`${out}/client/service-worker.mjs`, `${out}/client/service-worker.js`); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js new file mode 100644 index 0000000000000000000000000000000000000000..4e9d60aaacb4fa21b0858de8a3754f8a8e6e7cc5 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/remote.js @@ -0,0 +1,126 @@ +/** @import { ServerMetadata } from 'types' */ +/** @import { Rollup } from 'vite' */ + +import fs from 'node:fs'; +import path from 'node:path'; +import { Parser } from 'acorn'; +import MagicString from 'magic-string'; +import { posixify } from '../../../utils/filesystem.js'; +import { import_peer } from '../../../utils/import.js'; + +/** + * @param {string} out + * @param {Array<{ hash: string, file: string }>} remotes + * @param {ServerMetadata} metadata + * @param {string} cwd + * @param {Rollup.OutputBundle} server_bundle + * @param {NonNullable['sourcemap']} sourcemap + */ +export async function treeshake_prerendered_remotes( + out, + remotes, + metadata, + cwd, + server_bundle, + sourcemap +) { + if (remotes.length === 0) return; + + const vite = /** @type {typeof import('vite')} */ (await import_peer('vite')); + + for (const remote of remotes) { + const exports_map = metadata.remotes.get(remote.hash); + if (!exports_map) continue; + + /** @type {string[]} */ + const dynamic = []; + /** @type {string[]} */ + const prerendered = []; + + for (const [name, value] of exports_map) { + (value.dynamic ? dynamic : prerendered).push(name); + } + + if (prerendered.length === 0) continue; // nothing to treeshake + + // remove file extension + const remote_filename = path.basename(remote.file).split('.').slice(0, -1).join('.'); + + const remote_chunk = Object.values(server_bundle).find((chunk) => { + return chunk.name === remote_filename; + }); + + if (!remote_chunk) continue; + + const chunk_path = posixify(path.relative(cwd, `${out}/server/${remote_chunk.fileName}`)); + + const code = fs.readFileSync(chunk_path, 'utf-8'); + const parsed = Parser.parse(code, { sourceType: 'module', ecmaVersion: 'latest' }); + const modified_code = new MagicString(code); + + for (const fn of prerendered) { + for (const node of parsed.body) { + const declaration = + node.type === 'ExportNamedDeclaration' + ? node.declaration + : node.type === 'VariableDeclaration' + ? node + : null; + + if (!declaration || declaration.type !== 'VariableDeclaration') continue; + + for (const declarator of declaration.declarations) { + if (declarator.id.type === 'Identifier' && declarator.id.name === fn) { + modified_code.overwrite( + node.start, + node.end, + `const ${fn} = prerender('unchecked', () => { throw new Error('Unexpectedly called prerender function. Did you forget to set { dynamic: true } ?') });` + ); + } + } + } + } + + for (const node of parsed.body) { + if (node.type === 'ExportDefaultDeclaration') { + modified_code.remove(node.start, node.end); + } + } + + const stubbed = modified_code.toString(); + fs.writeFileSync(chunk_path, stubbed); + + const bundle = /** @type {import('vite').Rollup.RollupOutput} */ ( + await vite.build({ + configFile: false, + build: { + write: false, + ssr: true, + target: 'esnext', + sourcemap, + rollupOptions: { + // avoid resolving imports + external: (id) => !id.endsWith(chunk_path), + input: { + treeshaken: chunk_path + } + } + } + }) + ); + + const chunk = bundle.output.find( + (output) => output.type === 'chunk' && output.name === 'treeshaken' + ); + if (chunk && chunk.type === 'chunk') { + fs.writeFileSync(chunk_path, chunk.code); + + const chunk_sourcemap = bundle.output.find( + (output) => output.type === 'asset' && output.fileName === chunk.fileName + '.map' + ); + if (chunk_sourcemap && chunk_sourcemap.type === 'asset') { + fs.writeFileSync(chunk_path + '.map', chunk_sourcemap.source); + } + } + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..fc4079b80d90ae6941e29c3ce7794400a02d5016 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js @@ -0,0 +1,154 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { normalizePath } from 'vite'; + +/** + * Adds transitive JS and CSS dependencies to the js and css inputs. + * @param {import('vite').Manifest} manifest + * @param {string} entry + * @param {boolean} add_dynamic_css + * @returns {import('types').AssetDependencies} + */ +export function find_deps(manifest, entry, add_dynamic_css) { + /** @type {Set} */ + const seen = new Set(); + + /** @type {Set} */ + const imports = new Set(); + + /** @type {Set} */ + const stylesheets = new Set(); + + /** @type {Set} */ + const imported_assets = new Set(); + + /** @type {Map; assets: Set }>} */ + const stylesheet_map = new Map(); + + /** + * @param {string} current + * @param {boolean} add_js + * @param {string} initial_importer + * @param {number} dynamic_import_depth + */ + function traverse(current, add_js, initial_importer, dynamic_import_depth) { + if (seen.has(current)) return; + seen.add(current); + + const { chunk } = resolve_symlinks(manifest, current); + + if (add_js) imports.add(chunk.file); + + if (chunk.assets) { + chunk.assets.forEach((asset) => imported_assets.add(asset)); + } + + if (chunk.css) { + chunk.css.forEach((file) => stylesheets.add(file)); + } + + if (chunk.imports) { + chunk.imports.forEach((file) => + traverse(file, add_js, initial_importer, dynamic_import_depth) + ); + } + + if (!add_dynamic_css) return; + + if ((chunk.css || chunk.assets) && dynamic_import_depth <= 1) { + // group files based on the initial importer because if a file is only ever + // a transitive dependency, it doesn't have a suitable name we can map back to + // the server manifest + if (stylesheet_map.has(initial_importer)) { + const { css, assets } = /** @type {{ css: Set; assets: Set }} */ ( + stylesheet_map.get(initial_importer) + ); + if (chunk.css) chunk.css.forEach((file) => css.add(file)); + if (chunk.assets) chunk.assets.forEach((file) => assets.add(file)); + } else { + stylesheet_map.set(initial_importer, { + css: new Set(chunk.css), + assets: new Set(chunk.assets) + }); + } + } + + if (chunk.dynamicImports) { + dynamic_import_depth++; + chunk.dynamicImports.forEach((file) => { + traverse(file, false, file, dynamic_import_depth); + }); + } + } + + const { chunk, file } = resolve_symlinks(manifest, entry); + + traverse(file, true, entry, 0); + + const assets = Array.from(imported_assets); + + return { + assets, + file: chunk.file, + imports: Array.from(imports), + stylesheets: Array.from(stylesheets), + // TODO do we need this separately? + fonts: filter_fonts(assets), + stylesheet_map + }; +} + +/** + * @param {import('vite').Manifest} manifest + * @param {string} file + */ +export function resolve_symlinks(manifest, file) { + while (!manifest[file]) { + const next = normalizePath(path.relative('.', fs.realpathSync(file))); + if (next === file) throw new Error(`Could not find file "${file}" in Vite manifest`); + file = next; + } + + const chunk = manifest[file]; + + return { chunk, file }; +} + +/** + * @param {string[]} assets + * @returns {string[]} + */ +export function filter_fonts(assets) { + return assets.filter((asset) => /\.(woff2?|ttf|otf)$/.test(asset)); +} + +/** + * Writes a function with arguments used by a template literal. + * This helps us store strings in a module and inject values at runtime. + * @param {string} name The name of the function + * @param {string[]} placeholder_names The names of the placeholders in the string + * @param {string} str A string with placeholders such as "Hello ${arg0}". + * It must have backslashes, backticks and dollar signs already escaped. + * @returns {string} The function written as a string + */ +export function create_function_as_string(name, placeholder_names, str) { + const args = placeholder_names ? placeholder_names.join(', ') : ''; + return `function ${name}(${args}) { return \`${str}\`; }`; +} + +/** + * Guarantees that the generated placeholder is not already present in the content. + * @param {string} content + * @param {string} key + * @returns {string} + */ +export function generate_placeholder(content, key) { + let id = 1; + let placeholder = `__SVELTEKIT_${key}_${id}__`; + + while (content.includes(placeholder)) { + placeholder = `__SVELTEKIT_${key}_${++id}__`; + } + + return placeholder; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aadd288cac6369de2b37d40c912044682fe7d122 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js @@ -0,0 +1,684 @@ +/** @import { RequestEvent } from '@sveltejs/kit' */ +/** @import { PrerenderOption, UniversalNode } from 'types' */ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import { URL } from 'node:url'; +import { AsyncLocalStorage } from 'node:async_hooks'; +import colors from 'kleur'; +import sirv from 'sirv'; +import { isCSSRequest, loadEnv, buildErrorMessage } from 'vite'; +import { createReadableStream, getRequest, setResponse } from '../../../exports/node/index.js'; +import { installPolyfills } from '../../../exports/node/polyfills.js'; +import { coalesce_to_error } from '../../../utils/error.js'; +import { from_fs, posixify, resolve_entry, to_fs } from '../../../utils/filesystem.js'; +import { load_error_page } from '../../../core/config/index.js'; +import { SVELTE_KIT_ASSETS } from '../../../constants.js'; +import * as sync from '../../../core/sync/sync.js'; +import { get_mime_lookup, runtime_base } from '../../../core/utils.js'; +import { compact } from '../../../utils/array.js'; +import { is_chrome_devtools_request, not_found } from '../utils.js'; +import { SCHEME } from '../../../utils/url.js'; +import { check_feature } from '../../../utils/features.js'; +import { escape_html } from '../../../utils/escape.js'; + +const cwd = process.cwd(); +// vite-specifc queries that we should skip handling for css urls +const vite_css_query_regex = /(?:\?|&)(?:raw|url|inline)(?:&|$)/; + +/** + * @param {import('vite').ViteDevServer} vite + * @param {import('vite').ResolvedConfig} vite_config + * @param {import('types').ValidatedConfig} svelte_config + * @param {() => Array<{ hash: string, file: string }>} get_remotes + * @return {Promise void>>} + */ +export async function dev(vite, vite_config, svelte_config, get_remotes) { + installPolyfills(); + + /** @type {AsyncLocalStorage<{ event: RequestEvent, config: any, prerender: PrerenderOption }>} */ + const async_local_storage = new AsyncLocalStorage(); + + globalThis.__SVELTEKIT_TRACK__ = (label) => { + const context = async_local_storage.getStore(); + if (!context || context.prerender === true) return; + + check_feature( + /** @type {string} */ (context.event.route.id), + context.config, + label, + svelte_config.kit.adapter + ); + }; + + const fetch = globalThis.fetch; + globalThis.fetch = (info, init) => { + if (typeof info === 'string' && !SCHEME.test(info)) { + throw new Error( + `Cannot use relative URL (${info}) with global fetch — use \`event.fetch\` instead: https://svelte.dev/docs/kit/web-standards#fetch-apis` + ); + } + + return fetch(info, init); + }; + + sync.init(svelte_config, vite_config.mode); + + /** @type {import('types').ManifestData} */ + let manifest_data; + /** @type {import('@sveltejs/kit').SSRManifest} */ + let manifest; + + /** @type {Error | null} */ + let manifest_error = null; + + /** @param {string} url */ + async function loud_ssr_load_module(url) { + try { + return await vite.ssrLoadModule(url, { fixStacktrace: true }); + } catch (/** @type {unknown} */ e) { + const err = /** @type {import('rollup').RollupError} */ (e); + const msg = buildErrorMessage(err, [colors.red(`Internal server error: ${err.message}`)]); + + if (!vite.config.logger.hasErrorLogged(err)) { + vite.config.logger.error(msg, { error: err }); + } + + vite.ws.send({ + type: 'error', + err: /** @type {import('vite').ErrorPayload['err']} */ ({ + ...err, + // these properties are non-enumerable and will + // not be serialized unless we explicitly include them + message: err.message, + stack: err.stack ?? '' + }) + }); + + throw err; + } + } + + /** @param {string} id */ + async function resolve(id) { + const url = id.startsWith('..') ? to_fs(path.resolve(id)) : `/${id}`; + + const module = await loud_ssr_load_module(url); + + const module_node = await vite.moduleGraph.getModuleByUrl(url); + if (!module_node) throw new Error(`Could not find node for ${url}`); + + return { module, module_node, url }; + } + + function update_manifest() { + try { + ({ manifest_data } = sync.create(svelte_config)); + + if (manifest_error) { + manifest_error = null; + vite.ws.send({ type: 'full-reload' }); + } + } catch (error) { + manifest_error = /** @type {Error} */ (error); + + console.error(colors.bold().red(manifest_error.message)); + vite.ws.send({ + type: 'error', + err: { + message: manifest_error.message ?? 'Invalid routes', + stack: '' + } + }); + + return; + } + + manifest = { + appDir: svelte_config.kit.appDir, + appPath: svelte_config.kit.appDir, + assets: new Set(manifest_data.assets.map((asset) => asset.file)), + mimeTypes: get_mime_lookup(manifest_data), + _: { + client: { + start: `${runtime_base}/client/entry.js`, + app: `${to_fs(svelte_config.kit.outDir)}/generated/client/app.js`, + imports: [], + stylesheets: [], + fonts: [], + uses_env_dynamic_public: true, + nodes: + svelte_config.kit.router.resolution === 'client' + ? undefined + : manifest_data.nodes.map((node, i) => { + if (node.component || node.universal) { + return `${svelte_config.kit.paths.base}${to_fs(svelte_config.kit.outDir)}/generated/client/nodes/${i}.js`; + } + }), + // `css` is not necessary in dev, as the JS file from `nodes` will reference the CSS file + routes: + svelte_config.kit.router.resolution === 'client' + ? undefined + : compact( + manifest_data.routes.map((route) => { + if (!route.page) return; + + return { + id: route.id, + pattern: route.pattern, + params: route.params, + layouts: route.page.layouts.map((l) => + l !== undefined ? [!!manifest_data.nodes[l].server, l] : undefined + ), + errors: route.page.errors, + leaf: [!!manifest_data.nodes[route.page.leaf].server, route.page.leaf] + }; + }) + ) + }, + server_assets: new Proxy( + {}, + { + has: (_, /** @type {string} */ file) => fs.existsSync(from_fs(file)), + get: (_, /** @type {string} */ file) => fs.statSync(from_fs(file)).size + } + ), + nodes: manifest_data.nodes.map((node, index) => { + return async () => { + /** @type {import('types').SSRNode} */ + const result = {}; + result.index = index; + result.universal_id = node.universal; + result.server_id = node.server; + + // these are unused in dev, but it's easier to include them + result.imports = []; + result.stylesheets = []; + result.fonts = []; + + /** @type {import('vite').ModuleNode[]} */ + const module_nodes = []; + + if (node.component) { + result.component = async () => { + const { module_node, module } = await resolve( + /** @type {string} */ (node.component) + ); + + module_nodes.push(module_node); + + return module.default; + }; + } + + if (node.universal) { + if (node.page_options?.ssr === false) { + result.universal = /** @type {UniversalNode} */ (node.page_options); + } else { + // TODO: explain why the file was loaded on the server if we fail to load it + const { module, module_node } = await resolve(node.universal); + module_nodes.push(module_node); + result.universal = module; + } + } + + if (node.server) { + const { module } = await resolve(node.server); + result.server = module; + } + + // in dev we inline all styles to avoid FOUC. this gets populated lazily so that + // components/stylesheets loaded via import() during `load` are included + result.inline_styles = async () => { + /** @type {Set} */ + const deps = new Set(); + + for (const module_node of module_nodes) { + await find_deps(vite, module_node, deps); + } + + /** @type {Record} */ + const styles = {}; + + for (const dep of deps) { + if (isCSSRequest(dep.url) && !vite_css_query_regex.test(dep.url)) { + const inlineCssUrl = dep.url.includes('?') + ? dep.url.replace('?', '?inline&') + : dep.url + '?inline'; + try { + const mod = await vite.ssrLoadModule(inlineCssUrl); + styles[dep.url] = mod.default; + } catch { + // this can happen with dynamically imported modules, I think + // because the Vite module graph doesn't distinguish between + // static and dynamic imports? TODO investigate, submit fix + } + } + } + + return styles; + }; + + return result; + }; + }), + prerendered_routes: new Set(), + get remotes() { + return Object.fromEntries( + get_remotes().map((remote) => [ + remote.hash, + () => vite.ssrLoadModule(remote.file).then((module) => ({ default: module })) + ]) + ); + }, + routes: compact( + manifest_data.routes.map((route) => { + if (!route.page && !route.endpoint) return null; + + const endpoint = route.endpoint; + + return { + id: route.id, + pattern: route.pattern, + params: route.params, + page: route.page, + endpoint: endpoint + ? async () => { + const url = path.resolve(cwd, endpoint.file); + return await loud_ssr_load_module(url); + } + : null, + endpoint_id: endpoint?.file + }; + }) + ), + matchers: async () => { + /** @type {Record} */ + const matchers = {}; + + for (const key in manifest_data.matchers) { + const file = manifest_data.matchers[key]; + const url = path.resolve(cwd, file); + const module = await vite.ssrLoadModule(url, { fixStacktrace: true }); + + if (module.match) { + matchers[key] = module.match; + } else { + throw new Error(`${file} does not export a \`match\` function`); + } + } + + return matchers; + } + } + }; + } + + /** @param {Error} error */ + function fix_stack_trace(error) { + try { + vite.ssrFixStacktrace(error); + } catch { + // ssrFixStacktrace can fail on StackBlitz web containers and we don't know why + // by ignoring it the line numbers are wrong, but at least we can show the error + } + return error.stack?.replaceAll('\0', ''); // remove null bytes from e.g. virtual module IDs, or the response will fail + } + + update_manifest(); + + /** + * @param {string} event + * @param {(file: string) => void} cb + */ + const watch = (event, cb) => { + vite.watcher.on(event, (file) => { + if ( + file.startsWith(svelte_config.kit.files.routes + path.sep) || + file.startsWith(svelte_config.kit.files.params + path.sep) || + svelte_config.kit.moduleExtensions.some((ext) => file.endsWith(`.remote${ext}`)) || + // in contrast to server hooks, client hooks are written to the client manifest + // and therefore need rebuilding when they are added/removed + file.startsWith(svelte_config.kit.files.hooks.client) + ) { + cb(file); + } + }); + }; + /** @type {NodeJS.Timeout | null } */ + let timeout = null; + /** @param {() => void} to_run */ + const debounce = (to_run) => { + timeout && clearTimeout(timeout); + timeout = setTimeout(() => { + timeout = null; + to_run(); + }, 100); + }; + + // flag to skip watchers if server is already restarting + let restarting = false; + + // Debounce add/unlink events because in case of folder deletion or moves + // they fire in rapid succession, causing needless invocations. + // These watchers only run for routes, param matchers, and client hooks. + watch('add', () => debounce(update_manifest)); + watch('unlink', () => debounce(update_manifest)); + watch('change', (file) => { + // Don't run for a single file if the whole manifest is about to get updated + // Unless it's a file where the trailing slash page option might have changed + if (timeout || restarting || !/\+(page|layout|server).*$/.test(file)) return; + sync.update(svelte_config, manifest_data, file); + }); + + const { appTemplate, errorTemplate, serviceWorker, hooks } = svelte_config.kit.files; + + // vite client only executes a full reload if the triggering html file path is index.html + // kit defaults to src/app.html, so unless user changed that to index.html + // send the vite client a full-reload event without path being set + if (appTemplate !== 'index.html') { + vite.watcher.on('change', (file) => { + if (file === appTemplate && !restarting) { + vite.ws.send({ type: 'full-reload' }); + } + }); + } + + vite.watcher.on('all', (_, file) => { + if ( + file === appTemplate || + file === errorTemplate || + file.startsWith(serviceWorker) || + file.startsWith(hooks.server) + ) { + sync.server(svelte_config); + } + }); + + vite.watcher.on('change', async (file) => { + // changing the svelte config requires restarting the dev server + // the config is only read on start and passed on to vite-plugin-svelte + // which needs up-to-date values to operate correctly + if (file.match(/[/\\]svelte\.config\.[jt]s$/)) { + console.log(`svelte config changed, restarting vite dev-server. changed file: ${file}`); + restarting = true; + await vite.restart(); + } + }); + + const assets = svelte_config.kit.paths.assets ? SVELTE_KIT_ASSETS : svelte_config.kit.paths.base; + const asset_server = sirv(svelte_config.kit.files.assets, { + dev: true, + etag: true, + maxAge: 0, + extensions: [], + setHeaders: (res) => { + res.setHeader('access-control-allow-origin', '*'); + } + }); + + vite.middlewares.use((req, res, next) => { + const base = `${vite.config.server.https ? 'https' : 'http'}://${ + req.headers[':authority'] || req.headers.host + }`; + + const decoded = decodeURI(new URL(base + req.url).pathname); + + if (decoded.startsWith(assets)) { + const pathname = decoded.slice(assets.length); + const file = svelte_config.kit.files.assets + pathname; + + if (fs.existsSync(file) && !fs.statSync(file).isDirectory()) { + if (has_correct_case(file, svelte_config.kit.files.assets)) { + req.url = encodeURI(pathname); // don't need query/hash + asset_server(req, res); + return; + } + } + } + + next(); + }); + + const env = loadEnv(vite_config.mode, svelte_config.kit.env.dir, ''); + const emulator = await svelte_config.kit.adapter?.emulate?.(); + + return () => { + const serve_static_middleware = vite.middlewares.stack.find( + (middleware) => + /** @type {Function} */ (middleware.handle).name === 'viteServeStaticMiddleware' + ); + + // Vite will give a 403 on URLs like /test, /static, and /package.json preventing us from + // serving routes with those names. See https://github.com/vitejs/vite/issues/7363 + remove_static_middlewares(vite.middlewares); + + vite.middlewares.use(async (req, res) => { + // Vite's base middleware strips out the base path. Restore it + const original_url = req.url; + req.url = req.originalUrl; + try { + const base = `${vite.config.server.https ? 'https' : 'http'}://${ + req.headers[':authority'] || req.headers.host + }`; + + const decoded = decodeURI(new URL(base + req.url).pathname); + const file = posixify(path.resolve(decoded.slice(svelte_config.kit.paths.base.length + 1))); + const is_file = fs.existsSync(file) && !fs.statSync(file).isDirectory(); + const allowed = + !vite_config.server.fs.strict || + vite_config.server.fs.allow.some((dir) => file.startsWith(dir)); + + if (is_file && allowed) { + req.url = original_url; + // @ts-expect-error + serve_static_middleware.handle(req, res); + return; + } + + if (is_chrome_devtools_request(decoded, res)) { + return; + } + + if (!decoded.startsWith(svelte_config.kit.paths.base)) { + return not_found(req, res, svelte_config.kit.paths.base); + } + + if (decoded === svelte_config.kit.paths.base + '/service-worker.js') { + const resolved = resolve_entry(svelte_config.kit.files.serviceWorker); + + if (resolved) { + res.writeHead(200, { + 'content-type': 'application/javascript' + }); + res.end(`import '${svelte_config.kit.paths.base}${to_fs(resolved)}';`); + } else { + res.writeHead(404); + res.end('not found'); + } + + return; + } + + const resolved_instrumentation = resolve_entry( + path.join(svelte_config.kit.files.src, 'instrumentation.server') + ); + + if (resolved_instrumentation) { + await vite.ssrLoadModule(resolved_instrumentation); + } + + // we have to import `Server` before calling `set_assets` + const { Server } = /** @type {import('types').ServerModule} */ ( + await vite.ssrLoadModule(`${runtime_base}/server/index.js`, { fixStacktrace: true }) + ); + + const { set_fix_stack_trace } = await vite.ssrLoadModule( + `${runtime_base}/shared-server.js` + ); + set_fix_stack_trace(fix_stack_trace); + + const { set_assets } = await vite.ssrLoadModule('$app/paths/internal/server'); + set_assets(assets); + + const server = new Server(manifest); + + await server.init({ + env, + read: (file) => createReadableStream(from_fs(file)) + }); + + const request = await getRequest({ + base, + request: req + }); + + if (manifest_error) { + console.error(colors.bold().red(manifest_error.message)); + + const error_page = load_error_page(svelte_config); + + /** @param {{ status: number; message: string }} opts */ + const error_template = ({ status, message }) => { + return error_page + .replace(/%sveltekit\.status%/g, String(status)) + .replace(/%sveltekit\.error\.message%/g, escape_html(message)); + }; + + res.writeHead(500, { + 'Content-Type': 'text/html; charset=utf-8' + }); + res.end( + error_template({ status: 500, message: manifest_error.message ?? 'Invalid routes' }) + ); + + return; + } + + const rendered = await server.respond(request, { + getClientAddress: () => { + const { remoteAddress } = req.socket; + if (remoteAddress) return remoteAddress; + throw new Error('Could not determine clientAddress'); + }, + read: (file) => { + if (file in manifest._.server_assets) { + return fs.readFileSync(from_fs(file)); + } + + return fs.readFileSync(path.join(svelte_config.kit.files.assets, file)); + }, + before_handle: async (event, config, prerender, handle) => { + // we need to use .run because .enterWith() is not supported in Cloudflare Workers + // see https://blog.cloudflare.com/workers-node-js-asynclocalstorage/ + return await async_local_storage.run({ event, config, prerender }, handle); + }, + emulator + }); + + if (rendered.status === 404) { + // @ts-expect-error + serve_static_middleware.handle(req, res, () => { + void setResponse(res, rendered); + }); + } else { + void setResponse(res, rendered); + } + } catch (e) { + const error = coalesce_to_error(e); + res.statusCode = 500; + res.end(fix_stack_trace(error) || error.message); // handle `stackless` errors + } + }); + }; +} + +/** + * @param {import('connect').Server} server + */ +function remove_static_middlewares(server) { + const static_middlewares = ['viteServeStaticMiddleware', 'viteServePublicMiddleware']; + for (let i = server.stack.length - 1; i > 0; i--) { + // @ts-expect-error using internals + if (static_middlewares.includes(server.stack[i].handle.name)) { + server.stack.splice(i, 1); + } + } +} + +/** + * @param {import('vite').ViteDevServer} vite + * @param {import('vite').ModuleNode | import('vite').EnvironmentModuleNode} node + * @param {Set} deps + */ +async function find_deps(vite, node, deps) { + // since `ssrTransformResult.deps` contains URLs instead of `ModuleNode`s, this process is asynchronous. + // instead of using `await`, we resolve all branches in parallel. + /** @type {Promise[]} */ + const branches = []; + + /** @param {import('vite').ModuleNode | import('vite').EnvironmentModuleNode} node */ + async function add(node) { + if (!deps.has(node)) { + deps.add(node); + await find_deps(vite, node, deps); + } + } + + /** @param {string} url */ + async function add_by_url(url) { + const node = await get_server_module_by_url(vite, url); + + if (node) { + await add(node); + } + } + + const transform_result = + /** @type {import('vite').ModuleNode} */ (node).ssrTransformResult || node.transformResult; + + if (transform_result) { + if (transform_result.deps) { + transform_result.deps.forEach((url) => branches.push(add_by_url(url))); + } + + if (transform_result.dynamicDeps) { + transform_result.dynamicDeps.forEach((url) => branches.push(add_by_url(url))); + } + } else { + node.importedModules.forEach((node) => branches.push(add(node))); + } + + await Promise.all(branches); +} + +/** + * @param {import('vite').ViteDevServer} vite + * @param {string} url + */ +function get_server_module_by_url(vite, url) { + return vite.environments + ? vite.environments.ssr.moduleGraph.getModuleByUrl(url) + : vite.moduleGraph.getModuleByUrl(url, true); +} + +/** + * Determine if a file is being requested with the correct case, + * to ensure consistent behaviour between dev and prod and across + * operating systems. Note that we can't use realpath here, + * because we don't want to follow symlinks + * @param {string} file + * @param {string} assets + * @returns {boolean} + */ +function has_correct_case(file, assets) { + if (file === assets) return true; + + const parent = path.dirname(file); + + if (fs.readdirSync(parent).includes(path.basename(file))) { + return has_correct_case(parent, assets); + } + + return false; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bd3af895b4e0f736dfac9be3ce79d13610267a8d --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/index.js @@ -0,0 +1,1718 @@ +/** @import { EnvVarConfig } from '@sveltejs/kit' */ +/** @import { Options, SvelteConfig } from '@sveltejs/vite-plugin-svelte' */ +/** @import { PreprocessorGroup } from 'svelte/compiler' */ +/** @import { KitConfig } from '@sveltejs/kit' */ +/** @import { ConfigEnv, Manifest, Plugin, ResolvedConfig, UserConfig, ViteDevServer } from 'vite' */ +/** @import { ValidatedConfig } from 'types' */ +import fs from 'node:fs'; +import path from 'node:path'; +import process from 'node:process'; +import colors from 'kleur'; + +import { copy, mkdirp, posixify, read, resolve_entry, rimraf } from '../../utils/filesystem.js'; +import { + create_dynamic_module, + create_sveltekit_env, + create_sveltekit_env_public, + create_static_module, + resolve_explicit_env_entry, + create_sveltekit_env_service_worker_dev, + create_sveltekit_env_private +} from '../../core/env.js'; +import * as sync from '../../core/sync/sync.js'; +import { create_assets } from '../../core/sync/create_manifest_data/index.js'; +import { runtime_directory, logger } from '../../core/utils.js'; +import { load_svelte_config, process_config, split_config } from '../../core/config/index.js'; +import { generate_manifest } from '../../core/generate_manifest/index.js'; +import { build_server_nodes } from './build/build_server.js'; +import { build_service_worker } from './build/build_service_worker.js'; +import { find_deps, resolve_symlinks } from './build/utils.js'; +import { dev } from './dev/index.js'; +import { preview } from './preview/index.js'; +import { error_for_missing_config, get_config_aliases, get_env, normalize_id } from './utils.js'; +import { stackless } from '../../utils/error.js'; +import { write_client_manifest } from '../../core/sync/write_client_manifest.js'; +import prerender from '../../core/postbuild/prerender.js'; +import analyse from '../../core/postbuild/analyse.js'; +import { s } from '../../utils/misc.js'; +import { hash } from '../../utils/hash.js'; +import { dedent, isSvelte5Plus } from '../../core/sync/utils.js'; +import { + env_dynamic_private, + env_dynamic_public, + env_static_private, + env_static_public, + service_worker, + sveltekit_env, + sveltekit_env_private, + sveltekit_env_service_worker, + sveltekit_server, + sveltekit_env_public_client, + sveltekit_env_public_server +} from './module_ids.js'; +import { import_peer } from '../../utils/import.js'; +import { compact } from '../../utils/array.js'; +import { should_ignore, has_children } from './static_analysis/utils.js'; +import { treeshake_prerendered_remotes } from './build/remote.js'; + +const cwd = posixify(process.cwd()); + +/** @type {import('./types.js').EnforcedConfig} */ +const enforced_config = { + appType: true, + base: true, + build: { + cssCodeSplit: true, + emptyOutDir: true, + lib: { + entry: true, + name: true, + formats: true + }, + manifest: true, + outDir: true, + rollupOptions: { + input: true, + output: { + format: true, + entryFileNames: true, + chunkFileNames: true, + assetFileNames: true + }, + preserveEntrySignatures: true + }, + ssr: true + }, + publicDir: true, + resolve: { + alias: { + $app: true, + $lib: true, + '$service-worker': true + } + }, + root: true +}; + +const options_regex = /(export\s+const\s+(prerender|csr|ssr|trailingSlash))\s*=/s; + +/** @type {Set} */ +const warned = new Set(); + +/** @type {PreprocessorGroup} */ +const warning_preprocessor = { + script: ({ content, filename }) => { + if (!filename) return; + + const basename = path.basename(filename); + if (basename.startsWith('+page.') || basename.startsWith('+layout.')) { + const match = content.match(options_regex); + if (match && match.index !== undefined && !should_ignore(content, match.index)) { + const fixed = basename.replace('.svelte', '(.server).js/ts'); + + const message = + `\n${colors.bold().red(path.relative('.', filename))}\n` + + `\`${match[1]}\` will be ignored — move it to ${fixed} instead. See https://svelte.dev/docs/kit/page-options for more information.`; + + if (!warned.has(message)) { + console.log(message); + warned.add(message); + } + } + } + }, + markup: ({ content, filename }) => { + if (!filename) return; + + const basename = path.basename(filename); + + if (basename.startsWith('+layout.') && !has_children(content, isSvelte5Plus())) { + const message = + `\n${colors.bold().red(path.relative('.', filename))}\n` + + `\`\`${isSvelte5Plus() ? ' or `{@render ...}` tag' : ''}` + + ' missing — inner content will not be rendered'; + + if (!warned.has(message)) { + console.log(message); + warned.add(message); + } + } + } +}; + +/** + * Returns the SvelteKit Vite plugins. + * Since version 2.62.0 you can pass [configuration](configuration) directly, in which case `svelte.config.js` is ignored. + * Any options that don't belong to SvelteKit are passed through to `vite-plugin-svelte`. + * @param {KitConfig & Omit & Pick} [config] + * @returns {Promise} + */ +export async function sveltekit(config) { + /** @type {ValidatedConfig} */ + let svelte_config; + + // any options passed to the plugin that SvelteKit doesn't use itself are + // forwarded to vite-plugin-svelte, which does its own validation + /** @type {Record} */ + let vite_plugin_svelte_config = {}; + + if (config !== undefined) { + const split = split_config(config); + vite_plugin_svelte_config = split.vite_plugin_svelte_config; + + svelte_config = process_config(split.svelte_config, { + cwd, + source: 'SvelteKit options from Vite config' + }); + + const config_file = ['svelte.config.js', 'svelte.config.ts'].find((file) => + fs.existsSync(file) + ); + + if (config_file) { + console.warn(`${config_file} is ignored when options are passed via your Vite config`); + } + } else { + svelte_config = await load_svelte_config(); + } + + /** @type {Options['preprocess']} */ + let preprocess = svelte_config.preprocess; + if (Array.isArray(preprocess)) { + preprocess = [...preprocess, warning_preprocessor]; + } else if (preprocess) { + preprocess = [preprocess, warning_preprocessor]; + } else { + preprocess = warning_preprocessor; + } + + /** @type {Options} */ + const vite_plugin_svelte_options = { + // pass through any options that SvelteKit doesn't use itself first, so + // that the options SvelteKit manages below always take precedence + ...vite_plugin_svelte_config, + configFile: false, + extensions: svelte_config.extensions, + preprocess, + onwarn: svelte_config.onwarn, + compilerOptions: { + // @ts-ignore - ignore this property when running `pnpm check` against Svelte 5 in the ecosystem CI + hydratable: isSvelte5Plus() ? undefined : true, + ...svelte_config.compilerOptions + }, + ...svelte_config.vitePlugin + }; + + const { svelte } = await import_peer('@sveltejs/vite-plugin-svelte'); + + return [...svelte(vite_plugin_svelte_options), ...(await kit({ svelte_config }))]; +} + +// These variables live outside the `kit()` function because it is re-invoked by each Vite build + +let secondary_build_started = false; + +/** @type {import('types').ManifestData} */ +let manifest_data; + +/** @type {import('types').ServerMetadata | undefined} only set at build time once analysis is finished */ +let build_metadata = undefined; + +/** + * Returns the SvelteKit Vite plugin. Vite executes Rollup hooks as well as some of its own. + * Background reading is available at: + * - https://vitejs.dev/guide/api-plugin.html + * - https://rollupjs.org/guide/en/#plugin-development + * + * You can get an idea of the lifecycle by looking at the flow charts here: + * - https://rollupjs.org/guide/en/#build-hooks + * - https://rollupjs.org/guide/en/#output-generation-hooks + * + * @param {{ svelte_config: import('types').ValidatedConfig }} options + * @return {Promise} + */ +async function kit({ svelte_config }) { + /** @type {typeof import('vite')} */ + const vite = await import_peer('vite'); + + // @ts-ignore `vite.rolldownVersion` only exists in `vite 8` + const is_rolldown = !!vite.rolldownVersion; + + const { kit } = svelte_config; + /** `kit.outDir` but posix-ified */ + const out_dir = posixify(kit.outDir); + /** The base directory for the Vite builds */ + const out = `${out_dir}/output`; + + const version_hash = hash(kit.version.name); + + /** @type {ResolvedConfig} */ + let vite_config; + + /** @type {ConfigEnv} */ + let vite_config_env; + + /** @type {boolean} */ + let is_build; + + /** @type {{ all: Record; public: Record; private: Record }} */ + let env; + + /** @type {() => Promise} */ + let finalise; + + /** @type {UserConfig} */ + let initial_config; + + const service_worker_entry_file = resolve_entry(kit.files.serviceWorker); + const parsed_service_worker = path.parse(kit.files.serviceWorker); + + const normalized_cwd = vite.normalizePath(cwd); + const normalized_lib = vite.normalizePath(kit.files.lib); + const normalized_node_modules = vite.normalizePath(path.resolve('node_modules')); + + /** + * A map showing which features (such as `$app/server:read`) are defined + * in which chunks, so that we can later determine which routes use which features + * @type {Record} + */ + const tracked_features = {}; + + const sourcemapIgnoreList = /** @param {string} relative_path */ (relative_path) => + relative_path.includes('node_modules') || relative_path.includes(kit.outDir); + + /** @type {Plugin} */ + const plugin_setup = { + name: 'vite-plugin-sveltekit-setup', + api: { + options: svelte_config + }, + + /** + * Build the SvelteKit-provided Vite config to be merged with the user's vite.config.js file. + * @see https://vitejs.dev/guide/api-plugin.html#config + */ + config: { + order: 'pre', + handler(config, config_env) { + initial_config = config; + vite_config_env = config_env; + is_build = config_env.command === 'build'; + + env = get_env(kit.env, vite_config_env.mode); + + const allow = new Set([ + kit.files.lib, + kit.files.routes, + kit.files.src, + kit.outDir, + // ensures that the client entry is served even if it's located outside + // the local node_modules, such as the pnpm global virtual store + runtime_directory, + path.resolve('node_modules'), + path.resolve(vite.searchForWorkspaceRoot(cwd), 'node_modules') + ]); + + // We can only add directories to the allow list, so we find out + // if there's a client hooks file and pass its directory + const client_hooks = resolve_entry(kit.files.hooks.client); + if (client_hooks) allow.add(path.dirname(client_hooks)); + + const generated = path.posix.join(out_dir, 'generated'); + + // dev and preview config can be shared + /** @type {UserConfig} */ + const new_config = { + resolve: { + alias: [ + { find: '__SERVER__', replacement: `${generated}/server` }, + { find: '$app', replacement: `${runtime_directory}/app` }, + ...get_config_aliases(kit) + ] + }, + root: cwd, + server: { + cors: { preflightContinue: true }, + fs: { + allow: [...allow] + }, + sourcemapIgnoreList, + watch: { + ignored: [ + // Ignore all siblings of config.kit.outDir/generated + `${out_dir}/!(generated)` + ] + } + }, + preview: { + cors: { preflightContinue: true } + }, + optimizeDeps: { + entries: [ + `${kit.files.routes}/**/+*.{svelte,js,ts}`, + `!${kit.files.routes}/**/+*server.*` + ], + exclude: [ + // Without this SvelteKit will be prebundled on the client, which means we end up with two versions of Redirect etc. + // Also see https://github.com/sveltejs/kit/issues/5952#issuecomment-1218844057 + '@sveltejs/kit', + // exclude kit features so that libraries using them work even when they are prebundled + // this does not affect app code, just handling of imported libraries that use $app or $env + '$app', + '$env' + ] + }, + ssr: { + noExternal: [ + // This ensures that esm-env is inlined into the server output with the + // export conditions resolved correctly through Vite. This prevents adapters + // that bundle later on from resolving the export conditions incorrectly + // and for example include browser-only code in the server output + // because they for example use esbuild.build with `platform: 'browser'` + 'esm-env', + // This forces `$app/*` modules to be bundled, since they depend on + // virtual modules like `__sveltekit/env` (this isn't a valid bare + // import, but it works with vite-node's externalization logic, which + // uses basic concatenation) + '@sveltejs/kit/src/runtime' + ] + } + }; + + if (kit.experimental.remoteFunctions) { + // treat .remote.js files as empty for the purposes of prebundling + // detects rolldown to avoid a warning message in vite 8 beta + const remote_id_filter = new RegExp( + `.remote(${kit.moduleExtensions.join('|')})$`.replaceAll('.', '\\.') + ); + new_config.optimizeDeps ??= {}; // for some reason ts says this could be undefined even though it was set above + if (is_rolldown) { + // @ts-ignore + new_config.optimizeDeps.rolldownOptions ??= {}; + // @ts-ignore + new_config.optimizeDeps.rolldownOptions.plugins ??= []; + // @ts-ignore + new_config.optimizeDeps.rolldownOptions.plugins.push({ + name: 'vite-plugin-sveltekit-setup:optimize-remote-functions', + load: { + filter: { id: remote_id_filter }, + handler() { + return ''; + } + } + }); + } else { + new_config.optimizeDeps.esbuildOptions ??= {}; + new_config.optimizeDeps.esbuildOptions.plugins ??= []; + new_config.optimizeDeps.esbuildOptions.plugins.push({ + name: 'vite-plugin-sveltekit-setup:optimize-remote-functions', + setup(build) { + build.onLoad({ filter: remote_id_filter }, () => ({ contents: '' })); + } + }); + } + } + + const define = { + __SVELTEKIT_APP_DIR__: s(kit.appDir), + __SVELTEKIT_APP_VERSION__: s(kit.version.name), + __SVELTEKIT_EMBEDDED__: s(kit.embedded), + __SVELTEKIT_FORK_PRELOADS__: s(kit.experimental.forkPreloads), + __SVELTEKIT_PATHS_ASSETS__: s(kit.paths.assets), + __SVELTEKIT_PATHS_BASE__: s(kit.paths.base), + __SVELTEKIT_PATHS_RELATIVE__: s(kit.paths.relative), + __SVELTEKIT_CLIENT_ROUTING__: s(kit.router.resolution === 'client'), + __SVELTEKIT_HASH_ROUTING__: s(kit.router.type === 'hash'), + __SVELTEKIT_SERVER_TRACING_ENABLED__: s(kit.experimental.tracing.server), + __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__: s(kit.experimental.handleRenderingErrors), + __SVELTEKIT_EXPERIMENTAL_EXPLICIT_ENVIRONMENT_VARIABLES__: s( + kit.experimental.explicitEnvironmentVariables + ), + __SVELTEKIT_DEV__: s(!is_build) + }; + + if (is_build) { + if (!new_config.build) new_config.build = {}; + new_config.build.ssr = !secondary_build_started; + + new_config.define = { + ...define, + __SVELTEKIT_ADAPTER_NAME__: s(kit.adapter?.name), + __SVELTEKIT_APP_VERSION_FILE__: s(`${kit.appDir}/version.json`), + __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: s(kit.version.pollInterval), + __SVELTEKIT_PAYLOAD__: new_config.build.ssr + ? '{}' + : `globalThis.__sveltekit_${version_hash}` + }; + + if (!secondary_build_started) { + manifest_data = sync.all(svelte_config, config_env.mode).manifest_data; + // During the initial server build we don't know yet + new_config.define.__SVELTEKIT_HAS_SERVER_LOAD__ = 'true'; + new_config.define.__SVELTEKIT_HAS_UNIVERSAL_LOAD__ = 'true'; + } else { + const nodes = Object.values( + /** @type {import('types').ServerMetadata} */ (build_metadata).nodes + ); + + // Through the finished analysis we can now check if any node has server or universal load functions + const has_server_load = nodes.some((node) => node.has_server_load); + const has_universal_load = nodes.some((node) => node.has_universal_load); + + new_config.define.__SVELTEKIT_HAS_SERVER_LOAD__ = s(has_server_load); + new_config.define.__SVELTEKIT_HAS_UNIVERSAL_LOAD__ = s(has_universal_load); + } + } else { + new_config.define = { + ...define, + __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: '0', + __SVELTEKIT_PAYLOAD__: 'globalThis.__sveltekit_dev', + __SVELTEKIT_HAS_SERVER_LOAD__: 'true', + __SVELTEKIT_HAS_UNIVERSAL_LOAD__: 'true' + }; + + // @ts-ignore this prevents a reference error if `client.js` is imported on the server + globalThis.__sveltekit_dev = {}; + + // These Kit dependencies are packaged as CommonJS, which means they must always be externalized. + // Without this, the tests will still pass but `pnpm dev` will fail in projects that link `@sveltejs/kit`. + /** @type {NonNullable} */ (new_config.ssr).external = [ + 'cookie', + 'set-cookie-parser' + ]; + } + + // Vite's `define` is a compile-time text replacement, but Vitest strips + // user `define` from the server config and reinstalls the values only as + // `globalThis` properties inside test workers, so anything + // that runs outside of a test will freak out over + // them not being defined + if (process.env.VITEST === 'true') { + for (const key in new_config.define) { + const value = new_config.define[key]; + try { + /** @type {Record} */ (globalThis)[key] = JSON.parse(value); + } catch { + // `kit_global` isn't JSON, so don't try to parse it. We may one day + // need to define it in Vitest somehow but for now, ignore it + } + } + } + + warn_overridden_config(config, new_config); + + return new_config; + } + }, + + /** + * Stores the final config. + */ + configResolved(config) { + vite_config = config; + } + }; + + /** @type {string | null} */ + let explicit_env_entry = null; + + /** @type {Record> | null} */ + let explicit_env_config = null; + + /** @type {Plugin} */ + const plugin_virtual_modules = { + name: 'vite-plugin-sveltekit-virtual-modules', + + async configResolved(config) { + explicit_env_entry = resolve_explicit_env_entry(kit); + explicit_env_config = await sync.env(kit, explicit_env_entry, config.mode); + }, + + configureServer(server) { + if (!kit.experimental.explicitEnvironmentVariables) { + return; + } + + server.watcher.on('all', async (_, file) => { + if (!file.includes('env')) { + return; + } + + const resolved = resolve_explicit_env_entry(kit); + + if (file === explicit_env_entry || file === resolved) { + explicit_env_entry = resolved; + explicit_env_config = await sync.env(kit, explicit_env_entry, vite_config_env.mode); + + for (const id of [sveltekit_env, sveltekit_env_public_client]) { + const module = server.moduleGraph.getModuleById(id); + + if (module) { + server.moduleGraph.invalidateModule(module); + } + } + + server.ws.send({ type: 'full-reload' }); + } + }); + }, + + resolveId(id, importer) { + if (id === '__sveltekit/manifest') { + return `${out_dir}/generated/client-optimized/app.js`; + } + + // If importing from a service-worker, only allow $service-worker & $env/static/public, but none of the other virtual modules. + // This check won't catch transitive imports, but it will warn when the import comes from a service-worker directly. + // Transitive imports will be caught during the build. + // TODO move this logic to plugin_guard + // TODO allow $app/env/public + if (importer) { + const parsed_importer = path.parse(importer); + + const importer_is_service_worker = + parsed_importer.dir === parsed_service_worker.dir && + parsed_importer.name === parsed_service_worker.name; + + if ( + importer_is_service_worker && + id !== '$service-worker' && + id !== '$env/static/public' && + id !== 'virtual:$app/env/public' && + id !== '__sveltekit/env/service-worker' + ) { + throw new Error( + `Cannot import ${normalize_id( + id, + normalized_lib, + normalized_cwd + )} into service-worker code. Only the modules $service-worker, $env/static/public and $app/env/public are available in service workers.` + ); + } + } + + // treat $env/static/[public|private] as virtual + if (id.startsWith('$env/') || id === '$service-worker') { + // ids with :$ don't work with reverse proxies like nginx + return `\0virtual:${id.substring(1)}`; + } + + if (id === '__sveltekit/remote') { + return `${runtime_directory}/client/remote-functions/index.js`; + } + + if (id.startsWith('__sveltekit/')) { + return `\0virtual:${id}`; + } + }, + + load(id, options) { + const browser = !options?.ssr; + + const global = is_build + ? `globalThis.__sveltekit_${version_hash}` + : 'globalThis.__sveltekit_dev'; + + const explicit_env_flag = kit.experimental.explicitEnvironmentVariables; + + switch (id) { + case env_static_private: + return create_static_module('$env/static/private', env.private, explicit_env_flag); + + case env_static_public: + return create_static_module('$env/static/public', env.public, explicit_env_flag); + + case env_dynamic_private: + return create_dynamic_module( + 'private', + vite_config_env.command === 'serve' ? env.private : undefined, + explicit_env_flag + ); + + case env_dynamic_public: + // populate `$env/dynamic/public` from `window` + if (browser) { + return `export const env = ${global}.env;`; + } + + return create_dynamic_module( + 'public', + vite_config_env.command === 'serve' ? env.public : undefined, + explicit_env_flag + ); + + case service_worker: + return create_service_worker_module(svelte_config); + + case sveltekit_env: + return create_sveltekit_env(explicit_env_config, env.all, explicit_env_entry); + + case sveltekit_env_public_client: + return create_sveltekit_env_public( + explicit_env_config, + env.all, + `const env = ${global}.env;` + ); + + case sveltekit_env_public_server: + return create_sveltekit_env_public( + explicit_env_config, + env.all, + `import { rendered_env as env } from '__sveltekit/env';` + ); + + case sveltekit_env_private: + return create_sveltekit_env_private(explicit_env_config, env.all); + + case sveltekit_env_service_worker: + return create_sveltekit_env_service_worker_dev(explicit_env_config, env.all, global); + + case sveltekit_server: { + return dedent` + export let read_implementation = null; + + export let manifest = null; + + export function set_read_implementation(fn) { + read_implementation = fn; + } + + export function set_manifest(_) { + manifest = _; + } + `; + } + } + } + }; + + /** @type {Map>} */ + const import_map = new Map(); + const server_only_pattern = /.*\.server\..+/; + + /** + * Ensures that client-side code can't accidentally import server-side code, + * whether in `*.server.js` files, `$app/server`, `$lib/server`, `$app/env/private`, or `$env/[static|dynamic]/private` + * @type {Plugin} + */ + const plugin_guard = { + name: 'vite-plugin-sveltekit-guard', + + // Run this plugin before built-in resolution, so that relative imports + // are added to the module graph + enforce: 'pre', + + async resolveId(id, importer, options) { + if (importer && !importer.endsWith('index.html')) { + const resolved = await this.resolve(id, importer, { ...options, skipSelf: true }); + + if (resolved) { + const normalized = normalize_id(resolved.id, normalized_lib, normalized_cwd); + + let importers = import_map.get(normalized); + + if (!importers) { + importers = new Set(); + import_map.set(normalized, importers); + } + + importers.add(normalize_id(importer, normalized_lib, normalized_cwd)); + } + } + }, + + load(id, options) { + if (options?.ssr === true || process.env.TEST === 'true') { + return; + } + + // skip .server.js files outside the cwd or in node_modules, as the filename might not mean 'server-only module' in this context + const is_internal = id.startsWith(normalized_cwd) && !id.startsWith(normalized_node_modules); + + const normalized = normalize_id(id, normalized_lib, normalized_cwd); + + const is_server_only = + normalized === '$env/static/private' || + normalized === '$env/dynamic/private' || + normalized === '$app/env/private' || + normalized === '$app/server' || + normalized.startsWith('$lib/server/') || + (is_internal && server_only_pattern.test(path.basename(id))); + + if (is_server_only) { + // in dev, this doesn't exist, so we need to create it + manifest_data ??= sync.all(svelte_config, vite_config_env.mode).manifest_data; + + /** @type {Set} */ + const entrypoints = new Set(); + for (const node of manifest_data.nodes) { + if (node.component) entrypoints.add(node.component); + if (node.universal) entrypoints.add(node.universal); + } + + if (manifest_data.hooks.client) entrypoints.add(manifest_data.hooks.client); + if (manifest_data.hooks.universal) entrypoints.add(manifest_data.hooks.universal); + + const normalized = normalize_id(id, normalized_lib, normalized_cwd); + const chain = [normalized]; + + let current = normalized; + let includes_remote_file = false; + + while (true) { + const importers = import_map.get(current); + if (!importers) break; + + const candidates = Array.from(importers).filter((importer) => !chain.includes(importer)); + if (candidates.length === 0) break; + + chain.push((current = candidates[0])); + + includes_remote_file ||= svelte_config.kit.moduleExtensions.some((ext) => { + return current.endsWith(`.remote${ext}`); + }); + + if (entrypoints.has(current)) { + const pyramid = chain + .reverse() + .map((id, i) => { + return `${' '.repeat(i + 1)}${id}`; + }) + .join(' imports\n'); + + if (includes_remote_file) { + error_for_missing_config( + 'remote functions', + 'kit.experimental.remoteFunctions', + 'true' + ); + } + + let message = `Cannot import ${normalized} into code that runs in the browser, as this could leak sensitive information.`; + message += `\n\n${pyramid}`; + message += `\n\nIf you're only using the import as a type, change it to \`import type\`.`; + + throw stackless(message); + } + } + + throw new Error('An impossible situation occurred'); + } + } + }; + + /** @type {ViteDevServer} */ + let dev_server; + + /** @type {Array<{ hash: string, file: string }>} */ + const remotes = []; + + /** @type {Map} Maps remote hash -> original module id */ + const remote_original_by_hash = new Map(); + + /** @type {Set} Track which remote hashes have already been emitted */ + const emitted_remote_hashes = new Set(); + + /** @type {Plugin} */ + const plugin_remote = { + name: 'vite-plugin-sveltekit-remote', + + resolveId(id) { + if (id.startsWith('\0sveltekit-remote:')) return id; + }, + + load(id) { + // On-the-fly generated entry point for remote file just forwards the original module + // We're not using manualChunks because it can cause problems with circular dependencies + // (e.g. https://github.com/sveltejs/kit/issues/14679) and module ordering in general + // (e.g. https://github.com/sveltejs/kit/issues/14590). + if (id.startsWith('\0sveltekit-remote:')) { + const hash_id = id.slice('\0sveltekit-remote:'.length); + const original = remote_original_by_hash.get(hash_id); + if (!original) throw new Error(`Expected to find metadata for remote file ${id}`); + return `import * as m from ${s(original)};\nexport default m;`; + } + }, + + configureServer(_dev_server) { + dev_server = _dev_server; + }, + + async transform(code, id, opts) { + const normalized = normalize_id(id, normalized_lib, normalized_cwd); + if (!svelte_config.kit.moduleExtensions.some((ext) => normalized.endsWith(`.remote${ext}`))) { + return; + } + + const file = posixify(path.relative(cwd, id)); + const remote = { + hash: hash(file), + file + }; + + remotes.push(remote); + + if (opts?.ssr) { + // we need to add an `await Promise.resolve()` because if the user imports this function + // on the client AND in a load function when loading the client module we will trigger + // an ssrLoadModule during dev. During a link preload, the module can be mistakenly + // loaded and transformed twice and the first time all its exports would be undefined + // triggering a dev server error. By adding a microtask we ensure that the module is fully loaded + + // Extra newlines to prevent syntax errors around missing semicolons or comments + code += + '\n\n' + + dedent` + import * as $$_self_$$ from './${path.basename(id)}'; + import { init_remote_functions as $$_init_$$ } from '@sveltejs/kit/internal'; + + ${dev_server ? 'await Promise.resolve()' : ''} + + $$_init_$$($$_self_$$, ${s(file)}, ${s(remote.hash)}); + + for (const [name, fn] of Object.entries($$_self_$$)) { + fn.__.id = ${s(remote.hash)} + '/' + name; + fn.__.name = name; + } + `; + + // Emit a dedicated entry chunk for this remote in SSR builds (prod only) + if (!dev_server) { + remote_original_by_hash.set(remote.hash, id); + if (!emitted_remote_hashes.has(remote.hash)) { + this.emitFile({ + type: 'chunk', + id: `\0sveltekit-remote:${remote.hash}`, + name: `remote-${remote.hash}` + }); + emitted_remote_hashes.add(remote.hash); + } + } + + return code; + } + + // For the client, read the exports and create a new module that only contains fetch functions with the correct metadata + + /** @type {Map} */ + const map = new Map(); + + // in dev, load the server module here (which will result in this hook + // being called again with `opts.ssr === true` if the module isn't + // already loaded) so we can determine what it exports + if (dev_server) { + const module = await dev_server.ssrLoadModule(id); + + for (const [name, value] of Object.entries(module)) { + const type = value?.__?.type; + if (type) { + map.set(name, type); + } + } + } + + // in prod, we already built and analysed the server code before + // building the client code, so `remote_exports` is populated + else if (build_metadata?.remotes) { + const exports = build_metadata?.remotes.get(remote.hash); + if (!exports) throw new Error('Expected to find metadata for remote file ' + id); + + for (const [name, value] of exports) { + map.set(name, value.type); + } + } + + let namespace = '__remote'; + let uid = 1; + while (map.has(namespace)) namespace = `__remote${uid++}`; + + const exports = Array.from(map).map(([name, type]) => { + return `export const ${name} = ${namespace}.${type}('${remote.hash}/${name}');`; + }); + + let result = `import * as ${namespace} from '__sveltekit/remote';\n\n${exports.join('\n')}\n`; + + if (dev_server) { + result += `\nimport.meta.hot?.accept();\n`; + } + + return { + code: result + }; + } + }; + + /** @type {Plugin} */ + const plugin_service_worker_env = { + name: 'vite-plugin-sveltekit-service-worker-env', + + transform: { + filter: { + id: service_worker_entry_file || '' + }, + handler(code) { + // in dev, we prepend the service worker with an import that + // configures `env`, in case `$app/env/public` is imported, + // in prod, where we currently use non-module service + // workers, we have to use `importScripts` instead + return { + code: `import '__sveltekit/env/service-worker';\n${code}` + }; + } + } + }; + + /** @type {Plugin} */ + const plugin_compile = { + name: 'vite-plugin-sveltekit-compile', + + /** + * Build the SvelteKit-provided Vite config to be merged with the user's vite.config.js file. + * @see https://vitejs.dev/guide/api-plugin.html#config + */ + config: { + // avoids overwriting the base setting that's also set by Vitest + order: 'pre', + handler(config) { + /** @type {UserConfig} */ + let new_config; + + const kit_paths_base = kit.paths.base || '/'; + + if (is_build) { + const ssr = /** @type {boolean} */ (config.build?.ssr); + const app_immutable = `${kit.appDir}/immutable`; + + /** @type {Record} */ + const input = {}; + + if (ssr) { + input.index = `${runtime_directory}/server/index.js`; + input.internal = `${out_dir}/generated/server/internal.js`; + input.env = `__sveltekit/env`; + input['remote-entry'] = `${runtime_directory}/app/server/remote/index.js`; + + // add entry points for every endpoint... + manifest_data.routes.forEach((route) => { + if (route.endpoint) { + const resolved = path.resolve(route.endpoint.file); + const relative = decodeURIComponent(path.relative(kit.files.routes, resolved)); + const name = posixify( + path.join('entries/endpoints', relative.replace(/\.js$/, '')) + ); + input[name] = resolved; + } + }); + + // ...and every component used by pages... + manifest_data.nodes.forEach((node) => { + for (const file of [node.component, node.universal, node.server]) { + if (file) { + const resolved = path.resolve(file); + const relative = decodeURIComponent(path.relative(kit.files.routes, resolved)); + + const name = relative.startsWith('..') + ? posixify(path.join('entries/fallbacks', path.basename(file))) + : posixify(path.join('entries/pages', relative.replace(/\.js$/, ''))); + input[name] = resolved; + } + } + }); + + // ...and every matcher + Object.entries(manifest_data.matchers).forEach(([key, file]) => { + const name = posixify(path.join('entries/matchers', key)); + input[name] = path.resolve(file); + }); + + // ...and the hooks files + if (manifest_data.hooks.server) { + input['entries/hooks.server'] = path.resolve(manifest_data.hooks.server); + } + if (manifest_data.hooks.universal) { + input['entries/hooks.universal'] = path.resolve(manifest_data.hooks.universal); + } + + // ...and the server instrumentation file + const server_instrumentation = resolve_entry( + path.join(kit.files.src, 'instrumentation.server') + ); + if (server_instrumentation) { + const { adapter } = kit; + if (adapter && !adapter.supports?.instrumentation?.()) { + throw new Error(`${server_instrumentation} is unsupported in ${adapter.name}.`); + } + if (!kit.experimental.instrumentation.server) { + error_for_missing_config( + '`instrumentation.server.js`', + 'kit.experimental.instrumentation.server', + 'true' + ); + } + input['instrumentation.server'] = server_instrumentation; + } + } else if (svelte_config.kit.output.bundleStrategy !== 'split') { + input['bundle'] = `${runtime_directory}/client/bundle.js`; + } else { + input['entry/start'] = `${runtime_directory}/client/entry.js`; + input['entry/app'] = `${out_dir}/generated/client-optimized/app.js`; + manifest_data.nodes.forEach((node, i) => { + if (node.component || node.universal) { + input[`nodes/${i}`] = `${out_dir}/generated/client-optimized/nodes/${i}.js`; + } + }); + } + + // see the kit.output.preloadStrategy option for details on why we have multiple options here + const ext = kit.output.preloadStrategy === 'preload-mjs' ? 'mjs' : 'js'; + + const inline = !ssr && svelte_config.kit.output.bundleStrategy === 'inline'; + const split = ssr || svelte_config.kit.output.bundleStrategy === 'split'; + + /** @type {string} */ + const base = (kit.paths.assets || kit.paths.base) + '/'; + const root_to_assets = app_immutable + '/assets/'; + const assets_to_root = + app_immutable + .split('/') + .map(() => '..') + .join('/') + '/../'; + + const relative = kit.paths.relative !== false || !!kit.paths.assets; + + new_config = { + // Affects how Vite loads JS assets on the client. + // If the initial HTML we render uses an absolute path for assets, + // the additional chunks Vite loads must also use an absolute path. + // Otherwise, you end up with additional chunks being loaded relative + // to the current chunk rather than the root. + base: relative ? './' : base, + build: { + copyPublicDir: !ssr, + cssCodeSplit: svelte_config.kit.output.bundleStrategy !== 'inline', + cssMinify: + initial_config.build?.minify == null ? true : !!initial_config.build.minify, + manifest: true, + outDir: `${out}/${ssr ? 'server' : 'client'}`, + rollupOptions: { + input: inline ? input['bundle'] : input, + output: { + format: inline ? 'iife' : 'esm', + name: `__sveltekit_${version_hash}.app`, + entryFileNames: ssr ? '[name].js' : `${app_immutable}/[name].[hash].${ext}`, + chunkFileNames: ssr + ? 'chunks/[name].js' + : `${app_immutable}/chunks/[hash].${ext}`, + assetFileNames: `${app_immutable}/assets/[name].[hash][extname]`, + hoistTransitiveImports: false, + sourcemapIgnoreList, + inlineDynamicImports: is_rolldown ? undefined : !split + }, + preserveEntrySignatures: 'strict', + onwarn(warning, handler) { + if ( + (is_rolldown + ? warning.code === 'IMPORT_IS_UNDEFINED' + : warning.code === 'MISSING_EXPORT') && + warning.id === `${out_dir}/generated/client-optimized/app.js` + ) { + // ignore e.g. undefined `handleError` hook when + // referencing `client_hooks.handleError` + return; + } + + handler(warning); + } + }, + ssrEmitAssets: true, + target: ssr ? 'node18.13' : undefined + }, + publicDir: kit.files.assets, + worker: { + rollupOptions: { + output: { + entryFileNames: `${app_immutable}/workers/[name]-[hash].js`, + chunkFileNames: `${app_immutable}/workers/chunks/[hash].js`, + assetFileNames: `${app_immutable}/workers/assets/[name]-[hash][extname]`, + hoistTransitiveImports: false + } + } + }, + experimental: { + // Allows us to use relative paths in as many places as we can + renderBuiltUrl(filename, { ssr, hostType }) { + if (hostType === 'js') { + // SSR builds should use an absolute path in JS modules to + // match the default Vite behaviour + if (ssr) return base + filename; + + // We could always use a relative asset base path here, but it's better for performance not to. + // E.g. Vite generates `new URL('/asset.png', import.meta).href` for a relative path vs just '/asset.png'. + // That's larger and takes longer to run and also causes an HTML diff between SSR and client + // causing us to do a more expensive hydration check. + return { relative }; + } + + if (!relative) return; + + // ensure assets loaded by CSS files are loaded relative to the + // CSS file rather than the default of relative to the root + + // _app/immutable/assets files + if (filename.startsWith(root_to_assets)) { + return `./${filename.slice(root_to_assets.length)}`; + } + + // static dir files + return assets_to_root + filename; + } + } + }; + + // we must reference Vite 8 options conditionally. Otherwise, older Vite + // versions throw an error about unknown config options + if (is_rolldown && !split && new_config.build?.rollupOptions?.output) { + // @ts-ignore only available in Vite 8 + new_config.build.rollupOptions.output.codeSplitting = false; + } + } else { + new_config = { + appType: 'custom', + base: kit_paths_base, + build: { + rollupOptions: { + // Vite dependency crawler needs an explicit JS entry point + // even though server otherwise works without it + input: `${runtime_directory}/client/entry.js` + } + }, + publicDir: kit.files.assets + }; + } + + warn_overridden_config(config, new_config); + + return new_config; + } + }, + + /** + * Adds the SvelteKit middleware to do SSR in dev mode. + * @see https://vitejs.dev/guide/api-plugin.html#configureserver + */ + async configureServer(vite) { + return await dev(vite, vite_config, svelte_config, () => remotes); + }, + + /** + * Adds the SvelteKit middleware to do SSR in preview mode. + * @see https://vitejs.dev/guide/api-plugin.html#configurepreviewserver + */ + configurePreviewServer(vite) { + return preview(vite, vite_config, svelte_config); + }, + + /** + * Clears the output directories. + */ + buildStart() { + if (secondary_build_started) return; + + if (is_build) { + if (!vite_config.build.watch) { + rimraf(out); + } + mkdirp(out); + } + }, + + renderChunk(code, chunk) { + if (code.includes('__SVELTEKIT_TRACK__')) { + return { + // Rolldown changes our single quotes to double quotes so we need it in the regex too + code: code.replace(/__SVELTEKIT_TRACK__\(['"](.+?)['"]\)/g, (_, label) => { + (tracked_features[chunk.name + '.js'] ??= []).push(label); + // put extra whitespace at the end of the comment to preserve the source size and avoid interfering with source maps + return `/* track ${label} */`; + }), + map: null // TODO we may need to generate a sourcemap in future + }; + } + }, + + generateBundle() { + if (vite_config.build.ssr) return; + + this.emitFile({ + type: 'asset', + fileName: `${kit.appDir}/version.json`, + source: s({ version: kit.version.name }) + }); + }, + + /** + * Vite builds a single bundle. We need three bundles: client, server, and service worker. + * The user's package.json scripts will invoke the Vite CLI to execute the server build. We + * then use this hook to kick off builds for the client and service worker. + */ + writeBundle: { + sequential: true, + async handler(_options, server_bundle) { + if (secondary_build_started) return; // only run this once + + const verbose = vite_config.logLevel === 'info'; + const log = logger({ verbose }); + + /** @type {Manifest} */ + const server_manifest = JSON.parse(read(`${out}/server/.vite/manifest.json`)); + + /** @type {import('types').BuildData} */ + const build_data = { + app_dir: kit.appDir, + app_path: `${kit.paths.base.slice(1)}${kit.paths.base ? '/' : ''}${kit.appDir}`, + manifest_data, + out_dir: out, + service_worker: service_worker_entry_file ? 'service-worker.js' : null, // TODO make file configurable? + client: null, + server_manifest + }; + + const manifest_path = `${out}/server/manifest-full.js`; + fs.writeFileSync( + manifest_path, + `export const manifest = ${generate_manifest({ + build_data, + prerendered: [], + relative_path: '.', + routes: manifest_data.routes, + remotes + })};\n` + ); + + const server_chunks = Object.values(server_bundle); + const assets_path = `${kit.appDir}/immutable/assets`; + + // first, build server nodes without the client manifest so we can analyse it + build_server_nodes( + out, + kit, + manifest_data, + server_manifest, + null, + assets_path, + server_chunks + ); + + log.info('Analysing routes'); + + const { metadata } = await analyse({ + hash: kit.router.type === 'hash', + manifest_path, + manifest_data, + server_manifest, + tracked_features, + env: { ...env.private, ...env.public }, + out, + remotes + }); + + build_metadata = metadata; + + log.info('Building app'); + + // create client build + write_client_manifest( + kit, + manifest_data, + `${out_dir}/generated/client-optimized`, + metadata.nodes + ); + + const server_assets = `${out}/server/${assets_path}`; + const client_assets = `${out}/client/${assets_path}`; + + const skip_client_build = manifest_data.nodes.every( + (node) => node.page_options?.csr === false + ); + + /** @type {Manifest | null} */ + let client_manifest = null; + + if (!skip_client_build) { + let client_chunks; + + try { + secondary_build_started = true; + + const bundle = /** @type {import('vite').Rollup.RollupOutput} */ ( + await vite.build({ + configFile: vite_config.configFile, + // CLI args + mode: vite_config_env.mode, + logLevel: vite_config.logLevel, + clearScreen: vite_config.clearScreen, + build: { + minify: initial_config.build?.minify, + assetsInlineLimit: vite_config.build.assetsInlineLimit, + sourcemap: vite_config.build.sourcemap + }, + optimizeDeps: { + force: vite_config.optimizeDeps.force + } + }) + ); + + secondary_build_started = false; + + client_chunks = bundle.output; + } catch (e) { + const error = + e instanceof Error + ? e + : new Error(/** @type {any} */ (e).message ?? e ?? ''); + + // without this, errors that occur during the secondary build + // will be logged twice + throw stackless(error.stack ?? error.message); + } + + // We use `build.ssrEmitAssets` so that asset URLs created from + // imports in server-only modules correspond to files in the build, + // but we don't want to copy over CSS imports as these are already + // accounted for in the client bundle. In most cases it would be + // a no-op, but for SSR builds `url(...)` paths are handled + // differently (relative for client, absolute for server) + // resulting in different hashes, and thus duplication + const ssr_stylesheets = new Set( + Object.values(server_manifest) + .map((chunk) => chunk.css ?? []) + .flat() + ); + + if (fs.existsSync(server_assets)) { + for (const file of fs.readdirSync(server_assets)) { + const src = `${server_assets}/${file}`; + const dest = `${client_assets}/${file}`; + + if (fs.existsSync(dest) || ssr_stylesheets.has(`${assets_path}/${file}`)) { + continue; + } + + copy(src, dest); + } + } + + /** @type {Manifest} */ + const manifest = (client_manifest = JSON.parse( + read(`${out}/client/.vite/manifest.json`) + )); + + /** + * @param {string} entry + * @param {boolean} [add_dynamic_css] + */ + const deps_of = (entry, add_dynamic_css = false) => + find_deps(manifest, posixify(path.relative('.', entry)), add_dynamic_css); + + const has_explicit_dynamic_public_env = Object.values(explicit_env_config ?? {}).some( + (variable) => variable.public && !variable.static + ); + + const uses_env_dynamic_public = client_chunks.some( + (chunk) => + chunk.type === 'chunk' && + (chunk.modules[env_dynamic_public] || + (has_explicit_dynamic_public_env && chunk.modules[sveltekit_env_public_client])) + ); + + if (svelte_config.kit.output.bundleStrategy === 'split') { + const start = deps_of(`${runtime_directory}/client/entry.js`); + const app = deps_of(`${out_dir}/generated/client-optimized/app.js`); + + build_data.client = { + start: start.file, + app: app.file, + imports: [...start.imports, ...app.imports], + stylesheets: [...start.stylesheets, ...app.stylesheets], + fonts: [...start.fonts, ...app.fonts], + uses_env_dynamic_public + }; + + // In case of server-side route resolution, we create a purpose-built route manifest that is + // similar to that on the client, with as much information computed upfront so that we + // don't need to include any code of the actual routes in the server bundle. + if (svelte_config.kit.router.resolution === 'server') { + const nodes = manifest_data.nodes.map((node, i) => { + if (node.component || node.universal) { + const entry = `${out_dir}/generated/client-optimized/nodes/${i}.js`; + const deps = deps_of(entry, true); + const file = resolve_symlinks( + manifest, + `${out_dir}/generated/client-optimized/nodes/${i}.js` + ).chunk.file; + + return { file, css: deps.stylesheets }; + } + }); + build_data.client.nodes = nodes.map((node) => node?.file); + build_data.client.css = nodes.map((node) => node?.css); + + build_data.client.routes = compact( + manifest_data.routes.map((route) => { + if (!route.page) return; + + return { + id: route.id, + pattern: route.pattern, + params: route.params, + layouts: route.page.layouts.map((l) => + l !== undefined ? [metadata.nodes[l].has_server_load, l] : undefined + ), + errors: route.page.errors, + leaf: [metadata.nodes[route.page.leaf].has_server_load, route.page.leaf] + }; + }) + ); + } + } else { + const start = deps_of(`${runtime_directory}/client/bundle.js`); + + build_data.client = { + start: start.file, + imports: start.imports, + stylesheets: start.stylesheets, + fonts: start.fonts, + uses_env_dynamic_public + }; + + if (svelte_config.kit.output.bundleStrategy === 'inline') { + const style = /** @type {import('vite').Rollup.OutputAsset} */ ( + client_chunks.find( + (chunk) => + chunk.type === 'asset' && + chunk.names.length === 1 && + chunk.names[0] === 'style.css' + ) + ); + + build_data.client.inline = { + script: read(`${out}/client/${start.file}`), + style: /** @type {string | undefined} */ (style?.source) + }; + + // the bundle and stylesheet are inlined into the page, so the + // emitted files are never loaded + fs.unlinkSync(`${out}/client/${start.file}`); + fs.rmSync(`${out}/client/${start.file}.map`, { force: true }); + if (style) fs.unlinkSync(`${out}/client/${style.fileName}`); + } + } + + // regenerate manifest now that we have client entry... + fs.writeFileSync( + manifest_path, + `export const manifest = ${generate_manifest({ + build_data, + prerendered: [], + relative_path: '.', + routes: manifest_data.routes, + remotes + })};\n` + ); + + // regenerate nodes with the client manifest... + build_server_nodes( + out, + kit, + manifest_data, + server_manifest, + manifest, + assets_path, + client_chunks + ); + } else { + copy(server_assets, client_assets); + copy(kit.files.assets, `${out}/client`); + } + + // ...and prerender + const { prerendered, prerender_map } = await prerender({ + hash: kit.router.type === 'hash', + out, + manifest_path, + metadata, + verbose, + env: { ...env.private, ...env.public } + }); + + await treeshake_prerendered_remotes( + out, + remotes, + metadata, + cwd, + server_bundle, + vite_config.build.sourcemap + ); + + // generate a new manifest that doesn't include prerendered pages + fs.writeFileSync( + `${out}/server/manifest.js`, + `export const manifest = ${generate_manifest({ + build_data, + prerendered: prerendered.paths, + relative_path: '.', + routes: manifest_data.routes.filter((route) => prerender_map.get(route.id) !== true), + remotes + })};\n` + ); + + if (service_worker_entry_file) { + if (kit.paths.assets) { + throw new Error('Cannot use service worker alongside config.kit.paths.assets'); + } + + log.info('Building service worker'); + + await build_service_worker( + out, + kit, + { + ...vite_config, + build: { + ...vite_config.build, + minify: initial_config.build?.minify ?? true + } + }, + manifest_data, + service_worker_entry_file, + prerendered, + client_manifest ?? server_manifest, + explicit_env_config + ); + } + + // we need to defer this to closeBundle, so that adapters copy files + // created by other Vite plugins + finalise = async () => { + console.log( + `\nRun ${colors + .bold() + .cyan('npm run preview')} to preview your production build locally.` + ); + + if (kit.adapter) { + const { adapt } = await import('../../core/adapt/index.js'); + await adapt( + svelte_config, + build_data, + metadata, + prerendered, + prerender_map, + log, + remotes, + vite_config, + explicit_env_config + ); + } else { + console.log(colors.bold().yellow('\nNo adapter specified')); + + const link = colors.bold().cyan('https://svelte.dev/docs/kit/adapters'); + console.log( + `See ${link} to learn how to configure your app to run on the platform of your choosing` + ); + } + }; + } + }, + + /** + * Runs the adapter. + */ + closeBundle: { + sequential: true, + async handler() { + if (!vite_config.build.ssr) return; + await finalise?.(); + } + } + }; + + return [ + plugin_setup, + kit.experimental.remoteFunctions && plugin_remote, + plugin_virtual_modules, + plugin_guard, + kit.experimental.explicitEnvironmentVariables && + service_worker_entry_file && + plugin_service_worker_env, + plugin_compile + ].filter((p) => !!p); +} + +/** + * @param {UserConfig} config + * @param {UserConfig} resolved_config + */ +function warn_overridden_config(config, resolved_config) { + const overridden = find_overridden_config(config, resolved_config, enforced_config, '', []); + + if (overridden.length > 0) { + console.error( + colors.bold().red('The following Vite config options will be overridden by SvelteKit:') + + overridden.map((key) => `\n - ${key}`).join('') + ); + } +} + +/** + * @param {Record} config + * @param {Record} resolved_config + * @param {import('./types.js').EnforcedConfig} enforced_config + * @param {string} path + * @param {string[]} out used locally to compute the return value + */ +function find_overridden_config(config, resolved_config, enforced_config, path, out) { + if (config == null || resolved_config == null) { + return out; + } + + for (const key in enforced_config) { + if (typeof config === 'object' && key in config && key in resolved_config) { + const enforced = enforced_config[key]; + const resolved = resolved_config[key]; + + if (enforced === true) { + // Normalize path separators before comparing to avoid false positives on Windows, + // where config values like `root` may use backslashes while SvelteKit uses forward slashes. + const a = typeof config[key] === 'string' ? posixify(config[key]) : config[key]; + const b = typeof resolved === 'string' ? posixify(resolved) : resolved; + if (a !== b) { + out.push(path + key); + } + } else { + find_overridden_config(config[key], resolved, enforced, path + key + '.', out); + } + } + } + return out; +} + +/** + * @param {import('types').ValidatedConfig} config + */ +const create_service_worker_module = (config) => dedent` + if (typeof self === 'undefined' || self instanceof ServiceWorkerGlobalScope === false) { + throw new Error('This module can only be imported inside a service worker'); + } + + export const base = location.pathname.split('/').slice(0, -1).join('/'); + export const build = []; + export const files = [ + ${create_assets(config) + .filter((asset) => config.kit.serviceWorker.files(asset.file)) + .map((asset) => `${s(`${config.kit.paths.base}/${asset.file}`)}`) + .join(',\n')} + ]; + export const prerendered = []; + export const version = ${s(config.kit.version.name)}; +`; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js new file mode 100644 index 0000000000000000000000000000000000000000..acb1b2cbb47f12153f8a65ad7f007fb67f99c46c --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/module_ids.js @@ -0,0 +1,25 @@ +import { fileURLToPath } from 'node:url'; +import { posixify } from '../../utils/filesystem.js'; + +export const env_static_private = '\0virtual:env/static/private'; +export const env_static_public = '\0virtual:env/static/public'; +export const env_dynamic_private = '\0virtual:env/dynamic/private'; +export const env_dynamic_public = '\0virtual:env/dynamic/public'; + +export const sveltekit_env = '\0virtual:__sveltekit/env'; +export const sveltekit_env_public_client = '\0virtual:__sveltekit/env/public/client'; +export const sveltekit_env_public_server = '\0virtual:__sveltekit/env/public/server'; +export const sveltekit_env_private = '\0virtual:__sveltekit/env/private'; +export const sveltekit_env_service_worker = '\0virtual:__sveltekit/env/service-worker'; + +export const service_worker = '\0virtual:service-worker'; + +export const sveltekit_server = '\0virtual:__sveltekit/server'; + +export const app_server = posixify( + fileURLToPath(new URL('../../runtime/app/server/index.js', import.meta.url)) +); + +export const app_env_private = posixify( + fileURLToPath(new URL('../../runtime/app/env/private.js', import.meta.url)) +); diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js new file mode 100644 index 0000000000000000000000000000000000000000..02d70d5f3d54647d1b48ed6c5c2137863c33ff15 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/preview/index.js @@ -0,0 +1,274 @@ +import fs from 'node:fs'; +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import { lookup } from 'mrmime'; +import sirv from 'sirv'; +import { loadEnv, normalizePath } from 'vite'; +import { createReadableStream, getRequest, setResponse } from '../../../exports/node/index.js'; +import { installPolyfills } from '../../../exports/node/polyfills.js'; +import { SVELTE_KIT_ASSETS } from '../../../constants.js'; +import { is_chrome_devtools_request, not_found } from '../utils.js'; + +/** @typedef {import('http').IncomingMessage} Req */ +/** @typedef {import('http').ServerResponse} Res */ +/** @typedef {(req: Req, res: Res, next: () => void) => void} Handler */ + +/** + * @param {import('vite').PreviewServer} vite + * @param {import('vite').ResolvedConfig} vite_config + * @param {import('types').ValidatedConfig} svelte_config + */ +export async function preview(vite, vite_config, svelte_config) { + installPolyfills(); + + const { paths } = svelte_config.kit; + const base = paths.base; + const assets = paths.assets ? SVELTE_KIT_ASSETS : paths.base; + + const protocol = vite_config.preview.https ? 'https' : 'http'; + + const etag = `"${Date.now()}"`; + + const dir = join(svelte_config.kit.outDir, 'output/server'); + + if (!fs.existsSync(dir)) { + throw new Error(`Server files not found at ${dir}, did you run \`build\` first?`); + } + + const instrumentation = join(dir, 'instrumentation.server.js'); + if (fs.existsSync(instrumentation)) { + await import(pathToFileURL(instrumentation).href); + } + + /** @type {import('types').ServerInternalModule} */ + const { set_assets } = await import(pathToFileURL(join(dir, 'internal.js')).href); + + /** @type {import('types').ServerModule} */ + const { Server } = await import(pathToFileURL(join(dir, 'index.js')).href); + + const { manifest } = await import(pathToFileURL(join(dir, 'manifest.js')).href); + + set_assets(assets); + + const server = new Server(manifest); + + try { + await server.init({ + env: loadEnv(vite_config.mode, svelte_config.kit.env.dir, ''), + read: (file) => createReadableStream(`${dir}/${file}`) + }); + } catch (error) { + // Vite erases the error message when starting the preview server so we store + // it in the stack instead. This ensures errors thrown using `stackless` + // are still readable + if (error instanceof Error) error.stack = error.message; + throw error; + } + + const emulator = await svelte_config.kit.adapter?.emulate?.(); + + return () => { + // Remove the base middleware. It screws with the URL. + // It also only lets through requests beginning with the base path, so that requests beginning + // with the assets URL never reach us. We could serve assets separately before the base + // middleware, but we'd need that to occur after the compression and cors middlewares, so would + // need to insert it manually into the stack, which would be at least as bad as doing this. + for (let i = vite.middlewares.stack.length - 1; i > 0; i--) { + // @ts-expect-error using internals + if (vite.middlewares.stack[i].handle.name === 'viteBaseMiddleware') { + vite.middlewares.stack.splice(i, 1); + } + } + + // generated client assets and the contents of `static` + vite.middlewares.use( + scoped( + assets, + sirv(join(svelte_config.kit.outDir, 'output/client'), { + setHeaders: (res, pathname) => { + // only apply to immutable directory, not e.g. version.json + if (pathname.startsWith(`/${svelte_config.kit.appDir}/immutable`)) { + res.setHeader('cache-control', 'public,max-age=31536000,immutable'); + } + } + }) + ) + ); + + vite.middlewares.use((req, res, next) => { + const original_url = /** @type {string} */ (req.url); + const { pathname, search } = new URL(original_url, 'http://dummy'); + + // if `paths.base === '/a/b/c`, then the root route is `/a/b/c/`, + // regardless of the `trailingSlash` route option + if (base.length > 1 && pathname === base) { + let location = base + '/'; + if (search) location += search; + res.writeHead(307, { + location + }); + res.end(); + return; + } + + if (is_chrome_devtools_request(pathname, res)) { + return; + } + + if (pathname.startsWith(base)) { + next(); + } else { + res.statusCode = 404; + not_found(req, res, base); + } + }); + + // prerendered dependencies + vite.middlewares.use( + scoped(base, mutable(join(svelte_config.kit.outDir, 'output/prerendered/dependencies'))) + ); + + // prerendered pages (we can't just use sirv because we need to + // preserve the correct trailingSlash behaviour) + vite.middlewares.use( + scoped(base, (req, res, next) => { + let if_none_match_value = req.headers['if-none-match']; + + if (if_none_match_value?.startsWith('W/"')) { + if_none_match_value = if_none_match_value.substring(2); + } + + if (if_none_match_value === etag) { + res.statusCode = 304; + res.end(); + return; + } + + const { pathname, search } = new URL(/** @type {string} */ (req.url), 'http://dummy'); + + const dir = pathname.startsWith(`/${svelte_config.kit.appDir}/remote/`) ? 'data' : 'pages'; + + let filename = normalizePath( + join(svelte_config.kit.outDir, `output/prerendered/${dir}` + pathname) + ); + + try { + filename = decodeURI(filename); + } catch { + // malformed URI + } + + let prerendered = is_file(filename); + + if (!prerendered) { + const has_trailing_slash = pathname.endsWith('/'); + const html_filename = `${filename}${has_trailing_slash ? 'index.html' : '.html'}`; + + /** @type {string | undefined} */ + let redirect; + + if (is_file(html_filename)) { + filename = html_filename; + prerendered = true; + } else if (has_trailing_slash) { + if (is_file(filename.slice(0, -1) + '.html')) { + redirect = pathname.slice(0, -1); + } + } else if (is_file(filename + '/index.html')) { + redirect = pathname + '/'; + } + + if (redirect) { + if (search) redirect += search; + res.writeHead(307, { + location: redirect + }); + + res.end(); + + return; + } + } + + if (prerendered) { + res.writeHead(200, { + 'content-type': lookup(pathname) || 'text/html', + etag + }); + + fs.createReadStream(filename).pipe(res); + } else { + next(); + } + }) + ); + + // SSR + vite.middlewares.use(async (req, res) => { + const host = req.headers[':authority'] || req.headers.host; + + const request = await getRequest({ + base: `${protocol}://${host}`, + request: req + }); + + await setResponse( + res, + await server.respond(request, { + getClientAddress: () => { + const { remoteAddress } = req.socket; + if (remoteAddress) return remoteAddress; + throw new Error('Could not determine clientAddress'); + }, + read: (file) => { + if (file in manifest._.server_assets) { + return fs.readFileSync(join(dir, file)); + } + + return fs.readFileSync(join(svelte_config.kit.files.assets, file)); + }, + emulator + }) + ); + }); + }; +} + +/** + * @param {string} dir + * @returns {Handler} + */ +const mutable = (dir) => + fs.existsSync(dir) + ? sirv(dir, { + etag: true, + maxAge: 0 + }) + : (_req, _res, next) => next(); + +/** + * @param {string} scope + * @param {Handler} handler + * @returns {Handler} + */ +function scoped(scope, handler) { + if (scope === '') return handler; + + return (req, res, next) => { + if (req.url?.startsWith(scope)) { + const original_url = req.url; + req.url = req.url.slice(scope.length); + handler(req, res, () => { + req.url = original_url; + next(); + }); + } else { + next(); + } + }; +} + +/** @param {string} path */ +function is_file(path) { + return fs.existsSync(path) && !fs.statSync(path).isDirectory(); +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js new file mode 100644 index 0000000000000000000000000000000000000000..693b4eafb0566a0d7f083266a5c8d98ed67a1ec2 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/index.js @@ -0,0 +1,304 @@ +/** @import { PageOptions } from './types.js' */ +import process from 'node:process'; +import path from 'node:path'; +import { tsPlugin } from '@sveltejs/acorn-typescript'; +import { Parser } from 'acorn'; +import { read } from '../../../utils/filesystem.js'; + +export const valid_page_options_array = /** @type {const} */ ([ + 'ssr', + 'prerender', + 'csr', + 'trailingSlash', + 'config', + 'entries', + 'load' +]); + +/** @type {Set} */ +const valid_page_options = new Set(valid_page_options_array); + +const skip_parsing_regex = new RegExp( + `${Array.from(valid_page_options).join('|')}|(?:export[\\s\\n]+\\*[\\s\\n]+from)` +); + +const parser = Parser.extend(tsPlugin()); + +/** + * Collects page options from a +page.js/+layout.js file, ignoring reassignments + * and using the declared value (except for load functions, for which the value is `true`). + * Returns `null` if any export is too difficult to analyse. + * @param {string} filename The name of the file to report when an error occurs + * @param {string} input + * @returns {PageOptions | null} + */ +export function statically_analyse_page_options(filename, input) { + // if there's a chance there are no page exports or an unparseable + // export all declaration, then we can skip the AST parsing which is expensive + if (!skip_parsing_regex.test(input)) { + return {}; + } + + try { + const source = parser.parse(input, { + sourceType: 'module', + ecmaVersion: 'latest' + }); + + /** @type {Map} */ + const page_options = new Map(); + + for (const statement of source.body) { + // ignore export all declarations with aliases that are not page options + if ( + statement.type === 'ExportAllDeclaration' && + statement.exported && + !valid_page_options.has(get_name(statement.exported)) + ) { + continue; + } + + if ( + statement.type === 'ExportDefaultDeclaration' || + statement.type === 'ExportAllDeclaration' + ) { + return null; + } else if (statement.type !== 'ExportNamedDeclaration') { + continue; + } + + if (statement.specifiers.length) { + /** @type {Map} */ + const export_specifiers = new Map(); + for (const specifier of statement.specifiers) { + const exported_name = get_name(specifier.exported); + if (!valid_page_options.has(exported_name)) { + continue; + } + + if (statement.source) { + return null; + } + + export_specifiers.set(get_name(specifier.local), exported_name); + } + + for (const statement of source.body) { + switch (statement.type) { + case 'ImportDeclaration': { + for (const import_specifier of statement.specifiers) { + if (export_specifiers.has(import_specifier.local.name)) { + return null; + } + } + break; + } + case 'ExportNamedDeclaration': + case 'VariableDeclaration': + case 'FunctionDeclaration': + case 'ClassDeclaration': { + const declaration = + statement.type === 'ExportNamedDeclaration' ? statement.declaration : statement; + + if (!declaration) { + break; + } + + // class and function declarations + if (declaration.type !== 'VariableDeclaration') { + if (export_specifiers.has(declaration.id.name)) { + return null; + } + break; + } + + for (const variable_declarator of declaration.declarations) { + if ( + variable_declarator.id.type !== 'Identifier' || + !export_specifiers.has(variable_declarator.id.name) + ) { + continue; + } + + if (variable_declarator.init?.type === 'Literal') { + page_options.set( + /** @type {string} */ (export_specifiers.get(variable_declarator.id.name)), + variable_declarator.init.value + ); + export_specifiers.delete(variable_declarator.id.name); + continue; + } + + // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) + if (variable_declarator.id.name === 'load') { + page_options.set('load', null); + export_specifiers.delete('load'); + continue; + } + + // references a declaration we can't easily evaluate statically + return null; + } + break; + } + } + } + + // there were some export specifiers that we couldn't resolve + if (export_specifiers.size) { + return null; + } + continue; + } + + if (!statement.declaration) { + continue; + } + + // class and function declarations + if (statement.declaration.type !== 'VariableDeclaration') { + if (valid_page_options.has(statement.declaration.id.name)) { + // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) + if (statement.declaration.id.name === 'load') { + page_options.set('load', null); + } else { + return null; + } + } + continue; + } + + for (const declaration of statement.declaration.declarations) { + if (declaration.id.type !== 'Identifier') { + return null; + } + + if (!valid_page_options.has(declaration.id.name)) { + continue; + } + + if (declaration.init?.type === 'Literal') { + page_options.set(declaration.id.name, declaration.init.value); + continue; + } + + // Special case: We only want to know that 'load' is exported (in a way that doesn't cause truthy checks in other places to trigger) + if (declaration.id.name === 'load') { + page_options.set('load', null); + continue; + } + + // references a declaration we can't easily evaluate statically + return null; + } + } + + return Object.fromEntries(page_options); + } catch (error) { + if (error instanceof Error) { + error.message = `Failed to statically analyse page options for ${filename}. ${error.message}`; + } + throw error; + } +} + +/** + * @param {import('acorn').Identifier | import('acorn').Literal} node + * @returns {string} + */ +function get_name(node) { + return node.type === 'Identifier' ? node.name : /** @type {string} */ (node.value); +} + +/** + * Reads and statically analyses a file for page options + * @param {string} filepath + * @returns {PageOptions | null} Returns the page options for the file or `null` if unanalysable + */ +export function get_page_options(filepath) { + try { + const input = read(filepath); + const page_options = statically_analyse_page_options(filepath, input); + if (page_options === null) { + return null; + } + + return page_options; + } catch { + return null; + } +} + +/** + * @param {string} cwd + */ +export function create_node_analyser(cwd = process.cwd()) { + const static_exports = new Map(); + + /** + * @param {string | undefined} key + * @param {PageOptions | null} page_options + */ + const cache = (key, page_options) => { + if (key) static_exports.set(key, { page_options, children: [] }); + }; + + /** + * Computes the final page options (may include load function as `load: null`; special case) for a node (if possible). Otherwise, returns `null`. + * @param {import('types').PageNode} node + * @returns {PageOptions | null} + */ + const crawl = (node) => { + const key = node.universal || node.server; + if (key && static_exports.has(key)) { + return { ...static_exports.get(key)?.page_options }; + } + + /** @type {PageOptions} */ + let page_options = {}; + + if (node.parent) { + const parent_options = crawl(node.parent); + + const parent_key = node.parent.universal || node.parent.server; + if (key && parent_key) { + static_exports.get(parent_key)?.children.push(key); + } + + if (parent_options === null) { + // if the parent cannot be analysed, we can't know what page options + // the child node inherits, so we also mark it as unanalysable + cache(key, null); + return null; + } + + page_options = { ...parent_options }; + } + + if (node.server) { + const server_page_options = get_page_options(path.join(cwd, node.server)); + if (server_page_options === null) { + cache(key, null); + return null; + } + page_options = { ...page_options, ...server_page_options }; + } + + if (node.universal) { + const universal_page_options = get_page_options(path.join(cwd, node.universal)); + if (universal_page_options === null) { + cache(key, null); + return null; + } + page_options = { ...page_options, ...universal_page_options }; + } + + cache(key, page_options); + + return page_options; + }; + + return { + get_page_options: crawl + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/types.d.ts b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1107b7666ef947a7f83ea1757b6374d75a35f622 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/types.d.ts @@ -0,0 +1,14 @@ +import type { PrerenderOption, TrailingSlash } from 'types'; +import type { valid_page_options_array } from './index.js'; + +type ValidPageOption = (typeof valid_page_options_array)[number]; + +export type PageOptions = Partial<{ + [K in ValidPageOption]: K extends 'ssr' | 'csr' + ? boolean + : K extends 'prerender' + ? PrerenderOption + : K extends 'trailingSlash' + ? TrailingSlash + : any; +}>; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c39cc064d8be8356e236c4a06b2c2a2fb5b728fa --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/exports/vite/static_analysis/utils.js @@ -0,0 +1,118 @@ +/** + * Check if content has children rendering (slot, @render, or children prop forwarding) + * @param {string} content - The markup content + * @param {boolean} is_svelte_5_plus - Whether the project uses Svelte 5+ + * @returns {boolean} + */ +export function has_children(content, is_svelte_5_plus) { + return ( + content.includes('') { + in_html_comment = false; + i += 2; // Skip the '-->' part + continue; + } + + // If we're in any comment, skip processing + if (in_single_line_comment || in_multi_line_comment || in_html_comment) { + continue; + } + + // Handle escape sequences in strings + if ((in_single_quote || in_double_quote || in_template_literal) && char === '\\') { + i++; // Skip the escaped character + continue; + } + + // Handle string boundaries + if (!in_double_quote && !in_template_literal && char === "'") { + in_single_quote = !in_single_quote; + continue; + } + + if (!in_single_quote && !in_template_literal && char === '"') { + in_double_quote = !in_double_quote; + continue; + } + + if (!in_single_quote && !in_double_quote && char === '`') { + in_template_literal = !in_template_literal; + continue; + } + + // If we're inside any string, don't process comment delimiters + if (in_single_quote || in_double_quote || in_template_literal) { + continue; + } + + // Check for comment starts + if (next_two === '//') { + in_single_line_comment = true; + i++; // Skip the second '/' + continue; + } + + if (next_two === '/*') { + in_multi_line_comment = true; + i++; // Skip the '*' + continue; + } + + if (next_four === ' + * + * + *

Currently at {page.url.pathname}

+ * + * {#if page.error} + * Problem detected + * {:else} + * All systems operational + * {/if} + * ``` + * + * Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes) + * + * ```svelte + * + * + * ``` + * + * On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time. + * + * @type {import('@sveltejs/kit').Page} + */ +export const page = BROWSER ? client_page : server_page; + +/** + * A read-only object representing an in-progress navigation, with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. + * Values are `null` when no navigation is occurring, or during server rendering. + * @type {import('@sveltejs/kit').Navigation | { from: null, to: null, type: null, willUnload: null, delta: null, complete: null }} + */ +// @ts-expect-error +export const navigating = BROWSER ? client_navigating : server_navigating; + +/** + * A read-only reactive value that's initially `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update `current` to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. + * @type {{ get current(): boolean; check(): Promise; }} + */ +export const updated = BROWSER ? client_updated : server_updated; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/state/server.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/state/server.js new file mode 100644 index 0000000000000000000000000000000000000000..0be169314fc4d88b5b088c4cf759fa0a5c1f5cc8 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/state/server.js @@ -0,0 +1,63 @@ +import { DEV } from 'esm-env'; +import { getContext } from 'svelte'; + +function context() { + return getContext('__request__'); +} + +/** @param {string} name */ +function context_dev(name) { + try { + return context(); + } catch { + throw new Error( + `Can only read '${name}' on the server during rendering (not in e.g. \`load\` functions), as it is bound to the current request via component context. This prevents state from leaking between users. ` + + 'For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server' + ); + } +} + +export const page = { + get data() { + return (DEV ? context_dev('page.data') : context()).page.data; + }, + get error() { + return (DEV ? context_dev('page.error') : context()).page.error; + }, + get form() { + return (DEV ? context_dev('page.form') : context()).page.form; + }, + get params() { + return (DEV ? context_dev('page.params') : context()).page.params; + }, + get route() { + return (DEV ? context_dev('page.route') : context()).page.route; + }, + get state() { + return (DEV ? context_dev('page.state') : context()).page.state; + }, + get status() { + return (DEV ? context_dev('page.status') : context()).page.status; + }, + get url() { + return (DEV ? context_dev('page.url') : context()).page.url; + } +}; + +export const navigating = { + from: null, + to: null, + type: null, + willUnload: null, + delta: null, + complete: null +}; + +export const updated = { + get current() { + return false; + }, + check: () => { + throw new Error('Can only call updated.check() in the browser'); + } +}; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/stores.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/stores.js new file mode 100644 index 0000000000000000000000000000000000000000..11e84fee7dbd5eec000f178cd707dbf1b734886e --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/app/stores.js @@ -0,0 +1,101 @@ +import { getContext } from 'svelte'; +import { BROWSER, DEV } from 'esm-env'; +import { stores as browser_stores } from '../client/client.js'; + +/** + * A function that returns all of the contextual stores. On the server, this must be called during component initialization. + * Only use this if you need to defer store subscription until after the component has mounted, for some reason. + * + * @deprecated Use `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + */ +export const getStores = () => { + const stores = BROWSER ? browser_stores : getContext('__svelte__'); + + return { + /** @type {typeof page} */ + page: { + subscribe: stores.page.subscribe + }, + /** @type {typeof navigating} */ + navigating: { + subscribe: stores.navigating.subscribe + }, + /** @type {typeof updated} */ + updated: stores.updated + }; +}; + +/** + * A readable store whose value contains page data. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `page` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * @type {import('svelte/store').Readable} + */ +export const page = { + subscribe(fn) { + const store = DEV ? get_store('page') : getStores().page; + return store.subscribe(fn); + } +}; + +/** + * A readable store. + * When navigating starts, its value is a `Navigation` object with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. + * When navigating finishes, its value reverts to `null`. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `navigating` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * @type {import('svelte/store').Readable} + */ +export const navigating = { + subscribe(fn) { + const store = DEV ? get_store('navigating') : getStores().navigating; + return store.subscribe(fn); + } +}; + +/** + * A readable store whose initial value is `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `updated` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * @type {import('svelte/store').Readable & { check(): Promise }} + */ +export const updated = { + subscribe(fn) { + const store = DEV ? get_store('updated') : getStores().updated; + + if (BROWSER) { + updated.check = store.check; + } + + return store.subscribe(fn); + }, + check: () => { + throw new Error( + BROWSER + ? 'Cannot check updated store before subscribing' + : 'Can only check updated store in browser' + ); + } +}; + +/** + * @template {keyof ReturnType} Name + * @param {Name} name + * @returns {ReturnType[Name]} + */ +function get_store(name) { + try { + return getStores()[name]; + } catch { + throw new Error( + `Cannot subscribe to '${name}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.` + + 'For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server' + ); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/bundle.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..f375d02e83551c4cd980e4acbaccffded634de4b --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/bundle.js @@ -0,0 +1,17 @@ +/* if `bundleStrategy` is 'single' or 'inline', this file is used as the entry point */ + +import * as kit from './entry.js'; + +// @ts-expect-error +import * as app from '__sveltekit/manifest'; + +/** + * + * @param {HTMLElement} element + * @param {import('./types.js').HydrateOptions} options + */ +export function start(element, options) { + void kit.start(app, element, options); +} + +export { app }; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/client.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/client.js new file mode 100644 index 0000000000000000000000000000000000000000..a0b858ba0ddbdcfed4fc69776d95d9ad6c76e7a9 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/client.js @@ -0,0 +1,3451 @@ +/** @import { RemoteFunctionDataNode, ServerNodesResponse, ServerRedirectNode } from 'types' */ +/** @import { CacheEntry } from './remote-functions/cache.svelte.js' */ +/** @import { Query } from './remote-functions/query/instance.svelte.js' */ +/** @import { LiveQuery } from './remote-functions/query-live/instance.svelte.js' */ +import { BROWSER, DEV } from 'esm-env'; +import * as svelte from 'svelte'; +import { HttpError, Redirect, SvelteKitError } from '@sveltejs/kit/internal'; +const { onMount, tick } = svelte; +// Svelte 4 and under don't have `untrack`, so we have to fallback if `untrack` is not exported +const untrack = svelte.untrack ?? ((value) => value()); +import { + decode_params, + decode_pathname, + strip_hash, + make_trackable, + normalize_path +} from '../../utils/url.js'; +import { dev_fetch, initial_fetch, lock_fetch, subsequent_fetch, unlock_fetch } from './fetcher.js'; +import { parse, parse_server_route } from './parse.js'; +import * as storage from './session-storage.js'; +import { + find_anchor, + resolve_url, + get_link_info, + get_router_options, + is_external_url, + origin, + scroll_state, + notifiable_store, + create_updated_store, + load_css +} from './utils.js'; +import { base } from '$app/paths'; +import * as devalue from 'devalue'; +import { + HISTORY_INDEX, + NAVIGATION_INDEX, + PRELOAD_PRIORITIES, + SCROLL_KEY, + STATES_KEY, + SNAPSHOT_KEY, + PAGE_URL_KEY +} from './constants.js'; +import { validate_page_exports } from '../../utils/exports.js'; +import { noop } from '../../utils/functions.js'; +import { compact } from '../../utils/array.js'; +import { + INVALIDATED_PARAM, + TRAILING_SLASH_PARAM, + create_remote_key, + validate_depends, + validate_load_response +} from '../shared.js'; +import { get_message, get_status } from '../../utils/error.js'; +import { writable } from 'svelte/store'; +import { page, update, navigating } from './state.svelte.js'; +import { add_data_suffix, add_resolution_suffix } from '../pathname.js'; +import { noop_span } from '../telemetry/noop.js'; +import { read_ndjson } from './ndjson.js'; + +export { load_css }; +const ICON_REL_ATTRIBUTES = new Set(['icon', 'shortcut icon', 'apple-touch-icon']); + +let errored = false; +/** + * Set via transformError, reset and read at the end of navigate. + * Necessary because a navigation might succeed loading but during rendering + * an error occurs, at which point the navigation result needs to be overridden with the error result. + * TODO this is all very hacky, rethink for SvelteKit 3 where we can assume Svelte 5 and do an overhaul of client.js + * @type {{ error: App.Error, status: number } | null} + */ +let rendering_error = null; + +// We track the scroll position associated with each history entry in sessionStorage, +// rather than on history.state itself, because when navigation is driven by +// popstate it's too late to update the scroll position associated with the +// state we're navigating from +/** + * history index -> { x, y } + * @type {Record} + */ +const scroll_positions = storage.get(SCROLL_KEY) ?? {}; + +/** + * navigation index -> any + * @type {Record} + */ +const snapshots = storage.get(SNAPSHOT_KEY) ?? {}; + +if (DEV && BROWSER) { + let warned = false; + + const warn = () => { + if (warned) return; + + // Rather than saving a pointer to the original history methods, which would prevent monkeypatching by other libs, + // inspect the stack trace to see if we're being called from within SvelteKit. + let stack = new Error().stack?.split('\n'); + if (!stack) return; + if (!stack[0].includes('https:') && !stack[0].includes('http:')) stack = stack.slice(1); // Chrome includes the error message in the stack + + // skip over `warn` and the place where `warn` was called + const frame = stack[2]; + + // ignore calls that happen inside dependencies, including SvelteKit. + // `frame` can be falsy if we came from an anonymous function + if (frame?.includes('node_modules')) return; + + warned = true; + + console.warn( + "Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead." + ); + }; + + const push_state = history.pushState; + history.pushState = (...args) => { + warn(); + return push_state.apply(history, args); + }; + + const replace_state = history.replaceState; + history.replaceState = (...args) => { + warn(); + return replace_state.apply(history, args); + }; +} + +export const stores = { + url: /* @__PURE__ */ notifiable_store({}), + page: /* @__PURE__ */ notifiable_store({}), + navigating: /* @__PURE__ */ writable( + /** @type {import('@sveltejs/kit').Navigation | null} */ (null) + ), + updated: /* @__PURE__ */ create_updated_store() +}; + +/** @param {number} index */ +function update_scroll_positions(index) { + scroll_positions[index] = scroll_state(); +} + +/** + * @param {number} current_history_index + * @param {number} current_navigation_index + */ +function clear_onward_history(current_history_index, current_navigation_index) { + // if we navigated back, then pushed a new state, we can + // release memory by pruning the scroll/snapshot lookup + let i = current_history_index + 1; + while (scroll_positions[i]) { + delete scroll_positions[i]; + i += 1; + } + + i = current_navigation_index + 1; + while (snapshots[i]) { + delete snapshots[i]; + i += 1; + } +} + +/** + * Loads `href` the old-fashioned way, with a full page reload. + * Returns a `Promise` that never resolves (to prevent any + * subsequent work, e.g. history manipulation, from happening) + * @param {URL} url + * @param {boolean} [replace] if `true`, will replace the current `history` entry rather than creating a new one with `pushState` + * @returns {Promise} a promise that never resolves + */ +function native_navigation(url, replace = false) { + if (replace) { + location.replace(url.href); + } else { + location.href = url.href; + } + return new Promise(noop); +} + +/** + * Checks whether a service worker is registered, and if it is, + * tries to update it. + */ +async function update_service_worker() { + if ('serviceWorker' in navigator) { + const registration = await navigator.serviceWorker.getRegistration(base || '/'); + if (registration) { + await registration.update(); + } + } +} + +/** @type {import('types').CSRRoute[]} All routes of the app. Only available when kit.router.resolution=client */ +let routes; +/** @type {import('types').CSRPageNodeLoader} */ +let default_layout_loader; +/** @type {import('types').CSRPageNodeLoader} */ +let default_error_loader; +/** @type {HTMLElement} */ +let container; +/** @type {HTMLElement} */ +let target; + +/** @type {import('./types.js').SvelteKitApp} */ +export let app; + +/** + * Data that was serialized during SSR for queries/forms/commands, stored as + * `{ v }` (value) or `{ e }` (error) nodes so that failed states survive hydration. + * Entries are deleted as they are consumed (when the corresponding resource is created). + * @type {Record} + */ +export const query_responses = {}; + +/** + * Data that was serialized during SSR for prerender functions, stored as + * `{ v }` (value) or `{ e }` (error) nodes. + * This persists across client-side navigations. + * @type {Record} + */ +export const prerender_responses = {}; + +/** @type {Array<((url: URL) => boolean)>} */ +const invalidated = []; + +/** + * An array of the `+layout.svelte` and `+page.svelte` component instances + * that currently live on the page — used for capturing and restoring snapshots. + * It's updated/manipulated through `bind:this` in `Root.svelte`. + * @type {import('svelte').SvelteComponent[]} + */ +const components = []; + +/** @type {{id: string, token: {}, promise: Promise, fork: Promise | null} | null} */ +let load_cache = null; + +function discard_load_cache() { + void load_cache?.fork?.then((f) => f?.discard()); + load_cache = null; + current_a = { element: undefined, href: undefined }; +} + +/** + * @type {Map>} + * Cache for client-side rerouting, since it could contain async calls which we want to + * avoid running multiple times which would slow down navigations (e.g. else preloading + * wouldn't help because on navigation it would be called again). Since `reroute` should be + * a pure function (i.e. always return the same) value it's safe to cache across navigations. + * The server reroute calls don't need to be cached because they are called using `import(...)` + * which is cached per the JS spec. + */ +const reroute_cache = new Map(); + +/** + * Note on before_navigate_callbacks, on_navigate_callbacks and after_navigate_callbacks: + * do not re-assign as some closures keep references to these Sets + */ +/** @type {Set<(navigation: import('@sveltejs/kit').BeforeNavigate) => void>} */ +const before_navigate_callbacks = new Set(); + +/** @type {Set<(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>>} */ +const on_navigate_callbacks = new Set(); + +/** @type {Set<(navigation: import('@sveltejs/kit').AfterNavigate) => void>} */ +const after_navigate_callbacks = new Set(); + +/** @type {import('./types.js').NavigationState & { nav: import('@sveltejs/kit').NavigationEvent }} */ +let current = { + branch: [], + error: null, + // @ts-ignore - we need the initial value to be null + url: null, + // @ts-ignore - we need the initial value to be null + nav: null +}; + +/** this being true means we SSR'd */ +let hydrated = false; +let started = false; +let autoscroll = true; +let updating = false; +let is_navigating = false; +let hash_navigating = false; +/** True as soon as there happened one client-side navigation (excluding the SvelteKit-initialized initial one when in SPA mode) */ +let has_navigated = false; + +let force_invalidation = false; + +/** @type {import('svelte').SvelteComponent} */ +let root; + +/** @type {number} keeping track of the history index in order to prevent popstate navigation events if needed */ +let current_history_index; + +/** @type {number} */ +let current_navigation_index; + +/** @type {{}} */ +let token; + +/** + * A set of tokens which are associated to current preloads. + * If a preload becomes a real navigation, it's removed from the set. + * If a preload token is in the set and the preload errors, the error + * handling logic (for example reloading) is skipped. + */ +/** @type {Set<{}>} */ +const preload_tokens = new Set(); + +/** @type {Promise | null} */ +export let pending_invalidate; + +/** + * @type {Map>>>} + * A map of query id -> payload -> query internals for all active queries. + */ +export const query_map = new Map(); + +/** + * @type {Map>>>} + * A map of id -> payload -> live query internals for all active queries. + */ +export const live_query_map = new Map(); + +/** + * @param {import('./types.js').SvelteKitApp} _app + * @param {HTMLElement} _target + * @param {Parameters[1]} [hydrate] + */ +export async function start(_app, _target, hydrate) { + if (DEV && _target === document.body) { + console.warn( + 'Placing %sveltekit.body% directly inside is not recommended, as your app may break for users who have certain browser extensions installed.\n\nConsider wrapping it in an element:\n\n
\n %sveltekit.body%\n
' + ); + } + + if (__SVELTEKIT_PAYLOAD__.data) { + const { q = {}, p = {}, l = {}, f = {} } = __SVELTEKIT_PAYLOAD__.data; + + // store the whole nodes — error records seed the corresponding + // resources in a failed state when they are created during hydration + for (const k in q) query_responses[k] = q[k]; + for (const k in l) query_responses[k] = l[k]; + for (const k in f) query_responses[k] = f[k]; + for (const k in p) prerender_responses[k] = p[k]; + } + + // detect basic auth credentials in the current URL + // https://github.com/sveltejs/kit/pull/11179 + // if so, refresh the page without credentials + if (document.URL !== location.href) { + // eslint-disable-next-line no-self-assign + location.href = location.href; + } + + app = _app; + + await _app.hooks.init?.(); + + routes = __SVELTEKIT_CLIENT_ROUTING__ ? parse(_app) : []; + container = __SVELTEKIT_EMBEDDED__ ? _target : document.documentElement; + target = _target; + + // we import the root layout/error nodes eagerly, so that + // connectivity errors after initialisation don't nuke the app + default_layout_loader = _app.nodes[0]; + default_error_loader = _app.nodes[1]; + void default_layout_loader(); + void default_error_loader(); + + current_history_index = history.state?.[HISTORY_INDEX]; + current_navigation_index = history.state?.[NAVIGATION_INDEX]; + + if (!current_history_index) { + // we use Date.now() as an offset so that cross-document navigations + // within the app don't result in data loss + current_history_index = current_navigation_index = Date.now(); + + // create initial history entry, so we can return here + history.replaceState( + { + ...history.state, + [HISTORY_INDEX]: current_history_index, + [NAVIGATION_INDEX]: current_navigation_index + }, + '' + ); + } + + // if we reload the page, or Cmd-Shift-T back to it, + // recover scroll position + const scroll = scroll_positions[current_history_index]; + function restore_scroll() { + if (scroll) { + history.scrollRestoration = 'manual'; + scrollTo(scroll.x, scroll.y); + } + } + + if (hydrate) { + restore_scroll(); + + await _hydrate(target, hydrate); + } else { + await navigate({ + type: 'enter', + url: resolve_url(app.hash ? decode_hash(new URL(location.href)) : location.href), + replace_state: true + }); + + restore_scroll(); + } + + _start_router(); +} + +async function _invalidate(include_load_functions = true, reset_page_state = true) { + // Accept all invalidations as they come, don't swallow any while another invalidation + // is running because subsequent invalidations may make earlier ones outdated, + // but batch multiple synchronous invalidations. + await (pending_invalidate ||= Promise.resolve()); + if (!pending_invalidate) return; + pending_invalidate = null; + + const nav_token = (token = {}); + const intent = await get_navigation_intent(current.url, true); + + // Clear preload, it might be affected by the invalidation. + // Also solves an edge case where a preload is triggered, the navigation for it + // was then triggered and is still running while the invalidation kicks in, + // at which point the invalidation should take over and "win". + discard_load_cache(); + + // Rerun queries + /** @type {Map>} */ + const live_query_reconnects = new Map(); + if (force_invalidation) { + for (const entries of query_map.values()) { + for (const { resource } of entries.values()) { + void resource.refresh(); + } + } + + for (const [query_id, entries] of live_query_map) { + for (const [payload, { resource }] of entries) { + const key = create_remote_key(query_id, payload); + const promise = resource.reconnect(); + promise.catch(noop); + live_query_reconnects.set(key, promise); + } + } + } + + if (include_load_functions) { + const prev_state = page.state; + const navigation_result = intent && (await load_route(intent)); + if (!navigation_result || nav_token !== token) return; + + if (navigation_result.type === 'redirect') { + return _goto( + new URL(navigation_result.location, current.url).href, + { replaceState: true }, + 1, + nav_token + ); + } + + // This is a bit hacky but allows us not having to pass that boolean around, making things harder to reason about + if (!reset_page_state) { + navigation_result.props.page.state = prev_state; + } + update(navigation_result.props.page); + current = { ...navigation_result.state, nav: current.nav }; + reset_invalidation(); + root.$set(navigation_result.props); + } else { + reset_invalidation(); + } + + // only wait for promises that are connected to queries that still exist + /** @type {Promise[]} */ + const promises = []; + for (const entries of query_map.values()) { + for (const { resource } of entries.values()) { + promises.push(resource); + } + } + for (const [query_id, entries] of live_query_map) { + for (const payload of entries.keys()) { + const key = create_remote_key(query_id, payload); + const promise = live_query_reconnects.get(key); + if (promise) { + promises.push(promise); + } + } + } + + // Don't use allSettled yet because it's too new + await Promise.all(promises).catch(noop); +} + +function reset_invalidation() { + invalidated.length = 0; + force_invalidation = false; +} + +/** @param {number} index */ +function capture_snapshot(index) { + if (components.some((c) => c?.snapshot)) { + snapshots[index] = components.map((c) => c?.snapshot?.capture()); + } +} + +/** @param {number} index */ +function restore_snapshot(index) { + snapshots[index]?.forEach((value, i) => { + components[i]?.snapshot?.restore(value); + }); +} + +function persist_state() { + update_scroll_positions(current_history_index); + storage.set(SCROLL_KEY, scroll_positions); + + capture_snapshot(current_navigation_index); + storage.set(SNAPSHOT_KEY, snapshots); +} + +/** + * @param {string | URL} url + * @param {{ replaceState?: boolean; noScroll?: boolean; keepFocus?: boolean; invalidateAll?: boolean; invalidate?: Array boolean)>; state?: Record }} options + * @param {number} redirect_count + * @param {{}} [nav_token] + * @returns {Promise} + */ +export async function _goto(url, options, redirect_count, nav_token) { + /** @type {Set} */ + let query_keys; + /** @type {Set} */ + let live_query_keys; + + // Clear preload cache when invalidateAll is true to ensure fresh data + // after form submissions or explicit invalidations + if (options.invalidateAll) { + discard_load_cache(); + } + + await navigate({ + type: 'goto', + url: resolve_url(url), + keepfocus: options.keepFocus, + noscroll: options.noScroll, + replace_state: options.replaceState, + state: options.state, + redirect_count, + nav_token, + accept: () => { + if (options.invalidateAll) { + force_invalidation = true; + query_keys = new Set(); + for (const [id, entries] of query_map) { + for (const [payload, entry] of entries) { + // don't refresh yet, as some queries will be unrendered, + // but clear caches so that newly rendered queries + // don't use stale data. TODO same for `live_query_map` + entry.resource?.reset(); + query_keys.add(create_remote_key(id, payload)); + } + } + live_query_keys = new Set(); + for (const [id, entries] of live_query_map) { + for (const payload of entries.keys()) { + live_query_keys.add(create_remote_key(id, payload)); + } + } + } + + if (options.invalidate) { + options.invalidate.forEach(push_invalidated); + } + } + }); + + if (options.invalidateAll) { + // TODO the ticks shouldn't be necessary, something inside Svelte itself is buggy + // when a query in a layout that still exists after page change is refreshed earlier than this + void svelte + .tick() + .then(svelte.tick) + .then(() => { + for (const [id, entries] of query_map) { + for (const [payload, { resource }] of entries) { + if (query_keys?.has(create_remote_key(id, payload))) { + void resource.start(); + } + } + } + for (const [id, entries] of live_query_map) { + for (const [payload, { resource }] of entries) { + if (live_query_keys?.has(create_remote_key(id, payload))) { + void resource.reconnect(); + } + } + } + }); + } +} + +/** @param {import('./types.js').NavigationIntent} intent */ +async function _preload_data(intent) { + // Reuse the existing pending preload if it's for the same navigation. + // Prevents an edge case where same preload is triggered multiple times, + // then a later one is becoming the real navigation and the preload tokens + // get out of sync. + if (intent.id !== load_cache?.id) { + discard_load_cache(); + + const preload = {}; + preload_tokens.add(preload); + load_cache = { + id: intent.id, + token: preload, + promise: load_route({ ...intent, preload }).then((result) => { + preload_tokens.delete(preload); + if (result.type === 'loaded' && result.state.error) { + // Don't cache errors, because they might be transient + discard_load_cache(); + } + return result; + }), + fork: null + }; + + if (__SVELTEKIT_FORK_PRELOADS__ && svelte.fork) { + const lc = load_cache; + + lc.fork = lc.promise.then((result) => { + // if load_cache was discarded before load_cache.promise could + // resolve, bail rather than creating an orphan fork + if (lc === load_cache && result.type === 'loaded') { + try { + return svelte.fork(() => { + root.$set(result.props); + update(result.props.page); + }); + } catch { + // if it errors, it's because the experimental flag isn't enabled in Svelte + } + } + + return null; + }); + } + } + + return load_cache.promise; +} + +/** + * @param {URL} url + * @returns {Promise} + */ +async function _preload_code(url) { + const route = (await get_navigation_intent(url, false))?.route; + + if (route) { + await Promise.all( + /** @type {[has_server_load: boolean, node_loader: import('types').CSRPageNodeLoader][]} */ ( + [...route.layouts, route.leaf].filter(Boolean) + ).map((load) => load[1]()) + ); + } +} + +/** + * @param {import('./types.js').NavigationFinished} result + * @param {HTMLElement} target + * @param {boolean} hydrate + */ +async function initialize(result, target, hydrate) { + if (__SVELTEKIT_DEV__ && result.state.error && document.querySelector('vite-error-overlay')) + return; + + /** @type {import('@sveltejs/kit').NavigationEvent} */ + const nav = { + params: current.params, + route: { id: current.route?.id ?? null }, + url: new URL(location.href) + }; + + current = { + ...result.state, + nav + }; + + // Removes the style node we used to avoid FOUC during development + if (__SVELTEKIT_DEV__) { + const style = document.querySelector('style[data-sveltekit]'); + if (style) style.remove(); + } + + update(/** @type {import('@sveltejs/kit').Page} */ (result.props.page)); + + root = new app.root({ + target, + props: { ...result.props, stores, components }, + hydrate, + // @ts-ignore Svelte 5 specific: asynchronously instantiate the component, i.e. don't call flushSync + sync: false, + // @ts-ignore Svelte 5 specific: transformError allows to transform errors before they are passed to boundaries + transformError: __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__ + ? /** @param {unknown} e */ async (e) => { + const error = await handle_error(e, current.nav); + rendering_error = { error, status: get_status(e) }; + page.error = error; + page.status = rendering_error.status; + return error; + } + : undefined + }); + + // Wait for a microtask in case svelte experimental async is enabled, + // which causes component script blocks to run asynchronously + void (await Promise.resolve()); + + if (hydrate) { + /** @type {import('@sveltejs/kit').AfterNavigate} */ + const navigation = { + from: null, + to: { + ...nav, + scroll: scroll_positions[current_history_index] ?? scroll_state() + }, + willUnload: false, + type: 'enter', + complete: Promise.resolve() + }; + + after_navigate_callbacks.forEach((fn) => fn(navigation)); + } + + restore_snapshot(current_navigation_index); + + started = true; +} + +/** + * + * @param {{ + * url: URL; + * params: Record; + * branch: Array; + * errors?: Array; + * status: number; + * error: App.Error | null; + * route: import('types').CSRRoute | null; + * form?: Record | null; + * }} opts + */ +async function get_navigation_result_from_branch({ + url, + params, + branch, + errors, + status, + error, + route, + form +}) { + /** @type {import('types').TrailingSlash} */ + let slash = 'never'; + + // if `paths.base === '/a/b/c`, then the root route is always `/a/b/c/`, regardless of + // the `trailingSlash` route option, so that relative paths to JS and CSS work + if (base && (url.pathname === base || url.pathname === base + '/')) { + slash = 'always'; + } else { + for (const node of branch) { + if (node?.slash !== undefined) slash = node.slash; + } + } + + url.pathname = normalize_path(url.pathname, slash); + // eslint-disable-next-line no-self-assign + url.search = url.search; // turn `/?` into `/` + + /** @type {import('./types.js').NavigationFinished} */ + const result = { + type: 'loaded', + state: { + url, + params, + branch, + error, + route + }, + props: { + // @ts-ignore Somehow it's getting SvelteComponent and SvelteComponentDev mixed up + constructors: compact(branch).map((branch_node) => branch_node.node.component), + page: clone_page(page) + } + }; + + if (errors && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) { + let last_idx = -1; + result.props.errors = await Promise.all( + // eslint-disable-next-line @typescript-eslint/await-thenable + branch + .map((b, i) => { + if (i === 0) return undefined; // root layout wraps root error component, not the other way around + if (!b) return null; + + i--; + // Find the closest error component up to the previous branch + while (i > last_idx + 1 && !errors[i]) i -= 1; + last_idx = i; + return errors[i]?.() + .then((e) => e.component) + .catch(() => undefined); + }) + // filter out indexes where there was no branch, but keep indexes where there was a branch but no error component + .filter((e) => e !== null) + ); + } + + if (error && __SVELTEKIT_EXPERIMENTAL_USE_TRANSFORM_ERROR__) { + result.props.error = error; + } + + if (form !== undefined) { + result.props.form = form; + } + + let data = {}; + let data_changed = !page; + + let p = 0; + + for (let i = 0; i < Math.max(branch.length, current.branch.length); i += 1) { + const node = branch[i]; + const prev = current.branch[i]; + + if (node?.data !== prev?.data) data_changed = true; + if (!node) continue; + + data = { ...data, ...node.data }; + + // Only set props if the node actually updated. This prevents needless rerenders. + if (data_changed) { + result.props[`data_${p}`] = data; + } + + p += 1; + } + + const page_changed = + !current.url || + url.href !== current.url.href || + current.error !== error || + (form !== undefined && form !== page.form) || + data_changed; + + if (page_changed) { + result.props.page = { + error, + params, + route: { + id: route?.id ?? null + }, + state: {}, + status, + url: new URL(url), + form: form ?? null, + // The whole page store is updated, but this way the object reference stays the same + data: data_changed ? data : page.data + }; + } + + return result; +} + +/** + * Call the universal load function of the given node, if it exists. + * + * @param {{ + * loader: import('types').CSRPageNodeLoader; + * parent: () => Promise>; + * url: URL; + * params: Record; + * route: { id: string | null }; + * server_data_node: import('./types.js').DataNode | null; + * }} options + * @returns {Promise} + */ +async function load_node({ loader, parent, url, params, route, server_data_node }) { + /** @type {Record | null} */ + let data = null; + + let is_tracking = true; + + /** @type {import('types').Uses} */ + const uses = { + dependencies: new Set(), + params: new Set(), + parent: false, + route: false, + url: false, + search_params: new Set() + }; + + const node = await loader(); + + if (DEV) { + validate_page_exports(node.universal); + + if (node.universal && app.hash) { + const options = Object.keys(node.universal).filter((o) => o !== 'load'); + + if (options.length > 0) { + throw new Error( + `Page options are ignored when \`router.type === 'hash'\` (${route.id} has ${options + .filter((o) => o !== 'load') + .map((o) => `'${o}'`) + .join(', ')})` + ); + } + } + } + + if (__SVELTEKIT_HAS_UNIVERSAL_LOAD__ && node.universal?.load) { + /** @param {string[]} deps */ + function depends(...deps) { + for (const dep of deps) { + if (DEV) validate_depends(/** @type {string} */ (route.id), dep); + + const { href } = new URL(dep, url); + uses.dependencies.add(href); + } + } + + /** @type {import('@sveltejs/kit').LoadEvent} */ + const load_input = { + tracing: { enabled: false, root: noop_span, current: noop_span }, + route: new Proxy(route, { + get: (target, key) => { + if (is_tracking) { + uses.route = true; + } + return target[/** @type {'id'} */ (key)]; + } + }), + params: new Proxy(params, { + get: (target, key) => { + if (is_tracking) { + uses.params.add(/** @type {string} */ (key)); + } + return target[/** @type {string} */ (key)]; + } + }), + data: server_data_node?.data ?? null, + url: make_trackable( + url, + () => { + if (is_tracking) { + uses.url = true; + } + }, + (param) => { + if (is_tracking) { + uses.search_params.add(param); + } + }, + app.hash + ), + async fetch(resource, init) { + if (resource instanceof Request) { + // we're not allowed to modify the received `Request` object, so in order + // to fixup relative urls we create a new equivalent `init` object instead + init = { + // the request body must be consumed in memory until browsers + // implement streaming request bodies and/or the body getter + body: + resource.method === 'GET' || resource.method === 'HEAD' + ? undefined + : await resource.blob(), + cache: resource.cache, + credentials: resource.credentials, + // the server sets headers to `undefined` if there are no headers but + // the client defaults to an empty Headers object in the Request object. + // To keep the two values in sync, we explicitly set the headers to `undefined`. + // Also, not sure why, but sometimes 0 is evaluated as truthy so we need to + // explicitly compare the headers length to a number here + headers: [...resource.headers].length > 0 ? resource?.headers : undefined, + integrity: resource.integrity, + keepalive: resource.keepalive, + method: resource.method, + mode: resource.mode, + redirect: resource.redirect, + referrer: resource.referrer, + referrerPolicy: resource.referrerPolicy, + signal: resource.signal, + ...init + }; + } + + const { resolved, promise } = resolve_fetch_url(resource, init, url); + + if (is_tracking) { + depends(resolved.href); + } + + return promise; + }, + setHeaders: noop, + depends, + parent() { + if (is_tracking) { + uses.parent = true; + } + return parent(); + }, + untrack(fn) { + is_tracking = false; + try { + return fn(); + } finally { + is_tracking = true; + } + } + }; + + if (DEV) { + try { + lock_fetch(); + data = (await node.universal.load.call(null, load_input)) ?? null; + validate_load_response(data, `related to route '${route.id}'`); + } finally { + unlock_fetch(); + } + } else { + data = (await node.universal.load.call(null, load_input)) ?? null; + } + } + + return { + node, + loader, + server: server_data_node, + universal: node.universal?.load ? { type: 'data', data, uses } : null, + data: data ?? server_data_node?.data ?? null, + slash: node.universal?.trailingSlash ?? server_data_node?.slash + }; +} + +/** + * @param {Request | string | URL} input + * @param {RequestInit | undefined} init + * @param {URL} url + */ +function resolve_fetch_url(input, init, url) { + let requested = input instanceof Request ? input.url : input; + + // we must fixup relative urls so they are resolved from the target page + const resolved = new URL(requested, url); + + // match ssr serialized data url, which is important to find cached responses + if (resolved.origin === url.origin) { + requested = resolved.href.slice(url.origin.length); + } + + // prerendered pages may be served from any origin, so `initial_fetch` urls shouldn't be resolved + const promise = started + ? subsequent_fetch(requested, resolved.href, init) + : initial_fetch(requested, init); + + return { resolved, promise }; +} + +/** + * @param {boolean} parent_changed + * @param {boolean} route_changed + * @param {boolean} url_changed + * @param {Set} search_params_changed + * @param {import('types').Uses | undefined} uses + * @param {Record} params + */ +function has_changed( + parent_changed, + route_changed, + url_changed, + search_params_changed, + uses, + params +) { + if (force_invalidation) return true; + + if (!uses) return false; + + if (uses.parent && parent_changed) return true; + if (uses.route && route_changed) return true; + if (uses.url && url_changed) return true; + + for (const tracked_params of uses.search_params) { + if (search_params_changed.has(tracked_params)) return true; + } + + for (const param of uses.params) { + if (params[param] !== current.params[param]) return true; + } + + for (const href of uses.dependencies) { + if (invalidated.some((fn) => fn(new URL(href)))) return true; + } + + return false; +} + +/** + * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node + * @param {import('./types.js').DataNode | null} [previous] + * @returns {import('./types.js').DataNode | null} + */ +function create_data_node(node, previous) { + if (node?.type === 'data') return node; + if (node?.type === 'skip') return previous ?? null; + return null; +} + +/** + * @param {URL | null} old_url + * @param {URL} new_url + */ +function diff_search_params(old_url, new_url) { + if (!old_url) return new Set(new_url.searchParams.keys()); + + const changed = new Set([...old_url.searchParams.keys(), ...new_url.searchParams.keys()]); + + for (const key of changed) { + const old_values = old_url.searchParams.getAll(key); + const new_values = new_url.searchParams.getAll(key); + + if ( + old_values.every((value) => new_values.includes(value)) && + new_values.every((value) => old_values.includes(value)) + ) { + changed.delete(key); + } + } + + return changed; +} + +/** + * @param {Omit & { error: App.Error }} opts + * @returns {import('./types.js').NavigationFinished} + */ +function preload_error({ error, url, route, params }) { + return { + type: 'loaded', + state: { + error, + url, + route, + params, + branch: [] + }, + props: { + page: clone_page(page), + constructors: [] + } + }; +} + +/** + * @overload + * @param {import('./types.js').NavigationIntent} intent + * @returns {Promise} + */ +/** + * @overload + * @param {import('./types.js').NavigationIntent & { preload: {} }} intent + * @returns {Promise} + */ +/** + * @param {import('./types.js').NavigationIntent & { preload?: {} }} intent + * @returns {Promise} + */ +async function load_route({ id, invalidating, url, params, route, preload }) { + if (load_cache?.id === id) { + // the preload becomes the real navigation + preload_tokens.delete(load_cache.token); + return load_cache.promise; + } + + const { errors, layouts, leaf } = route; + + const loaders = [...layouts, leaf]; + + // preload modules to avoid waterfall, but handle rejections + // so they don't get reported to Sentry et al (we don't need + // to act on the failures at this point) + errors.forEach((loader) => loader?.().catch(noop)); + loaders.forEach((loader) => loader?.[1]().catch(noop)); + + /** @type {import('types').ServerNodesResponse | import('types').ServerRedirectNode | null} */ + let server_data = null; + const url_changed = current.url ? id !== get_page_key(current.url) : false; + const route_changed = current.route ? route.id !== current.route.id : false; + const search_params_changed = diff_search_params(current.url, url); + + let parent_invalid = false; + + if (__SVELTEKIT_HAS_SERVER_LOAD__) { + const invalid_server_nodes = loaders.map((loader, i) => { + const previous = current.branch[i]; + + const invalid = + !!loader?.[0] && + (previous?.loader !== loader[1] || + has_changed( + parent_invalid, + route_changed, + url_changed, + search_params_changed, + previous.server?.uses, + params + )); + + if (invalid) { + // For the next one + parent_invalid = true; + } + + return invalid; + }); + + if (invalid_server_nodes.some(Boolean)) { + try { + server_data = await load_data(url, invalid_server_nodes); + } catch (error) { + const handled_error = await handle_error(error, { url, params, route: { id } }); + + if (preload && preload_tokens.has(preload)) { + return preload_error({ error: handled_error, url, params, route }); + } + + return load_root_error_page({ + status: get_status(error), + error: handled_error, + url, + route + }); + } + + if (server_data.type === 'redirect') { + return server_data; + } + } + } + + const server_data_nodes = server_data?.nodes; + + let parent_changed = false; + + const branch_promises = loaders.map(async (loader, i) => { + if (!loader) return; + + /** @type {import('./types.js').BranchNode | undefined} */ + const previous = current.branch[i]; + + const server_data_node = server_data_nodes?.[i]; + + // reuse data from previous load if it's still valid + const valid = + (!server_data_node || server_data_node.type === 'skip') && + loader[1] === previous?.loader && + !has_changed( + parent_changed, + route_changed, + url_changed, + search_params_changed, + previous.universal?.uses, + params + ); + if (valid) return previous; + + parent_changed = true; + + if (server_data_node?.type === 'error') { + // rethrow and catch below + throw server_data_node; + } + + return load_node({ + loader: loader[1], + url, + params, + route, + parent: async () => { + const data = {}; + for (let j = 0; j < i; j += 1) { + Object.assign(data, (await branch_promises[j])?.data); + } + return data; + }, + server_data_node: create_data_node( + // server_data_node is undefined if it wasn't reloaded from the server; + // and if current loader uses server data, we want to reuse previous data. + server_data_node === undefined && loader[0] ? { type: 'skip' } : (server_data_node ?? null), + loader[0] ? previous?.server : undefined + ) + }); + }); + + // if we don't do this, rejections will be unhandled + for (const p of branch_promises) p.catch(noop); + + /** @type {Array} */ + const branch = []; + + for (let i = 0; i < loaders.length; i += 1) { + if (loaders[i]) { + try { + branch.push(await branch_promises[i]); + } catch (err) { + if (err instanceof Redirect) { + return { + type: 'redirect', + location: err.location + }; + } + + if (preload && preload_tokens.has(preload)) { + return preload_error({ + error: await handle_error(err, { params, url, route: { id: route.id } }), + url, + params, + route + }); + } + + let status = get_status(err); + /** @type {App.Error} */ + let error; + + if (server_data_nodes?.includes(/** @type {import('types').ServerErrorNode} */ (err))) { + // this is the server error rethrown above, reconstruct but don't invoke + // the client error handler; it should've already been handled on the server + status = /** @type {import('types').ServerErrorNode} */ (err).status ?? status; + error = /** @type {import('types').ServerErrorNode} */ (err).error; + } else if (err instanceof HttpError) { + error = err.body; + } else { + // Referenced node could have been removed due to redeploy, check + const updated = await stores.updated.check(); + if (updated) { + // Before reloading, try to update the service worker if it exists + await update_service_worker(); + return await native_navigation(url); + } + + error = await handle_error(err, { params, url, route: { id: route.id } }); + } + + const error_load = await load_nearest_error_page(i, branch, errors); + if (error_load) { + return get_navigation_result_from_branch({ + url, + params, + branch: branch.slice(0, error_load.idx).concat(error_load.node), + errors, + status, + error, + route + }); + } else { + return await server_fallback(url, { id: route.id }, error, status); + } + } + } else { + // push an empty slot so we can rewind past gaps to the + // layout that corresponds with an +error.svelte page + branch.push(undefined); + } + } + + return get_navigation_result_from_branch({ + url, + params, + branch, + errors, + status: 200, + error: null, + route, + // Reset `form` on navigation, but not invalidation + form: invalidating ? undefined : null + }); +} + +/** + * @param {number} i Start index to backtrack from + * @param {Array} branch Branch to backtrack + * @param {Array} errors All error pages for this branch + * @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>} + */ +async function load_nearest_error_page(i, branch, errors) { + while (i--) { + if (errors[i]) { + let j = i; + while (!branch[j]) j -= 1; + try { + return { + idx: j + 1, + node: { + node: await /** @type {import('types').CSRPageNodeLoader } */ (errors[i])(), + loader: /** @type {import('types').CSRPageNodeLoader } */ (errors[i]), + data: {}, + server: null, + universal: null + } + }; + } catch { + continue; + } + } + } +} + +/** + * @param {{ + * status: number; + * error: App.Error; + * url: URL; + * route: { id: string | null } + * }} opts + * @returns {Promise} returns `undefined` in case of a redirect + */ +async function load_root_error_page({ status, error, url, route }) { + /** @type {Record} */ + const params = {}; // error page does not have params + + /** @type {import('types').ServerDataNode | null} */ + let server_data_node = null; + + if (__SVELTEKIT_HAS_SERVER_LOAD__) { + const default_layout_has_server_load = app.server_loads[0] === 0; + + if (default_layout_has_server_load) { + // TODO post-https://github.com/sveltejs/kit/discussions/6124 we can use + // existing root layout data + try { + const server_data = await load_data(url, [true]); + + if ( + server_data.type !== 'data' || + (server_data.nodes[0] && server_data.nodes[0].type !== 'data') + ) { + throw 0; + } + + server_data_node = server_data.nodes[0] ?? null; + } catch (e) { + // at this point we have no choice but to fall back to the server, if it wouldn't + // bring us right back here, turning this into an endless loop. + // if __data.json returned 404, the route doesn't exist — don't reload or we loop + if ( + !(e instanceof HttpError && e.status === 404) && + (url.origin !== origin || url.pathname !== location.pathname || hydrated) + ) { + return await native_navigation(url); + } + } + } + } + + try { + const root_layout = await load_node({ + loader: default_layout_loader, + url, + params, + route, + parent: () => Promise.resolve({}), + server_data_node: create_data_node(server_data_node) + }); + + /** @type {import('./types.js').BranchNode} */ + const root_error = { + node: await default_error_loader(), + loader: default_error_loader, + universal: null, + server: null, + data: null + }; + + return get_navigation_result_from_branch({ + url, + params, + branch: [root_layout, root_error], + status, + error, + errors: [], + route: null + }); + } catch (error) { + // client-side navigation if the root layout loader throws a redirect while + // rendering the default error page + if (error instanceof Redirect) { + await _goto(new URL(error.location, location.href), {}, 0); + return; + } + + // otherwise, render the static error page + const error_template = await app.get_error_template(); + const handled = await handle_error(error, { url, params, route }); + const message = String(handled?.message ?? '') + .replace(/&/g, '&') + .replace(//g, '>'); + const html = error_template({ status, message }); + const parsed = new DOMParser().parseFromString(html, 'text/html'); + document.documentElement.replaceChild(document.adoptNode(parsed.head), document.head); + document.documentElement.replaceChild(document.adoptNode(parsed.body), document.body); + + throw error; + } +} + +/** + * Resolve the relative rerouted URL for a client-side navigation + * @param {URL} url + * @returns {Promise} + */ +async function get_rerouted_url(url) { + const href = url.href; + + if (reroute_cache.has(href)) { + return reroute_cache.get(href); + } + + let rerouted; + + try { + const promise = (async () => { + // reroute could alter the given URL, so we pass a copy + let rerouted = + (await app.hooks.reroute({ + url: new URL(url), + fetch: async (input, init) => { + return resolve_fetch_url(input, init, url).promise; + } + })) ?? url; + + if (typeof rerouted === 'string') { + const tmp = new URL(url); // do not mutate the incoming URL + + if (app.hash) { + tmp.hash = rerouted; + } else { + tmp.pathname = rerouted; + } + + rerouted = tmp; + } + + return rerouted; + })(); + + reroute_cache.set(href, promise); + rerouted = await promise; + } catch (e) { + reroute_cache.delete(href); + if (DEV) { + // in development, print the error... + console.error(e); + + // ...and pause execution, since otherwise we will immediately reload the page + debugger; // eslint-disable-line + } + + // fall back to native navigation + return; + } + + return rerouted; +} + +/** + * Resolve the full info (which route, params, etc.) for a client-side navigation from the URL, + * taking the reroute hook into account. If this isn't a client-side-navigation (or the URL is undefined), + * returns undefined. + * @param {URL | undefined} url + * @param {boolean} invalidating + * @returns {Promise} + */ +export async function get_navigation_intent(url, invalidating) { + if (!url) return; + if (is_external_url(url, base, app.hash)) return; + + if (__SVELTEKIT_CLIENT_ROUTING__) { + const rerouted = await get_rerouted_url(url); + if (!rerouted) return; + + const path = get_url_path(rerouted); + + for (const route of routes) { + const params = route.exec(path); + + if (params) { + return { + id: get_page_key(url), + invalidating, + route, + params: decode_params(params), + url + }; + } + } + } else { + /** @type {{ route?: import('types').CSRRouteServer, params: Record}} */ + const { route, params } = await import( + /* @vite-ignore */ + add_resolution_suffix(url.pathname) + ); + + if (!route) return; + + return { + id: get_page_key(url), + invalidating, + route: parse_server_route(route, app.nodes), + params, + url + }; + } +} + +/** @param {URL} url */ +function get_url_path(url) { + return ( + decode_pathname( + app.hash ? url.hash.replace(/^#/, '').replace(/[?#].+/, '') : url.pathname.slice(base.length) + ) || '/' + ); +} + +/** @param {URL} url */ +function get_page_key(url) { + return (app.hash ? url.hash.replace(/^#/, '') : url.pathname) + url.search; +} + +/** + * @param {{ + * url: URL; + * type: import('@sveltejs/kit').Navigation["type"]; + * intent?: import('./types.js').NavigationIntent; + * delta?: number; + * event?: PopStateEvent | MouseEvent; + * scroll?: { x: number, y: number }; + * }} opts + */ +function _before_navigate({ url, type, intent, delta, event, scroll }) { + let should_block = false; + + const nav = create_navigation(current, intent, url, type, scroll ?? null); + + if (delta !== undefined) { + nav.navigation.delta = delta; + } + + if (event !== undefined) { + // @ts-ignore + nav.navigation.event = event; + } + + const cancellable = { + ...nav.navigation, + cancel: () => { + should_block = true; + nav.reject(new Error('navigation cancelled')); + } + }; + + if (!is_navigating) { + // Don't run the event during redirects + before_navigate_callbacks.forEach((fn) => fn(cancellable)); + } + + return should_block ? null : nav; +} + +/** + * @param {{ + * type: import('@sveltejs/kit').NavigationType; + * url: URL; + * popped?: { + * state: Record; + * scroll: { x: number, y: number }; + * delta: number; + * }; + * keepfocus?: boolean; + * noscroll?: boolean; + * replace_state?: boolean; + * state?: Record; + * redirect_count?: number; + * nav_token?: {}; + * accept?: () => void; + * block?: () => void; + * event?: Event + * }} opts + * @returns {Promise} + */ +async function navigate({ + type, + url, + popped, + keepfocus, + noscroll, + replace_state, + state = {}, + redirect_count = 0, + nav_token = {}, + accept = noop, + block = noop, + event +}) { + const prev_token = token; + token = nav_token; + + const intent = await get_navigation_intent(url, false); + const nav = + type === 'enter' + ? create_navigation(current, intent, url, type) + : _before_navigate({ + url, + type, + delta: popped?.delta, + intent, + scroll: popped?.scroll, + // @ts-ignore + event + }); + + if (!nav) { + block(); + if (token === nav_token) token = prev_token; + return; + } + + // store this before calling `accept()`, which may change the index + const previous_history_index = current_history_index; + const previous_navigation_index = current_navigation_index; + + accept(); + + is_navigating = true; + + if (started && nav.navigation.type !== 'enter') { + stores.navigating.set((navigating.current = nav.navigation)); + } + + let navigation_result = intent && (await load_route(intent)); + + if (!navigation_result) { + if (is_external_url(url, base, app.hash)) { + if (DEV && app.hash) { + // Special case for hash mode during DEV: If someone accidentally forgets to use a hash for the link, + // they would end up here in an endless loop. Fall back to error page in that case + navigation_result = await server_fallback( + url, + { id: null }, + await handle_error( + new SvelteKitError( + 404, + 'Not Found', + `Not found: ${url.pathname} (did you forget the hash?)` + ), + { + url, + params: {}, + route: { id: null } + } + ), + 404, + replace_state + ); + } else { + return await native_navigation(url, replace_state); + } + } else { + navigation_result = await server_fallback( + url, + { id: null }, + await handle_error(new SvelteKitError(404, 'Not Found', `Not found: ${url.pathname}`), { + url, + params: {}, + route: { id: null } + }), + 404, + replace_state + ); + } + } + + // if this is an internal navigation intent, use the normalized + // URL for the rest of the function + url = intent?.url || url; + + // abort if user navigated during update + if (token !== nav_token) { + nav.reject(new Error('navigation aborted')); + return; + } + + if (!navigation_result) return; + + if (navigation_result.type === 'redirect') { + // whatwg fetch spec https://fetch.spec.whatwg.org/#http-redirect-fetch says to error after 20 redirects + if (redirect_count < 20) { + await navigate({ + type, + url: new URL(navigation_result.location, url), + popped, + keepfocus, + noscroll, + replace_state, + state, + redirect_count: redirect_count + 1, + nav_token + }); + + nav.fulfil(undefined); + return; + } + + navigation_result = await load_root_error_page({ + status: 500, + error: await handle_error(new Error('Redirect loop'), { + url, + params: {}, + route: { id: null } + }), + url, + route: { id: null } + }); + + if (!navigation_result) return; + } else if (/** @type {number} */ (navigation_result.props.page.status) >= 400) { + const updated = await stores.updated.check(); + if (updated) { + // Before reloading, try to update the service worker if it exists + await update_service_worker(); + return await native_navigation(url, replace_state); + } + } + + // reset invalidation only after a finished navigation. If there are redirects or + // additional invalidations, they should get the same invalidation treatment + reset_invalidation(); + + updating = true; + + update_scroll_positions(previous_history_index); + capture_snapshot(previous_navigation_index); + + // ensure the url pathname matches the page's trailing slash option + if (navigation_result.props.page.url.pathname !== url.pathname) { + url.pathname = navigation_result.props.page.url.pathname; + } + + state = popped ? popped.state : state; + + if (!popped) { + // this is a new navigation, rather than a popstate + const change = replace_state ? 0 : 1; + + const entry = { + [HISTORY_INDEX]: (current_history_index += change), + [NAVIGATION_INDEX]: (current_navigation_index += change), + [STATES_KEY]: state + }; + + const fn = replace_state ? history.replaceState : history.pushState; + fn.call(history, entry, '', url); + + if (!replace_state) { + clear_onward_history(current_history_index, current_navigation_index); + } + } + + // also compare ids to avoid using wrong fork (e.g. a new one could've been added while navigating) + const load_cache_fork = intent && load_cache?.id === intent.id ? load_cache.fork : null; + // reset preload synchronously after the history state has been set to avoid race conditions + if (load_cache?.fork && !load_cache_fork) { + // discard fork of different route + discard_load_cache(); + } else { + load_cache = null; + current_a = { element: undefined, href: undefined }; + } + + navigation_result.props.page.state = state; + + /** + * @type {Promise | undefined} + */ + let commit_promise; + if (started) { + const after_navigate = ( + await Promise.all( + // eslint-disable-next-line @typescript-eslint/await-thenable -- we need to await because they can be asynchronous + Array.from(on_navigate_callbacks, (fn) => + fn(/** @type {import('@sveltejs/kit').OnNavigate} */ (nav.navigation)) + ) + ) + ).filter(/** @returns {value is () => void} */ (value) => typeof value === 'function'); + + if (after_navigate.length > 0) { + function cleanup() { + after_navigate.forEach((fn) => { + after_navigate_callbacks.delete(fn); + }); + } + + after_navigate.push(cleanup); + + after_navigate.forEach((fn) => { + after_navigate_callbacks.add(fn); + }); + } + + // Type-casts are save because we know this resolved a proper SvelteKit route + const target = /** @type {import('@sveltejs/kit').NavigationTarget} */ (nav.navigation.to); + current = { + ...navigation_result.state, + nav: { + params: /** @type {Record} */ (target.params), + route: target.route, + url: target.url + } + }; + + // reset url before updating page store + if (navigation_result.props.page) { + navigation_result.props.page.url = url; + } + + // Remove focus before updating the component tree, so that blur/focusout + // handlers fire while the old component's data is still valid (#14575) + if ( + !keepfocus && + document.activeElement instanceof HTMLElement && + document.activeElement !== document.body + ) { + document.activeElement.blur(); + } + + const fork = load_cache_fork && (await load_cache_fork); + + if (fork) { + commit_promise = fork.commit(); + } else { + rendering_error = null; // TODO this can break with forks, rethink for SvelteKit 3 where we can assume Svelte 5 + root.$set(navigation_result.props); + // Check for sync rendering error + if (rendering_error) { + Object.assign(navigation_result.props.page, rendering_error); + } + update(navigation_result.props.page); + + commit_promise = svelte.settled?.(); + } + + has_navigated = true; + } else { + await initialize(navigation_result, target, false); + } + + const { activeElement } = document; + + await commit_promise; + + // TODO 3.0 remote — the double tick is probably necessary because + // of some store shenanigans. `settled()` and `f.commit()` + // should resolve after DOM updates in newer versions + await svelte.tick(); + await svelte.tick(); + + if (token !== nav_token) { + // a new navigation happened while we were waiting for the DOM to update, so abort + nav.reject(new Error('navigation aborted')); + return; + } + + // Check for async rendering error + if (navigation_result.props.page && rendering_error) { + Object.assign(navigation_result.props.page, rendering_error); + } + + // we reset scroll before dealing with focus, to avoid a flash of unscrolled content + /** @type {Element | null | ''} */ + let deep_linked = null; + + if (autoscroll) { + const scroll = popped ? popped.scroll : noscroll ? scroll_state() : null; + if (scroll) { + scrollTo(scroll.x, scroll.y); + } else if ((deep_linked = url.hash && document.getElementById(get_id(url)))) { + // Here we use `scrollIntoView` on the element instead of `scrollTo` + // because it natively supports the `scroll-margin` and `scroll-behavior` + // CSS properties. + deep_linked.scrollIntoView(); + } else { + scrollTo(0, 0); + } + } + + const changed_focus = + // reset focus only if any manual focus management didn't override it + document.activeElement !== activeElement && + // also refocus when activeElement is body already because the + // focus event might not have been fired on it yet + document.activeElement !== document.body; + + if (!keepfocus && !changed_focus) { + // We don't need to manually restore the scroll position if we're navigating + // to a fragment identifier. It is automatically done for us when we set the + // sequential navigation starting point with `location.replace` + reset_focus(url, !deep_linked); + } + + autoscroll = true; + + is_navigating = false; + + nav.fulfil(undefined); + + // Update to.scroll to the actual scroll position after navigation completed + if (nav.navigation.to) { + nav.navigation.to.scroll = scroll_state(); + } + + after_navigate_callbacks.forEach((fn) => + fn(/** @type {import('@sveltejs/kit').AfterNavigate} */ (nav.navigation)) + ); + + if (type === 'popstate') { + restore_snapshot(current_navigation_index); + } + + stores.navigating.set((navigating.current = null)); + + updating = false; +} + +/** + * Does a full page reload if it wouldn't result in an endless loop in the SPA case + * @param {URL} url + * @param {{ id: string | null }} route + * @param {App.Error} error + * @param {number} status + * @param {boolean} [replace_state] + * @returns {Promise} + */ +async function server_fallback(url, route, error, status, replace_state) { + if (url.origin === origin && url.pathname === location.pathname && !hydrated) { + // We would reload the same page we're currently on, which isn't hydrated, + // which means no SSR, which means we would end up in an endless loop + return await load_root_error_page({ + status, + error, + url, + route + }); + } + + if (DEV && status !== 404) { + console.error( + 'An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)' + ); + + debugger; // eslint-disable-line + } + + return await native_navigation(url, replace_state); +} + +if (import.meta.hot) { + import.meta.hot.on('vite:beforeUpdate', () => { + if (current.error) location.reload(); + }); +} + +/** @typedef {(typeof PRELOAD_PRIORITIES)['hover'] | (typeof PRELOAD_PRIORITIES)['tap']} PreloadDataPriority */ + +/** + * The anchor element whose href is being preloaded. It is reset after navigation + * or changes when a different anchor element is being preloaded. + * @type {{ element: Element | SVGAElement | undefined; href: string | SVGAnimatedString | undefined }} + */ +let current_a = { element: undefined, href: undefined }; + +function setup_preload() { + /** @type {NodeJS.Timeout} */ + let mousemove_timeout; + /** @type {PreloadDataPriority} */ + let current_priority; + + container.addEventListener('mousemove', (event) => { + const target = /** @type {Element} */ (event.target); + + clearTimeout(mousemove_timeout); + mousemove_timeout = setTimeout(() => { + void preload(target, PRELOAD_PRIORITIES.hover); + }, 20); + }); + + /** @param {Event} event */ + function tap(event) { + if (event.defaultPrevented) return; + void preload(/** @type {Element} */ (event.composedPath()[0]), PRELOAD_PRIORITIES.tap); + } + + container.addEventListener('mousedown', tap); + container.addEventListener('touchstart', tap, { passive: true }); + + const observer = new IntersectionObserver( + (entries) => { + for (const entry of entries) { + if (entry.isIntersecting) { + void _preload_code(new URL(/** @type {HTMLAnchorElement} */ (entry.target).href)); + observer.unobserve(entry.target); + } + } + }, + { threshold: 0 } + ); + + /** + * @param {Element} element + * @param {PreloadDataPriority} priority + */ + async function preload(element, priority) { + const a = find_anchor(element, container); + + // we don't want to preload data again if the user has already hovered/tapped + const interacted = + a === current_a.element && a?.href === current_a.href && priority >= current_priority; + if (!a || interacted) return; + + const { url, external, download } = get_link_info(a, base, app.hash); + if (external || download) return; + + const options = get_router_options(a); + + // we don't want to preload data for a page we're already on + const same_url = url && get_page_key(current.url) === get_page_key(url); + if (options.reload || same_url) return; + + if (priority <= options.preload_data) { + current_a = { element: a, href: a.href }; + // we don't want to preload data again on tap if we've already preloaded it on hover + current_priority = PRELOAD_PRIORITIES.tap; + + const intent = await get_navigation_intent(url, false); + if (!intent) return; + + if (DEV) { + void _preload_data(intent).then((result) => { + if (result.type === 'loaded' && result.state.error) { + console.warn( + `Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\n` + + 'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' + + 'This route was preloaded due to a data-sveltekit-preload-data attribute. ' + + 'See https://svelte.dev/docs/kit/link-options for more info' + ); + } + }); + } else { + void _preload_data(intent); + } + } else if (priority <= options.preload_code) { + current_a = { element: a, href: a.href }; + current_priority = priority; + void _preload_code(/** @type {URL} */ (url)); + } + } + + function after_navigate() { + observer.disconnect(); + + for (const a of container.querySelectorAll('a')) { + const { url, external, download } = get_link_info(a, base, app.hash); + if (external || download) continue; + + const options = get_router_options(a); + if (options.reload) continue; + + if (options.preload_code === PRELOAD_PRIORITIES.viewport) { + observer.observe(a); + } + + if (options.preload_code === PRELOAD_PRIORITIES.eager) { + void _preload_code(/** @type {URL} */ (url)); + } + } + } + + after_navigate_callbacks.add(after_navigate); + after_navigate(); +} + +/** + * @param {unknown} error + * @param {import('@sveltejs/kit').NavigationEvent} event + * @returns {import('types').MaybePromise} + */ +function handle_error(error, event) { + if (error instanceof HttpError) { + return error.body; + } + + if (DEV) { + errored = true; + console.warn('The next HMR update will cause the page to reload'); + } + + const status = get_status(error); + const message = get_message(error); + + return ( + app.hooks.handleError({ error, event, status, message }) ?? /** @type {any} */ ({ message }) + ); +} + +/** + * @template {Function} T + * @param {Set} callbacks + * @param {T} callback + */ +function add_navigation_callback(callbacks, callback) { + onMount(() => { + callbacks.add(callback); + + return () => { + callbacks.delete(callback); + }; + }); +} + +/** + * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL. + * + * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * @param {(navigation: import('@sveltejs/kit').AfterNavigate) => void} callback + * @returns {void} + */ +export function afterNavigate(callback) { + add_navigation_callback(after_navigate_callbacks, callback); +} + +/** + * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls. + * + * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response. + * + * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`. + * + * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`. + * + * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * @param {(navigation: import('@sveltejs/kit').BeforeNavigate) => void} callback + * @returns {void} + */ +export function beforeNavigate(callback) { + add_navigation_callback(before_navigate_callbacks, callback); +} + +/** + * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations. + * + * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user. + * + * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated. + * + * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * @param {(navigation: import('@sveltejs/kit').OnNavigate) => import('types').MaybePromise<(() => void) | void>} callback + * @returns {void} + */ +export function onNavigate(callback) { + add_navigation_callback(on_navigate_callbacks, callback); +} + +/** + * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling. + * This is generally discouraged, since it breaks user expectations. + * @returns {void} + */ +export function disableScrollHandling() { + if (!BROWSER) { + throw new Error('Cannot call disableScrollHandling() on the server'); + } + + if (DEV && started && !updating) { + throw new Error('Can only disable scroll handling during navigation'); + } + + if (updating || !started) { + autoscroll = false; + } +} + +/** + * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused. + * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`. + * + * For external URLs, use `window.location = url` instead of calling `goto(url)`. + * + * @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app. + * @param {Object} [opts] Options related to the navigation + * @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState` + * @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation + * @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body + * @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation. + * @param {Array boolean)>} [opts.invalidate] Causes any load functions to re-run if they depend on one of the urls + * @param {App.PageState} [opts.state] An optional object that will be available as `page.state` + * @returns {Promise} + */ +export function goto(url, opts = {}) { + if (!BROWSER) { + throw new Error('Cannot call goto(...) on the server'); + } + + url = new URL(resolve_url(url)); + + if (url.origin !== origin) { + return Promise.reject( + new Error( + DEV + ? `Cannot use \`goto\` with an external URL. Use \`window.location = "${url}"\` instead` + : 'goto: invalid URL' + ) + ); + } + + return _goto(url, opts, 0); +} + +/** + * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated. + * + * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters). + * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL. + * + * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned. + * This can be useful if you want to invalidate based on a pattern instead of a exact match. + * + * ```ts + * // Example: Match '/path' regardless of the query parameters + * import { invalidate } from '$app/navigation'; + * + * invalidate((url) => url.pathname === '/path'); + * ``` + * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL + * @returns {Promise} + */ +export function invalidate(resource) { + if (!BROWSER) { + throw new Error('Cannot call invalidate(...) on the server'); + } + + push_invalidated(resource); + + return _invalidate(); +} + +/** + * @param {string | URL | ((url: URL) => boolean)} resource The invalidated URL + */ +function push_invalidated(resource) { + if (typeof resource === 'function') { + invalidated.push(resource); + } else { + const { href } = new URL(resource, location.href); + invalidated.push((url) => url.href === href); + } +} + +/** + * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated. + * @returns {Promise} + */ +export function invalidateAll() { + if (!BROWSER) { + throw new Error('Cannot call invalidateAll() on the server'); + } + + force_invalidation = true; + return _invalidate(); +} + +/** + * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument). + * Returns a `Promise` that resolves when the page is subsequently updated. + * @param {{ includeLoadFunctions?: boolean }} [options] + * @returns {Promise} + */ +export function refreshAll({ includeLoadFunctions = true } = {}) { + if (!BROWSER) { + throw new Error('Cannot call refreshAll() on the server'); + } + + force_invalidation = true; + return _invalidate(includeLoadFunctions, false); +} + +/** + * Programmatically preloads the given page, which means + * 1. ensuring that the code for the page is loaded, and + * 2. calling the page's load function with the appropriate options. + * + * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `` element with `data-sveltekit-preload-data`. + * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous. + * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete. + * + * @param {string} href Page to preload + * @returns {Promise<{ type: 'loaded'; status: number; data: Record } | { type: 'redirect'; location: string }>} + */ +export async function preloadData(href) { + if (!BROWSER) { + throw new Error('Cannot call preloadData(...) on the server'); + } + + const url = resolve_url(href); + const intent = await get_navigation_intent(url, false); + + if (!intent) { + throw new Error(`Attempted to preload a URL that does not belong to this app: ${url}`); + } + + const result = await _preload_data(intent); + if (result.type === 'redirect') { + return { + type: result.type, + location: result.location + }; + } + + const { status, data } = result.props.page ?? page; + return { type: result.type, status, data }; +} + +/** + * Programmatically imports the code for routes that haven't yet been fetched. + * Typically, you might call this to speed up subsequent navigation. + * + * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`). + * + * Unlike `preloadData`, this won't call `load` functions. + * Returns a Promise that resolves when the modules have been imported. + * + * @param {string} pathname + * @returns {Promise} + */ +export async function preloadCode(pathname) { + if (!BROWSER) { + throw new Error('Cannot call preloadCode(...) on the server'); + } + + // `current.url` is null until the first navigation/hydration completes, so fall back + // to `location` to support calling `preloadCode` during initial page load (#13297) + const url = new URL(pathname, current.url ?? location.href); + + if (DEV) { + if (!pathname.startsWith('/')) { + throw new Error( + 'argument passed to preloadCode must be a pathname (i.e. "/about" rather than "http://example.com/about"' + ); + } + + if (!pathname.startsWith(base)) { + throw new Error( + `pathname passed to preloadCode must start with \`paths.base\` (i.e. "${base}${pathname}" rather than "${pathname}")` + ); + } + + if (__SVELTEKIT_CLIENT_ROUTING__) { + const rerouted = await get_rerouted_url(url); + if (!rerouted || !routes.find((route) => route.exec(get_url_path(rerouted)))) { + throw new Error(`'${pathname}' did not match any routes`); + } + } + } + + return _preload_code(url); +} + +/** + * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). + * + * @param {string | URL} url + * @param {App.PageState} state + * @returns {void} + */ +export function pushState(url, state) { + if (!BROWSER) { + throw new Error('Cannot call pushState(...) on the server'); + } + + if (DEV) { + if (!started) { + throw new Error('Cannot call pushState(...) before router is initialized'); + } + + try { + // use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances + devalue.stringify(state); + } catch (error) { + // @ts-expect-error + throw new Error(`Could not serialize state${error.path}`, { cause: error }); + } + } + + update_scroll_positions(current_history_index); + + const opts = { + [HISTORY_INDEX]: (current_history_index += 1), + [NAVIGATION_INDEX]: current_navigation_index, + [PAGE_URL_KEY]: page.url.href, + [STATES_KEY]: state + }; + + history.pushState(opts, '', resolve_url(url)); + has_navigated = true; + + page.state = state; + root.$set({ + // we need to assign a new page object so that subscribers are correctly notified + page: untrack(() => clone_page(page)) + }); + + clear_onward_history(current_history_index, current_navigation_index); +} + +/** + * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). + * + * @param {string | URL} url + * @param {App.PageState} state + * @returns {void} + */ +export function replaceState(url, state) { + if (!BROWSER) { + throw new Error('Cannot call replaceState(...) on the server'); + } + + if (DEV) { + if (!started) { + throw new Error('Cannot call replaceState(...) before router is initialized'); + } + + try { + // use `devalue.stringify` as a convenient way to ensure we exclude values that can't be properly rehydrated, such as custom class instances + devalue.stringify(state); + } catch (error) { + // @ts-expect-error + throw new Error(`Could not serialize state${error.path}`, { cause: error }); + } + } + + const opts = { + [HISTORY_INDEX]: current_history_index, + [NAVIGATION_INDEX]: current_navigation_index, + [PAGE_URL_KEY]: page.url.href, + [STATES_KEY]: state + }; + + history.replaceState(opts, '', resolve_url(url)); + + page.state = state; + root.$set({ + page: untrack(() => clone_page(page)) + }); +} + +/** + * This action updates the `form` property of the current page with the given data and updates `page.status`. + * In case of an error, it redirects to the nearest error page. + * @template {Record | undefined} Success + * @template {Record | undefined} Failure + * @param {import('@sveltejs/kit').ActionResult} result + * @returns {Promise} + */ +export async function applyAction(result) { + if (!BROWSER) { + throw new Error('Cannot call applyAction(...) on the server'); + } + + if (result.type === 'error') { + await set_nearest_error_page(result.error, result.status); + } else if (result.type === 'redirect') { + await _goto(result.location, { invalidateAll: true }, 0); + } else { + page.form = result.data; + page.status = result.status; + + /** @type {Record} */ + root.$set({ + // this brings Svelte's view of the world in line with SvelteKit's + // after use:enhance reset the form.... + form: null, + page: clone_page(page) + }); + + // ...so that setting the `form` prop takes effect and isn't ignored + await tick(); + root.$set({ form: result.data }); + + if (result.type === 'success') { + reset_focus(page.url); + } + } +} + +/** + * @param {App.Error} error + * @param {number} status + */ +export async function set_nearest_error_page(error, status = 500) { + const url = new URL(location.href); + + const { branch, route } = current; + if (!route) return; + + const error_load = await load_nearest_error_page(current.branch.length, branch, route.errors); + if (error_load) { + const navigation_result = await get_navigation_result_from_branch({ + url, + params: current.params, + branch: branch.slice(0, error_load.idx).concat(error_load.node), + status, + error, + // do not set errors, we haven't changed the page so the previous ones are still current + route + }); + + current = { ...navigation_result.state, nav: current.nav }; + + root.$set(navigation_result.props); + update(navigation_result.props.page); + + void tick().then(() => reset_focus(current.url)); + } +} + +function _start_router() { + history.scrollRestoration = 'manual'; + + // Adopted from Nuxt.js + // Reset scrollRestoration to auto when leaving page, allowing page reload + // and back-navigation from other pages to use the browser to restore the + // scrolling position. + addEventListener('beforeunload', (e) => { + let should_block = false; + + persist_state(); + + if (!is_navigating) { + const nav = create_navigation(current, undefined, null, 'leave'); + + // If we're navigating, beforeNavigate was already called. If we end up in here during navigation, + // it's due to an external or full-page-reload link, for which we don't want to call the hook again. + /** @type {import('@sveltejs/kit').BeforeNavigate} */ + const navigation = { + ...nav.navigation, + cancel: () => { + should_block = true; + nav.reject(new Error('navigation cancelled')); + } + }; + + before_navigate_callbacks.forEach((fn) => fn(navigation)); + } + + if (should_block) { + e.preventDefault(); + e.returnValue = ''; + } else { + history.scrollRestoration = 'auto'; + } + }); + + addEventListener('visibilitychange', () => { + if (document.visibilityState === 'hidden') { + persist_state(); + } + }); + + // @ts-expect-error this isn't supported everywhere yet + if (!navigator.connection?.saveData) { + setup_preload(); + } + + /** @param {MouseEvent} event */ + container.addEventListener('click', async (event) => { + // Adapted from https://github.com/visionmedia/page.js + // MIT license https://github.com/visionmedia/page.js#license + if (event.button || event.which !== 1) return; + if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return; + if (event.defaultPrevented) return; + + const a = find_anchor(/** @type {Element} */ (event.composedPath()[0]), container); + if (!a) return; + + const { url, external, target, download } = get_link_info(a, base, app.hash); + if (!url) return; + + // bail out before `beforeNavigate` if link opens in a different tab + if (target === '_parent' || target === '_top') { + if (window.parent !== window) return; + } else if (target && target !== '_self') { + return; + } + + const options = get_router_options(a); + const is_svg_a_element = a instanceof SVGAElement; + + // Ignore URL protocols that differ to the current one and are not http(s) (e.g. `mailto:`, `tel:`, `myapp:`, etc.) + // This may be wrong when the protocol is x: and the link goes to y:.. which should be treated as an external + // navigation, but it's not clear how to handle that case and it's not likely to come up in practice. + // MEMO: Without this condition, firefox will open mailer twice. + // See: + // - https://github.com/sveltejs/kit/issues/4045 + // - https://github.com/sveltejs/kit/issues/5725 + // - https://github.com/sveltejs/kit/issues/6496 + if ( + !is_svg_a_element && + url.protocol !== location.protocol && + !(url.protocol === 'https:' || url.protocol === 'http:') + ) + return; + + if (download) return; + + const [nonhash, hash] = (app.hash ? url.hash.replace(/^#/, '') : url.href).split('#'); + const same_pathname = nonhash === strip_hash(location); + + // Ignore the following but fire beforeNavigate + if (external || (options.reload && (!same_pathname || !hash))) { + if (_before_navigate({ url, type: 'link', event })) { + // set `navigating` to `true` to prevent `beforeNavigate` callbacks + // being called when the page unloads + is_navigating = true; + } else { + event.preventDefault(); + } + + return; + } + + // Check if new url only differs by hash and use the browser default behavior in that case + // This will ensure the `hashchange` event is fired + // Removing the hash does a full page navigation in the browser, so make sure a hash is present + if (hash !== undefined && same_pathname) { + // If we are trying to navigate to the same hash, we should only + // attempt to scroll to that element and avoid any history changes. + // Otherwise, this can cause Firefox to incorrectly assign a null + // history state value without any signal that we can detect. + const [, current_hash] = current.url.href.split('#'); + if (current_hash === hash) { + event.preventDefault(); + + // We're already on /# and click on a link that goes to /#, or we're on + // /#top and click on a link that goes to /#top. In those cases just go to + // the top of the page, and avoid a history change. + if (hash === '' || (hash === 'top' && a.ownerDocument.getElementById('top') === null)) { + scrollTo({ top: 0 }); + } else { + const element = a.ownerDocument.getElementById(decodeURIComponent(hash)); + if (element) { + element.scrollIntoView(); + element.focus(); + } + } + + return; + } + // set this flag to distinguish between navigations triggered by + // clicking a hash link and those triggered by popstate + hash_navigating = true; + + update_scroll_positions(current_history_index); + + update_url(url); + + if (!options.replace_state) return; + + // hashchange event shouldn't occur if the router is replacing state. + hash_navigating = false; + } + + event.preventDefault(); + + // allow the browser to repaint before navigating — + // this prevents INP scores being penalised + await new Promise((fulfil) => { + requestAnimationFrame(() => { + setTimeout(fulfil, 0); + }); + + setTimeout(fulfil, 100); // fallback for edge case where rAF doesn't fire because e.g. tab was backgrounded + }); + + await navigate({ + type: 'link', + url, + keepfocus: options.keepfocus, + noscroll: options.noscroll, + replace_state: options.replace_state ?? url.href === location.href, + event + }); + }); + + container.addEventListener('submit', (event) => { + if (event.defaultPrevented) return; + + const form = /** @type {HTMLFormElement} */ ( + HTMLFormElement.prototype.cloneNode.call(event.target) + ); + + const submitter = /** @type {HTMLButtonElement | HTMLInputElement | null} */ (event.submitter); + + const target = submitter?.formTarget || form.target; + + if (target === '_blank') return; + + const method = submitter?.formMethod || form.method; + + if (method !== 'get') return; + + // It is impossible to use form actions with hash router, so we just ignore handling them here + const url = new URL( + (submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action + ); + + if (is_external_url(url, base, false)) return; + + const event_form = /** @type {HTMLFormElement} */ (event.target); + + const options = get_router_options(event_form); + if (options.reload) return; + + event.preventDefault(); + event.stopPropagation(); + + const data = new FormData(event_form, submitter); + + // @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that + url.search = new URLSearchParams(data).toString(); + + void navigate({ + type: 'form', + url, + keepfocus: options.keepfocus, + noscroll: options.noscroll, + replace_state: options.replace_state ?? url.href === location.href, + event + }); + }); + + addEventListener('popstate', async (event) => { + if (resetting_focus) return; + + if (event.state?.[HISTORY_INDEX]) { + const history_index = event.state[HISTORY_INDEX]; + token = {}; + + // if a popstate-driven navigation is cancelled, we need to counteract it + // with history.go, which means we end up back here, hence this check + if (history_index === current_history_index) return; + + const scroll = scroll_positions[history_index]; + const state = event.state[STATES_KEY] ?? {}; + const url = new URL(event.state[PAGE_URL_KEY] ?? location.href); + const navigation_index = event.state[NAVIGATION_INDEX]; + const is_hash_change = current.url ? strip_hash(location) === strip_hash(current.url) : false; + const shallow = + navigation_index === current_navigation_index && (has_navigated || is_hash_change); + + if (shallow) { + // We don't need to navigate, we just need to update scroll and/or state. + // This happens with hash links and `pushState`/`replaceState`. The + // exception is if we haven't navigated yet, since we could have + // got here after a modal navigation then a reload + if (state !== page.state) { + page.state = state; + } + + update_url(url); + + scroll_positions[current_history_index] = scroll_state(); + if (scroll) scrollTo(scroll.x, scroll.y); + + current_history_index = history_index; + return; + } + + const delta = history_index - current_history_index; + + await navigate({ + type: 'popstate', + url, + popped: { + state, + scroll, + delta + }, + accept: () => { + current_history_index = history_index; + current_navigation_index = navigation_index; + }, + block: () => { + history.go(-delta); + }, + nav_token: token, + event + }); + } else { + // since popstate event is also emitted when an anchor referencing the same + // document is clicked, we have to check that the router isn't already handling + // the navigation. otherwise we would be updating the page store twice. + if (!hash_navigating) { + const url = new URL(location.href); + update_url(url); + + // if the user edits the hash via the browser URL bar, trigger a full-page + // reload to align with pathname router behavior + if (app.hash) { + location.reload(); + } + } + } + }); + + addEventListener('hashchange', () => { + // if the hashchange happened as a result of clicking on a link, + // we need to update history, otherwise we have to leave it alone + if (hash_navigating) { + hash_navigating = false; + history.replaceState( + { + ...history.state, + [HISTORY_INDEX]: ++current_history_index, + [NAVIGATION_INDEX]: current_navigation_index + }, + '', + location.href + ); + } + }); + + // fix link[rel=icon], because browsers will occasionally try to load relative + // URLs after a pushState/replaceState, resulting in a 404 — see + // https://github.com/sveltejs/kit/issues/3748#issuecomment-1125980897 + for (const link of document.querySelectorAll('link')) { + if (ICON_REL_ATTRIBUTES.has(link.rel)) { + link.href = link.href; // eslint-disable-line + } + } + + addEventListener('pageshow', (event) => { + // If the user navigates to another site and then uses the back button and + // bfcache hits, we need to set navigating to null, the site doesn't know + // the navigation away from it was successful. + // Info about bfcache here: https://web.dev/bfcache + if (event.persisted) { + stores.navigating.set((navigating.current = null)); + } + }); + + /** + * @param {URL} url + */ + function update_url(url) { + current.url = page.url = url; + stores.page.set(clone_page(page)); + stores.page.notify(); + } +} + +/** + * @param {HTMLElement} target + * @param {import('./types.js').HydrateOptions} opts + * @returns {Promise} + */ +async function _hydrate( + target, + { status = 200, error, node_ids, params, route, server_route, data: server_data_nodes, form } +) { + hydrated = true; + + const url = new URL(location.href); + + /** @type {import('types').CSRRoute | undefined} */ + let parsed_route; + + if (__SVELTEKIT_CLIENT_ROUTING__) { + if (!__SVELTEKIT_EMBEDDED__) { + // See https://github.com/sveltejs/kit/pull/4935#issuecomment-1328093358 for one motivation + // of determining the params on the client side. + ({ params = {}, route = { id: null } } = (await get_navigation_intent(url, false)) || {}); + } + + parsed_route = routes.find(({ id }) => id === route.id); + } else { + // undefined in case of 404 + if (server_route) { + parsed_route = route = parse_server_route(server_route, app.nodes); + } else { + route = { id: null }; + params = {}; + } + } + + /** @type {import('./types.js').NavigationFinished | undefined} */ + let result; + let hydrate = true; + + try { + const branch_promises = node_ids.map(async (n, i) => { + const server_data_node = server_data_nodes[i]; + // Type isn't completely accurate, we still need to deserialize uses + if (server_data_node?.uses) { + server_data_node.uses = deserialize_uses(server_data_node.uses); + } + + return load_node({ + loader: app.nodes[n], + url, + params, + route, + parent: async () => { + const data = {}; + for (let j = 0; j < i; j += 1) { + Object.assign(data, (await branch_promises[j]).data); + } + return data; + }, + server_data_node: create_data_node(server_data_node) + }); + }); + + /** @type {Array} */ + const branch = await Promise.all(branch_promises); + + // server-side will have compacted the branch, reinstate empty slots + // so that error boundaries can be lined up correctly + if (parsed_route) { + const layouts = parsed_route.layouts; + for (let i = 0; i < layouts.length; i++) { + if (!layouts[i]) { + branch.splice(i, 0, undefined); + } + } + } + + result = await get_navigation_result_from_branch({ + url, + params, + branch, + status, + error, + errors: parsed_route?.errors, // TODO load earlier? + form, + route: parsed_route ?? null + }); + } catch (error) { + if (error instanceof Redirect) { + // this is a real edge case — `load` would need to return + // a redirect but only in the browser + return await native_navigation(new URL(error.location, location.href)); + } + + result = await load_root_error_page({ + status: get_status(error), + error: await handle_error(error, { url, params, route }), + url, + route + }); + + target.textContent = ''; + hydrate = false; + } + + // Exit early when we encounter a redirect while loading the root error page. + // In this case, `initialize` will be called later on + if (!result) return; + + if (result.props.page) { + result.props.page.state = {}; + } + + await initialize(result, target, hydrate); +} + +/** + * @param {URL} url + * @param {boolean[]} invalid + * @returns {Promise} + */ +async function load_data(url, invalid) { + const data_url = new URL(url); + data_url.pathname = add_data_suffix(url.pathname); + if (url.pathname.endsWith('/')) { + data_url.searchParams.append(TRAILING_SLASH_PARAM, '1'); + } + if (DEV && url.searchParams.has(INVALIDATED_PARAM)) { + throw new Error(`Cannot used reserved query parameter "${INVALIDATED_PARAM}"`); + } + data_url.searchParams.append(INVALIDATED_PARAM, invalid.map((i) => (i ? '1' : '0')).join('')); + + // use window.fetch directly to allow using a 3rd party-patched fetch implementation + const fetcher = DEV ? dev_fetch : window.fetch; + const res = await fetcher(data_url.href, {}); + + if (!res.ok) { + // error message is a JSON-stringified string which devalue can't handle at the top level + // turn it into a HttpError to not call handleError on the client again (was already handled on the server) + // if `__data.json` doesn't exist or the server has an internal error, + // avoid parsing the HTML error page as a JSON + /** @type {string | undefined} */ + let message; + if (res.headers.get('content-type')?.includes('application/json')) { + message = await res.json(); + } else if (res.status === 404) { + message = 'Not Found'; + } else if (res.status === 500) { + message = 'Internal Error'; + } + throw new HttpError(res.status, message); + } + + return new Promise((resolve, reject) => { + process_stream(resolve, res).catch(reject); + }); + + // TODO edge case handling necessary? stream() read fails? +} + +/** + * @param {(value: ServerNodesResponse | ServerRedirectNode) => void} resolve + * @param {Response} res + * @returns {Promise} + */ +async function process_stream(resolve, res) { + const reader = /** @type {ReadableStream} */ (res.body).getReader(); + + /** + * Map of deferred promises that will be resolved by a subsequent chunk of data + * @type {Map} + */ + const deferreds = new Map(); + + /** + * @param {any} data + */ + function deserialize(data) { + return devalue.unflatten(data, { + ...app.decoders, + Promise: (id) => { + return new Promise((fulfil, reject) => { + deferreds.set(id, { fulfil, reject }); + }); + } + }); + } + + for await (const node of read_ndjson(reader)) { + if (node.type === 'redirect') { + return resolve(node); + } + + if (node.type === 'data') { + // This is the first (and possibly only, if no pending promises) chunk + node.nodes?.forEach((/** @type {any} */ node) => { + if (node?.type === 'data') { + node.uses = deserialize_uses(node.uses); + node.data = deserialize(node.data); + } + }); + + resolve(node); + } else if (node.type === 'chunk') { + // This is a subsequent chunk containing deferred data + const { id, data, error } = node; + const deferred = /** @type {import('types').Deferred} */ (deferreds.get(id)); + deferreds.delete(id); + + if (error) { + deferred.reject(deserialize(error)); + } else { + deferred.fulfil(deserialize(data)); + } + } + } +} + +/** + * @param {any} uses + * @return {import('types').Uses} + */ +function deserialize_uses(uses) { + return { + dependencies: new Set(uses?.dependencies ?? []), + params: new Set(uses?.params ?? []), + parent: !!uses?.parent, + route: !!uses?.route, + url: !!uses?.url, + search_params: new Set(uses?.search_params ?? []) + }; +} + +/** + * This flag is used to avoid client-side navigation when we're only using + * `location.replace()` to set focus. + */ +let resetting_focus = false; + +/** + * @param {URL} url + * @param {boolean} [scroll] + */ +function reset_focus(url, scroll = true) { + const autofocus = document.querySelector('[autofocus]'); + if (autofocus) { + // @ts-ignore + autofocus.focus(); + } else { + // Reset page selection and focus + + // Mimic the browsers' behaviour and set the sequential focus navigation + // starting point to the fragment identifier. + const id = get_id(url); + if (id && document.getElementById(id)) { + const { x, y } = scroll_state(); + + // `element.focus()` doesn't work on Safari and Firefox Ubuntu so we need + // to use this hack with `location.replace()` instead. + setTimeout(() => { + const history_state = history.state; + + resetting_focus = true; + location.replace(new URL(`#${id}`, location.href)); + + // Firefox has a bug that sets the history state to `null` so we need to + // restore it after. See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924 + // This is also needed to restore the original hash if we're using hash routing + history.replaceState(history_state, '', url); + + // If scroll management has already happened earlier, we need to restore + // the scroll position after setting the sequential focus navigation starting point + if (scroll) scrollTo(x, y); + resetting_focus = false; + }); + } else { + // If the ID doesn't exist, we try to mimic browsers' behaviour as closely + // as possible by targeting the first scrollable region. Unfortunately, it's + // not a perfect match — e.g. shift-tabbing won't immediately cycle up from + // the end of the page on Chromium + // See https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area + const root = document.body; + const tabindex = root.getAttribute('tabindex'); + + root.tabIndex = -1; + // TODO: remove this when we switch to TypeScript 6 + // @ts-ignore options.focusVisible is only typed in TypeScript 6 + // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility + root.focus({ preventScroll: true, focusVisible: false }); + + // restore `tabindex` as to prevent `root` from stealing input from elements + if (tabindex !== null) { + root.setAttribute('tabindex', tabindex); + } else { + root.removeAttribute('tabindex'); + } + } + + // capture current selection, so we can compare the state after + // snapshot restoration and afterNavigate callbacks have run + const selection = getSelection(); + + if (selection && selection.type !== 'None') { + /** @type {Range[]} */ + const ranges = []; + + for (let i = 0; i < selection.rangeCount; i += 1) { + ranges.push(selection.getRangeAt(i)); + } + + setTimeout(() => { + if (selection.rangeCount !== ranges.length) return; + + for (let i = 0; i < selection.rangeCount; i += 1) { + const a = ranges[i]; + const b = selection.getRangeAt(i); + + // we need to do a deep comparison rather than just `a !== b` because + // Safari behaves differently to other browsers + if ( + a.commonAncestorContainer !== b.commonAncestorContainer || + a.startContainer !== b.startContainer || + a.endContainer !== b.endContainer || + a.startOffset !== b.startOffset || + a.endOffset !== b.endOffset + ) { + return; + } + } + + // if the selection hasn't changed (as a result of an element being (auto)focused, + // or a programmatic selection, we reset everything as part of the navigation) + // fixes https://github.com/sveltejs/kit/issues/8439 + selection.removeAllRanges(); + }); + } + } +} + +/** + * @template {import('@sveltejs/kit').NavigationType} T + * @param {import('./types.js').NavigationState} current + * @param {import('./types.js').NavigationIntent | undefined} intent + * @param {URL | null} url + * @param {T} type + * @param {{ x: number, y: number } | null} [target_scroll] The scroll position for the target (for popstate navigations) + */ +function create_navigation(current, intent, url, type, target_scroll = null) { + /** @type {(value: any) => void} */ + let fulfil; + + /** @type {(error: any) => void} */ + let reject; + + const complete = new Promise((f, r) => { + fulfil = f; + reject = r; + }); + + // Handle any errors off-chain so that it doesn't show up as an unhandled rejection + complete.catch(noop); + + /** @type {(import('@sveltejs/kit').Navigation | import('@sveltejs/kit').AfterNavigate) & { type: T }} */ + const navigation = /** @type {any} */ ({ + from: { + params: current.params, + route: { id: current.route?.id ?? null }, + url: current.url, + scroll: scroll_state() + }, + to: url && { + params: intent?.params ?? null, + route: { id: intent?.route?.id ?? null }, + url, + scroll: target_scroll + }, + willUnload: !intent, + type, + complete + }); + + return { + navigation, + // @ts-expect-error + fulfil, + // @ts-expect-error + reject + }; +} + +/** + * TODO: remove this in 3.0 when the page store is also removed + * + * We need to assign a new page object so that subscribers are correctly notified. + * However, spreading `{ ...page }` returns an empty object so we manually + * assign to each property instead. + * + * @param {import('@sveltejs/kit').Page} page + */ +function clone_page(page) { + return { + data: page.data, + error: page.error, + form: page.form, + params: page.params, + route: page.route, + state: page.state, + status: page.status, + url: page.url + }; +} + +/** + * @param {URL} url + * @returns {URL} + */ +function decode_hash(url) { + const new_url = new URL(url); + // Safari, for some reason, does change # to %23, when entered through the address bar + new_url.hash = decodeURIComponent(url.hash); + return new_url; +} + +/** + * @param {URL} url + * @returns {string} + */ +function get_id(url) { + let id; + + if (app.hash) { + const [, , second] = url.hash.split('#', 3); + id = second ?? ''; + } else { + id = url.hash.slice(1); + } + + return decodeURIComponent(id); +} + +if (DEV) { + // Nasty hack to silence harmless warnings the user can do nothing about + const console_warn = console.warn; + console.warn = function warn(...args) { + if ( + args.length === 1 && + /<(Layout|Page|Error)(_[\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test( + args[0] + ) + ) { + return; + } + console_warn(...args); + }; + + if (import.meta.hot) { + import.meta.hot.on('vite:beforeUpdate', () => { + if (errored) { + location.reload(); + } + }); + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/constants.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..982c25d7debe1aeef5ae8206016e6c639e970b27 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/constants.js @@ -0,0 +1,16 @@ +export const SNAPSHOT_KEY = 'sveltekit:snapshot'; +export const SCROLL_KEY = 'sveltekit:scroll'; +export const STATES_KEY = 'sveltekit:states'; +export const PAGE_URL_KEY = 'sveltekit:pageurl'; + +export const HISTORY_INDEX = 'sveltekit:history'; +export const NAVIGATION_INDEX = 'sveltekit:navigation'; + +export const PRELOAD_PRIORITIES = /** @type {const} */ ({ + tap: 1, + hover: 2, + viewport: 3, + eager: 4, + off: -1, + false: -1 +}); diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/entry.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/entry.js new file mode 100644 index 0000000000000000000000000000000000000000..74b0fb283a58c3a406b0a2378938d2df307abe51 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/entry.js @@ -0,0 +1,3 @@ +// we expose this as a separate entry point (rather than treating client.js as the entry point) +// so that everything other than `start`/`load_css` can be treeshaken +export { start, load_css } from './client.js'; diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js new file mode 100644 index 0000000000000000000000000000000000000000..a601f7a293f82b1230f22b55591b4f7eeb0f4a72 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/fetcher.js @@ -0,0 +1,180 @@ +import { BROWSER, DEV } from 'esm-env'; +import { noop } from '../../utils/functions.js'; +import { hash } from '../../utils/hash.js'; +import { base64_decode } from '../utils.js'; + +let loading = 0; + +/** @type {typeof fetch} */ +const native_fetch = BROWSER ? window.fetch : /** @type {any} */ (noop); + +export function lock_fetch() { + loading += 1; +} + +export function unlock_fetch() { + loading -= 1; +} + +if (DEV && BROWSER) { + let can_inspect_stack_trace = false; + + // detect whether async stack traces work + // eslint-disable-next-line @typescript-eslint/require-await + const check_stack_trace = async () => { + const stack = /** @type {string} */ (new Error().stack); + can_inspect_stack_trace = stack.includes('check_stack_trace'); + }; + + void check_stack_trace(); + + /** + * @param {RequestInfo | URL} input + * @param {RequestInit & Record | undefined} init + */ + window.fetch = (input, init) => { + // Check if fetch was called via load_node. the lock method only checks if it was called at the + // same time, but not necessarily if it was called from `load`. + // We use just the filename as the method name sometimes does not appear on the CI. + const url = input instanceof Request ? input.url : input.toString(); + const stack_array = /** @type {string} */ (new Error().stack).split('\n'); + // We need to do a cutoff because Safari and Firefox maintain the stack + // across events and for example traces a `fetch` call triggered from a button + // back to the creation of the event listener and the element creation itself, + // where at some point client.js will show up, leading to false positives. + const cutoff = stack_array.findIndex((a) => a.includes('load@') || a.includes('at load')); + const stack = stack_array.slice(0, cutoff + 2).join('\n'); + + const in_load_heuristic = can_inspect_stack_trace + ? stack.includes('src/runtime/client/client.js') + : loading; + + // This flag is set in initial_fetch and subsequent_fetch + const used_kit_fetch = init?.__sveltekit_fetch__; + + if (in_load_heuristic && !used_kit_fetch) { + console.warn( + `Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests` + ); + } + + const method = input instanceof Request ? input.method : init?.method || 'GET'; + + if (method !== 'GET') { + cache.delete(build_selector(input)); + } + + return native_fetch(input, init); + }; +} else if (BROWSER) { + window.fetch = (input, init) => { + const method = input instanceof Request ? input.method : init?.method || 'GET'; + + if (method !== 'GET') { + cache.delete(build_selector(input)); + } + + return native_fetch(input, init); + }; +} + +const cache = new Map(); + +/** + * Should be called on the initial run of load functions that hydrate the page. + * Saves any requests with cache-control max-age to the cache. + * @param {URL | string} resource + * @param {RequestInit} [opts] + */ +export function initial_fetch(resource, opts) { + const selector = build_selector(resource, opts); + + const script = document.querySelector(selector); + if (script?.textContent) { + script.remove(); // In case multiple script tags match the same selector + let { body, ...init } = JSON.parse(script.textContent); + + const b64 = script.getAttribute('data-b64'); + if (b64 !== null) { + // Can't use native_fetch('data:...;base64,${body}') + // csp can block the request + body = base64_decode(body); + } + + const ttl = script.getAttribute('data-ttl'); + if (ttl) cache.set(selector, { body, init, ttl: 1000 * Number(ttl) }); + + return Promise.resolve(new Response(body, init)); + } + + return DEV ? dev_fetch(resource, opts) : window.fetch(resource, opts); +} + +/** + * Tries to get the response from the cache, if max-age allows it, else does a fetch. + * @param {URL | string} resource + * @param {string} resolved + * @param {RequestInit} [opts] + */ +export function subsequent_fetch(resource, resolved, opts) { + if (cache.size > 0) { + const selector = build_selector(resource, opts); + const cached = cache.get(selector); + if (cached) { + // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache#value + if ( + performance.now() < cached.ttl && + ['default', 'force-cache', 'only-if-cached', undefined].includes(opts?.cache) + ) { + return new Response(cached.body, cached.init); + } + + cache.delete(selector); + } + } + + return DEV ? dev_fetch(resolved, opts) : window.fetch(resolved, opts); +} + +/** + * @param {RequestInfo | URL} resource + * @param {RequestInit & Record | undefined} opts + */ +export function dev_fetch(resource, opts) { + const patched_opts = { ...opts }; + // This assigns the __sveltekit_fetch__ flag and makes it non-enumerable + Object.defineProperty(patched_opts, '__sveltekit_fetch__', { + value: true, + writable: true, + configurable: true + }); + return window.fetch(resource, patched_opts); +} + +/** + * Build the cache key for a given request + * @param {URL | RequestInfo} resource + * @param {RequestInit} [opts] + */ +function build_selector(resource, opts) { + const url = JSON.stringify(resource instanceof Request ? resource.url : resource); + + let selector = `script[data-sveltekit-fetched][data-url=${url}]`; + + if (opts?.headers || opts?.body) { + /** @type {import('types').StrictBody[]} */ + const values = []; + + if (opts.headers) { + values.push([...new Headers(opts.headers)].join(',')); + } + + if (opts.body && (typeof opts.body === 'string' || ArrayBuffer.isView(opts.body))) { + values.push(opts.body); + } + + selector += `[data-hash="${hash(...values)}"]`; + } + + return selector; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/ndjson.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/ndjson.js new file mode 100644 index 0000000000000000000000000000000000000000..faa4bfd37da0945a8b7053970261795c81c53faa --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/ndjson.js @@ -0,0 +1,15 @@ +import { read_stream } from './stream.js'; + +/** + * Yields parsed JSON objects from a ReadableStream of newline-delimited JSON. + * Each yielded value is the raw `JSON.parse`'d object — callers handle deserialization. + * @param {ReadableStreamDefaultReader} reader + */ +export async function* read_ndjson(reader) { + for await (const block of read_stream(reader, '\n')) { + const line = block.trim(); + if (line) { + yield JSON.parse(line); + } + } +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/parse.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..20445fc9cef0ca0445499b586022242b30597427 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/parse.js @@ -0,0 +1,77 @@ +import { exec, parse_route_id } from '../../utils/routing.js'; + +/** + * @param {import('./types.js').SvelteKitApp} app + * @returns {import('types').CSRRoute[]} + */ +export function parse({ nodes, server_loads, dictionary, matchers }) { + const layouts_with_server_load = new Set(server_loads); + + return Object.entries(dictionary).map(([id, [leaf, layouts, errors]]) => { + const { pattern, params } = parse_route_id(id); + + /** @type {import('types').CSRRoute} */ + const route = { + id, + /** @param {string} path */ + exec: (path) => { + const match = pattern.exec(path); + if (match) return exec(match, params, matchers); + }, + errors: [1, ...(errors || [])].map((n) => nodes[n]), + layouts: [0, ...(layouts || [])].map(create_layout_loader), + leaf: create_leaf_loader(leaf) + }; + + // bit of a hack, but ensures that layout/error node lists are the same + // length, without which the wrong data will be applied if the route + // manifest looks like `[[a, b], [c,], d]` + route.errors.length = route.layouts.length = Math.max( + route.errors.length, + route.layouts.length + ); + + return route; + }); + + /** + * @param {number} id + * @returns {[boolean, import('types').CSRPageNodeLoader]} + */ + function create_leaf_loader(id) { + // whether or not the route uses the server data is + // encoded using the ones' complement, to save space + const uses_server_data = id < 0; + if (uses_server_data) id = ~id; + return [uses_server_data, nodes[id]]; + } + + /** + * @param {number | undefined} id + * @returns {[boolean, import('types').CSRPageNodeLoader] | undefined} + */ + function create_layout_loader(id) { + // whether or not the layout uses the server data is + // encoded in the layouts array, to save space + return id === undefined ? id : [layouts_with_server_load.has(id), nodes[id]]; + } +} + +/** + * @param {import('types').CSRRouteServer} input + * @param {import('types').CSRPageNodeLoader[]} app_nodes Will be modified if a new node is loaded that's not already in the array + * @returns {import('types').CSRRoute} + */ +export function parse_server_route({ nodes, id, leaf, layouts, errors }, app_nodes) { + return { + id, + exec: () => ({}), // dummy function; exec already happened on the server + // By writing to app_nodes only when a loader at that index is not already defined, + // we ensure that loaders have referential equality when they load the same node. + // Code elsewhere in client.js relies on this referential equality to determine + // if a loader is different and should therefore (re-)run. + errors: errors.map((n) => (n ? (app_nodes[n] ||= nodes[n]) : undefined)), + layouts: layouts.map((n) => (n ? [n[0], (app_nodes[n[1]] ||= nodes[n[1]])] : undefined)), + leaf: [leaf[0], (app_nodes[leaf[1]] ||= nodes[leaf[1]])] + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/cache.svelte.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/cache.svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..2f779d22d3627b2bf32ebe6071bcbdbc741ef28c --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/cache.svelte.js @@ -0,0 +1,157 @@ +import { tick } from 'svelte'; +import { once } from '../../../utils/functions.js'; + +/** + * @template R + * @typedef {object} CacheEntry + * @property {number} proxy_count The number of live proxy instances referencing this + * entry. The entry is eligible for eviction when this hits zero. + * @property {R} resource The actual reactive resource (Query or LiveQuery). + * @property {() => void} cleanup Tears down the `$effect.root` that owns the resource. + * Run when the entry is evicted. + */ + +/** + * @template R + * @typedef {{ entry: CacheEntry, id: string, payload: string }} ProxyFinalizerToken + */ + +/** + * Cache controller bound to a specific cache map and resource teardown function. Owns the + * eviction scheduling and FinalizationRegistry for its cache. + * + * Methods are defined as arrow-function class fields so they can be destructured and + * re-exported without losing their `this` binding. + * + * @template R + */ +export class CacheController { + /** @type {Map>>} */ + #cache_map; + + /** @type {((resource: R) => void) | undefined} */ + #destroy_resource; + + /** + * The held value points at the cache entry the proxy is contributing to. When the + * proxy is GC'd, we decrement that entry's `proxy_count` and schedule a deferred + * eviction check. + * + * @type {FinalizationRegistry>} + */ + #proxy_finalizer = new FinalizationRegistry(({ entry, id, payload }) => { + this.deref(entry, id, payload); + }); + + /** + * @param {Map>>} cache_map + * @param {(resource: R) => void} [destroy_resource] Optional teardown hook called on + * the resource itself before the cache entry's `$effect.root` cleanup runs. Used by + * live queries to detach event listeners and abort connections. + */ + constructor(cache_map, destroy_resource) { + this.#cache_map = cache_map; + this.#destroy_resource = destroy_resource; + } + + /** + * Get-or-create the cache entry for `(id, payload)`. The resource is constructed + * inside an `$effect.root`, the cleanup of which is stored on the entry. + * + * @param {string} id + * @param {string} payload + * @param {() => R} create_resource + * @returns {CacheEntry} + */ + ensure_entry = (id, payload, create_resource) => { + let entries = this.#cache_map.get(id); + + if (!entries) { + entries = new Map(); + this.#cache_map.set(id, entries); + } + + let entry = entries.get(payload); + + if (!entry) { + const c = /** @type {CacheEntry} */ ({ + proxy_count: 0, + resource: /** @type {R} */ (/** @type {unknown} */ (null)), + cleanup: /** @type {() => void} */ (/** @type {unknown} */ (null)) + }); + + c.cleanup = $effect.root(() => { + c.resource = create_resource(); + }); + + entry = c; + entries.set(payload, entry); + } + + return entry; + }; + + /** + * Register a reference to a resource cache entry using an anchor object with the FinalizationRegistry. + * When the anchor object is garbage collected, the held value's `entry.proxy_count` is decremented + * and a deferred eviction check is scheduled for `(id, payload)`. + * + * @param {object} anchor + * @param {CacheEntry} entry + * @param {string} id + * @param {string} payload + */ + ref = (anchor, entry, id, payload) => { + entry.proxy_count++; + this.#proxy_finalizer.register(anchor, { entry, id, payload }); + }; + + /** + * Manually reference this cache entry. Danger: This entry will never be cleaned up unless the returned callback is called. + * + * @param {CacheEntry} entry + * @param {string} id + * @param {string} payload + */ + manual_ref = (entry, id, payload) => { + entry.proxy_count++; + return once(() => this.deref(entry, id, payload)); + }; + + /** + * Dereference this cache entry. If the entry's `proxy_count` hits zero, schedule a deferred eviction check. + * + * @param {CacheEntry} entry + * @param {string} id + * @param {string} payload + */ + deref = (entry, id, payload) => { + entry.proxy_count--; + void tick().then(() => { + const entry = this.#cache_map.get(id)?.get(payload); + if (!entry || entry.proxy_count > 0) return; + this.#evict(id, payload); + }); + }; + + /** + * Tear down the cache entry for `(id, payload)` if it exists. Runs the optional + * resource teardown and the entry's `$effect.root` cleanup, then removes the entry + * from the cache map. + * + * @param {string} id + * @param {string} payload + */ + #evict = (id, payload) => { + const entries = this.#cache_map.get(id); + const entry = entries?.get(payload); + if (!entry) return; + + this.#destroy_resource?.(entry.resource); + entry.cleanup(); + entries?.delete(payload); + if (entries && entries.size === 0) { + this.#cache_map.delete(id); + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..a2bdc81a3cd6ee24263eacf6520d3106a6014e17 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/command.svelte.js @@ -0,0 +1,99 @@ +/** @import { RemoteCommand, RemoteQueryUpdate } from '@sveltejs/kit' */ +import { app_dir, base } from '$app/paths/internal/client'; +import { app } from '../client.js'; +import { stringify_command_arg } from '../../shared.js'; +import { get_remote_request_headers, categorize_updates, remote_request } from './shared.svelte.js'; + +/** + * Client-version of the `command` function from `$app/server`. + * @param {string} id + * @returns {RemoteCommand} + */ +export function command(id) { + /** @type {number} */ + let pending_count = $state(0); + + // Careful: This function MUST be synchronous (can't use the async keyword) because the return type has to be a promise with an updates() method. + // If we make it async, the return type will be a promise that resolves to a promise with an updates() method, which is not what we want. + /** @type {RemoteCommand} */ + const command_function = (arg) => { + let overrides = /** @type {Array<() => void> | null} */ (null); + + /** @type {Set | null} */ + let refreshes = null; + + /** @type {Error | undefined} */ + let updates_error; + + // Increment pending count when command starts + pending_count++; + + // No one should call commands during rendering, but this is belt and braces. + // Do this here, after Svelte's reactivity context is gone. + const headers = { + 'Content-Type': 'application/json', + ...get_remote_request_headers() + }; + + /** @type {Promise & { updates: (...args: RemoteQueryUpdate[]) => Promise }} */ + const promise = (async () => { + try { + // Wait a tick to give room for the `updates` method to be called + await Promise.resolve(); + + if (updates_error) { + throw updates_error; + } + + const response = await remote_request(`${base}/${app_dir}/remote/${id}`, { + method: 'POST', + body: JSON.stringify({ + payload: await stringify_command_arg(arg, app.hooks.transport), + refreshes: Array.from(refreshes ?? []) + }), + headers + }); + + if (response.redirect) { + throw new Error( + 'Redirects are not allowed in commands. Return a result instead and use goto on the client' + ); + } + + return response._; + } finally { + overrides?.forEach((fn) => fn()); + + // Decrement pending count when command completes + pending_count--; + } + })(); + + let updates_called = false; + promise.updates = (...args) => { + if (updates_called) { + console.warn( + 'Updates can only be sent once per command invocation. Ignoring additional updates.' + ); + return promise; + } + updates_called = true; + + try { + ({ refreshes, overrides } = categorize_updates(args)); + } catch (error) { + updates_error = /** @type {Error} */ (error); + } + + return promise; + }; + + return promise; + }; + + Object.defineProperty(command_function, 'pending', { + get: () => pending_count + }); + + return command_function; +} diff --git a/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..e2b7fb0944fe079a273bc280de0ae17882da1ae4 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/form.svelte.js @@ -0,0 +1,807 @@ +/** @import { StandardSchemaV1 } from '@standard-schema/spec' */ +/** @import { RemoteFormInput, RemoteForm, RemoteQueryUpdate } from '@sveltejs/kit' */ +/** @import { InternalRemoteFormIssue } from 'types' */ +import { app_dir, base } from '$app/paths/internal/client'; +import { DEV } from 'esm-env'; +import { HttpError } from '@sveltejs/kit/internal'; +import { query_responses, _goto, set_nearest_error_page, invalidateAll } from '../client.js'; +import { tick } from 'svelte'; +import { categorize_updates, remote_request } from './shared.svelte.js'; +import { createAttachmentKey } from 'svelte/attachments'; +import { + convert_formdata, + flatten_issues, + create_field_proxy, + deep_set, + set_nested_value, + throw_on_old_property_access, + build_path_string, + normalize_issue, + serialize_binary_form, + DELETE_KEY, + BINARY_FORM_CONTENT_TYPE +} from '../../form-utils.js'; + +/** + * Merge client issues into server issues. Server issues are persisted unless + * a client-issue exists for the same path, in which case the client-issue overrides it. + * @param {FormData} form_data + * @param {InternalRemoteFormIssue[]} current_issues + * @param {InternalRemoteFormIssue[]} client_issues + * @returns {InternalRemoteFormIssue[]} + */ +function merge_with_server_issues(form_data, current_issues, client_issues) { + const merged = [ + ...current_issues.filter( + (issue) => issue.server && !client_issues.some((i) => i.name === issue.name) + ), + ...client_issues + ]; + + const keys = Array.from(form_data.keys()); + + return merged.sort((a, b) => keys.indexOf(a.name) - keys.indexOf(b.name)); +} + +/** + * Client-version of the `form` function from `$app/server`. + * @template {RemoteFormInput} T + * @template U + * @param {string} id + * @returns {RemoteForm} + */ +export function form(id) { + /** @type {Map }>} */ + const instances = new Map(); + + /** @type {StandardSchemaV1 | null} */ + let shared_preflight_schema = null; + + /** @param {string | number | boolean} [key] */ + function create_instance(key) { + const action_id_without_key = id; + const action_id = id + (key != undefined ? `/${JSON.stringify(key)}` : ''); + const action = '?/remote=' + encodeURIComponent(action_id); + + // the output of a non-enhanced submission that resulted in this page — + // consume it so the form's state survives hydration (form outputs are + // always value nodes; the server never serializes them as errors) + /** @type {{ input?: Record, issues?: InternalRemoteFormIssue[], result?: any } | undefined} */ + const initial = query_responses[action_id]?.v; + delete query_responses[action_id]; + + /** + * @type {Record} + */ + let input = $state(initial?.input ?? {}); + + /** @type {InternalRemoteFormIssue[]} */ + let raw_issues = $state.raw(initial?.issues ?? []); + + const issues = $derived(flatten_issues(raw_issues)); + + /** @type {any} */ + let result = $state.raw(initial?.result); + + /** @type {number} */ + let pending_count = $state(0); + + /** @type {StandardSchemaV1 | undefined} */ + let preflight_schema = undefined; + + /** + * @param {Omit, 'enhance' | 'element'> & { readonly element: HTMLFormElement }} instance + */ + let enhance_callback = async (instance) => { + if (await instance.submit()) { + await tick(); + // We call reset from the prototype to avoid DOM clobbering + HTMLFormElement.prototype.reset.call(instance.element); + } + }; + + /** @type {HTMLFormElement | null} */ + let element = null; + + /** @type {Record} */ + let touched = {}; + + let submitted = $state(false); + + /** @type {InternalRemoteFormIssue[] | null} */ + let unread_issues = null; + + /** @type {string | null} */ + let previous_submitter_name = null; + + /** + * In dev, warn if there are validation issues going unread + */ + function warn_on_missing_issue_reads() { + unread_issues = raw_issues; + + setTimeout(() => { + if (unread_issues === null) { + return; + } + + if (unread_issues.length > 0) { + const message = `Form submission had invalid data, but the validation issues were ignored:`; + const summary = unread_issues + .map((issue) => + issue.path.length === 0 + ? ` - ${issue.message}` + : ` - ${issue.path.join('.')} (${issue.message})` + ) + .join('\n'); + const suggestion = `Make sure you provide actionable feedback to users, using e.g. \`myForm.fields.myField.issues()\` or \`myForm.fields.allIssues()\``; + + console.warn(`${message}\n\n${summary}\n\n${suggestion}`); + } + + unread_issues = null; + }); + } + + /** + * @param {FormData} form_data + * @returns {Record} + */ + function convert(form_data) { + const data = convert_formdata(form_data); + if (key !== undefined && !form_data.has('id')) { + data.id = key; + } + return data; + } + + /** + * @param {FormData} form_data + * @param {boolean} should_preflight + * @returns {Promise & { updates: (...args: any[]) => Promise }} + */ + function submit(form_data, should_preflight) { + // Store a reference to the current instance and increment the usage count for the duration + // of the request. This ensures that the instance is not deleted in case of an optimistic update + // (e.g. when deleting an item in a list) that fails and wants to surface an error to the user afterwards. + // If the instance would be deleted in the meantime, the error property would be assigned to the old, + // no-longer-visible instance, so it would never be shown to the user. + const entry = instances.get(key); + if (entry) { + entry.count++; + } + + let overrides = /** @type {Array<() => void> | null} */ (null); + + /** @type {Set | null} */ + let refreshes = null; + + /** @type {Error | undefined} */ + let updates_error; + + /** @type {Promise & { updates: (...args: RemoteQueryUpdate[]) => Promise }} */ + const promise = (async () => { + try { + await Promise.resolve(); + + if (updates_error) { + throw updates_error; + } + + if (should_preflight) { + const valid = await preflight(form_data); + if (!valid) return false; + } + + const { blob } = serialize_binary_form(convert(form_data), { + remote_refreshes: Array.from(refreshes ?? []) + }); + + const response = await remote_request( + `${base}/${app_dir}/remote/${action_id_without_key}`, + { + method: 'POST', + headers: { + 'Content-Type': BINARY_FORM_CONTENT_TYPE, + // Forms cannot be called during rendering, so it's save to use location here + 'x-sveltekit-pathname': location.pathname, + 'x-sveltekit-search': location.search + }, + body: blob + } + ); + + ({ issues: raw_issues = [], result } = response._ ?? {}); + + // if the developer took control of updates via `.updates(...)` (even with + // no arguments), or the server performed explicit refreshes, don't invalidateAll + const should_invalidate = refreshes === null && !response.r; + + if (response.redirect) { + // Use internal version to allow redirects to external URLs + void _goto( + response.redirect, + { + invalidateAll: should_invalidate + }, + 0 + ); + return true; + } + + const succeeded = raw_issues.length === 0; + + if (succeeded) { + if (should_invalidate) { + void invalidateAll(); + } + } else { + if (DEV) { + warn_on_missing_issue_reads(); + } + } + + return succeeded; + } catch (e) { + result = undefined; + raw_issues = []; + throw e; + } finally { + overrides?.forEach((fn) => fn()); + + void tick().then(() => { + if (entry) { + entry.count--; + if (entry.count === 0) { + instances.delete(key); + } + } + }); + } + })(); + + let updates_called = false; + promise.updates = (...args) => { + if (updates_called) { + console.warn( + 'Updates can only be sent once per form submission. Ignoring additional updates.' + ); + return promise; + } + updates_called = true; + + try { + ({ refreshes, overrides } = categorize_updates(args)); + } catch (error) { + updates_error = /** @type {Error} */ (error); + } + + return promise; + }; + + return promise; + } + + /** + * @param {HTMLFormElement} form + * @param {FormData} form_data + * @returns {Omit, 'enhance' | 'element'> & { readonly element: HTMLFormElement }} + */ + function create_enhance_callback_instance(form, form_data) { + const { enhance: _enhance, ...descriptors } = Object.getOwnPropertyDescriptors(instance); + void _enhance; + + return /** @type {Omit, 'enhance' | 'element'> & { readonly element: HTMLFormElement }} */ ( + Object.defineProperties( + {}, + { + ...descriptors, + data: { + get() { + // TODO 3.0 remove + throw new Error( + `The \`data\` property has been removed from the \`enhance\` callback argument. Use \`instance.fields.value()\` instead.` + ); + } + }, + form: { + get() { + // TODO 3.0 remove + throw new Error( + `The \`form\` property has been removed from the \`enhance\` callback argument. To get the current \`
\` element, use \`instance.element\` instead.` + ); + } + }, + element: { + value: form + }, + submit: { + value: () => submit(form_data, false) + } + } + ) + ); + } + + /** + * @param {FormData} form_data + */ + async function preflight(form_data) { + const data = convert(form_data); + const schema = preflight_schema ?? shared_preflight_schema; + const validated = await schema?.['~standard'].validate(data); + + if (validated?.issues) { + raw_issues = merge_with_server_issues( + form_data, + raw_issues, + validated.issues.map((issue) => normalize_issue(issue, false)) + ); + + if (DEV) { + warn_on_missing_issue_reads(); + } + + return false; + } + + // Preflight passed - clear stale client-side preflight issues + if (preflight_schema) { + raw_issues = raw_issues.filter((issue) => issue.server); + } + + return true; + } + + /** @type {RemoteForm} */ + const instance = {}; + + instance.method = 'POST'; + instance.action = action; + + instance[createAttachmentKey()] = (/** @type {HTMLFormElement} */ form) => { + if (element) { + let message = `A form object can only be attached to a single \`\` element`; + if (DEV && !key) { + const name = id.split('/').pop(); + message += `. To create multiple instances, use \`${name}.for(key)\``; + } + + throw new Error(message); + } + + element = form; + + touched = {}; + + /** @param {SubmitEvent} event */ + const handle_submit = async (event) => { + const form = /** @type {HTMLFormElement} */ (event.target); + const method = event.submitter?.hasAttribute('formmethod') + ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formMethod + : clone(form).method; + + if (method !== 'post') return; + + const action = new URL( + // We can't do submitter.formAction directly because that property is always set + event.submitter?.hasAttribute('formaction') + ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formAction + : clone(form).action + ); + + if (action.searchParams.get('/remote') !== action_id) { + return; + } + + const target = event.submitter?.hasAttribute('formtarget') + ? /** @type {HTMLButtonElement | HTMLInputElement} */ (event.submitter).formTarget + : clone(form).target; + + if (target === '_blank') { + return; + } + + event.preventDefault(); + + const form_data = new FormData(form, event.submitter); + + if ( + previous_submitter_name !== null && + !Array.from(form_data.keys()).map(strip_prefix).includes(previous_submitter_name) + ) { + // Strip any `n:`/`b:` type prefix before clearing, otherwise + // `set_nested_value` would coerce `undefined` to `NaN`/`false` + // instead of clearing the previously-submitted value. + set_nested_value(input, previous_submitter_name, undefined); + } + + if (event.submitter) { + const name = event.submitter.getAttribute('name'); + const value = /** @type {any} */ (event.submitter).value; + + if (name !== null && value !== undefined) { + set_nested_value(input, name, value); + } + + previous_submitter_name = strip_prefix(name); + } else { + previous_submitter_name = null; + } + + if (DEV) { + validate_form_data(form_data, clone(form).enctype); + } + + submitted = true; + + try { + // Increment pending count immediately so that `pending` reflects + // the in-progress state during async preflight validation + pending_count++; + + const valid = await preflight(form_data); + if (!valid) return; + + await enhance_callback(create_enhance_callback_instance(form, form_data)); + } catch (e) { + const error = + e instanceof HttpError ? e.body : { message: /** @type {any} */ (e).message }; + const status = e instanceof HttpError ? e.status : 500; + void set_nearest_error_page(error, status); + } finally { + pending_count--; + } + }; + + /** @param {Event} e */ + const handle_input = (e) => { + // strictly speaking it can be an HTMLTextAreaElement or HTMLSelectElement + // but that makes the types unnecessarily awkward + const element = /** @type {HTMLInputElement} */ (e.target); + + let name = element.name; + if (!name) return; + + const is_array = name.endsWith('[]'); + if (is_array) name = name.slice(0, -2); + + const is_file = element.type === 'file'; + + touched[name] = true; + + if (is_array) { + let value; + + if (element.tagName === 'SELECT') { + value = Array.from( + element.querySelectorAll('option:checked'), + (e) => /** @type {HTMLOptionElement} */ (e).value + ); + } else { + const elements = /** @type {HTMLInputElement[]} */ ( + Array.from(form.querySelectorAll(`[name="${name}[]"]`)) + ); + + if (DEV) { + for (const e of elements) { + if ((e.type === 'file') !== is_file) { + throw new Error( + `Cannot mix and match file and non-file inputs under the same name ("${element.name}")` + ); + } + } + } + + value = is_file + ? elements.map((input) => Array.from(input.files ?? [])).flat() + : elements.map((element) => element.value); + if (element.type === 'checkbox') { + value = /** @type {string[]} */ (value.filter((_, i) => elements[i].checked)); + } + } + + set_nested_value(input, name, value); + } else if (is_file) { + if (DEV && element.multiple) { + throw new Error( + `Can only use the \`multiple\` attribute when \`name\` includes a \`[]\` suffix — consider changing "${name}" to "${name}[]"` + ); + } + + const file = /** @type {HTMLInputElement & { files: FileList }} */ (element).files[0]; + + if (file) { + set_nested_value(input, name, file); + } else { + set_nested_value(input, name, DELETE_KEY); + } + } else { + set_nested_value( + input, + name, + element.type === 'checkbox' && !element.checked ? null : element.value + ); + } + + name = strip_prefix(name); + + touched[name] = true; + }; + + const handle_reset = async () => { + // need to wait a moment, because the `reset` event occurs before + // the inputs are actually updated (so that it can be cancelled) + await tick(); + + input = convert_formdata(new FormData(form)); + raw_issues = []; + touched = {}; + }; + + form.addEventListener('submit', handle_submit); + form.addEventListener('input', handle_input); + form.addEventListener('reset', handle_reset); + + return () => { + form.removeEventListener('submit', handle_submit); + form.removeEventListener('input', handle_input); + form.removeEventListener('reset', handle_reset); + element = null; + }; + }; + + let validate_id = 0; + + // TODO 3.0 remove + if (DEV) { + throw_on_old_property_access(instance); + + Object.defineProperty(instance, 'buttonProps', { + get() { + throw new Error( + '`form.buttonProps` has been removed: Instead of ` + * ``` + */ + depends: (...deps: Array<`${string}:${string}`>) => void; + /** + * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: + * + * ```js + * /// file: src/routes/+page.server.js + * export async function load({ untrack, url }) { + * // Untrack url.pathname so that path changes don't trigger a rerun + * if (untrack(() => url.pathname === '/')) { + * return { message: 'Welcome!' }; + * } + * } + * ``` + */ + untrack: (fn: () => T) => T; + + /** + * Access to spans for tracing. If tracing is not enabled or the function is being run in the browser, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current `load` function. */ + current: Span; + }; + } + + export interface NavigationEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null + > { + /** + * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object + */ + params: Params; + /** + * Info about the current route + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId; + }; + /** + * The URL of the current page + */ + url: URL; + } + + /** + * Information about the target of a specific navigation. + */ + export interface NavigationTarget< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null + > { + /** + * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route). + */ + params: Params | null; + /** + * Info about the target route + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId | null; + }; + /** + * The URL that is navigated to + */ + url: URL; + /** + * The scroll position associated with this navigation. + * + * For the `from` target, this is the scroll position at the moment of navigation. + * + * For the `to` target, this represents the scroll position that will be or was restored: + * - In `beforeNavigate` and `onNavigate`, this is only available for `popstate` navigations (back/forward button) + * and will be `null` for other navigation types, since the final scroll position isn't known + * ahead of time. + * - In `afterNavigate`, this is always the scroll position that was applied after the navigation + * completed. + */ + scroll: { x: number; y: number } | null; + } + + /** + * - `enter`: The app has hydrated/started + * - `form`: The user submitted a `` + * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring + * - `link`: Navigation was triggered by a link click + * - `popstate`: Navigation was triggered by back/forward navigation + */ + export type NavigationType = 'enter' | 'form' | 'leave' | 'link' | 'goto' | 'popstate'; + + export interface NavigationBase { + /** + * The type of navigation: + * - `enter`: The app has hydrated/started + * - `form`: The user submitted a `` + * - `goto`: Navigation was triggered by a `goto(...)` call or a redirect + * - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring + * - `link`: Navigation was triggered by a link click + * - `popstate`: Navigation was triggered by back/forward navigation + */ + type: NavigationType; + /** + * Where navigation was triggered from + */ + from: NavigationTarget | null; + /** + * Where navigation is going to/has gone to + */ + to: NavigationTarget | null; + /** + * Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation). + */ + willUnload: boolean; + /** + * A promise that resolves once the navigation is complete, and rejects if the navigation + * fails or is aborted. In the case of a `willUnload` navigation, the promise will never resolve + */ + complete: Promise; + } + + /** + * The navigation that occurs when the app starts/hydrates + */ + export interface NavigationEnter extends NavigationBase { + type: 'enter'; + + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + + /** + * Dispatched `Event` object when navigation occurred by `popstate` or `link`. + */ + event?: undefined; + } + + export type NavigationExternal = NavigationGoto | NavigationLeave; + + /** + * A navigation triggered by a `goto(...)` call or a redirect + */ + export interface NavigationGoto extends NavigationBase { + type: 'goto'; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + } + + /** + * A navigation triggered by the tab being closed, or the user navigating to a different document + */ + export interface NavigationLeave extends NavigationBase { + type: 'leave'; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + } + + /** + * A navigation triggered by a `` + */ + export interface NavigationFormSubmit extends NavigationBase { + type: 'form'; + + /** + * The `SubmitEvent` that caused the navigation + */ + event: SubmitEvent; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + } + + /** + * A navigation triggered by back/forward navigation + */ + export interface NavigationPopState extends NavigationBase { + type: 'popstate'; + + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta: number; + + /** + * The `PopStateEvent` that caused the navigation + */ + event: PopStateEvent; + } + + /** + * A navigation triggered by a link click + */ + export interface NavigationLink extends NavigationBase { + type: 'link'; + + /** + * The `PointerEvent` that caused the navigation + */ + event: PointerEvent; + + // TODO 3.0 remove this property, so that it only exists when type is 'popstate' + // (would possibly be a breaking change to do it prior to that) + /** + * In case of a history back/forward navigation, the number of steps to go back/forward + */ + delta?: undefined; + } + + export type Navigation = + | NavigationExternal + | NavigationFormSubmit + | NavigationPopState + | NavigationLink; + + /** + * The argument passed to [`beforeNavigate`](https://svelte.dev/docs/kit/$app-navigation#beforeNavigate) callbacks. + */ + export type BeforeNavigate = Navigation & { + /** + * Call this to prevent the navigation from starting. + */ + cancel: () => void; + }; + + /** + * The argument passed to [`onNavigate`](https://svelte.dev/docs/kit/$app-navigation#onNavigate) callbacks. + */ + export type OnNavigate = Navigation & { + type: Exclude; + /** + * Since `onNavigate` callbacks are called immediately before a client-side navigation, they will never be called with a navigation that unloads the page. + */ + willUnload: false; + }; + + /** + * The argument passed to [`afterNavigate`](https://svelte.dev/docs/kit/$app-navigation#afterNavigate) callbacks. + */ + export type AfterNavigate = (Navigation | NavigationEnter) & { + type: Exclude; + /** + * Since `afterNavigate` callbacks are called after a navigation completes, they will never be called with a navigation that unloads the page. + */ + willUnload: false; + }; + + /** + * The shape of the [`page`](https://svelte.dev/docs/kit/$app-state#page) reactive object and the [`$page`](https://svelte.dev/docs/kit/$app-stores) store. + */ + export interface Page< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null + > { + /** + * The URL of the current page. + */ + url: URL & { pathname: ResolvedPathname }; + /** + * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + */ + params: Params; + /** + * Info about the current route. + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + */ + id: RouteId; + }; + /** + * HTTP status code of the current page. + */ + status: number; + /** + * The error object of the current page, if any. Filled from the `handleError` hooks. + */ + error: App.Error | null; + /** + * The merged result of all data from all `load` functions on the current page. You can type a common denominator through `App.PageData`. + */ + data: App.PageData & Record; + /** + * The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. + */ + state: App.PageState; + /** + * Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info. + */ + form: any; + } + + /** + * The shape of a param matcher. See [matching](https://svelte.dev/docs/kit/advanced-routing#Matching) for more info. + */ + export type ParamMatcher = (param: string) => boolean; + + /** + * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested) + * when called with a regular `query`. `arg` is the validated argument (the input *after* + * the query's schema validated and transformed it, if applicable); `query` is a + * `RemoteQuery` bound to the client's original cache key, so `refresh()` / `set()` will + * update the correct client entry. + */ + export type RequestedEntry = { + arg: Validated; + query: RemoteQuery; + }; + + /** + * A single entry yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested) + * when called with a `query.live`. `arg` is the validated argument; `query` is a + * `RemoteLiveQuery` bound to the client's original cache key, so `reconnect()` targets + * the correct client subscription. + */ + export type LiveRequestedEntry = { + arg: Validated; + query: RemoteLiveQuery; + }; + + export type QueryRequestedResult = Iterable> & + AsyncIterable> & { + /** + * Call `refresh` on all queries selected by this `requested` invocation. + * This is identical to: + * ```ts + * import { requested } from '$app/server'; + * + * for await (const { query } of requested(getPost, ...)) { + * void query.refresh(); + * } + * ``` + */ + refreshAll: () => Promise; + }; + + export type LiveQueryRequestedResult = Iterable< + LiveRequestedEntry + > & + AsyncIterable> & { + /** + * Call `reconnect` on all live queries selected by this `requested` invocation. + * This is identical to: + * ```ts + * import { requested } from '$app/server'; + * + * for await (const { query } of requested(liveQuery, ...)) { + * void query.reconnect(); + * } + * ``` + */ + reconnectAll: () => Promise; + }; + + export type RequestedResult = + | QueryRequestedResult + | LiveQueryRequestedResult; + + export interface RequestEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null + > { + /** + * Get or set cookies related to the current request + */ + cookies: Cookies; + /** + * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features: + * + * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request. + * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context). + * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call. + * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#handle) + * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request. + * + * You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies). + */ + fetch: typeof fetch; + /** + * The client's IP address, set by the adapter. + */ + getClientAddress: () => string; + /** + * Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#handle). + */ + locals: App.Locals; + /** + * The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + params: Params; + /** + * Additional data made available through the adapter. + */ + platform: Readonly | undefined; + /** + * The original request object. + */ + request: Request; + /** + * Info about the current route. + */ + route: { + /** + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + id: RouteId; + }; + /** + * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example: + * + * ```js + * /// file: src/routes/blog/+page.js + * export async function load({ fetch, setHeaders }) { + * const url = `https://cms.example.com/articles.json`; + * const response = await fetch(url); + * + * setHeaders({ + * age: response.headers.get('age'), + * 'cache-control': response.headers.get('cache-control') + * }); + * + * return response.json(); + * } + * ``` + * + * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once. + * + * You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead. + */ + setHeaders: (headers: Record) => void; + /** + * The requested URL. + * + * In the context of a remote function request initiated by the client, this relates to the page the remote function + * was called from, _not_ the URL of the endpoint SvelteKit creates for the remote function. Never use this to determine + * whether or not a user is authorized to access certain data, as these values are part of the request which could be manipulated. + */ + url: URL; + /** + * `true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information + * related to the data request in this case. Use this property instead if the distinction is important to you. + */ + isDataRequest: boolean; + /** + * `true` for `+server.js` calls coming from SvelteKit without the overhead of actually making an HTTP request. This happens when you make same-origin `fetch` requests on the server. + */ + isSubRequest: boolean; + + /** + * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current `handle` hook, `load` function, or form action. */ + current: Span; + }; + + /** + * `true` if the request comes from the client via a remote function. The `url` property will be stripped of the internal information + * related to the data request in this case. Use this property instead if the distinction is important to you. + */ + isRemoteRequest: boolean; + } + + /** + * A `(event: RequestEvent) => Response` function exported from a `+server.js` file that corresponds to an HTTP verb (`GET`, `PUT`, `PATCH`, etc) and handles requests with that method. + * + * It receives `Params` as the first generic argument, which you can skip by using [generated types](https://svelte.dev/docs/kit/types#Generated-types) instead. + */ + export type RequestHandler< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null + > = (event: RequestEvent) => MaybePromise; + + export interface ResolveOptions { + /** + * Applies custom transforms to HTML. If `done` is true, it's the final chunk. Chunks are not guaranteed to be well-formed HTML + * (they could include an element's opening tag but not its closing tag, for example) + * but they will always be split at sensible boundaries such as `%sveltekit.head%` or layout/page components. + * @param input the html chunk and the info if this is the last chunk + */ + transformPageChunk?: (input: { html: string; done: boolean }) => MaybePromise; + /** + * Determines which headers should be included in serialized responses when a `load` function loads a resource with `fetch`. + * By default, none will be included. + * @param name header name + * @param value header value + */ + filterSerializedResponseHeaders?: (name: string, value: string) => boolean; + /** + * Determines what should be added to the `` tag to preload it. + * By default, `js` and `css` files will be preloaded. + * @param input the type of the file and its path + */ + preload?: (input: { type: 'font' | 'css' | 'js' | 'asset'; path: string }) => boolean; + } + + export interface RouteDefinition { + id: string; + api: { + methods: Array; + }; + page: { + methods: Array>; + }; + pattern: RegExp; + prerender: PrerenderOption; + segments: RouteSegment[]; + methods: Array; + config: Config; + } + + export class Server { + constructor(manifest: SSRManifest); + init(options: ServerInitOptions): Promise; + respond(request: Request, options: RequestOptions): Promise; + } + + export interface ServerInitOptions { + /** A map of environment variables. */ + env: Record; + /** A function that turns an asset filename into a `ReadableStream`. Required for the `read` export from `$app/server` to work. */ + read?: (file: string) => MaybePromise; + } + + export interface SSRManifest { + appDir: string; + appPath: string; + /** Static files from `kit.config.files.assets` and the service worker (if any). */ + assets: Set; + mimeTypes: Record; + + /** private fields */ + _: { + client: BuildData['client']; + nodes: SSRNodeLoader[]; + /** hashed filename -> import to that file */ + remotes: Record Promise>; + routes: SSRRoute[]; + prerendered_routes: Set; + matchers: () => Promise>; + /** A `[file]: size` map of all assets imported by server code. */ + server_assets: Record; + }; + } + + /** + * The generic form of `PageServerLoad` and `LayoutServerLoad`. You should import those from `./$types` (see [generated types](https://svelte.dev/docs/kit/types#Generated-types)) + * rather than using `ServerLoad` directly. + */ + export type ServerLoad< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + ParentData extends Record = Record, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null + > = (event: ServerLoadEvent) => MaybePromise; + + export interface ServerLoadEvent< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + ParentData extends Record = Record, + RouteId extends AppRouteId | null = AppRouteId | null + > extends RequestEvent { + /** + * `await parent()` returns data from parent `+layout.server.js` `load` functions. + * + * Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data. + */ + parent: () => Promise; + /** + * This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun. + * + * Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`. + * + * URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding). + * + * Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html). + * + * The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun. + * + * ```js + * /// file: src/routes/+page.js + * let count = 0; + * export async function load({ depends }) { + * depends('increase:count'); + * + * return { count: count++ }; + * } + * ``` + * + * ```html + * /// file: src/routes/+page.svelte + * + * + *

{data.count}

+ * + * ``` + */ + depends: (...deps: string[]) => void; + /** + * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example: + * + * ```js + * /// file: src/routes/+page.js + * export async function load({ untrack, url }) { + * // Untrack url.pathname so that path changes don't trigger a rerun + * if (untrack(() => url.pathname === '/')) { + * return { message: 'Welcome!' }; + * } + * } + * ``` + */ + untrack: (fn: () => T) => T; + + /** + * Access to spans for tracing. If tracing is not enabled, these spans will do nothing. + * @since 2.31.0 + */ + tracing: { + /** Whether tracing is enabled. */ + enabled: boolean; + /** The root span for the request. This span is named `sveltekit.handle.root`. */ + root: Span; + /** The span associated with the current server `load` function. */ + current: Span; + }; + } + + /** + * Shape of a form action method that is part of `export const actions = {...}` in `+page.server.js`. + * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. + */ + export type Action< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null + > = (event: RequestEvent) => MaybePromise; + + /** + * Shape of the `export const actions = {...}` object in `+page.server.js`. + * See [form actions](https://svelte.dev/docs/kit/form-actions) for more information. + */ + export type Actions< + Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, + OutputData extends Record | void = Record | void, + RouteId extends AppRouteId | null = AppRouteId | null + > = Record>; + + /** + * When calling a form action via fetch, the response will be one of these shapes. + * ```svelte + * { + * return ({ result }) => { + * // result is of type ActionResult + * }; + * }} + * ``` + */ + export type ActionResult< + Success extends Record | undefined = Record, + Failure extends Record | undefined = Record + > = + | { type: 'success'; status: number; data?: Success } + | { type: 'failure'; status: number; data?: Failure } + | { type: 'redirect'; status: number; location: string } + | { type: 'error'; status?: number; error: any }; + + /** + * The object returned by the [`error`](https://svelte.dev/docs/kit/@sveltejs-kit#error) function. + */ + export interface HttpError { + /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses), in the range 400-599. */ + status: number; + /** The content of the error. */ + body: App.Error; + } + + /** + * The object returned by the [`redirect`](https://svelte.dev/docs/kit/@sveltejs-kit#redirect) function. + */ + export interface Redirect { + /** The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages), in the range 300-308. */ + status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; + /** The location to redirect to. */ + location: string; + } + + export type SubmitFunction< + Success extends Record | undefined = Record, + Failure extends Record | undefined = Record + > = (input: { + action: URL; + formData: FormData; + formElement: HTMLFormElement; + controller: AbortController; + submitter: HTMLElement | null; + cancel: () => void; + }) => MaybePromise< + | void + | ((opts: { + formData: FormData; + formElement: HTMLFormElement; + action: URL; + result: ActionResult; + /** + * Call this to get the default behavior of a form submission response. + * @param options Set `reset: false` if you don't want the `` values to be reset after a successful submission. + * @param invalidateAll Set `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission. + */ + update: (options?: { reset?: boolean; invalidateAll?: boolean }) => Promise; + }) => MaybePromise) + >; + + /** + * The type of `export const snapshot` exported from a page or layout component. + */ + export interface Snapshot { + capture: () => T; + restore: (snapshot: T) => void; + } + + // If T is unknown or has an index signature, the types below will recurse indefinitely and create giant unions that TS can't handle + type WillRecurseIndefinitely = unknown extends T ? true : string extends keyof T ? true : false; + + // Input type mappings for form fields + type InputTypeMap = { + text: string; + email: string; + password: string; + url: string; + tel: string; + search: string; + number: number; + range: number; + date: string; + 'datetime-local': string; + time: string; + month: string; + week: string; + color: string; + checkbox: boolean | string[]; + radio: string; + file: File; + hidden: string | number | boolean; + submit: string | number | boolean; + button: string; + reset: string; + image: string; + select: string; + 'select multiple': string[]; + 'file multiple': File[]; + }; + + // Valid input types for a given value type + export type RemoteFormFieldType = { + [K in keyof InputTypeMap]: T extends InputTypeMap[K] ? K : never; + }[keyof InputTypeMap]; + + // Input element properties based on type + type InputElementProps = T extends 'checkbox' | 'radio' + ? { + name: string; + type: T; + value?: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get checked(): boolean; + set checked(value: boolean); + readonly defaultChecked?: boolean; + } + : T extends 'file' + ? { + name: string; + type: 'file'; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get files(): FileList | null; + set files(v: FileList | null); + } + : T extends 'select' + ? { + name: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string; + set value(v: string); + } + : T extends 'select multiple' + ? { + name: string; + multiple: true; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string[]; + set value(v: string[]); + } + : T extends 'text' + ? { + name: string; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string | number; + set value(v: string | number); + readonly defaultValue?: string | number; + } + : { + name: string; + type: T; + 'aria-invalid': boolean | 'false' | 'true' | undefined; + get value(): string | number; + set value(v: string | number); + readonly defaultValue?: string | number; + }; + + type RemoteFormFieldMethods = { + /** The values that will be submitted */ + value(): DeepPartial; + /** Set the values that will be submitted */ + set(input: DeepPartial): DeepPartial; + /** Validation issues, if any */ + issues(): RemoteFormIssue[] | undefined; + }; + + // These two types use "T extends unknown ? .. : .." to distribute over unions. + // Example: if "type T = A | b" then "keyof T" only contains keys that both A and B have, with "KeysOfUnion" we get the keys of both A and B + type KeysOfUnion = T extends unknown ? keyof T : never; + type ValueOfUnionKey = T extends unknown + ? K extends keyof T + ? T[K] + : never + : never; + + export type RemoteFormFieldValue = string | string[] | number | boolean | File | File[]; + + type AsArgs = Type extends 'checkbox' + ? Value extends string[] + ? [type: Type, value: Value[number] | (string & {})] + : Value extends boolean + ? [type: Type] | [type: Type, value: boolean] + : [type: Type] | [type: Type, value: Value | (string & {})] + : Type extends 'submit' | 'hidden' + ? Value extends string + ? [type: Type, value: Value | (string & {})] + : [type: Type, value: Value] + : Type extends 'radio' + ? [type: Type, value: Value | (string & {})] + : Type extends 'file' | 'file multiple' + ? [type: Type] + : [type: Type] | [type: Type, value: Value | (string & {})]; + + /** + * Form field accessor type that provides name(), value(), and issues() methods + */ + export type RemoteFormField = RemoteFormFieldMethods & { + /** + * Returns an object that can be spread onto an input element with the correct type attribute, + * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. + * @example + * ```svelte + * + * + * + * ``` + */ + as>(...args: AsArgs): InputElementProps; + }; + + type RemoteFormFieldContainer = RemoteFormFieldMethods & { + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; + }; + + type UnknownField = RemoteFormFieldMethods & { + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; + /** + * Returns an object that can be spread onto an input element with the correct type attribute, + * aria-invalid attribute if the field is invalid, and appropriate value/checked property getters/setters. + * @example + * ```svelte + * + * + * + * ``` + */ + as>(...args: AsArgs): InputElementProps; + } & { + [key: string | number]: UnknownField; + }; + + type RemoteFormFieldsRoot = + IsAny extends true + ? RecursiveFormFields + : Input extends void + ? { + /** Validation issues, if any */ + issues(): RemoteFormIssue[] | undefined; + /** Validation issues belonging to this or any of the fields that belong to it, if any */ + allIssues(): RemoteFormIssue[] | undefined; + } + : RemoteFormFields; + + /** + * Recursive type to build form fields structure with proxy access + */ + export type RemoteFormFields = + WillRecurseIndefinitely extends true + ? RecursiveFormFields + : NonNullable extends string | number | boolean | File + ? RemoteFormField> + : // [NonNullable] is used to prevent distributing over union while still allowing + // nullable wrappers (e.g. `string[] | undefined` from a schema with `.default([])`) + // to be treated as arrays; only the last condition should distribute over unions + [NonNullable] extends [string[] | File[]] + ? RemoteFormField> & { + [K in number]: RemoteFormField[number]>; + } + : [NonNullable] extends [Array] + ? RemoteFormFieldContainer> & { + [K in number]: RemoteFormFields; + } + : RemoteFormFieldContainer & { + [K in KeysOfUnion]-?: RemoteFormFields>; + }; + + // By breaking this out into its own type, we avoid the TS recursion depth limit + type RecursiveFormFields = RemoteFormFieldContainer & { + [key: string | number]: UnknownField; + }; + + type MaybeArray = T | T[]; + + export interface RemoteFormInput { + [key: string]: MaybeArray | undefined; + } + + export interface RemoteFormIssue { + message: string; + path: Array; + } + + // If the schema specifies `id` as a string or number, ensure that `for(...)` + // only accepts that type. Otherwise, accept `string | number` + type ExtractId = Input extends { id: infer Id } + ? Id extends string | number + ? Id + : string | number + : string | number; + + /** + * A function and proxy object used to imperatively create validation errors in form handlers. + * + * Access properties to create field-specific issues: `issue.fieldName('message')`. + * The type structure mirrors the input data structure for type-safe field access. + * Call `invalid(issue.foo(...), issue.nested.bar(...))` to throw a validation error. + */ + export type InvalidField = + WillRecurseIndefinitely extends true + ? Record + : NonNullable extends string | number | boolean | File + ? (message: string) => StandardSchemaV1.Issue + : NonNullable extends Array + ? { + [K in number]: InvalidField; + } & ((message: string) => StandardSchemaV1.Issue) + : NonNullable extends RemoteFormInput + ? { + [K in keyof T]-?: InvalidField; + } & ((message: string) => StandardSchemaV1.Issue) + : Record; + + /** + * A validation error thrown by `invalid`. + */ + export interface ValidationError { + /** The validation issues */ + issues: StandardSchemaV1.Issue[]; + } + + /** + * The form instance as received inside an `enhance` callback. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ + export type RemoteFormEnhanceInstance< + Input extends RemoteFormInput | void = RemoteFormInput | void, + Output = any + > = Omit, 'enhance' | 'element'> & { + readonly element: HTMLFormElement; + }; + + /** + * The callback passed to a remote form's `enhance` method. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ + export type RemoteFormEnhanceCallback< + Input extends RemoteFormInput | void = RemoteFormInput | void, + Output = any + > = (form: RemoteFormEnhanceInstance) => MaybePromise; + + /** + * The type of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + */ + export type RemoteForm = { + /** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */ + [attachment: symbol]: (node: HTMLFormElement) => void; + method: 'POST'; + /** The URL to send the form to. */ + action: string; + /** The `` element this instance is currently attached to, if any. */ + get element(): HTMLFormElement | null; + /** Submit the currently attached form programmatically. */ + submit(): Promise & { + updates: (...updates: RemoteQueryUpdate[]) => Promise; + }; + /** Use the `enhance` method to influence what happens when the form is submitted. */ + enhance(callback: RemoteFormEnhanceCallback): { + method: 'POST'; + action: string; + [attachment: symbol]: (node: HTMLFormElement) => void; + }; + /** + * Create an instance of the form for the given `id`. + * The `id` is stringified and used for deduplication to potentially reuse existing instances. + * Useful when you have multiple forms that use the same remote form action, for example in a loop. + * ```svelte + * {#each todos as todo} + * {@const todoForm = updateTodo.for(todo.id)} + * + * {#if todoForm.result?.invalid}

Invalid data

{/if} + * ... + * + * {/each} + * ``` + */ + for(id: ExtractId): Omit, 'for'>; + /** Preflight checks */ + preflight(schema: StandardSchemaV1): RemoteForm; + /** Validate the form contents programmatically */ + validate(options?: { + /** Set this to `true` to also show validation issues of fields that haven't been touched yet. */ + includeUntouched?: boolean; + /** Set this to `true` to only run the `preflight` validation. */ + preflightOnly?: boolean; + }): Promise; + /** The result of the form submission */ + get result(): Output | undefined; + /** The number of pending submissions */ + get pending(): number; + /** True if the form has been submitted at least once */ + get submitted(): boolean; + /** Access form fields using object notation */ + fields: RemoteFormFieldsRoot; + }; + + /** + * The type of a remote `command` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. + */ + export type RemoteCommand = { + (arg: undefined extends Input ? Input | void : Input): Promise & { + updates(...updates: RemoteQueryUpdate[]): Promise; + }; + /** The number of pending command executions */ + get pending(): number; + }; + + export type RemoteQueryUpdate = + | RemoteQuery + | RemoteLiveQuery + | RemoteQueryFunction + | RemoteLiveQueryFunction + | RemoteQueryOverride; + + export type RemoteResource = Promise & { + /** The error in case the query fails. Most often this is a [`HttpError`](https://svelte.dev/docs/kit/@sveltejs-kit#HttpError) but it isn't guaranteed to be. */ + get error(): any; + /** `true` before the first result is available and during refreshes */ + get loading(): boolean; + } & ( + | { + /** The current value of the query. Undefined until `ready` is `true` */ + get current(): undefined; + ready: false; + } + | { + /** The current value of the query. Undefined until `ready` is `true` */ + get current(): T; + ready: true; + } + ); + + export type RemoteQuery = RemoteResource & { + /** + * On the client, this function will update the value of the query without re-fetching it. + * + * On the server, this can be called in the context of a `command` or `form` and the specified data will accompany the action response back to the client. + * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. + */ + set(value: T): void; + /** + * On the client, this function will re-fetch the query from the server. + * + * On the server, this can be called in the context of a `command` or `form` and the refreshed data will accompany the action response back to the client. + * This prevents SvelteKit needing to refresh all queries on the page in a second server round-trip. + */ + refresh(): Promise; + /** + * Temporarily override a query's value during a [single-flight mutation](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations) to provide optimistic updates. + * + * ```svelte + * + * + *
{ + * await form.submit().updates( + * todos.withOverride((todos) => [...todos, { text: form.fields.text.value() }]) + * ); + * })}> + * + * + *
+ * ``` + */ + withOverride(update: (current: T) => T): RemoteQueryOverride; + }; + + export type RemoteLiveQuery = RemoteResource & + AsyncIterable & { + /** `true` if the live stream is currently connected. */ + readonly connected: boolean; + /** `true` once the current live stream iterator is done. */ + readonly done: boolean; + /** Reconnects the live stream immediately. */ + reconnect(): Promise; + }; + + export type RemoteQueryOverride = () => void; + + /** + * The type of a remote `prerender` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. + */ + export type RemotePrerenderFunction = ( + arg: undefined extends Input ? Input | void : Input + ) => RemoteResource; + + /** + * The return value of a remote `query` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. + * + * The optional `Validated` generic parameter represents the argument type *after* the + * query's schema has validated and (optionally) transformed it — this is the type the + * query's implementation function receives on the server, and the type yielded by + * [`requested`](https://svelte.dev/docs/kit/$app-server#requested). For queries declared + * with [Standard Schema](https://standardschema.dev/) it differs from `Input` when the + * schema contains a transform (e.g. `v.pipe(v.number(), v.transform(String))` has + * `Input = number` but `Validated = string`). For `'unchecked'` validators and queries + * without arguments it defaults to `Input`. + */ + export type RemoteQueryFunction = ( + arg: undefined extends Input ? Input | void : Input + ) => RemoteQuery; + + /** + * The type of a remote `query.live` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.live) for full documentation. + * + * The optional `Validated` generic parameter represents the argument type *after* the + * query's schema has validated and (optionally) transformed it, and matches the type + * yielded by [`requested`](https://svelte.dev/docs/kit/$app-server#requested). + */ + export type RemoteLiveQueryFunction = ( + arg: undefined extends Input ? Input | void : Input + ) => RemoteLiveQuery; + + /** + * [Environment variables](https://svelte.dev/docs/kit/environment-variables) can be configured by exporting + * a `variables` object from `src/env.ts`, using [`defineEnvVars`](https://svelte.dev/docs/kit/@sveltejs-kit-env#defineEnvVars). + */ + export interface EnvVarConfig { + /** + * Whether the environment variable can be accessed by client-side code. + * - if `true`, it can be imported from `$app/env/public` + * - if `false`, it can be imported from `$app/env/private`, which is a [server-only module](https://svelte.dev/docs/kit/server-only-modules) + * @default false + */ + public?: boolean; + /** + * Whether the value is determined at build time or when the app runs. + * - if `true`, the build time value is inlined into the bundle. This enables optimisations like dead-code elimination + * - if `false`, the value is read from the environment when the app starts + * @default false + */ + static?: boolean; + /** + * A [Standard Schema](https://standardschema.dev/) validator that is applied to the value when the app starts. + * The validator can output any value — not necessarily a string — but public, non-static values must be + * serializable by [devalue](https://github.com/sveltejs/devalue) so that they can be sent to the browser. + * + * If omitted, the value must be a non-empty string. + */ + schema?: StandardSchemaV1; + /** + * A description of the variable that will be used for inline documentation on hover. + */ + description?: string; + } + interface AdapterEntry { + /** + * A string that uniquely identifies an HTTP service (e.g. serverless function) and is used for deduplication. + * For example, `/foo/a-[b]` and `/foo/[c]` are different routes, but would both + * be represented in a Netlify _redirects file as `/foo/:param`, so they share an ID + */ + id: string; + + /** + * A function that compares the candidate route with the current route to determine + * if it should be grouped with the current route. + * + * Use cases: + * - Fallback pages: `/foo/[c]` is a fallback for `/foo/a-[b]`, and `/[...catchall]` is a fallback for all routes + * - Grouping routes that share a common `config`: `/foo` should be deployed to the edge, `/bar` and `/baz` should be deployed to a serverless function + */ + filter(route: RouteDefinition): boolean; + + /** + * A function that is invoked once the entry has been created. This is where you + * should write the function to the filesystem and generate redirect manifests. + */ + complete(entry: { generateManifest(opts: { relativePath: string }): string }): MaybePromise; + } + + // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts + // + // MIT License + // + // Copyright (c) 2021-present, Joshua Hemphill + // Copyright (c) 2021, Tecnico Corporation + // + // 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. + + namespace Csp { + type ActionSource = 'strict-dynamic' | 'report-sample'; + type BaseSource = + | 'self' + | 'unsafe-eval' + | 'unsafe-hashes' + | 'unsafe-inline' + | 'unsafe-allow-redirects' + | 'unsafe-webtransport-hashes' + | 'wasm-unsafe-eval' + | 'trusted-types-eval' + | 'none'; + type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`; + type FrameSource = HostSource | SchemeSource | 'self' | 'none'; + type HostNameScheme = `${string}.${string}` | 'localhost'; + type HostSource = `${HostProtocolSchemes}${HostNameScheme}${PortScheme}`; + type HostProtocolSchemes = `${string}://` | ''; + type HttpDelineator = '/' | '?' | '#' | '\\'; + type PortScheme = `:${number}` | '' | ':*'; + type SchemeSource = + | 'http:' + | 'https:' + | 'ws:' + | 'wss:' + | 'data:' + | 'mediastream:' + | 'blob:' + | 'filesystem:' + | (`${string}:` & {}); + type Source = HostSource | SchemeSource | CryptoSource | BaseSource; + type Sources = Source[]; + } + + interface CspDirectives { + 'child-src'?: Csp.Sources; + 'default-src'?: Array; + 'frame-src'?: Csp.Sources; + 'worker-src'?: Csp.Sources; + 'connect-src'?: Csp.Sources; + 'font-src'?: Csp.Sources; + 'img-src'?: Csp.Sources; + 'manifest-src'?: Csp.Sources; + 'media-src'?: Csp.Sources; + 'object-src'?: Csp.Sources; + 'prefetch-src'?: Csp.Sources; + 'script-src'?: Array; + 'script-src-elem'?: Csp.Sources; + 'script-src-attr'?: Csp.Sources; + 'style-src'?: Array; + 'style-src-elem'?: Csp.Sources; + 'style-src-attr'?: Csp.Sources; + 'base-uri'?: Array; + sandbox?: Array< + | 'allow-downloads-without-user-activation' + | 'allow-forms' + | 'allow-modals' + | 'allow-orientation-lock' + | 'allow-pointer-lock' + | 'allow-popups' + | 'allow-popups-to-escape-sandbox' + | 'allow-presentation' + | 'allow-same-origin' + | 'allow-scripts' + | 'allow-storage-access-by-user-activation' + | 'allow-top-navigation' + | 'allow-top-navigation-by-user-activation' + >; + 'form-action'?: Array; + 'frame-ancestors'?: Array; + 'navigate-to'?: Array; + 'report-uri'?: string[]; + 'report-to'?: string[]; + + 'require-trusted-types-for'?: Array<'script'>; + 'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>; + 'upgrade-insecure-requests'?: boolean; + + /** @deprecated */ + 'require-sri-for'?: Array<'script' | 'style' | 'script style'>; + + /** @deprecated */ + 'block-all-mixed-content'?: boolean; + + /** @deprecated */ + 'plugin-types'?: Array<`${string}/${string}` | 'none'>; + + /** @deprecated */ + referrer?: Array< + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url' + | 'none' + >; + } + + type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS'; + + interface Logger { + (msg: string): void; + success(msg: string): void; + error(msg: string): void; + warn(msg: string): void; + minor(msg: string): void; + info(msg: string): void; + } + + type MaybePromise = T | Promise; + + interface Prerendered { + /** + * A map of `path` to `{ file }` objects, where a path like `/foo` corresponds to `foo.html` and a path like `/bar/` corresponds to `bar/index.html`. + */ + pages: Map< + string, + { + /** The location of the .html file relative to the output directory */ + file: string; + } + >; + /** + * A map of `path` to `{ type }` objects. + */ + assets: Map< + string, + { + /** The MIME type of the asset */ + type: string; + } + >; + /** + * A map of redirects encountered during prerendering. + */ + redirects: Map< + string, + { + status: number; + location: string; + } + >; + /** An array of prerendered paths (without trailing slashes, regardless of the trailingSlash config) */ + paths: string[]; + } + + interface PrerenderHttpErrorHandler { + (details: { + status: number; + path: string; + referrer: string | null; + referenceType: 'linked' | 'fetched'; + message: string; + }): void; + } + + interface PrerenderMissingIdHandler { + (details: { path: string; id: string; referrers: string[]; message: string }): void; + } + + interface PrerenderEntryGeneratorMismatchHandler { + (details: { generatedFromId: string; entry: string; matchedId: string; message: string }): void; + } + + interface PrerenderUnseenRoutesHandler { + (details: { routes: string[]; message: string }): void; + } + + interface PrerenderInvalidUrlHandler { + (details: { href: string; referrer: string | null; message: string }): void; + } + + type PrerenderHttpErrorHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderHttpErrorHandler; + type PrerenderMissingIdHandlerValue = 'fail' | 'warn' | 'ignore' | PrerenderMissingIdHandler; + type PrerenderUnseenRoutesHandlerValue = + | 'fail' + | 'warn' + | 'ignore' + | PrerenderUnseenRoutesHandler; + type PrerenderEntryGeneratorMismatchHandlerValue = + | 'fail' + | 'warn' + | 'ignore' + | PrerenderEntryGeneratorMismatchHandler; + type PrerenderInvalidUrlHandlerValue = + | 'fail' + | 'warn' + | 'ignore' + | PrerenderInvalidUrlHandler; + + export type PrerenderOption = boolean | 'auto'; + + interface RequestOptions { + getClientAddress(): string; + platform?: App.Platform; + } + + interface RouteSegment { + content: string; + dynamic: boolean; + rest: boolean; + } + + /** @default 'never' */ + type TrailingSlash = 'never' | 'always' | 'ignore'; + + type DeepPartial = T extends Record | unknown[] + ? { + [K in keyof T]?: T[K] extends Record | unknown[] + ? DeepPartial + : T[K]; + } + : T | undefined; + + type IsAny = 0 extends 1 & T ? true : false; + interface Asset { + file: string; + size: number; + type: string | null; + } + + interface BuildData { + app_dir: string; + app_path: string; + manifest_data: ManifestData; + out_dir: string; + service_worker: string | null; + client: { + /** Path to the client entry point. */ + start: string; + /** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'`. */ + app?: string; + /** JS files that the client entry point relies on. */ + imports: string[]; + /** + * JS files that represent the entry points of the layouts/pages. + * An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file). + * Only set in case of `router.resolution === 'server'`. + */ + nodes?: Array; + /** + * CSS files referenced in the entry points of the layouts/pages. + * An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file) or if has no CSS. + * Only set in case of `router.resolution === 'server'`. + */ + css?: Array; + /** + * Contains the client route manifest in a form suitable for the server which is used for server-side route resolution. + * Notably, it contains all routes, regardless of whether they are prerendered or not (those are missing in the optimized server route manifest). + * Only set in case of `router.resolution === 'server'`. + */ + routes?: SSRClientRoute[]; + stylesheets: string[]; + fonts: string[]; + /** + * Whether the client uses public dynamic env vars — `$env/dynamic/public` or `$app/env/public`. + */ + uses_env_dynamic_public: boolean; + /** Only set in case of `bundleStrategy === 'inline'`. */ + inline?: { + script: string; + style: string | undefined; + }; + } | null; + server_manifest: import('vite').Manifest; + } + + interface ManifestData { + /** Static files from `kit.config.files.assets`. */ + assets: Asset[]; + hooks: { + client: string | null; + server: string | null; + universal: string | null; + }; + nodes: PageNode[]; + routes: RouteData[]; + matchers: Record; + } + + interface PageNode { + depth: number; + /** The `+page/layout.svelte`. */ + component?: string; // TODO supply default component if it's missing (bit of an edge case) + /** The `+page/layout.js/.ts`. */ + universal?: string; + /** The `+page/layout.server.js/ts`. */ + server?: string; + parent_id?: string; + parent?: PageNode; + /** Filled with the pages that reference this layout (if this is a layout). */ + child_pages?: PageNode[]; + /** The final page options for a node if it was statically analysable */ + page_options?: PageOptions | null; + } + + type RecursiveRequired = { + // Recursive implementation of TypeScript's Required utility type. + // Will recursively continue until it reaches a primitive or Function + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + [K in keyof T]-?: Extract extends never // If it does not have a Function type + ? RecursiveRequired // recursively continue through. + : T[K]; // Use the exact type for everything else + }; + + interface RouteParam { + name: string; + matcher: string; + optional: boolean; + rest: boolean; + chained: boolean; + } + + /** + * Represents a route segment in the app. It can either be an intermediate node + * with only layout/error pages, or a leaf, at which point either `page` and `leaf` + * or `endpoint` is set. + */ + interface RouteData { + id: string; + parent: RouteData | null; + + segment: string; + pattern: RegExp; + params: RouteParam[]; + + layout: PageNode | null; + error: PageNode | null; + leaf: PageNode | null; + + page: { + layouts: Array; + errors: Array; + leaf: number; + } | null; + + endpoint: { + file: string; + /** The final page options for the endpoint if it was statically analysable */ + page_options: PageOptions | null; + } | null; + } + + interface SSRComponent { + default: { + render( + props: Record, + opts: { context: Map; csp?: { nonce?: string; hash?: boolean } } + ): { + html: string; + head: string; + css: { + code: string; + map: any; // TODO + }; + /** Until we require all Svelte versions that support hashes, this might not be defined */ + hashes?: { + script: Array<`sha256-${string}`>; + }; + }; + }; + } + + type SSRComponentLoader = () => Promise; + + interface UniversalNode { + /** Is `null` in case static analysis succeeds but the node is ssr=false */ + load?: Load; + prerender?: PrerenderOption; + ssr?: boolean; + csr?: boolean; + trailingSlash?: TrailingSlash; + config?: any; + entries?: PrerenderEntryGenerator; + } + + interface ServerNode { + load?: ServerLoad; + prerender?: PrerenderOption; + ssr?: boolean; + csr?: boolean; + trailingSlash?: TrailingSlash; + actions?: Actions; + config?: any; + entries?: PrerenderEntryGenerator; + } + + interface SSRNode { + /** index into the `nodes` array in the generated `client/app.js`. */ + index: number; + /** external JS files that are loaded on the client. `imports[0]` is the entry point (e.g. `client/nodes/0.js`) */ + imports: string[]; + /** external CSS files that are loaded on the client */ + stylesheets: string[]; + /** external font files that are loaded on the client */ + fonts: string[]; + + universal_id?: string; + server_id?: string; + + /** + * During development, all styles are inlined for the page to avoid FOUC. + * But in production, this stores styles that are below the inline threshold + */ + inline_styles?(): MaybePromise< + Record string)> + >; + /** Svelte component */ + component?: SSRComponentLoader; + /** +page.js or +layout.js */ + universal?: UniversalNode; + /** +page.server.js, +layout.server.js, or +server.js */ + server?: ServerNode; + } + + type SSRNodeLoader = () => Promise; + + interface PageNodeIndexes { + errors: Array; + layouts: Array; + leaf: number; + } + + type PrerenderEntryGenerator = () => MaybePromise>>; + + type SSREndpoint = Partial> & { + prerender?: PrerenderOption; + trailingSlash?: TrailingSlash; + config?: any; + entries?: PrerenderEntryGenerator; + fallback?: RequestHandler; + }; + + interface SSRRoute { + id: string; + pattern: RegExp; + params: RouteParam[]; + page: PageNodeIndexes | null; + endpoint: (() => Promise) | null; + endpoint_id?: string; + } + + interface SSRClientRoute { + id: string; + pattern: RegExp; + params: RouteParam[]; + errors: Array; + layouts: Array<[has_server_load: boolean, node_id: number] | undefined>; + leaf: [has_server_load: boolean, node_id: number]; + } + + type ValidatedConfig = Config & { + kit: ValidatedKitConfig; + extensions: string[]; + }; + + type ValidatedKitConfig = Omit, 'adapter'> & { + adapter?: Adapter; + }; + /** + * Throws an error with a HTTP status code and an optional message. + * When called during request handling, this will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. + * @throws {Error} If the provided status is invalid (not between 400 and 599). + */ + export function error(status: number, body: App.Error): never; + /** + * Throws an error with a HTTP status code and an optional message. + * When called during request handling, this will cause SvelteKit to + * return an error response without invoking `handleError`. + * Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it. + * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property. + * @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling. + * @throws {Error} If the provided status is invalid (not between 400 and 599). + */ + export function error(status: number, body?: { + message: string; + } extends App.Error ? App.Error | string | undefined : never): never; + /** + * Checks whether this is an error thrown by {@link error}. + * @param status The status to filter for. + * */ + export function isHttpError(e: unknown, status?: T): e is (HttpError_1 & { + status: T extends undefined ? never : T; + }); + /** + * Redirect a request. When called during request handling, SvelteKit will return a redirect response. + * Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it. + * + * Most common status codes: + * * `303 See Other`: redirect as a GET request (often used after a form POST request) + * * `307 Temporary Redirect`: redirect will keep the request method + * * `308 Permanent Redirect`: redirect will keep the request method, SEO will be transferred to the new page + * + * [See all redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages) + * + * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308. + * @param location The location to redirect to. + * @throws {Redirect} This error instructs SvelteKit to redirect to the specified location. + * @throws {Error} If the provided status is invalid or the location cannot be used as a header value. + * */ + export function redirect(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | ({} & number), location: string | URL): never; + /** + * Checks whether this is a redirect thrown by {@link redirect}. + * @param e The object to check. + * */ + export function isRedirect(e: unknown): e is Redirect_1; + /** + * Create a JSON `Response` object from the supplied data. + * @param data The value that will be serialized as JSON. + * @param init Options such as `status` and `headers` that will be added to the response. `Content-Type: application/json` and `Content-Length` headers will be added automatically. + */ + export function json(data: any, init?: ResponseInit): Response; + /** + * Create a `Response` object from the supplied body. + * @param body The value that will be used as-is. + * @param init Options such as `status` and `headers` that will be added to the response. A `Content-Length` header will be added automatically. + */ + export function text(body: string, init?: ResponseInit): Response; + /** + * Create an `ActionFailure` object. Call when form submission fails. + * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * */ + export function fail(status: number): ActionFailure; + /** + * Create an `ActionFailure` object. Call when form submission fails. + * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599. + * @param data Data associated with the failure (e.g. validation errors) + * */ + export function fail(status: number, data: T): ActionFailure; + /** + * Checks whether this is an action failure thrown by {@link fail}. + * @param e The object to check. + * */ + export function isActionFailure(e: unknown): e is ActionFailure; + /** + * Use this to throw a validation error to imperatively fail form validation. + * Can be used in combination with `issue` passed to form actions to create field-specific issues. + * + * @example + * ```ts + * import { invalid } from '@sveltejs/kit'; + * import { form } from '$app/server'; + * import { tryLogin } from '$lib/server/auth'; + * import * as v from 'valibot'; + * + * export const login = form( + * v.object({ name: v.string(), _password: v.string() }), + * async ({ name, _password }) => { + * const success = tryLogin(name, _password); + * if (!success) { + * invalid('Incorrect username or password'); + * } + * + * // ... + * } + * ); + * ``` + * @since 2.47.3 + */ + export function invalid(...issues: (StandardSchemaV1.Issue | string)[]): never; + /** + * Checks whether this is an validation error thrown by {@link invalid}. + * @param e The object to check. + * @since 2.47.3 + */ + export function isValidationError(e: unknown): e is ActionFailure; + /** + * Strips possible SvelteKit-internal suffixes and trailing slashes from the URL pathname. + * Returns the normalized URL as well as a method for adding the potential suffix back + * based on a new pathname (possibly including search) or URL. + * ```js + * import { normalizeUrl } from '@sveltejs/kit'; + * + * const { url, denormalize } = normalizeUrl('/blog/post/__data.json'); + * console.log(url.pathname); // /blog/post + * console.log(denormalize('/blog/post/a')); // /blog/post/a/__data.json + * ``` + * @since 2.18.0 + */ + export function normalizeUrl(url: URL | string): { + url: URL; + wasNormalized: boolean; + denormalize: (url?: string | URL) => URL; + }; + export type LessThan = TNumber extends TArray["length"] ? TArray[number] : LessThan; + export type NumericRange = Exclude, LessThan>; + type ValidPageOption = (typeof valid_page_options_array)[number]; + + type PageOptions = Partial<{ + [K in ValidPageOption]: K extends 'ssr' | 'csr' + ? boolean + : K extends 'prerender' + ? PrerenderOption + : K extends 'trailingSlash' + ? TrailingSlash + : any; + }>; + export const VERSION: string; + class HttpError_1 { + + constructor(status: number, body: { + message: string; + } extends App.Error ? (App.Error | string | undefined) : App.Error); + status: number; + body: App.Error; + toString(): string; + } + class Redirect_1 { + + constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string); + status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; + location: string; + } + const valid_page_options_array: readonly ["ssr", "prerender", "csr", "trailingSlash", "config", "entries", "load"]; + + export {}; +} + +declare module '@sveltejs/kit/env' { + import type { EnvVarConfig } from '@sveltejs/kit'; + /** + * Utility for defining [environment variables](https://svelte.dev/docs/kit/environment-variables), + * which are made available via `$app/env/public` and `$app/env/private`. + * */ + export function defineEnvVars>>(variables: T): T; + + export {}; +} + +declare module '@sveltejs/kit/hooks' { + import type { EnvVarConfig, Handle } from '@sveltejs/kit'; + /** + * Utility for defining [environment variables](https://svelte.dev/docs/kit/environment-variables), + * which are made available via `$app/env/public` and `$app/env/private`. + * @deprecated Import `defineEnvVars` from `@sveltejs/kit/env` instead + */ + export function defineEnvVars>>(variables: T): T; + /** + * A helper function for sequencing multiple `handle` calls in a middleware-like manner. + * The behavior for the `handle` options is as follows: + * - `transformPageChunk` is applied in reverse order and merged + * - `preload` is applied in forward order, the first option "wins" and no `preload` options after it are called + * - `filterSerializedResponseHeaders` behaves the same as `preload` + * + * ```js + * /// file: src/hooks.server.js + * import { sequence } from '@sveltejs/kit/hooks'; + * + * /// type: import('@sveltejs/kit').Handle + * async function first({ event, resolve }) { + * console.log('first pre-processing'); + * const result = await resolve(event, { + * transformPageChunk: ({ html }) => { + * // transforms are applied in reverse order + * console.log('first transform'); + * return html; + * }, + * preload: () => { + * // this one wins as it's the first defined in the chain + * console.log('first preload'); + * return true; + * } + * }); + * console.log('first post-processing'); + * return result; + * } + * + * /// type: import('@sveltejs/kit').Handle + * async function second({ event, resolve }) { + * console.log('second pre-processing'); + * const result = await resolve(event, { + * transformPageChunk: ({ html }) => { + * console.log('second transform'); + * return html; + * }, + * preload: () => { + * console.log('second preload'); + * return true; + * }, + * filterSerializedResponseHeaders: () => { + * // this one wins as it's the first defined in the chain + * console.log('second filterSerializedResponseHeaders'); + * return true; + * } + * }); + * console.log('second post-processing'); + * return result; + * } + * + * export const handle = sequence(first, second); + * ``` + * + * The example above would print: + * + * ``` + * first pre-processing + * first preload + * second pre-processing + * second filterSerializedResponseHeaders + * second transform + * first transform + * second post-processing + * first post-processing + * ``` + * + * @param handlers The chain of `handle` functions + * */ + export function sequence(...handlers: Handle[]): Handle; + + export {}; +} + +declare module '@sveltejs/kit/node' { + export function getRequest({ request, base, bodySizeLimit }: { + request: import("http").IncomingMessage; + base: string; + bodySizeLimit?: number; + }): Promise; + + export function setResponse(res: import("http").ServerResponse, response: Response): Promise; + /** + * Converts a file on disk to a readable stream + * @since 2.4.0 + */ + export function createReadableStream(file: string): ReadableStream; + + export {}; +} + +declare module '@sveltejs/kit/node/polyfills' { + /** + * Make various web APIs available as globals: + * - `crypto` + * - `File` + */ + export function installPolyfills(): void; + + export {}; +} + +declare module '@sveltejs/kit/vite' { + import type { KitConfig } from '@sveltejs/kit'; + import type { Options, SvelteConfig } from '@sveltejs/vite-plugin-svelte'; + import type { Plugin } from 'vite'; + /** + * Returns the SvelteKit Vite plugins. + * Since version 2.62.0 you can pass [configuration](configuration) directly, in which case `svelte.config.js` is ignored. + * Any options that don't belong to SvelteKit are passed through to `vite-plugin-svelte`. + * */ + export function sveltekit(config?: KitConfig & Omit & Pick): Promise; + + export {}; +} + +declare module '$app/env' { + /** + * `true` if the app is running in the browser. + */ + export const browser: boolean; + + /** + * Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`. + */ + export const dev: boolean; + + /** + * SvelteKit analyses your app during the `build` step by running it. During this process, `building` is `true`. This also applies during prerendering. + */ + export const building: boolean; + + /** + * The value of `config.kit.version.name`. + */ + export const version: string; + + export {}; +} + +declare module '$app/environment' { + /** + * `true` if the app is running in the browser. + */ + export const browser: boolean; + + /** + * Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`. + */ + export const dev: boolean; + + /** + * SvelteKit analyses your app during the `build` step by running it. During this process, `building` is `true`. This also applies during prerendering. + */ + export const building: boolean; + + /** + * The value of `config.kit.version.name`. + */ + export const version: string; + + export {}; +} + +declare module '$app/forms' { + /** + * Use this function to deserialize the response from a form submission. + * Usage: + * + * ```js + * import { deserialize } from '$app/forms'; + * + * async function handleSubmit(event) { + * const response = await fetch('/form?/action', { + * method: 'POST', + * body: new FormData(event.target) + * }); + * + * const result = deserialize(await response.text()); + * // ... + * } + * ``` + * */ + export function deserialize | undefined, Failure extends Record | undefined>(result: string): import("@sveltejs/kit").ActionResult; + /** + * This action enhances a `
` element that otherwise would work without JavaScript. + * + * The `submit` function is called upon submission with the given FormData and the `action` that should be triggered. + * If `cancel` is called, the form will not be submitted. + * You can use the abort `controller` to cancel the submission in case another one starts. + * If a function is returned, that function is called with the response from the server. + * If nothing is returned, the fallback will be used. + * + * If this function or its return value isn't set, it + * - falls back to updating the `form` prop with the returned data if the action is on the same page as the form + * - updates `page.status` + * - resets the `` element and invalidates all data in case of successful submission with no redirect response + * - redirects in case of a redirect response + * - redirects to the nearest error page in case of an unexpected error + * + * If you provide a custom function with a callback and want to use the default behavior, invoke `update` in your callback. + * It accepts an options object + * - `reset: false` if you don't want the `` values to be reset after a successful submission + * - `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission + * @param form_element The form element + * @param submit Submit callback + */ + export function enhance | undefined, Failure extends Record | undefined>(form_element: HTMLFormElement, submit?: import("@sveltejs/kit").SubmitFunction): { + destroy(): void; + }; + /** + * This action updates the `form` property of the current page with the given data and updates `page.status`. + * In case of an error, it redirects to the nearest error page. + * */ + export function applyAction | undefined, Failure extends Record | undefined>(result: import("@sveltejs/kit").ActionResult): Promise; + + export {}; +} + +declare module '$app/navigation' { + /** + * A lifecycle function that runs the supplied `callback` when the current component mounts, and also whenever we navigate to a URL. + * + * `afterNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * */ + export function afterNavigate(callback: (navigation: import("@sveltejs/kit").AfterNavigate) => void): void; + /** + * A navigation interceptor that triggers before we navigate to a URL, whether by clicking a link, calling `goto(...)`, or using the browser back/forward controls. + * + * Calling `cancel()` will prevent the navigation from completing. If `navigation.type === 'leave'` — meaning the user is navigating away from the app (or closing the tab) — calling `cancel` will trigger the native browser unload confirmation dialog. In this case, the navigation may or may not be cancelled depending on the user's response. + * + * When a navigation isn't to a SvelteKit-owned route (and therefore controlled by SvelteKit's client-side router), `navigation.to.route.id` will be `null`. + * + * If the navigation will (if not cancelled) cause the document to unload — in other words `'leave'` navigations and `'link'` navigations where `navigation.to.route === null` — `navigation.willUnload` is `true`. + * + * `beforeNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * */ + export function beforeNavigate(callback: (navigation: import("@sveltejs/kit").BeforeNavigate) => void): void; + /** + * A lifecycle function that runs the supplied `callback` immediately before we navigate to a new URL except during full-page navigations. + * + * If you return a `Promise`, SvelteKit will wait for it to resolve before completing the navigation. This allows you to — for example — use `document.startViewTransition`. Avoid promises that are slow to resolve, since navigation will appear stalled to the user. + * + * If a function (or a `Promise` that resolves to a function) is returned from the callback, it will be called once the DOM has updated. + * + * `onNavigate` must be called during a component initialization. It remains active as long as the component is mounted. + * */ + export function onNavigate(callback: (navigation: import("@sveltejs/kit").OnNavigate) => MaybePromise<(() => void) | void>): void; + /** + * If called when the page is being updated following a navigation (in `onMount` or `afterNavigate` or an action, for example), this disables SvelteKit's built-in scroll handling. + * This is generally discouraged, since it breaks user expectations. + * */ + export function disableScrollHandling(): void; + /** + * Allows you to navigate programmatically to a given route, with options such as keeping the current element focused. + * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`. + * + * For external URLs, use `window.location = url` instead of calling `goto(url)`. + * + * @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app. + * @param {Object} opts Options related to the navigation + * */ + export function goto(url: string | URL, opts?: { + replaceState?: boolean | undefined; + noScroll?: boolean | undefined; + keepFocus?: boolean | undefined; + invalidateAll?: boolean | undefined; + invalidate?: (string | URL | ((url: URL) => boolean))[] | undefined; + state?: App.PageState | undefined; + }): Promise; + /** + * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated. + * + * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters). + * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL. + * + * The `function` argument can be used define a custom predicate. It receives the full `URL` and causes `load` to rerun if `true` is returned. + * This can be useful if you want to invalidate based on a pattern instead of a exact match. + * + * ```ts + * // Example: Match '/path' regardless of the query parameters + * import { invalidate } from '$app/navigation'; + * + * invalidate((url) => url.pathname === '/path'); + * ``` + * @param resource The invalidated URL + * */ + export function invalidate(resource: string | URL | ((url: URL) => boolean)): Promise; + /** + * Causes all `load` and `query` functions belonging to the currently active page to re-run. Returns a `Promise` that resolves when the page is subsequently updated. + * */ + export function invalidateAll(): Promise; + /** + * Causes all currently active remote functions to refresh, and all `load` functions belonging to the currently active page to re-run (unless disabled via the option argument). + * Returns a `Promise` that resolves when the page is subsequently updated. + * */ + export function refreshAll({ includeLoadFunctions }?: { + includeLoadFunctions?: boolean; + }): Promise; + /** + * Programmatically preloads the given page, which means + * 1. ensuring that the code for the page is loaded, and + * 2. calling the page's load function with the appropriate options. + * + * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `` element with `data-sveltekit-preload-data`. + * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous. + * Returns a Promise that resolves with the result of running the new route's `load` functions once the preload is complete. + * + * @param href Page to preload + * */ + export function preloadData(href: string): Promise<{ + type: "loaded"; + status: number; + data: Record; + } | { + type: "redirect"; + location: string; + }>; + /** + * Programmatically imports the code for routes that haven't yet been fetched. + * Typically, you might call this to speed up subsequent navigation. + * + * You can specify routes by any matching pathname such as `/about` (to match `src/routes/about/+page.svelte`) or `/blog/*` (to match `src/routes/blog/[slug]/+page.svelte`). + * + * Unlike `preloadData`, this won't call `load` functions. + * Returns a Promise that resolves when the modules have been imported. + * + * */ + export function preloadCode(pathname: string): Promise; + /** + * Programmatically create a new history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). + * + * */ + export function pushState(url: string | URL, state: App.PageState): void; + /** + * Programmatically replace the current history entry with the given `page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing). + * + * */ + export function replaceState(url: string | URL, state: App.PageState): void; + type MaybePromise = T | Promise; + + export {}; +} + +declare module '$app/paths' { + import type { RouteIdWithSearchOrHash, PathnameWithSearchOrHash, ResolvedPathname, RouteId, RouteParams, Asset, Pathname } from '$app/types'; + /** + * A string that matches [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths). + * + * Example usage: `Link` + * + * @deprecated Use [`resolve(...)`](https://svelte.dev/docs/kit/$app-paths#resolve) instead + */ + export let base: '' | `/${string}`; + + /** + * An absolute path that matches [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths). + * + * > [!NOTE] If a value for `config.kit.paths.assets` is specified, it will be replaced with `'/_svelte_kit_assets'` during `vite dev` or `vite preview`, since the assets don't yet live at their eventual URL. + * + * @deprecated Use [`asset(...)`](https://svelte.dev/docs/kit/$app-paths#asset) instead + */ + export let assets: '' | `https://${string}` | `http://${string}` | '/_svelte_kit_assets'; + + /** + * @deprecated Use [`resolve(...)`](https://svelte.dev/docs/kit/$app-paths#resolve) instead + */ + export function resolveRoute( + ...args: ResolveArgs + ): ResolvedPathname; + type StripSearchOrHash = T extends `${infer Pathname}?${string}` + ? Pathname + : T extends `${infer Pathname}#${string}` + ? Pathname + : T; + + type ResolveArgs = + T extends RouteId + ? RouteParams extends Record + ? [route: T] + : [route: T, params: RouteParams] + : StripSearchOrHash extends infer U extends RouteId + ? RouteParams extends Record + ? [route: T] + : [route: T, params: RouteParams] + : [route: T]; + /** + * Resolve the URL of an asset in your `static` directory, by prefixing it with [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths) if configured, or otherwise by prefixing it with the base path. + * + * During server rendering, the base path is relative and depends on the page currently being rendered. + * + * @example + * ```svelte + * + * + * a potato + * ``` + * @since 2.26 + * + * */ + export function asset(file: Asset): string; + /** + * Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters. + * + * During server rendering, the base path is relative and depends on the page currently being rendered. + * + * @example + * ```js + * import { resolve } from '$app/paths'; + * + * // using a pathname + * const resolved = resolve(`/blog/hello-world`); + * + * // using a route ID plus parameters + * const resolved = resolve('/blog/[slug]', { + * slug: 'hello-world' + * }); + * ``` + * @since 2.26 + * + * */ + export function resolve(...args: ResolveArgs): ResolvedPathname; + /** + * Match a path or URL to a route ID and extracts any parameters. + * + * @example + * ```js + * import { match } from '$app/paths'; + * + * const route = await match('/blog/hello-world'); + * + * if (route?.id === '/blog/[slug]') { + * const slug = route.params.slug; + * const response = await fetch(`/api/posts/${slug}`); + * const post = await response.json(); + * } + * ``` + * @since 2.52.0 + * + * */ + export function match(url: Pathname | URL | (string & {})): Promise<{ + id: RouteId; + params: Record; + } | null>; + + export {}; +} + +declare module '$app/server' { + import type { RequestEvent, RemoteCommand, RemoteForm, RemoteFormInput, InvalidField, RemotePrerenderFunction, RemoteQueryFunction, RemoteLiveQueryFunction, QueryRequestedResult, LiveQueryRequestedResult } from '@sveltejs/kit'; + import type { StandardSchemaV1 } from '@standard-schema/spec'; + /** + * Read the contents of an imported asset from the filesystem + * @example + * ```js + * import { read } from '$app/server'; + * import somefile from './somefile.txt'; + * + * const asset = read(somefile); + * const text = await asset.text(); + * ``` + * @since 2.4.0 + */ + export function read(asset: string): Response; + /** + * Returns the current `RequestEvent`. Can be used inside server hooks, server `load` functions, actions, and endpoints (and functions called by them). + * + * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). + * @since 2.20.0 + * + * */ + export function getRequestEvent(): RequestEvent; + /** + * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. + * + * @since 2.27 + */ + export function command(fn: () => MaybePromise): RemoteCommand; + /** + * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. + * + * @since 2.27 + */ + export function command(validate: "unchecked", fn: (arg: Input) => MaybePromise): RemoteCommand; + /** + * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#command) for full documentation. + * + * @since 2.27 + */ + export function command(validate: Schema, fn: (arg: StandardSchemaV1.InferOutput) => MaybePromise): RemoteCommand, Output>; + /** + * Creates a form object that can be spread onto a `` element. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + * + * @since 2.27 + */ + export function form(fn: () => MaybePromise): RemoteForm; + /** + * Creates a form object that can be spread onto a `` element. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + * + * @since 2.27 + */ + export function form(validate: "unchecked", fn: (data: Input, issue: InvalidField) => MaybePromise): RemoteForm; + /** + * Creates a form object that can be spread onto a `` element. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation. + * + * @since 2.27 + */ + export function form>, Output>(validate: true extends HasNonOptionalBoolean> ? "Error: All booleans in form schemas must be optional (e.g. `v.optional(v.boolean(), false)`) because checkbox inputs do not send a false value when unchecked." : Schema, fn: (data: StandardSchemaV1.InferOutput, issue: InvalidField>) => MaybePromise): RemoteForm, Output>; + /** + * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. + * + * @since 2.27 + */ + export function prerender(fn: () => MaybePromise, options?: { + inputs?: RemotePrerenderInputsGenerator; + dynamic?: boolean; + } | undefined): RemotePrerenderFunction; + /** + * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. + * + * @since 2.27 + */ + export function prerender(validate: "unchecked", fn: (arg: Input) => MaybePromise, options?: { + inputs?: RemotePrerenderInputsGenerator; + dynamic?: boolean; + } | undefined): RemotePrerenderFunction; + /** + * Creates a remote prerender function. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#prerender) for full documentation. + * + * @since 2.27 + */ + export function prerender(schema: Schema, fn: (arg: StandardSchemaV1.InferOutput) => MaybePromise, options?: { + inputs?: RemotePrerenderInputsGenerator>; + dynamic?: boolean; + } | undefined): RemotePrerenderFunction, Output>; + /** + * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. + * + * @since 2.27 + */ + export function query(fn: () => MaybePromise): RemoteQueryFunction; + /** + * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. + * + * @since 2.27 + */ + export function query(validate: "unchecked", fn: (arg: Input) => MaybePromise): RemoteQueryFunction; + /** + * Creates a remote query. When called from the browser, the function will be invoked on the server via a `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query) for full documentation. + * + * @since 2.27 + */ + export function query(schema: Schema, fn: (arg: StandardSchemaV1.InferOutput) => MaybePromise): RemoteQueryFunction, Output, StandardSchemaV1.InferOutput>; + export namespace query { + /** + * Creates a batch query function that collects multiple calls and executes them in a single request + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.batch) for full documentation. + * + * @since 2.35 + */ + function batch(validate: "unchecked", fn: (args: Input[]) => MaybePromise<(arg: Input, idx: number) => Output>): RemoteQueryFunction; + /** + * Creates a batch query function that collects multiple calls and executes them in a single request + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.batch) for full documentation. + * + * @since 2.35 + */ + function batch(schema: Schema, fn: (args: StandardSchemaV1.InferOutput[]) => MaybePromise<(arg: StandardSchemaV1.InferOutput, idx: number) => Output>): RemoteQueryFunction, Output, StandardSchemaV1.InferOutput>; + /** + * Creates a live remote query. When called from the browser, the function will be invoked on the server via a streaming `fetch` call. + * + * See [Remote functions](https://svelte.dev/docs/kit/remote-functions#query.live) for full documentation. + * + * */ + function live(fn: (arg: void) => RemoteLiveQueryUserFunctionReturnType): RemoteLiveQueryFunction; + + function live(validate: "unchecked", fn: (arg: Input) => RemoteLiveQueryUserFunctionReturnType): RemoteLiveQueryFunction; + + function live(schema: Schema, fn: (arg: StandardSchemaV1.InferOutput) => RemoteLiveQueryUserFunctionReturnType): RemoteLiveQueryFunction, Output, StandardSchemaV1.InferOutput>; + } + /** + * Inside a remote `command` or `form` callback, returns an iterable + * of `{ arg, query }` entries for the query instances the client asked to refresh, up to + * the supplied `limit`. Each `query` is a `RemoteQuery` bound to the original + * client-side cache key, so `refresh()` / `set()` propagate correctly even when + * the query's schema transforms the input. `arg` is the *validated* argument, + * i.e. the value after the schema has run (so `InferOutput` for queries + * declared with a Standard Schema). + * + * Arguments that fail validation or exceed `limit` are recorded as failures in + * the response to the client. + * See [Client-requested refreshes](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations-Client-requested-refreshes) + * for usage in a remote `command` or `form`. + * + * @example + * ```ts + * import { requested } from '$app/server'; + * + * for (const { arg, query } of requested(getPost, 5)) { + * // `arg` is the validated argument; `query` is bound to the client's + * // cache key. It's safe to throw away this promise -- SvelteKit will + * // await it and forward any errors to the client. + * void query.refresh(); + * } + * ``` + * + * As a shorthand for the above, you can also call `refreshAll` on the result: + * + * @example + * ```ts + * import { requested } from '$app/server'; + * + * await requested(getPost, 5).refreshAll(); + * ``` + * + * Works with `query.batch` as well — refreshes for individual entries are + * collected into a single batched call. + * + * For live queries, the same applies, but with `reconnect` and `reconnectAll`. + * + * */ + export function requested(query: RemoteQueryFunction, limit: number): QueryRequestedResult; + /** + * Inside a remote `command` or `form` callback, returns an iterable + * of `{ arg, query }` entries for the live query instances the client asked to reconnect, up to + * the supplied `limit`. Each `query` is a `RemoteLiveQuery` bound to the original + * client-side cache key, so `reconnect()` propagates correctly even when + * the query's schema transforms the input. `arg` is the *validated* argument. + * + * Arguments that fail validation or exceed `limit` are recorded as failures in + * the response to the client. + * See [Client-requested refreshes](https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations-Client-requested-refreshes) + * for usage in a remote `command` or `form`. + * + * @example + * ```ts + * import { requested } from '$app/server'; + * + * for (const { query } of requested(getPost, 5)) { + * void query.reconnect(); + * } + * ``` + * + * As a shorthand, you can also call `reconnectAll` on the result: + * + * @example + * ```ts + * import { requested } from '$app/server'; + * + * await requested(getPost, 5).reconnectAll(); + * ``` + * + * */ + export function requested(query: RemoteLiveQueryFunction, limit: number): LiveQueryRequestedResult; + type RemoteLiveQueryUserFunctionReturnType = MaybePromise< + | AsyncGenerator + | AsyncIterator + | AsyncIterable + | Generator + | Iterator + | Iterable + >; + type RemotePrerenderInputsGenerator = () => MaybePromise; + type MaybePromise = T | Promise; + + type IsAny = 0 extends 1 & T ? true : false; + + type HasNonOptionalBoolean = + IsAny extends true + ? never + : [T] extends [boolean] + ? true + : T extends Array + ? HasNonOptionalBoolean + : T extends Record + ? { [K in keyof T]: HasNonOptionalBoolean }[keyof T] + : never; + + export {}; +} + +declare module '$app/state' { + /** + * A read-only reactive object with information about the current page, serving several use cases: + * - retrieving the combined `data` of all pages/layouts anywhere in your component tree (also see [loading data](https://svelte.dev/docs/kit/load)) + * - retrieving the current value of the `form` prop anywhere in your component tree (also see [form actions](https://svelte.dev/docs/kit/form-actions)) + * - retrieving the page state that was set through `goto`, `pushState` or `replaceState` (also see [goto](https://svelte.dev/docs/kit/$app-navigation#goto) and [shallow routing](https://svelte.dev/docs/kit/shallow-routing)) + * - retrieving metadata such as the URL you're on, the current route and its parameters, and whether or not there was an error + * + * ```svelte + * + * + * + *

Currently at {page.url.pathname}

+ * + * {#if page.error} + * Problem detected + * {:else} + * All systems operational + * {/if} + * ``` + * + * Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes) + * + * ```svelte + * + * + * ``` + * + * On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time. + * + * */ + export const page: import("@sveltejs/kit").Page; + /** + * A read-only object representing an in-progress navigation, with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. + * Values are `null` when no navigation is occurring, or during server rendering. + * */ + export const navigating: import("@sveltejs/kit").Navigation | { + from: null; + to: null; + type: null; + willUnload: null; + delta: null; + complete: null; + }; + /** + * A read-only reactive value that's initially `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update `current` to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. + * */ + export const updated: { + get current(): boolean; + check(): Promise; + }; + + export {}; +} + +declare module '$app/stores' { + export function getStores(): { + + page: typeof page; + + navigating: typeof navigating; + + updated: typeof updated; + }; + /** + * A readable store whose value contains page data. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `page` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * */ + export const page: import("svelte/store").Readable; + /** + * A readable store. + * When navigating starts, its value is a `Navigation` object with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. + * When navigating finishes, its value reverts to `null`. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `navigating` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * */ + export const navigating: import("svelte/store").Readable; + /** + * A readable store whose initial value is `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling. + * + * On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time. + * + * @deprecated Use `updated` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated)) + * */ + export const updated: import("svelte/store").Readable & { + check(): Promise; + }; + + export {}; +} + +/** + * It's possible to tell SvelteKit how to type objects inside your app by declaring the `App` namespace. By default, a new project will have a file called `src/app.d.ts` containing the following: + * + * ```ts + * declare global { + * namespace App { + * // interface Error {} + * // interface Locals {} + * // interface PageData {} + * // interface PageState {} + * // interface Platform {} + * } + * } + * + * export {}; + * ``` + * + * The `export {}` line exists because without it, the file would be treated as an _ambient module_ which prevents you from adding `import` declarations. + * If you need to add ambient `declare module` declarations, do so in a separate file like `src/ambient.d.ts`. + * + * By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, and `data` from `load` functions. + */ +declare namespace App { + /** + * Defines the common shape of expected and unexpected errors. Expected errors are thrown using the `error` function. Unexpected errors are handled by the `handleError` hooks which should return this shape. + */ + export interface Error { + message: string; + } + + /** + * The interface that defines `event.locals`, which can be accessed in server [hooks](https://svelte.dev/docs/kit/hooks) (`handle`, and `handleError`), server-only `load` functions, and `+server.js` files. + */ + export interface Locals {} + + /** + * Defines the common shape of the [page.data state](https://svelte.dev/docs/kit/$app-state#page) and [$page.data store](https://svelte.dev/docs/kit/$app-stores#page) - that is, the data that is shared between all pages. + * The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly. + * Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`). + */ + export interface PageData {} + + /** + * The shape of the `page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`. + */ + export interface PageState {} + + /** + * If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#Platform-specific-context) via `event.platform`, you can specify it here. + */ + export interface Platform {} +} + +/** + * This module is only available to [service workers](https://svelte.dev/docs/kit/service-workers). + */ +declare module '$service-worker' { + /** + * The `base` path of the deployment. Typically this is equivalent to `config.kit.paths.base`, but it is calculated from `location.pathname` meaning that it will continue to work correctly if the site is deployed to a subdirectory. + * Note that there is a `base` but no `assets`, since service workers cannot be used if `config.kit.paths.assets` is specified. + */ + export const base: string; + /** + * An array of URL strings representing the files generated by Vite, suitable for caching with `cache.addAll(build)`. + * During development, this is an empty array. + */ + export const build: string[]; + /** + * An array of URL strings representing the files in your static directory, or whatever directory is specified by `config.kit.files.assets`. You can customize which files are included from `static` directory using [`config.kit.serviceWorker.files`](https://svelte.dev/docs/kit/configuration#serviceWorker) + */ + export const files: string[]; + /** + * An array of pathnames corresponding to prerendered pages and endpoints. + * During development, this is an empty array. + */ + export const prerendered: string[]; + /** + * See [`config.kit.version`](https://svelte.dev/docs/kit/configuration#version). It's useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches. + */ + export const version: string; +} + +/** + * This module contains generated types for the routes in your app. + */ +declare module '$app/types' { + /** + * Interface for all generated app types. This gets extended via declaration merging. DO NOT USE THIS INTERFACE DIRECTLY. + */ + export interface AppTypes { + // These are all functions so that we can leverage function overloads to get the correct type. + // Using the return types directly would error with a "not the same type" error. + // https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces + RouteId(): string; + RouteParams(): Record>; + LayoutParams(): Record>; + Pathname(): string; + ResolvedPathname(): string; + Asset(): string; + } + + /** + * A union of all the route IDs in your app. Used for `page.route.id` and `event.route.id`. + */ + export type RouteId = ReturnType; + + /** + * `RouteId`, but possibly suffixed with a search string and/or hash. + */ + export type RouteIdWithSearchOrHash = RouteId | `${RouteId}?${string}` | `${RouteId}#${string}`; + + /** + * A utility for getting the parameters associated with a given route. + */ + export type RouteParams = T extends keyof ReturnType + ? ReturnType[T] + : Record; + + /** + * A utility for getting the parameters associated with a given layout, which is similar to `RouteParams` but also includes optional parameters for any child route. + */ + export type LayoutParams = T extends keyof ReturnType + ? ReturnType[T] + : Record; + + /** + * A union of all valid pathnames in your app. + */ + export type Pathname = ReturnType; + + /** + * `Pathname`, but possibly suffixed with a search string and/or hash. + */ + export type PathnameWithSearchOrHash = + | Pathname + | `${Pathname}?${string}` + | `${Pathname}#${string}`; + + /** + * `Pathname`, but possibly prefixed with a base path. Used for `page.url.pathname`. + */ + export type ResolvedPathname = ReturnType; + + /** + * A union of all the filenames of assets contained in your `static` directory. + */ + export type Asset = ReturnType; +} + +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/kit/types/index.d.ts.map b/tools/ui/node_modules/@sveltejs/kit/types/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cf735d15da89a03a9df4d9489810ec541a64b6ba --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/kit/types/index.d.ts.map @@ -0,0 +1,258 @@ +{ + "version": 3, + "file": "index.d.ts", + "names": [ + "Span", + "Adapter", + "LoadProperties", + "AwaitedActions", + "OptionalUnion", + "uniqueSymbol", + "ActionFailure", + "UnpackValidationError", + "Builder", + "Config", + "Cookies", + "Emulator", + "KitConfig", + "Handle", + "HandleServerError", + "HandleValidationError", + "HandleClientError", + "HandleFetch", + "ServerInit", + "ClientInit", + "Reroute", + "Transport", + "Transporter", + "Load", + "LoadEvent", + "NavigationEvent", + "NavigationTarget", + "NavigationType", + "NavigationBase", + "NavigationEnter", + "NavigationExternal", + "NavigationGoto", + "NavigationLeave", + "NavigationFormSubmit", + "NavigationPopState", + "NavigationLink", + "Navigation", + "BeforeNavigate", + "OnNavigate", + "AfterNavigate", + "Page", + "ParamMatcher", + "RequestedEntry", + "LiveRequestedEntry", + "QueryRequestedResult", + "LiveQueryRequestedResult", + "RequestedResult", + "RequestEvent", + "RequestHandler", + "ResolveOptions", + "RouteDefinition", + "Server", + "ServerInitOptions", + "SSRManifest", + "ServerLoad", + "ServerLoadEvent", + "Action", + "Actions", + "ActionResult", + "HttpError", + "Redirect", + "SubmitFunction", + "Snapshot", + "WillRecurseIndefinitely", + "InputTypeMap", + "RemoteFormFieldType", + "InputElementProps", + "RemoteFormFieldMethods", + "KeysOfUnion", + "ValueOfUnionKey", + "RemoteFormFieldValue", + "AsArgs", + "RemoteFormField", + "RemoteFormFieldContainer", + "UnknownField", + "RemoteFormFieldsRoot", + "RemoteFormFields", + "RecursiveFormFields", + "MaybeArray", + "RemoteFormInput", + "RemoteFormIssue", + "ExtractId", + "InvalidField", + "ValidationError", + "RemoteFormEnhanceInstance", + "RemoteFormEnhanceCallback", + "RemoteForm", + "RemoteCommand", + "RemoteQueryUpdate", + "RemoteResource", + "RemoteQuery", + "RemoteLiveQuery", + "RemoteQueryOverride", + "RemotePrerenderFunction", + "RemoteQueryFunction", + "RemoteLiveQueryFunction", + "EnvVarConfig", + "AdapterEntry", + "Csp", + "CspDirectives", + "HttpMethod", + "Logger", + "MaybePromise", + "Prerendered", + "PrerenderHttpErrorHandler", + "PrerenderMissingIdHandler", + "PrerenderEntryGeneratorMismatchHandler", + "PrerenderUnseenRoutesHandler", + "PrerenderInvalidUrlHandler", + "PrerenderHttpErrorHandlerValue", + "PrerenderMissingIdHandlerValue", + "PrerenderUnseenRoutesHandlerValue", + "PrerenderEntryGeneratorMismatchHandlerValue", + "PrerenderInvalidUrlHandlerValue", + "PrerenderOption", + "RequestOptions", + "RouteSegment", + "TrailingSlash", + "DeepPartial", + "IsAny", + "Asset", + "BuildData", + "ManifestData", + "PageNode", + "RecursiveRequired", + "RouteParam", + "RouteData", + "SSRComponent", + "SSRComponentLoader", + "UniversalNode", + "ServerNode", + "SSRNode", + "SSRNodeLoader", + "PageNodeIndexes", + "PrerenderEntryGenerator", + "SSREndpoint", + "SSRRoute", + "SSRClientRoute", + "ValidatedConfig", + "ValidatedKitConfig", + "isHttpError", + "redirect", + "isRedirect", + "json", + "text", + "isActionFailure", + "invalid", + "isValidationError", + "normalizeUrl", + "ValidPageOption", + "PageOptions", + "VERSION", + "valid_page_options_array", + "defineEnvVars", + "sequence", + "getRequest", + "setResponse", + "createReadableStream", + "installPolyfills", + "sveltekit", + "browser", + "dev", + "building", + "version", + "deserialize", + "enhance", + "applyAction", + "afterNavigate", + "beforeNavigate", + "onNavigate", + "disableScrollHandling", + "goto", + "invalidate", + "invalidateAll", + "refreshAll", + "preloadData", + "preloadCode", + "pushState", + "replaceState", + "base", + "assets", + "resolveRoute", + "StripSearchOrHash", + "ResolveArgs", + "asset", + "resolve", + "match", + "read", + "getRequestEvent", + "RemoteLiveQueryUserFunctionReturnType", + "RemotePrerenderInputsGenerator", + "HasNonOptionalBoolean", + "page", + "navigating", + "updated", + "getStores" + ], + "sources": [ + "../src/exports/public.d.ts", + "../src/exports/internal/index.js", + "../src/types/private.d.ts", + "../src/types/internal.d.ts", + "../src/exports/index.js", + "../src/exports/vite/static_analysis/types.d.ts", + "../src/version.js", + "../src/exports/vite/static_analysis/index.js", + "../src/exports/env/index.js", + "../src/exports/hooks/index.js", + "../src/exports/hooks/sequence.js", + "../src/exports/node/index.js", + "../src/exports/node/polyfills.js", + "../src/exports/vite/index.js", + "../src/runtime/app/env/types.d.ts", + "../src/runtime/app/environment/types.d.ts", + "../src/runtime/app/forms.js", + "../src/runtime/client/client.js", + "../src/runtime/app/paths/public.d.ts", + "../src/runtime/app/paths/types.d.ts", + "../src/runtime/app/paths/client.js", + "../src/runtime/app/server/index.js", + "../src/exports/internal/event.js", + "../src/runtime/app/state/index.js", + "../src/runtime/app/stores.js" + ], + "sourcesContent": [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + "mappings": ";;;;;;;;MAkCKA,IAAIA;;;;;kBAKQC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCZC,cAAcA;;;;;;aAMdC,cAAcA;;;;;;;;MAQrBC,aAAaA;;;;;OAKJC,YAAYA;;kBAETC,aAAaA;;;;;;MAMzBC,qBAAqBA;;;;;;;;;;;kBAWTC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8IPC,MAAMA;;;;;;;;;;;kBAWNC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4DPC,QAAQA;;;;;;;;kBAQRC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAqmBdC,MAAMA;;;;;;;;;;;aAWNC,iBAAiBA;;;;;;;;;;;;aAYjBC,qBAAqBA;;;;;;;;;aASrBC,iBAAiBA;;;;;;;;;;aAUjBC,WAAWA;;;;;;;;;;aAUXC,UAAUA;;;;;;aAMVC,UAAUA;;;;;;aAMVC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;aA0BPC,SAASA;;;;;kBAKJC,WAAWA;;;;;;;;;;;;aAYhBC,IAAIA;;;;;;;;;;;;kBAYCC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyHTC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BfC,gBAAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6CrBC,cAAcA;;kBAETC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiCdC,eAAeA;;;;;;;;;;;;;;aAcpBC,kBAAkBA;;;;;kBAKbC,cAAcA;;;;;;;;;;;;;;kBAcdC,eAAeA;;;;;;;;;;;;;;kBAcfC,oBAAoBA;;;;;;;;;;;;;;;;;;;kBAmBpBC,kBAAkBA;;;;;;;;;;;;;;;;;kBAiBlBC,cAAcA;;;;;;;;;;;;;;;;aAgBnBC,UAAUA;;;;;;;;;aASVC,cAAcA;;;;;;;;;;aAUdC,UAAUA;;;;;;;;;;;aAWVC,aAAaA;;;;;;;;;;;kBAWRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8CTC,YAAYA;;;;;;;;;aASZC,cAAcA;;;;;;;;;;;aAWdC,kBAAkBA;;;;;aAKlBC,oBAAoBA;;;;;;;;;;;;;;;;aAgBpBC,wBAAwBA;;;;;;;;;;;;;;;;;;aAkBxBC,eAAeA;;;;kBAIVC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA2HjBC,cAAcA;;;;;kBAKTC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;kBAuBdC,eAAeA;;;;;;;;;;;;;;;cAenBC,MAAMA;;;;;;kBAMFC,iBAAiBA;;;;;;;kBAOjBC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;aAyBhBC,UAAUA;;;;;;;kBAOLC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkFpBC,MAAMA;;;;;;;;;;aAUNC,OAAOA;;;;;;;;;;;;;;;;aAgBPC,YAAYA;;;;;;;;;;;;kBCh0DXC,SAASA;;;;;;;;;;kBAqBTC,QAAQA;;;;;;;aDw0DTC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6BTC,QAAQA;;;;;;MAMpBC,uBAAuBA;;;MAGvBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6BLC,mBAAmBA;;;;;MAK1BC,iBAAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkDjBC,sBAAsBA;;;;;;;;;;;MAWtBC,WAAWA;MACXC,eAAeA;;;;;;aAMRC,oBAAoBA;;MAE3BC,MAAMA;;;;;;;;;;;;;;;;;;;aAmBCC,eAAeA;;;;;;;;;;;;;;MActBC,wBAAwBA;;;;;MAKxBC,YAAYA;;;;;;;;;;;;;;;;;;MAkBZC,oBAAoBA;;;;;;;;;;;;;;;aAebC,gBAAgBA;;;;;;;;;;;;;;;;;;;;;MAqBvBC,mBAAmBA;;;;MAInBC,UAAUA;;kBAEEC,eAAeA;;;;kBAIfC,eAAeA;;;;;;;MAO3BC,SAASA;;;;;;;;;;;;;aAaFC,YAAYA;;;;;;;;;;;;;;;;;;kBAkBPC,eAAeA;;;;;;;;aAQpBC,yBAAyBA;;;;;;;;;;aAUzBC,yBAAyBA;;;;;;;;aAQzBC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuDVC,aAAaA;;;;;;;;aAQbC,iBAAiBA;;;;;;;aAOjBC,cAAcA;;;;;;;;;;;;;;;;;;aAkBdC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAqCXC,eAAeA;;;;;;;;;;aAUfC,mBAAmBA;;;;;aAKnBC,uBAAuBA;;;;;;;;;;;;;;;;aAgBvBC,mBAAmBA;;;;;;;;;;;aAWnBC,uBAAuBA;;;;;;;;kBAQlBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;WE5zEZC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkDZC,GAAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAiCHC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmElBC,UAAUA;;WAELC,MAAMA;;;;;;;;;MASXC,YAAYA;;WAEPC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmCXC,yBAAyBA;;;;;;;;;;WAUzBC,yBAAyBA;;;;WAIzBC,sCAAsCA;;;;WAItCC,4BAA4BA;;;;WAI5BC,0BAA0BA;;;;MAI/BC,8BAA8BA;MAC9BC,8BAA8BA;MAC9BC,iCAAiCA;;;;;MAKjCC,2CAA2CA;;;;;MAK3CC,+BAA+BA;;;;;;aAM/BC,eAAeA;;WAIVC,cAAcA;;;;;WAKdC,YAAYA;;;;;;;MAOjBC,aAAaA;;MAEbC,WAAWA;;;;;;;;MAQXC,KAAKA;WC1NAC,KAAKA;;;;;;WAeLC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAgITC,YAAYA;;;;;;;;;;;;;WAkBZC,QAAQA;;;;;;;;;;;;;;;;MA+BbC,iBAAiBA;;;;;;;;;WAWZC,UAAUA;;;;;;;;;;;;;WAaVC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;WAyJTC,YAAYA;;;;;;;;;;;;;;;;;;;;MAoBjBC,kBAAkBA;;WAEbC,aAAaA;;;;;;;;;;;WAWbC,UAAUA;;;;;;;;;;;WAWVC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BZC,aAAaA;;WA+BRC,eAAeA;;;;;;MAMpBC,uBAAuBA;;MAGvBC,WAAWA;;;;;;;;WAQNC,QAAQA;;;;;;;;;WASRC,cAAcA;;;;;;;;;MAqDnBC,eAAeA;;;;;MAKfC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3gBdC,WAAWA;;;;;;;;;;;;;;;;;;;iBAsBXC,QAAQA;;;;;iBAiBRC,UAAUA;;;;;;iBASVC,IAAIA;;;;;;iBA4BJC,IAAIA;;;;;;;;;;;;;;;;iBAkDJC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BfC,OAAOA;;;;;;iBAYPC,iBAAiBA;;;;;;;;;;;;;;iBAmBjBC,YAAYA;;;;;;;MClRvBC,eAAeA;;MAERC,WAAWA;;;;;;;;;cCFVC,OAAOA;;;;;;;;;;;;;;;;OCIPC,wBAAwBA;;;;;;;;;;;iBCErBC,aAAaA;;;;;;;;;;;;iBCGbA,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCmEbC,QAAQA;;;;;;iBCyCFC,UAAUA;;;;;;iBAgDVC,WAAWA;;;;;iBAwEjBC,oBAAoBA;;;;;;;;;;;iBC9NpBC,gBAAgBA;;;;;;;;;;;;;;iBCmIVC,SAASA;;;;;;;;;cClJlBC,OAAOA;;;;;cAKPC,GAAGA;;;;;cAKHC,QAAQA;;;;;cAKRC,OAAOA;;;;;;;;;cCfPH,OAAOA;;;;;cAKPC,GAAGA;;;;;cAKHC,QAAQA;;;;;cAKRC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;iBCaJC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;iBAgDXC,OAAOA;;;;;;;iBCi9EDC,WAAWA;;;;;;;;;;;iBAhVjBC,aAAaA;;;;;;;;;;;;iBAiBbC,cAAcA;;;;;;;;;;iBAedC,UAAUA;;;;;iBASVC,qBAAqBA;;;;;;;;;;iBA8BrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCJC,UAAUA;;;;iBA0BVC,aAAaA;;;;;iBAebC,UAAUA;;;;;;;;;;;;;;iBAqBJC,WAAWA;;;;;;;;;;;;;;;;;;iBAoCXC,WAAWA;;;;;iBAwCjBC,SAASA;;;;;iBA+CTC,YAAYA;Mf/0EhB5E,YAAYA;;;;;;;;;;;;;;YgB3Jb6E,IAAIA;;;;;;;;;YASJC,MAAMA;;;;;iBAKDC,YAAYA;;;MCnBvBC,iBAAiBA;;;;;;MAMVC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;iBCWPC,KAAKA;;;;;;;;;;;;;;;;;;;;;iBA6BLC,OAAOA;;;;;;;;;;;;;;;;;;;iBAmCDC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;iBCtEXC,IAAIA;;;;;;;;iBCUJC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MnB8TnBC,qCAAqCA;;;;;;;;MA6LrCC,8BAA8BA;MDhX9BxF,YAAYA;;MA2GZiB,KAAKA;;MAELwE,qBAAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cqBnOpBC,IAAIA;;;;;cAQJC,UAAUA;;;;;;;;;;;cAMVC,OAAOA;;;;;;;;;iBCrDPC,SAASA;;;;;;;;;;;;;;;cAyBTH,IAAIA;;;;;;;;;;cAiBJC,UAAUA;;;;;;;;cAeVC,OAAOA", + "ignoreList": [] +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/load-config/LICENSE b/tools/ui/node_modules/@sveltejs/load-config/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..df659d46b774218fb5cb363228ca8cc4d2888900 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/load-config/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2020-Present [these people](https://github.com/sveltejs/language-tools/graphs/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/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.d.ts b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..629d63b96309b05f3d47c42c3da9a72ff523abc3 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.d.ts @@ -0,0 +1,35 @@ +type ConfigSource = 'svelte' | 'vite'; +interface SvelteConfig { + compilerOptions?: Record; + preprocess?: unknown; + extensions?: string[]; + kit?: unknown; + vitePlugin?: unknown; + [key: string]: unknown; +} +interface LoadedConfig { + config: SvelteConfig; + configFilePath: string; + configSource: ConfigSource; +} +interface FailedConfig { + error: unknown; + configFilePath: string; + configSource: ConfigSource; +} +type LoadConfigResult = LoadedConfig | FailedConfig | undefined; +/** + * Loads the Svelte configuration by searching for `vite.config` and `svelte.config` files. + * + * If `traverse` is true, it starts from the provided directory and traverses up the directory tree until it finds a config or reaches the root. + * Else it only checks the provided directory. + * + * `vite.config` with either vite-plugin-svelte or the SvelteKit plugin providing options is preferred over `svelte.config`. + * + * The results are cached to optimize subsequent calls. + */ +export declare function loadConfig(dir: string, { traverse, clearCache }?: { + traverse?: boolean; + clearCache?: boolean; +}): Promise; +export {}; diff --git a/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ad82d129bc84dbdd14cb5bcbb0893cb7ff730ef8 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js @@ -0,0 +1,180 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadConfig = loadConfig; +const node_fs_1 = __importDefault(require("node:fs")); +const node_path_1 = __importDefault(require("node:path")); +const node_url_1 = require("node:url"); +const VITE_CONFIG_EXTENSIONS = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts']; +const SVELTE_CONFIG_EXTENSIONS = ['js', 'cjs', 'mjs']; +const SVELTE_CONFIG_TS_EXTENSIONS = ['ts', 'mts']; +const cache = new Map(); +/** + * This function encapsulates the import call in a way + * that TypeScript does not transpile `import()`. + * https://github.com/microsoft/TypeScript/issues/43329 + */ +const dynamicImport = new Function('modulePath', 'return import(modulePath)'); +/** + * Loads the Svelte configuration by searching for `vite.config` and `svelte.config` files. + * + * If `traverse` is true, it starts from the provided directory and traverses up the directory tree until it finds a config or reaches the root. + * Else it only checks the provided directory. + * + * `vite.config` with either vite-plugin-svelte or the SvelteKit plugin providing options is preferred over `svelte.config`. + * + * The results are cached to optimize subsequent calls. + */ +function loadConfig(dir, { traverse = true, clearCache = false } = {}) { + if (clearCache) + cache.clear(); + const startDir = node_path_1.default.resolve(dir); + const cached = cache.get(startDir); + if (cached) { + return cached; + } + const loading = loadConfigUncached(startDir, traverse); + cache.set(startDir, loading); + return loading; +} +async function loadConfigUncached(dir, traverse) { + let currentDir = dir; + const dirs = [dir]; + while (true) { + const result = await loadConfigFromDirectory(currentDir); + if (result) { + if (isLoadedConfig(result)) { + // Cache the loaded config for all traversed directories + for (const d of dirs) { + cache.set(d, Promise.resolve(result)); + } + } + else { + cache.delete(dir); + } + return result; + } + if (!traverse) { + return undefined; + } + const parentDir = node_path_1.default.dirname(currentDir); + if (parentDir === currentDir) { + return undefined; + } + currentDir = parentDir; + dirs.push(currentDir); + } +} +async function loadConfigFromDirectory(dir) { + const viteConfigPath = findConfigInDirectory(dir, 'vite.config', VITE_CONFIG_EXTENSIONS); + let viteError; + if (viteConfigPath) { + const result = await loadSvelteConfigFromVite(dir, viteConfigPath); + if (isLoadedConfig(result)) { + return result; + } + if (result?.error) { + viteError = result; + } + } + const svelteConfigPath = findConfigInDirectory(dir, 'svelte.config', getSvelteConfigExtensions()); + if (!svelteConfigPath) { + return viteError; + } + return (await loadSvelteConfig(svelteConfigPath)) ?? viteError; +} +let resolving = null; +async function loadSvelteConfigFromVite(root, configFilePath) { + const vite = await tryImportVite(root); + if (!vite) { + return undefined; + } + // Make sure that only one Vite config is resolved at a time, to prevent race conditions with multiple + // calls to `loadConfig` ending up with changing the process' current working directory mid-resolution. + await resolving; + let resolve; + resolving = new Promise((r) => (resolve = r)); + const cwd = process.cwd(); + try { + process.chdir(root); + const resolved = await vite.resolveConfig({ root, configFile: configFilePath, logLevel: 'error' }, 'serve'); + const kitPlugin = resolved.plugins.find((plugin) => plugin.name === 'vite-plugin-sveltekit-setup'); + const kitOptions = kitPlugin?.api?.options; + if (kitOptions) { + const { preprocess, compilerOptions, extensions, vitePlugin, ...kit } = kitOptions; + return { + config: { preprocess, compilerOptions, extensions, vitePlugin, kit }, + configFilePath, + configSource: 'vite' + }; + } + const sveltePlugin = resolved.plugins.find((plugin) => plugin.name === 'vite-plugin-svelte:config'); + const options = sveltePlugin?.api?.options; + if (options) { + return { + config: options, + configFilePath, + configSource: 'vite' + }; + } + } + catch (error) { + return { + error, + configFilePath, + configSource: 'vite' + }; + } + finally { + process.chdir(cwd); + resolve(); + } +} +async function loadSvelteConfig(configFilePath) { + try { + const config = (await dynamicImport((0, node_url_1.pathToFileURL)(configFilePath).href))?.default; + if (!config) { + throw new Error('Missing exports in the config. Make sure to include "export default config" or "module.exports = config"'); + } + return { + config, + configFilePath, + configSource: 'svelte' + }; + } + catch (error) { + return { + error, + configFilePath, + configSource: 'svelte' + }; + } +} +async function tryImportVite(fromPath) { + try { + const main = require.resolve('vite', { paths: [fromPath] }); + return await dynamicImport((0, node_url_1.pathToFileURL)(main).href); + } + catch { + return undefined; + } +} +function findConfigInDirectory(dir, basename, extensions) { + for (const extension of extensions) { + const configPath = node_path_1.default.join(dir, `${basename}.${extension}`); + if (node_fs_1.default.existsSync(configPath)) { + return configPath; + } + } +} +function getSvelteConfigExtensions() { + return process.features && 'typescript' in process.features && process.features.typescript + ? [...SVELTE_CONFIG_EXTENSIONS, ...SVELTE_CONFIG_TS_EXTENSIONS] + : SVELTE_CONFIG_EXTENSIONS; +} +function isLoadedConfig(result) { + return !!result && 'config' in result; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js.map b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5278bf2e7eac5913accafa36741208346c965400 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/load-config/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AA+DA,gCAeC;AA9ED,sDAAyB;AACzB,0DAA6B;AAC7B,uCAA8C;AAE9C,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AACjF,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAC/D,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,KAAK,CAAU,CAAC;AAoC3D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAqC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAE3D,CAAC;AAElB;;;;;;;;;GASG;AACH,SAAgB,UAAU,CACtB,GAAW,EACX,EAAE,QAAQ,GAAG,IAAI,EAAE,UAAU,GAAG,KAAK,KAAmD,EAAE;IAE1F,IAAI,UAAU;QAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAE9B,MAAM,QAAQ,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvD,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,GAAW,EAAE,QAAiB;IAC5D,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAEnB,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzB,wDAAwD;gBACxD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;oBACnB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC1C,CAAC;YACL,CAAC;iBAAM,CAAC;gBACJ,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,UAAU,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;AACL,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,GAAW;IAC9C,MAAM,cAAc,GAAG,qBAAqB,CAAC,GAAG,EAAE,aAAa,EAAE,sBAAsB,CAAC,CAAC;IACzF,IAAI,SAAmC,CAAC;IAExC,IAAI,cAAc,EAAE,CAAC;QACjB,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACnE,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,MAAM,EAAE,KAAK,EAAE,CAAC;YAChB,SAAS,GAAG,MAAM,CAAC;QACvB,CAAC;IACL,CAAC;IAED,MAAM,gBAAgB,GAAG,qBAAqB,CAC1C,GAAG,EACH,eAAe,EACf,yBAAyB,EAAE,CAC9B,CAAC;IACF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,IAAI,SAAS,CAAC;AACnE,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,KAAK,UAAU,wBAAwB,CACnC,IAAY,EACZ,cAAsB;IAEtB,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,sGAAsG;IACtG,uGAAuG;IACvG,MAAM,SAAS,CAAC;IAEhB,IAAI,OAAO,CAAC;IACZ,SAAS,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,IAAI,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CACrC,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,EACvD,OAAO,CACV,CAAC;QACF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CACnC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,6BAA6B,CAC5D,CAAC;QACF,MAAM,UAAU,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC;QAC3C,IAAI,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,GAAG,EAAE,GAAG,UAAU,CAAC;YACnF,OAAO;gBACH,MAAM,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE;gBACpE,cAAc;gBACd,YAAY,EAAE,MAAM;aACvB,CAAC;QACN,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CACtC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,2BAA2B,CAC1D,CAAC;QACF,MAAM,OAAO,GAAG,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC;QAC3C,IAAI,OAAO,EAAE,CAAC;YACV,OAAO;gBACH,MAAM,EAAE,OAAO;gBACf,cAAc;gBACd,YAAY,EAAE,MAAM;aACvB,CAAC;QACN,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO;YACH,KAAK;YACL,cAAc;YACd,YAAY,EAAE,MAAM;SACvB,CAAC;IACN,CAAC;YAAS,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAQ,EAAE,CAAC;IACf,CAAC;AACL,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,cAAsB;IAClD,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,CAAC,MAAM,aAAa,CAAC,IAAA,wBAAa,EAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC;QAClF,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACX,0GAA0G,CAC7G,CAAC;QACN,CAAC;QAED,OAAO;YACH,MAAM;YACN,cAAc;YACd,YAAY,EAAE,QAAQ;SACzB,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO;YACH,KAAK;YACL,cAAc;YACd,YAAY,EAAE,QAAQ;SACzB,CAAC;IACN,CAAC;AACL,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,QAAgB;IACzC,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,MAAM,aAAa,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAC1B,GAAW,EACX,QAAyC,EACzC,UAA6B;IAE7B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,IAAI,SAAS,EAAE,CAAC,CAAC;QAC9D,IAAI,iBAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,UAAU,CAAC;QACtB,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAS,yBAAyB;IAC9B,OAAO,OAAO,CAAC,QAAQ,IAAI,YAAY,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU;QACtF,CAAC,CAAC,CAAC,GAAG,wBAAwB,EAAE,GAAG,2BAA2B,CAAC;QAC/D,CAAC,CAAC,wBAAwB,CAAC;AACnC,CAAC;AAED,SAAS,cAAc,CAAC,MAAwB;IAC5C,OAAO,CAAC,CAAC,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/load-config/package.json b/tools/ui/node_modules/@sveltejs/load-config/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ede40567cbcd935316dd9826ae3b71c0562b6833 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/load-config/package.json @@ -0,0 +1,31 @@ +{ + "name": "@sveltejs/load-config", + "version": "0.1.1", + "description": "Load Svelte config via vite.config or svelte.config", + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/language-tools.git" + }, + "main": "dist/src/index.js", + "typings": "dist/src/index.d.ts", + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "default": "./dist/src/index.js" + } + }, + "files": [ + "dist/src" + ], + "engines": { + "node": ">= 18.0.0" + }, + "license": "MIT", + "devDependencies": { + "@types/node": "^18.0.0", + "typescript": "^6.0.3" + }, + "scripts": { + "build": "tsc" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/LICENSE b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c1a5d8f07a261030581a794a667eb58701637e92 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 [these people](https://github.com/sveltejs/vite-plugin-svelte/graphs/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/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/README.md b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/README.md new file mode 100644 index 0000000000000000000000000000000000000000..14dfbbbb6053d36ba335aaec7911beb3afae6c11 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/README.md @@ -0,0 +1,26 @@ +# @sveltejs/vite-plugin-svelte-inspector + +A [Svelte](https://svelte.dev) inspector plugin for [Vite](https://vitejs.dev). + +## Usage + +This plugin is automatically installed as a dependency of [@sveltejs/vite-plugin-svelte](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte). + +You can enable it in `svelte.config.js` by adding the `vitePlugin.inspector` option. + +```js +// svelte.config.js +export default { + vitePlugin: { + inspector: true + } +}; +``` + +Now simply press `alt-x` (`option-x` on MacOS) on a page served by the Vite dev server to activate inspect mode. Click on a highlighted element to jump to its source code in your editor. + +Also check out the [docs](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/inspector.md) for customization options. + +## License + +[MIT](./LICENSE) diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/package.json b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dbc5c76dfe2faeee564753459d83e8012f47dd53 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/package.json @@ -0,0 +1,54 @@ +{ + "name": "@sveltejs/vite-plugin-svelte-inspector", + "version": "5.0.2", + "license": "MIT", + "author": "dominikg", + "files": [ + "src", + "types" + ], + "type": "module", + "types": "types/index.d.ts", + "exports": { + ".": { + "types": "./types/index.d.ts", + "default": "./src/index.js" + } + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/vite-plugin-svelte.git", + "directory": "packages/vite-plugin-svelte-inspector" + }, + "keywords": [ + "vite-plugin", + "vite plugin", + "vite", + "svelte" + ], + "bugs": { + "url": "https://github.com/sveltejs/vite-plugin-svelte/issues" + }, + "homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme", + "dependencies": { + "obug": "^2.1.0" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.0.0-next.0", + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + }, + "devDependencies": { + "@types/debug": "^4.1.12", + "svelte": "^5.45.4", + "vite": "^7.2.6" + }, + "scripts": { + "check:publint": "publint --strict", + "check:types": "tsc --noEmit", + "generate:types": "dts-buddy -m \"@sveltejs/vite-plugin-svelte-inspector:src/public.d.ts\"" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/debug.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/debug.js new file mode 100644 index 0000000000000000000000000000000000000000..82554e6a8a7800c1b36a676a489200a9da61e122 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/debug.js @@ -0,0 +1,3 @@ +import { createDebug } from 'obug'; + +export const debug = createDebug('vite-plugin-svelte-inspector'); diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/index.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..18a48a544d740f3922ce925b0ae6412fb0267571 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/index.js @@ -0,0 +1,127 @@ +import { normalizePath } from 'vite'; +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { debug } from './debug.js'; +import { defaultInspectorOptions, parseEnvironmentOptions } from './options.js'; +import { cleanUrl } from './utils.js'; + +function getInspectorPath() { + const pluginPath = normalizePath(path.dirname(fileURLToPath(import.meta.url))); + return pluginPath.replace( + /\/vite-plugin-svelte-inspector\/src$/, + '/vite-plugin-svelte-inspector/src/runtime/' + ); +} + +/** + * @param {Partial} [options] + * @returns {import('vite').Plugin} + */ +export function svelteInspector(options) { + const inspectorPath = getInspectorPath(); + debug(`svelte inspector path: ${inspectorPath}`); + + /** @type {import('vite').ResolvedConfig} */ + let viteConfig; + /** @type {import('./public.d.ts').Options} */ + let inspectorOptions; + let disabled = false; + + return { + name: 'vite-plugin-svelte-inspector', + apply: 'serve', + enforce: 'pre', + + applyToEnvironment(env) { + return !disabled && env.config.consumer === 'client'; + }, + + configResolved(config) { + viteConfig = config; + const environmentOptions = parseEnvironmentOptions(config); + if (environmentOptions === false) { + debug('environment options set to false, inspector disabled'); + disabled = true; + return; + } + + // Handle config from svelte.config.js through vite-plugin-svelte + const vps = config.plugins.find((p) => p.name === 'vite-plugin-svelte:config'); + const configFileOptions = vps?.api?.options?.inspector; + + // vite-plugin-svelte can only pass options through it's `api` instead of `options`. + // that means this plugin could be created but should be disabled, so we check this case here. + if (vps && !options && !configFileOptions && !environmentOptions) { + debug("vite-plugin-svelte didn't pass options, inspector disabled"); + disabled = true; + return; + } + + if (environmentOptions === true) { + inspectorOptions = defaultInspectorOptions; + } else { + inspectorOptions = { + ...defaultInspectorOptions, + ...configFileOptions, + ...options, + ...(environmentOptions || {}) + }; + } + + inspectorOptions.__internal = { + base: config.base?.replace(/\/$/, '') || '' + }; + }, + resolveId: { + filter: { + id: /^virtual:svelte-inspector-/ + }, + async handler(id) { + if (disabled) { + return; + } + if (id === 'virtual:svelte-inspector-options') { + return id; + } else if (id.startsWith('virtual:svelte-inspector-path:')) { + return id.replace('virtual:svelte-inspector-path:', inspectorPath); + } + } + }, + load: { + filter: { + id: { + include: [`${inspectorPath}/**`, /^virtual:svelte-inspector-options$/], + exclude: [/style&lang\.css$/] + } + }, + async handler(id) { + if (disabled) { + return; + } + if (id === 'virtual:svelte-inspector-options') { + return `export default ${JSON.stringify(inspectorOptions ?? {})}`; + } else if (id.startsWith(inspectorPath)) { + // read file ourselves to avoid getting shut out by vites fs.allow check + const file = cleanUrl(id); + if (fs.existsSync(id)) { + return await fs.promises.readFile(file, 'utf-8'); + } else { + viteConfig.logger.error( + `[vite-plugin-svelte-inspector] failed to find svelte-inspector: ${id}` + ); + } + } + } + }, + transform: { + filter: { id: /vite\/dist\/client\/client\.mjs(?:\?|$)/ }, + handler(code) { + if (disabled) { + return; + } + return { code: `${code}\nimport('virtual:svelte-inspector-path:load-inspector.js')` }; + } + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/options.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/options.js new file mode 100644 index 0000000000000000000000000000000000000000..15a24564e7b584d15ac5fe995188cbbad7333a90 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/options.js @@ -0,0 +1,63 @@ +import process from 'node:process'; +import { loadEnv } from 'vite'; +import { debug } from './debug.js'; + +/** @type {import('./public.d.ts').Options} */ +export const defaultInspectorOptions = { + toggleKeyCombo: 'alt-x', + navKeys: { parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' }, + escapeKeys: ['Backspace', 'Escape'], + openKey: 'Enter', + holdMode: true, + showToggleButton: 'active', + toggleButtonPos: 'top-right', + customStyles: true +}; + +/** + * @param {import('vite').ResolvedConfig} config + * @returns {Partial | boolean | void} + */ +export function parseEnvironmentOptions(config) { + const env = loadEnv(config.mode, config.envDir ?? process.cwd(), 'SVELTE_INSPECTOR'); + const options = env?.SVELTE_INSPECTOR_OPTIONS; + const toggle = env?.SVELTE_INSPECTOR_TOGGLE; + if (options) { + try { + const parsed = JSON.parse(options); + const parsedType = typeof parsed; + if (parsedType === 'boolean') { + return parsed; + } else if (parsedType === 'object') { + if (Array.isArray(parsed)) { + throw new Error('invalid type, expected object map but got array'); + } + const parsedKeys = Object.keys(parsed); + const defaultKeys = Object.keys(defaultInspectorOptions); + const unknownKeys = parsedKeys.filter((k) => !defaultKeys.includes(k)); + if (unknownKeys.length) { + config.logger.warn( + `[vite-plugin-svelte-inspector] ignoring unknown options in environment SVELTE_INSPECTOR_OPTIONS: ${unknownKeys.join( + ', ' + )}` + ); + for (const key of unknownKeys) { + delete parsed[key]; + } + } + debug('loaded environment config', parsed); + return parsed; + } + } catch (e) { + config.logger.error( + `[vite-plugin-svelte-inspector] failed to parse inspector options from environment SVELTE_INSPECTOR_OPTIONS="${options}"\n${e}` + ); + } + } else if (toggle) { + const keyConfig = { + toggleKeyCombo: toggle + }; + debug('loaded environment config', keyConfig); + return keyConfig; + } +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/public.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/public.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94e844b58297ab524f70b5ebbecfa3792a3ae16f --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/public.d.ts @@ -0,0 +1,78 @@ +export interface Options { + /** + * define a key combo to toggle inspector, + * @default 'alt-x' + * + * any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by - + * examples: control-shift, control-o, control-alt-s meta-x control-meta + * Some keys have native behavior (e.g. alt-s opens history menu on firefox). + * To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended. + */ + toggleKeyCombo?: string; + + /** + * define keys to select elements with via keyboard + * @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } + * + * improves accessibility and also helps when you want to select elements that do not have a hoverable surface area + * due to tight wrapping + * + * A note for users of screen-readers: + * If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. + * e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} + * + * + * parent: select closest parent + * child: select first child (or grandchild) + * next: next sibling (or parent if no next sibling exists) + * prev: previous sibling (or parent if no prev sibling exists) + */ + navKeys?: { parent: string; child: string; next: string; prev: string }; + + /** + * define key to open the editor for the currently selected dom node + * + * @default 'Enter' + */ + openKey?: string; + + /** + * define keys to close the inspector + * @default ['Backspace', 'Escape'] + */ + escapeKeys?: string[]; + + /** + * inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress + * @default true + */ + holdMode?: boolean; + + /** + * when to show the toggle button + * @default 'active' + */ + showToggleButton?: 'always' | 'active' | 'never'; + + /** + * where to display the toggle button + * @default 'top-right' + */ + toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; + + /** + * inject custom styles when inspector is active + */ + customStyles?: boolean; + + /** + * internal options that are automatically set, not to be set or used by users + * @internal + */ + __internal?: { + // vite base url + base: string; + }; +} +// eslint-disable-next-line n/no-missing-import +export * from './index.js'; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/Inspector.svelte b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/Inspector.svelte new file mode 100644 index 0000000000000000000000000000000000000000..9a03c49c7944cbe1720a7a48e28b4bff45d1d45f --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/Inspector.svelte @@ -0,0 +1,411 @@ + + + + +{#if show_toggle} + +{/if} +{#if enabled && active_el && file_loc} + {@const loc = active_el.__svelte_meta.loc} +
+ <{active_el.tagName.toLowerCase()}> {file_loc} +
+
+ {active_el.tagName.toLowerCase()} in file {loc.file} on line {loc.line} column {loc.column} +
+{/if} + + diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/load-inspector.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/load-inspector.js new file mode 100644 index 0000000000000000000000000000000000000000..5662f9fa04d56259c8967023f1c2a8f628ac4fb6 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/runtime/load-inspector.js @@ -0,0 +1,14 @@ +// eslint-disable-next-line n/no-missing-import +import Inspector from 'virtual:svelte-inspector-path:Inspector.svelte'; +import { mount } from 'svelte'; +function create_inspector_host() { + const id = 'svelte-inspector-host'; + if (document.getElementById(id) != null) { + throw new Error('svelte-inspector-host element already exists'); + } + const el = document.createElement('div'); + el.setAttribute('id', id); + document.documentElement.appendChild(el); + return el; +} +mount(Inspector, { target: create_inspector_host() }); diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/utils.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..bcb43f9fcd29109677f5447b8a03d3183040bcb7 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/src/utils.js @@ -0,0 +1,8 @@ +const postfixRE = /[?#].*$/s; + +/** + * @param {string} url + */ +export function cleanUrl(url) { + return url.replace(postfixRE, ''); +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..581654bc946415600619d1888950c2a7238febdf --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts @@ -0,0 +1,82 @@ +declare module '@sveltejs/vite-plugin-svelte-inspector' { + export interface Options { + /** + * define a key combo to toggle inspector, + * @default 'alt-x' + * + * any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by - + * examples: control-shift, control-o, control-alt-s meta-x control-meta + * Some keys have native behavior (e.g. alt-s opens history menu on firefox). + * To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended. + */ + toggleKeyCombo?: string; + + /** + * define keys to select elements with via keyboard + * @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } + * + * improves accessibility and also helps when you want to select elements that do not have a hoverable surface area + * due to tight wrapping + * + * A note for users of screen-readers: + * If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. + * e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} + * + * + * parent: select closest parent + * child: select first child (or grandchild) + * next: next sibling (or parent if no next sibling exists) + * prev: previous sibling (or parent if no prev sibling exists) + */ + navKeys?: { parent: string; child: string; next: string; prev: string }; + + /** + * define key to open the editor for the currently selected dom node + * + * @default 'Enter' + */ + openKey?: string; + + /** + * define keys to close the inspector + * @default ['Backspace', 'Escape'] + */ + escapeKeys?: string[]; + + /** + * inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress + * @default true + */ + holdMode?: boolean; + + /** + * when to show the toggle button + * @default 'active' + */ + showToggleButton?: 'always' | 'active' | 'never'; + + /** + * where to display the toggle button + * @default 'top-right' + */ + toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; + + /** + * inject custom styles when inspector is active + */ + customStyles?: boolean; + + /** + * internal options that are automatically set, not to be set or used by users + * */ + __internal?: { + // vite base url + base: string; + }; + } + export function svelteInspector(options?: Partial): import("vite").Plugin; + + export {}; +} + +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts.map b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e01cdd7fb29878dbd7bdfef3524989e1b1d8e4ef --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte-inspector/types/index.d.ts.map @@ -0,0 +1,18 @@ +{ + "version": 3, + "file": "index.d.ts", + "names": [ + "Options", + "svelteInspector" + ], + "sources": [ + "../src/public.d.ts", + "../src/index.js" + ], + "sourcesContent": [ + null, + null + ], + "mappings": ";kBAAiBA,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCoBRC,eAAeA", + "ignoreList": [] +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/LICENSE b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c1a5d8f07a261030581a794a667eb58701637e92 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 [these people](https://github.com/sveltejs/vite-plugin-svelte/graphs/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/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/README.md b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/README.md new file mode 100644 index 0000000000000000000000000000000000000000..48798bcc5ae122d3dccd0feb7ac739f02398a953 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/README.md @@ -0,0 +1,28 @@ +# @sveltejs/vite-plugin-svelte + +The official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev). + +## Usage + +```js +// vite.config.js +import { defineConfig } from 'vite'; +import { svelte } from '@sveltejs/vite-plugin-svelte'; + +export default defineConfig({ + plugins: [ + svelte({ + /* plugin options */ + }) + ] +}); +``` + +## Documentation + +- [Plugin options](../../docs/config.md) +- [FAQ](../../docs/faq.md) + +## License + +[MIT](./LICENSE) diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/package.json b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e0a36f12ec96fc84aa50e745821207c524f62ddf --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/package.json @@ -0,0 +1,58 @@ +{ + "name": "@sveltejs/vite-plugin-svelte", + "version": "6.2.1", + "license": "MIT", + "author": "dominikg", + "files": [ + "src", + "types" + ], + "type": "module", + "types": "types/index.d.ts", + "exports": { + ".": { + "types": "./types/index.d.ts", + "default": "./src/index.js" + } + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/vite-plugin-svelte.git", + "directory": "packages/vite-plugin-svelte" + }, + "keywords": [ + "vite-plugin", + "vite plugin", + "vite", + "svelte" + ], + "bugs": { + "url": "https://github.com/sveltejs/vite-plugin-svelte/issues" + }, + "homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0", + "debug": "^4.4.1", + "deepmerge": "^4.3.1", + "magic-string": "^0.30.17", + "vitefu": "^1.1.1" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + }, + "devDependencies": { + "@types/debug": "^4.1.12", + "sass": "^1.91.0", + "svelte": "^5.38.6", + "vite": "^7.1.4" + }, + "scripts": { + "check:publint": "publint --strict", + "check:types": "tsc --noEmit", + "generate:types": "dts-buddy -m \"@sveltejs/vite-plugin-svelte:src/public.d.ts\"" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/index.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..83e0cc72038b61d22f671841316b1e3da4b7b793 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/index.js @@ -0,0 +1,42 @@ +import process from 'node:process'; +import { log } from './utils/log.js'; +import { configure } from './plugins/configure.js'; +import { preprocess } from './plugins/preprocess.js'; +import { compile } from './plugins/compile.js'; +import { loadCompiledCss } from './plugins/load-compiled-css.js'; +import { setupOptimizer } from './plugins/setup-optimizer.js'; +import { compileModule } from './plugins/compile-module.js'; +import { svelteInspector } from '@sveltejs/vite-plugin-svelte-inspector'; +import { loadCustom } from './plugins/load-custom.js'; +import { hotUpdate } from './plugins/hot-update.js'; + +/** + * returns a list of plugins to handle svelte files + * plugins are named `vite-plugin-svelte:` + * + * @param {Partial} [inlineOptions] + * @returns {import('vite').Plugin[]} + */ +export function svelte(inlineOptions) { + if (process.env.DEBUG != null) { + log.setLevel('debug'); + } + /** @type {import('./types/plugin-api.js').PluginAPI} */ + // @ts-expect-error initialize empty to guard against early use + const api = {}; // initialized by configure plugin, used in others + return [ + { name: 'vite-plugin-svelte' }, // marker for detection logic in other plugins that expect this name + configure(api, inlineOptions), + setupOptimizer(api), + loadCompiledCss(api), + loadCustom(api), + preprocess(api), + compile(api), + compileModule(api), + hotUpdate(api), + svelteInspector() + ]; +} + +export { vitePreprocess } from './preprocess.js'; +export { loadSvelteConfig } from './utils/load-svelte-config.js'; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js new file mode 100644 index 0000000000000000000000000000000000000000..4ae62f9859a2390d51aa5420703b8e4a5d083e0c --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile-module.js @@ -0,0 +1,130 @@ +import { buildModuleIdFilter, buildModuleIdParser } from '../utils/id.js'; +import * as svelteCompiler from 'svelte/compiler'; +import { log, logCompilerWarnings } from '../utils/log.js'; +import { toRollupError } from '../utils/error.js'; +import { isSvelteWithAsync } from '../utils/svelte-version.js'; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function compileModule(api) { + /** + * @type {import("../types/options.js").ResolvedOptions} + */ + let options; + /** + * @type {import("../types/id.js").ModuleIdParser} + */ + let idParser; + + /** + * @type {import('svelte/compiler').ModuleCompileOptions} + */ + let staticModuleCompileOptions; + + /** @type {import('vite').Plugin} */ + const plugin = { + name: 'vite-plugin-svelte:compile-module', + enforce: 'post', + async configResolved() { + options = api.options; + //@ts-expect-error transform defined below but filter not in type + plugin.transform.filter = buildModuleIdFilter(options); + idParser = buildModuleIdParser(options); + staticModuleCompileOptions = filterNonModuleCompilerOptions(options.compilerOptions); + }, + transform: { + async handler(code, id) { + const ssr = this.environment.config.consumer === 'server'; + const moduleRequest = idParser(id, ssr); + if (!moduleRequest) { + return; + } + const filename = moduleRequest.filename; + /** @type {import('svelte/compiler').CompileOptions} */ + const compileOptions = { + ...staticModuleCompileOptions, + dev: !this.environment.config.isProduction, + generate: ssr ? 'server' : 'client', + filename + }; + const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ + filename, + code, + compileOptions + }); + if (dynamicCompileOptions && log.debug.enabled) { + log.debug( + `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, + undefined, + 'compileModule' + ); + } + const finalCompileOptions = dynamicCompileOptions + ? { + ...compileOptions, + ...dynamicCompileOptions + } + : compileOptions; + if (dynamicCompileOptions?.experimental) { + finalCompileOptions.experimental = { + ...compileOptions.experimental, + ...dynamicCompileOptions.experimental + }; + } + const finalModuleCompileOptions = filterNonModuleCompilerOptions(finalCompileOptions); + if (log.debug.enabled) { + log.debug( + `final ModuleCompileOptions for ${filename}: ${JSON.stringify(finalModuleCompileOptions)}`, + undefined, + 'compileModule' + ); + } + try { + const compileResult = svelteCompiler.compileModule(code, finalModuleCompileOptions); + logCompilerWarnings(moduleRequest, compileResult.warnings, options); + return compileResult.js; + } catch (e) { + throw toRollupError(e, options); + } + } + } + }; + return plugin; +} + +/** + * + * @param {import('svelte/compiler').CompileOptions} compilerOptions + * @return {import('svelte/compiler').ModuleCompileOptions} + */ +function filterNonModuleCompilerOptions(compilerOptions) { + /** @type {Array} */ + const knownModuleCompileOptionNames = ['dev', 'generate', 'filename', 'rootDir', 'warningFilter']; + if (isSvelteWithAsync) { + knownModuleCompileOptionNames.push('experimental'); + } + // not typed but this is temporary until svelte itself ignores CompileOptions passed to compileModule + const experimentalModuleCompilerOptionNames = ['async']; + + /** @type {import('svelte/compiler').ModuleCompileOptions} */ + const filtered = filterByPropNames(compilerOptions, knownModuleCompileOptionNames); + if (filtered.experimental) { + filtered.experimental = filterByPropNames( + filtered.experimental, + experimentalModuleCompilerOptionNames + ); + } + return filtered; +} + +/** + * + * @param {object} o + * @param {string[]} names + * @returns {object} + */ +function filterByPropNames(o, names) { + return Object.fromEntries(Object.entries(o).filter(([name]) => names.includes(name))); +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js new file mode 100644 index 0000000000000000000000000000000000000000..e696d8c40ff6c29b32f028d31a64e17e7f405dca --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/compile.js @@ -0,0 +1,65 @@ +import { toRollupError } from '../utils/error.js'; +import { logCompilerWarnings } from '../utils/log.js'; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function compile(api) { + /** + * @type {import("../types/options.js").ResolvedOptions} + */ + let options; + + /** + * @type {import("../types/compile.d.ts").CompileSvelte} + */ + let compileSvelte; + /** @type {import('vite').Plugin} */ + const plugin = { + name: 'vite-plugin-svelte:compile', + configResolved() { + //@ts-expect-error defined below but filter not in type + plugin.transform.filter = api.filter; + options = api.options; + compileSvelte = api.compileSvelte; + }, + transform: { + async handler(code, id) { + const ssr = this.environment.config.consumer === 'server'; + const svelteRequest = api.idParser(id, ssr); + if (!svelteRequest || svelteRequest.raw) { + return; + } + let compileData; + try { + compileData = await compileSvelte( + svelteRequest, + code, + options, + this.getCombinedSourcemap() + ); + } catch (e) { + throw toRollupError(e, options); + } + if (compileData.compiled?.warnings) { + logCompilerWarnings(svelteRequest, compileData.compiled.warnings, options); + } + + return { + ...compileData.compiled.js, + moduleType: 'js', + meta: { + vite: { + lang: compileData.lang + }, + svelte: { + css: compileData.compiled.css + } + } + }; + } + } + }; + return plugin; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js new file mode 100644 index 0000000000000000000000000000000000000000..b5538b06a86c5be03135d73e7f5ad845f8ce9fa1 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/configure.js @@ -0,0 +1,97 @@ +import process from 'node:process'; +import { isDebugNamespaceEnabled, log } from '../utils/log.js'; +import * as vite from 'vite'; +import { VitePluginSvelteStats } from '../utils/vite-plugin-svelte-stats.js'; +import { + buildExtraViteConfig, + validateInlineOptions, + resolveOptions, + preResolveOptions, + ensureConfigEnvironmentMainFields, + ensureConfigEnvironmentConditions +} from '../utils/options.js'; +import { buildIdFilter, buildIdParser } from '../utils/id.js'; +import { createCompileSvelte } from '../utils/compile.js'; + +// @ts-ignore rolldownVersion +const { version: viteVersion, rolldownVersion } = vite; + +/** + * @param {Partial} [inlineOptions] + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function configure(api, inlineOptions) { + if (rolldownVersion) { + log.warn.once( + `!!! Support for rolldown-vite in vite-plugin-svelte is experimental (rolldown: ${rolldownVersion}, vite: ${viteVersion}) !!! + See https://github.com/sveltejs/vite-plugin-svelte/issues/1143 for a list of known issues and to report feedback.`.replace( + /\t+/g, + '\t' + ) + ); + } + + validateInlineOptions(inlineOptions); + + /** + * @type {import("../types/options.d.ts").PreResolvedOptions} + */ + let preOptions; + + /** @type {import('vite').Plugin} */ + return { + name: 'vite-plugin-svelte:config', + api, + // make sure it runs first + enforce: 'pre', + config: { + order: 'pre', + async handler(config, configEnv) { + // setup logger + if (process.env.DEBUG) { + log.setLevel('debug'); + } else if (config.logLevel) { + log.setLevel(config.logLevel); + } + + preOptions = await preResolveOptions(inlineOptions, config, configEnv); + // extra vite config + const extraViteConfig = await buildExtraViteConfig(preOptions, config); + log.debug('additional vite config', extraViteConfig, 'config'); + return extraViteConfig; + } + }, + configResolved: { + order: 'pre', + handler(config) { + const options = resolveOptions(preOptions, config); + api.options = options; + if (isDebugNamespaceEnabled('stats')) { + api.options.stats = new VitePluginSvelteStats(); + } + + api.filter = buildIdFilter(options); + api.idFilter = api.filter; + api.idParser = buildIdParser(options); + api.compileSvelte = createCompileSvelte(); + log.debug('resolved options', api.options, 'config'); + } + }, + + configEnvironment(name, config, opts) { + ensureConfigEnvironmentMainFields(name, config, opts); + // @ts-expect-error the function above should make `resolve.mainFields` non-nullable + config.resolve.mainFields.unshift('svelte'); + + ensureConfigEnvironmentConditions(name, config, opts); + // @ts-expect-error the function above should make `resolve.conditions` non-nullable + config.resolve.conditions.push('svelte'); + }, + + configureServer(server) { + const { options } = api; + options.server = server; + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js new file mode 100644 index 0000000000000000000000000000000000000000..b264009a361258db88fa09e19f0d9c745cca92a8 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/hot-update.js @@ -0,0 +1,181 @@ +import { log } from '../utils/log.js'; +import { setupWatchers } from '../utils/watch.js'; +import { SVELTE_VIRTUAL_STYLE_ID_REGEX } from '../utils/constants.js'; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function hotUpdate(api) { + /** + * @type {import("../types/options.js").ResolvedOptions} + */ + let options; + /** + * @type {import('../types/id.d.ts').IdParser} + */ + let idParser; + + /** + * + * @type {Map} + */ + const transformResultCache = new Map(); + + /** @type {import('vite').Plugin} */ + const plugin = { + name: 'vite-plugin-svelte:hot-update', + enforce: 'post', + configResolved() { + options = api.options; + idParser = api.idParser; + + // @ts-expect-error + plugin.transform.filter = { + id: { + // reinclude virtual styles to get their output + include: [...api.filter.id.include, SVELTE_VIRTUAL_STYLE_ID_REGEX], + exclude: [ + // ignore files in node_modules, we don't hot update them + /\/node_modules\//, + // remove style exclusion + ...api.filter.id.exclude.filter((filter) => filter !== SVELTE_VIRTUAL_STYLE_ID_REGEX) + ] + } + }; + }, + + applyToEnvironment(env) { + // we only handle updates for client components + // ssr frameworks have to handle updating/reloading themselves as v-p-s can't know what they prefer + const hmrEnabled = options.compilerOptions.hmr && options.emitCss; + return hmrEnabled && env.config.consumer === 'client'; + }, + + configureServer(server) { + const clientEnvironment = Object.values(server.environments).find( + (e) => e.config.consumer === 'client' + ); + if (clientEnvironment) { + setupWatchers(options); + } else { + log.warn( + 'No client environment found, not adding watchers for svelte config and preprocessor dependencies' + ); + } + }, + + buildStart() { + transformResultCache.clear(); + }, + + transform: { + order: 'post', + handler(code, id) { + transformResultCache.set(id, code); + } + }, + hotUpdate: { + order: 'post', + async handler(ctx) { + const svelteRequest = idParser(ctx.file, false, ctx.timestamp); + if (svelteRequest) { + const { modules } = ctx; + const svelteModules = []; + const nonSvelteModules = []; + for (const mod of modules) { + if (transformResultCache.has(mod.id)) { + svelteModules.push(mod); + } else { + nonSvelteModules.push(mod); + } + } + + if (svelteModules.length === 0) { + return; // nothing to do for us + } + const affectedModules = []; + const prevResults = svelteModules.map((m) => transformResultCache.get(m.id)); + for (let i = 0; i < svelteModules.length; i++) { + const mod = svelteModules[i]; + const prev = prevResults[i]; + await this.environment.transformRequest(mod.url); + const next = transformResultCache.get(mod.id); + if (hasCodeChanged(prev, next, mod.id)) { + affectedModules.push(mod); + } else { + log.debug( + `skipping hot update for ${mod.id} because result is unchanged`, + undefined, + 'hmr' + ); + } + } + log.debug( + `hotUpdate for ${svelteRequest.id} result: [${affectedModules.map((m) => m.id).join(', ')}]`, + undefined, + 'hmr' + ); + return [...affectedModules, ...nonSvelteModules]; + } + } + } + }; + + return plugin; +} + +/** + * @param {string | undefined | null} prev + * @param {string | undefined | null} next + * @param {string | null} id + * @returns {boolean} + */ +function hasCodeChanged(prev, next, id) { + const isStrictEqual = nullSafeEqual(prev, next); + if (isStrictEqual) { + return false; + } + const isLooseEqual = nullSafeEqual(normalize(prev), normalize(next)); + if (!isStrictEqual && isLooseEqual) { + log.debug( + `ignoring compiler output change for ${id} as it is equal to previous output after normalization`, + undefined, + 'hmr' + ); + } + return !isLooseEqual; +} + +/** + * @param {string | null | undefined} prev + * @param {string | null | undefined} next + * @returns {boolean} + */ +function nullSafeEqual(prev, next) { + return (prev == null && next == null) || (prev != null && next != null && prev === next); +} + +/** + * remove code that only changes metadata and does not require a js update for the component to keep working + * + * 1) location numbers argument from $.add_locations calls in svelte output eg [[1,2],[3,4]] + * 2) timestamp queries added to imports by vite eg ?t=0123456789123 + * + * @param {string | null | undefined } code + * @returns {string | null | undefined} + */ +function normalize(code) { + if (code == null) { + return code; + } + + return ( + code + // svelte5 $.add_locations line numbers argument [[1,2],[3,4]] + // uses matching group replace to keep the template argument intact + .replace(/(\$\.add_locations\(.*), (\[\[[\d, [\]]+]])\)/g, '$1, []') + // vite import analysis timestamp queries, ?t=0123456789123& + .replace(/[?&]t=\d{13}\b/g, '') + ); +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js new file mode 100644 index 0000000000000000000000000000000000000000..0a9e9c233066bf47bfcd237d701d67d1c3b1d805 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-compiled-css.js @@ -0,0 +1,66 @@ +import { log } from '../utils/log.js'; +import { SVELTE_VIRTUAL_STYLE_ID_REGEX } from '../utils/constants.js'; + +const filter = { id: SVELTE_VIRTUAL_STYLE_ID_REGEX }; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function loadCompiledCss(api) { + let useLocalCache = false; + + /** @type{Map} */ + const buildWatchCssCache = new Map(); + return { + name: 'vite-plugin-svelte:load-compiled-css', + + configResolved(c) { + const isDev = c.command === 'serve'; + const isBuildWatch = !!c.build?.watch; + useLocalCache = isDev || isBuildWatch; + }, + + resolveId: { + filter, // same filter in load to ensure minimal work + handler(id) { + log.debug(`resolveId resolved virtual css module ${id}`, undefined, 'resolve'); + return id; + } + }, + load: { + filter, + async handler(id) { + const ssr = this.environment.config.consumer === 'server'; + const svelteRequest = api.idParser(id, ssr); + if (!svelteRequest) { + return; + } + let cachedCss = this.getModuleInfo(svelteRequest.filename)?.meta.svelte?.css; + // in `build --watch` or dev ssr reloads getModuleInfo only returns changed module data. + // To ensure virtual css is loaded unchanged, we cache it here separately + if (useLocalCache) { + if (cachedCss) { + buildWatchCssCache.set(svelteRequest.filename, cachedCss); + } else { + cachedCss = buildWatchCssCache.get(svelteRequest.filename); + } + } + + if (cachedCss) { + const { hasGlobal, ...css } = cachedCss; + if (hasGlobal === false) { + // hasGlobal was added in svelte 5.26.0, so make sure it is boolean false + css.meta ??= {}; + css.meta.vite ??= {}; + css.meta.vite.cssScopeTo = [svelteRequest.filename, 'default']; + } + css.moduleType = 'css'; + return css; + } else { + log.warn(`failed to load virtual css module ${id}`, undefined, 'load'); + } + } + } + }; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js new file mode 100644 index 0000000000000000000000000000000000000000..2c762c0d2af5198a120b08e0433773ac7d888197 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/load-custom.js @@ -0,0 +1,42 @@ +import fs from 'node:fs'; +import { log } from '../utils/log.js'; + +/** + * if svelte config includes files that vite treats as assets (e.g. .svg) + * we have to manually load them to avoid getting urls + * + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function loadCustom(api) { + /** @type {import('vite').Plugin} */ + const plugin = { + name: 'vite-plugin-svelte:load-custom', + enforce: 'pre', // must come before vites own asset handling or custom extensions like .svg won't work + configResolved() { + //@ts-expect-error load defined below but filter not in type + plugin.load.filter = api.filter; + }, + + load: { + //filter: is set in configResolved + async handler(id) { + const config = this.environment.config; + const ssr = config.consumer === 'server'; + const svelteRequest = api.idParser(id, ssr); + if (svelteRequest) { + const { filename, query } = svelteRequest; + if (!query.url && config.assetsInclude(filename)) { + log.debug( + `loading ${filename} to prevent vite asset handling to turn it into a url by default`, + undefined, + 'load' + ); + return fs.readFileSync(filename, 'utf-8'); + } + } + } + } + }; + return plugin; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js new file mode 100644 index 0000000000000000000000000000000000000000..827885ea663eda4626483b723707f7ea11252f31 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/preprocess.js @@ -0,0 +1,208 @@ +import { toRollupError } from '../utils/error.js'; +import { mapToRelative } from '../utils/sourcemaps.js'; +import * as svelte from 'svelte/compiler'; +import { log } from '../utils/log.js'; +import { arraify } from '../utils/options.js'; +import fs from 'node:fs'; +import path from 'node:path'; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function preprocess(api) { + /** + * @type {import("../types/options.js").ResolvedOptions} + */ + let options; + + /** + * @type {DependenciesCache} + */ + let dependenciesCache; + + /** + * @type {import("../types/compile.d.ts").PreprocessSvelte} + */ + let preprocessSvelte; + + /** @type {import('vite').Plugin} */ + const plugin = { + name: 'vite-plugin-svelte:preprocess', + enforce: 'pre', + configResolved(c) { + options = api.options; + if (arraify(options.preprocess).length > 0) { + preprocessSvelte = createPreprocessSvelte(options, c); + // @ts-expect-error defined below but filter not in type + plugin.transform.filter = api.filter; + } else { + log.debug( + `disabling ${plugin.name} because no preprocessor is configured`, + undefined, + 'preprocess' + ); + // @ts-expect-error force set undefined to clear memory + preprocessSvelte = undefined; + // @ts-expect-error defined below but filter not in type + plugin.transform.filter = { id: /$./ }; // never match + } + }, + configureServer(server) { + dependenciesCache = new DependenciesCache(server); + }, + buildStart() { + dependenciesCache?.clear(); + }, + transform: { + async handler(code, id) { + const ssr = this.environment.config.consumer === 'server'; + const svelteRequest = api.idParser(id, ssr); + if (!svelteRequest) { + return; + } + try { + const preprocessed = await preprocessSvelte(svelteRequest, code, options); + dependenciesCache?.update(svelteRequest, preprocessed?.dependencies ?? []); + if (!preprocessed) { + return; + } + if (options.isBuild && this.environment.config.build.watch && preprocessed.dependencies) { + for (const dep of preprocessed.dependencies) { + this.addWatchFile(dep); + } + } + + /** @type {import('vite').Rollup.SourceDescription}*/ + const result = { code: preprocessed.code }; + if (preprocessed.map) { + // @ts-expect-error type differs but should work + result.map = preprocessed.map; + } + return result; + } catch (e) { + throw toRollupError(e, options); + } + } + } + }; + return plugin; +} +/** + * @param {import("../types/options.js").ResolvedOptions} options + * @param {import("vite").ResolvedConfig} resolvedConfig + * @returns {import('../types/compile.d.ts').PreprocessSvelte} + */ +function createPreprocessSvelte(options, resolvedConfig) { + /** @type {Array} */ + const preprocessors = arraify(options.preprocess); + + for (const preprocessor of preprocessors) { + if (preprocessor.style && '__resolvedConfig' in preprocessor.style) { + preprocessor.style.__resolvedConfig = resolvedConfig; + } + } + + /** @type {import('../types/compile.d.ts').PreprocessSvelte} */ + return async function preprocessSvelte(svelteRequest, code) { + const { filename } = svelteRequest; + let preprocessed; + if (preprocessors && preprocessors.length > 0) { + try { + preprocessed = await svelte.preprocess(code, preprocessors, { filename }); // full filename here so postcss works + } catch (e) { + e.message = `Error while preprocessing ${filename}${e.message ? ` - ${e.message}` : ''}`; + throw e; + } + if (typeof preprocessed?.map === 'object') { + mapToRelative(preprocessed?.map, filename); + } + return preprocessed; + } + }; +} + +/** + * @class + * + * caches dependencies of preprocessed files and emit change events on dependants + */ +class DependenciesCache { + /** @type {Map} */ + #dependencies = new Map(); + /** @type {Map>} */ + #dependants = new Map(); + + /** @type {import('vite').ViteDevServer} */ + #server; + /** + * + * @param {import('vite').ViteDevServer} server + */ + constructor(server) { + this.#server = server; + /** @type {(filename: string) => void} */ + const emitChangeEventOnDependants = (filename) => { + const dependants = this.#dependants.get(filename); + dependants?.forEach((dependant) => { + if (fs.existsSync(dependant)) { + log.debug( + `emitting virtual change event for "${dependant}" because dependency "${filename}" changed`, + undefined, + 'hmr' + ); + server.watcher.emit('change', dependant); + } + }); + }; + server.watcher.on('change', emitChangeEventOnDependants); + server.watcher.on('unlink', emitChangeEventOnDependants); + } + + /** + * @param {string} file + */ + #ensureWatchedFile(file) { + const root = this.#server.config.root; + if ( + file && + // only need to watch if out of root + !file.startsWith(root + '/') && + // some rollup plugins use null bytes for private resolved Ids + !file.includes('\0') && + fs.existsSync(file) + ) { + // resolve file to normalized system path + this.#server.watcher.add(path.resolve(file)); + } + } + + clear() { + this.#dependencies.clear(); + this.#dependants.clear(); + } + + /** + * + * @param {import('../types/id.d.ts').SvelteRequest} svelteRequest + * @param {string[]} dependencies + */ + update(svelteRequest, dependencies) { + const id = svelteRequest.normalizedFilename; + const prevDependencies = this.#dependencies.get(id) || []; + + this.#dependencies.set(id, dependencies); + const removed = prevDependencies.filter((d) => !dependencies.includes(d)); + const added = dependencies.filter((d) => !prevDependencies.includes(d)); + added.forEach((d) => { + this.#ensureWatchedFile(d); + if (!this.#dependants.has(d)) { + this.#dependants.set(d, new Set()); + } + /** @type {Set} */ (this.#dependants.get(d)).add(svelteRequest.filename); + }); + removed.forEach((d) => { + /** @type {Set} */ (this.#dependants.get(d)).delete(svelteRequest.filename); + }); + } +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js new file mode 100644 index 0000000000000000000000000000000000000000..56468a5ac9942721537d1e934dacbbb95af623ef --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/plugins/setup-optimizer.js @@ -0,0 +1,340 @@ +import fs from 'node:fs/promises'; +import path from 'node:path'; +import { readFileSync } from 'node:fs'; +import * as svelte from 'svelte/compiler'; +import { log } from '../utils/log.js'; +import { toESBuildError, toRollupError } from '../utils/error.js'; +import { safeBase64Hash } from '../utils/hash.js'; +import { normalize } from '../utils/id.js'; +import * as vite from 'vite'; +// @ts-ignore not typed on vite +const { rolldownVersion } = vite; + +/** + * @typedef {NonNullable} EsbuildOptions + * @typedef {NonNullable[number]} EsbuildPlugin + */ +/** + * @typedef {NonNullable} RollupPlugin + */ + +const optimizeSveltePluginName = 'vite-plugin-svelte:optimize'; +const optimizeSvelteModulePluginName = 'vite-plugin-svelte:optimize-module'; + +/** + * @param {import('../types/plugin-api.d.ts').PluginAPI} api + * @returns {import('vite').Plugin} + */ +export function setupOptimizer(api) { + /** @type {import('vite').ResolvedConfig} */ + let viteConfig; + + return { + name: 'vite-plugin-svelte:setup-optimizer', + apply: 'serve', + config() { + /** @type {import('vite').UserConfig['optimizeDeps']} */ + const optimizeDeps = { + // Experimental Vite API to allow these extensions to be scanned and prebundled + extensions: ['.svelte'] + }; + // Add optimizer plugins to prebundle Svelte files. + // Currently, a placeholder as more information is needed after Vite config is resolved, + // the added plugins are patched in configResolved below + if (rolldownVersion) { + //@ts-ignore rolldown types not finished + optimizeDeps.rollupOptions = { + plugins: [ + placeholderRolldownOptimizerPlugin(optimizeSveltePluginName), + placeholderRolldownOptimizerPlugin(optimizeSvelteModulePluginName) + ] + }; + } else { + optimizeDeps.esbuildOptions = { + plugins: [ + { name: optimizeSveltePluginName, setup: () => {} }, + { name: optimizeSvelteModulePluginName, setup: () => {} } + ] + }; + } + return { optimizeDeps }; + }, + configResolved(c) { + viteConfig = c; + const optimizeDeps = c.optimizeDeps; + if (rolldownVersion) { + const plugins = + // @ts-expect-error not typed + optimizeDeps.rollupOptions?.plugins?.filter((p) => + [optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name) + ) ?? []; + for (const plugin of plugins) { + patchRolldownOptimizerPlugin(plugin, api.options); + } + } else { + const plugins = + optimizeDeps.esbuildOptions?.plugins?.filter((p) => + [optimizeSveltePluginName, optimizeSvelteModulePluginName].includes(p.name) + ) ?? []; + for (const plugin of plugins) { + patchESBuildOptimizerPlugin(plugin, api.options); + } + } + }, + async buildStart() { + if (!api.options.prebundleSvelteLibraries) return; + const changed = await svelteMetadataChanged(viteConfig.cacheDir, api.options); + if (changed) { + // Force Vite to optimize again. Although we mutate the config here, it works because + // Vite's optimizer runs after `buildStart()`. + viteConfig.optimizeDeps.force = true; + } + } + }; +} + +/** + * @param {EsbuildPlugin} plugin + * @param {import('../types/options.d.ts').ResolvedOptions} options + */ +function patchESBuildOptimizerPlugin(plugin, options) { + const components = plugin.name === optimizeSveltePluginName; + const compileFn = components ? compileSvelte : compileSvelteModule; + const statsName = components ? 'prebundle library components' : 'prebundle library modules'; + const filter = components ? /\.svelte(?:\?.*)?$/ : /\.svelte\.[jt]s(?:\?.*)?$/; + plugin.setup = (build) => { + if (build.initialOptions.plugins?.some((v) => v.name === 'vite:dep-scan')) return; + + /** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection | undefined} */ + let statsCollection; + build.onStart(() => { + statsCollection = options.stats?.startCollection(statsName, { + logResult: (c) => c.stats.length > 1 + }); + }); + build.onLoad({ filter }, async ({ path: filename }) => { + const code = readFileSync(filename, 'utf8'); + try { + const result = await compileFn(options, { filename, code }, statsCollection); + const contents = result.map + ? result.code + '//# sourceMappingURL=' + result.map.toUrl() + : result.code; + return { contents }; + } catch (e) { + return { errors: [toESBuildError(e, options)] }; + } + }); + build.onEnd(() => { + statsCollection?.finish(); + }); + }; +} + +/** + * @param {RollupPlugin} plugin + * @param {import('../types/options.d.ts').ResolvedOptions} options + */ +function patchRolldownOptimizerPlugin(plugin, options) { + const components = plugin.name === optimizeSveltePluginName; + const compileFn = components ? compileSvelte : compileSvelteModule; + const statsName = components ? 'prebundle library components' : 'prebundle library modules'; + const includeRe = components ? /^[^?#]+\.svelte(?:[?#]|$)/ : /^[^?#]+\.svelte\.[jt]s(?:[?#]|$)/; + /** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection | undefined} */ + let statsCollection; + + plugin.options = (opts) => { + // @ts-expect-error plugins is an array here + const isScanner = opts.plugins.some( + (/** @type {{ name: string; }} */ p) => p.name === 'vite:dep-scan:resolve' + ); + if (isScanner) { + delete plugin.buildStart; + delete plugin.transform; + delete plugin.buildEnd; + } else { + plugin.transform = { + filter: { id: includeRe }, + /** + * @param {string} code + * @param {string} filename + */ + async handler(code, filename) { + try { + return await compileFn(options, { filename, code }, statsCollection); + } catch (e) { + throw toRollupError(e, options); + } + } + }; + plugin.buildStart = () => { + statsCollection = options.stats?.startCollection(statsName, { + logResult: (c) => c.stats.length > 1 + }); + }; + plugin.buildEnd = () => { + statsCollection?.finish(); + }; + } + }; +} + +/** + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @param {{ filename: string, code: string }} input + * @param {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection} [statsCollection] + * @returns {Promise} + */ +async function compileSvelte(options, { filename, code }, statsCollection) { + let css = options.compilerOptions.css; + if (css !== 'injected') { + // TODO ideally we'd be able to externalize prebundled styles too, but for now always put them in the js + css = 'injected'; + } + /** @type {import('svelte/compiler').CompileOptions} */ + const compileOptions = { + dev: true, // default to dev: true because prebundling is only used in dev + ...options.compilerOptions, + css, + filename, + generate: 'client' + }; + + if (compileOptions.hmr && options.emitCss) { + const hash = `s-${safeBase64Hash(normalize(filename, options.root))}`; + compileOptions.cssHash = () => hash; + } + + let preprocessed; + + if (options.preprocess) { + try { + preprocessed = await svelte.preprocess(code, options.preprocess, { filename }); + } catch (e) { + e.message = `Error while preprocessing ${filename}${e.message ? ` - ${e.message}` : ''}`; + throw e; + } + if (preprocessed.map) compileOptions.sourcemap = preprocessed.map; + } + + const finalCode = preprocessed ? preprocessed.code : code; + + const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ + filename, + code: finalCode, + compileOptions + }); + + if (dynamicCompileOptions && log.debug.enabled) { + log.debug( + `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, + undefined, + 'compile' + ); + } + + const finalCompileOptions = dynamicCompileOptions + ? { + ...compileOptions, + ...dynamicCompileOptions + } + : compileOptions; + const endStat = statsCollection?.start(filename); + const compiled = svelte.compile(finalCode, finalCompileOptions); + if (endStat) { + endStat(); + } + return { + ...compiled.js, + moduleType: 'js' + }; +} + +/** + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @param {{ filename: string; code: string }} input + * @param {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection} [statsCollection] + * @returns {Promise} + */ +async function compileSvelteModule(options, { filename, code }, statsCollection) { + const endStat = statsCollection?.start(filename); + const compiled = svelte.compileModule(code, { + dev: options.compilerOptions?.dev ?? true, // default to dev: true because prebundling is only used in dev + filename, + generate: 'client' + }); + if (endStat) { + endStat(); + } + return { + ...compiled.js, + moduleType: 'js' + }; +} + +// List of options that changes the prebundling result +/** @type {(keyof import('../types/options.d.ts').ResolvedOptions)[]} */ +const PREBUNDLE_SENSITIVE_OPTIONS = [ + 'compilerOptions', + 'configFile', + 'experimental', + 'extensions', + 'ignorePluginPreprocessors', + 'preprocess' +]; + +/** + * stores svelte metadata in cache dir and compares if it has changed + * + * @param {string} cacheDir + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @returns {Promise} Whether the Svelte metadata has changed + */ +async function svelteMetadataChanged(cacheDir, options) { + const svelteMetadata = generateSvelteMetadata(options); + const svelteMetadataPath = path.resolve(cacheDir, '_svelte_metadata.json'); + + const currentSvelteMetadata = JSON.stringify(svelteMetadata, (_, value) => { + // Handle preprocessors + return typeof value === 'function' ? value.toString() : value; + }); + + /** @type {string | undefined} */ + let existingSvelteMetadata; + try { + existingSvelteMetadata = await fs.readFile(svelteMetadataPath, 'utf8'); + } catch { + // ignore + } + + await fs.mkdir(cacheDir, { recursive: true }); + await fs.writeFile(svelteMetadataPath, currentSvelteMetadata); + return currentSvelteMetadata !== existingSvelteMetadata; +} + +/** + * + * @param {string} name + * @returns {import('vite').Rollup.Plugin} + */ +function placeholderRolldownOptimizerPlugin(name) { + return { + name, + options() {}, + buildStart() {}, + buildEnd() {}, + transform: { filter: { id: /^$/ }, handler() {} } + }; +} + +/** + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @returns {Partial} + */ +function generateSvelteMetadata(options) { + /** @type {Record} */ + const metadata = {}; + for (const key of PREBUNDLE_SENSITIVE_OPTIONS) { + metadata[key] = options[key]; + } + return metadata; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js new file mode 100644 index 0000000000000000000000000000000000000000..d1b695cf46f62f9ea6bb671b2053a6c9880838ae --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.js @@ -0,0 +1,166 @@ +import process from 'node:process'; +import * as vite from 'vite'; +import { mapToRelative, removeLangSuffix } from './utils/sourcemaps.js'; +const { + isCSSRequest, + preprocessCSS, + resolveConfig, + transformWithEsbuild, + //@ts-ignore rolldown types don't exist + rolldownVersion, + //@ts-ignore rolldown types don't exist + transformWithOxc +} = vite; +/** + * @typedef {(code: string, filename: string) => Promise<{ code: string; map?: any; deps?: Set }>} CssTransform + */ + +const supportedScriptLangs = ['ts']; + +export const lang_sep = '.vite-preprocess'; + +/** + * @param {import('./public.d.ts').VitePreprocessOptions} [opts] + * @returns {import('svelte/compiler').PreprocessorGroup} + */ +export function vitePreprocess(opts) { + /** @type {import('svelte/compiler').PreprocessorGroup} */ + const preprocessor = { name: 'vite-preprocess' }; + if (opts?.script === true) { + preprocessor.script = rolldownVersion ? viteScriptOxc().script : viteScript().script; + } + if (opts?.style !== false) { + const styleOpts = typeof opts?.style == 'object' ? opts?.style : undefined; + preprocessor.style = viteStyle(styleOpts).style; + } + return preprocessor; +} + +/** + * @returns {{ script: import('svelte/compiler').Preprocessor }} + */ +function viteScript() { + return { + async script({ attributes, content, filename = '' }) { + const lang = /** @type {string} */ (attributes.lang); + if (!supportedScriptLangs.includes(lang)) return; + const { code, map } = await transformWithEsbuild(content, filename, { + loader: /** @type {import('vite').ESBuildOptions['loader']} */ (lang), + target: 'esnext', + tsconfigRaw: { + compilerOptions: { + // svelte typescript needs this flag to work with type imports + importsNotUsedAsValues: 'preserve', + preserveValueImports: true + } + } + }); + + mapToRelative(map, filename); + + return { + code, + map + }; + } + }; +} + +/** + * @returns {{ script: import('svelte/compiler').Preprocessor }} + */ +function viteScriptOxc() { + return { + async script({ attributes, content, filename = '' }) { + if (typeof attributes.lang !== 'string' || !supportedScriptLangs.includes(attributes.lang)) { + return; + } + const lang = /** @type {'ts'} */ (attributes.lang); + const { code, map } = await transformWithOxc(content, filename, { + lang, + target: 'esnext' + // TODO, how to pass tsconfig compilerOptions (or not needed as config is loaded for file + /*tsconfigRaw: { + compilerOptions: { + // svelte typescript needs this flag to work with type imports + importsNotUsedAsValues: 'preserve', + preserveValueImports: true + } + }*/ + }); + + mapToRelative(map, filename); + + return { + code, + map + }; + } + }; +} + +/** + * @param {import('vite').ResolvedConfig | import('vite').InlineConfig} config + * @returns {{ style: import('svelte/compiler').Preprocessor }} + */ +function viteStyle(config = {}) { + /** @type {Promise | CssTransform} */ + let cssTransform; + /** @type {import('svelte/compiler').Preprocessor} */ + const style = async ({ attributes, content, filename = '' }) => { + const ext = attributes.lang ? `.${attributes.lang}` : '.css'; + if (attributes.lang && !isCSSRequest(ext)) return; + if (!cssTransform) { + cssTransform = createCssTransform(style, config).then((t) => (cssTransform = t)); + } + const transform = await cssTransform; + const suffix = `${lang_sep}${ext}`; + const moduleId = `${filename}${suffix}`; + const { code, map, deps } = await transform(content, moduleId); + removeLangSuffix(map, suffix); + mapToRelative(map, filename); + const dependencies = deps ? Array.from(deps).filter((d) => !d.endsWith(suffix)) : undefined; + return { + code, + map: map ?? undefined, + dependencies + }; + }; + // @ts-expect-error tag so can be found by v-p-s + style.__resolvedConfig = null; + return { style }; +} + +/** + * @param {import('svelte/compiler').Preprocessor} style + * @param {import('vite').ResolvedConfig | import('vite').InlineConfig} config + * @returns {Promise} + */ +async function createCssTransform(style, config) { + /** @type {import('vite').ResolvedConfig} */ + let resolvedConfig; + // @ts-expect-error special prop added if running in v-p-s + if (style.__resolvedConfig) { + // @ts-expect-error not typed + resolvedConfig = style.__resolvedConfig; + } else if (isResolvedConfig(config)) { + resolvedConfig = config; + } else { + // default to "build" if no NODE_ENV is set to avoid running in dev mode for svelte-check etc. + const useBuild = !process.env.NODE_ENV || process.env.NODE_ENV === 'production'; + const command = useBuild ? 'build' : 'serve'; + const defaultMode = useBuild ? 'production' : 'development'; + resolvedConfig = await resolveConfig(config, command, defaultMode, defaultMode, false); + } + return async (code, filename) => { + return preprocessCSS(code, filename, resolvedConfig); + }; +} + +/** + * @param {any} config + * @returns {config is import('vite').ResolvedConfig} + */ +function isResolvedConfig(config) { + return !!config.inlineConfig; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a21280b72f912f7a9bdbfbe75b9dfceec125493a --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/public.d.ts @@ -0,0 +1,217 @@ +import type { InlineConfig, ResolvedConfig } from 'vite'; +import type { CompileOptions, Warning, PreprocessorGroup } from 'svelte/compiler'; +import type { Options as InspectorOptions } from '@sveltejs/vite-plugin-svelte-inspector'; + +export type Options = Omit & PluginOptionsInline; + +interface PluginOptionsInline extends PluginOptions { + /** + * Path to a svelte config file, either absolute or relative to Vite root + * + * set to `false` to ignore the svelte config file + * + * @see https://vitejs.dev/config/#root + */ + configFile?: string | false; +} + +export interface PluginOptions { + /** + * A `picomatch` pattern, or array of patterns, which specifies the files the plugin should + * operate on. By default, all svelte files are included. + * + * @see https://github.com/micromatch/picomatch + */ + include?: Arrayable; + /** + * A `picomatch` pattern, or array of patterns, which specifies the files to be ignored by the + * plugin. By default, no files are ignored. + * + * @see https://github.com/micromatch/picomatch + */ + exclude?: Arrayable; + /** + * Emit Svelte styles as virtual CSS files for Vite and other plugins to process + * + * @default true + */ + emitCss?: boolean; + /** + * Enable or disable Hot Module Replacement. + * Deprecated, use compilerOptions.hmr instead! + * + * @deprecated + * @default true for development, always false for production + */ + hot?: boolean; + + /** + * Some Vite plugins can contribute additional preprocessors by defining `api.sveltePreprocess`. + * If you don't want to use them, set this to true to ignore them all or use an array of strings + * with plugin names to specify which. + * + * @default false + */ + ignorePluginPreprocessors?: boolean | string[]; + /** + * vite-plugin-svelte automatically handles excluding svelte libraries and reinclusion of their dependencies + * in vite.optimizeDeps. + * + * `disableDependencyReinclusion: true` disables all reinclusions + * `disableDependencyReinclusion: ['foo','bar']` disables reinclusions for dependencies of foo and bar + * + * This should be used for hybrid packages that contain both node and browser dependencies, eg Routify + * + * @default false + */ + disableDependencyReinclusion?: boolean | string[]; + /** + * Enable support for Vite's dependency optimization to prebundle Svelte libraries. + * + * To disable prebundling for a specific library, add it to `optimizeDeps.exclude`. + * + * @default true for dev, false for build + */ + prebundleSvelteLibraries?: boolean; + /** + * toggle/configure Svelte Inspector + * + * @default unset for dev, always false for build + */ + inspector?: InspectorOptions | boolean; + + /** + * A function to update `compilerOptions` before compilation + * + * `data.filename` - The file to be compiled + * `data.code` - The preprocessed Svelte code + * `data.compileOptions` - The current compiler options + * + * To change part of the compiler options, return an object with the changes you need. + * + * @example + * ``` + * ({ filename, compileOptions }) => { + * // Dynamically set runes mode per Svelte file + * if (forceRunesMode(filename) && !compileOptions.runes) { + * return { runes: true }; + * } + * } + * ``` + */ + dynamicCompileOptions?: (data: { + filename: string; + code: string; + compileOptions: Partial; + }) => Promise | void> | Partial | void; + + /** + * These options are considered experimental and breaking changes to them can occur in any release + */ + experimental?: ExperimentalOptions; +} + +export interface SvelteConfig { + /** + * A list of file extensions to be compiled by Svelte + * + * @default ['.svelte'] + */ + extensions?: string[]; + /** + * An array of preprocessors to transform the Svelte source code before compilation + * + * @see https://svelte.dev/docs/svelte/svelte-compiler#PreprocessorGroup + */ + preprocess?: Arrayable; + /** + * The options to be passed to the Svelte compiler. A few options are set by default, + * including `dev` and `css`. However, some options are non-configurable, like + * `filename`, `format`, `generate`, and `cssHash` (in dev). + * + * @see https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions + */ + compilerOptions?: Omit; + + /** + * Handles warning emitted from the Svelte compiler + * + * warnings emitted for files in node_modules are logged at the debug level, to see them run + * `DEBUG=vite-plugin-svelte:node-modules-onwarn pnpm build` + * + * @example + * ``` + * (warning, defaultHandler) => { + * // ignore some warnings + * if (!['foo','bar'].includes(warning.code)) { + * defaultHandler(warning); + * } + * } + * ``` + * + */ + onwarn?: (warning: Warning, defaultHandler: (warning: Warning) => void) => void; + /** + * Options for vite-plugin-svelte + */ + vitePlugin?: PluginOptions; +} + +/** + * These options are considered experimental and breaking changes to them can occur in any release + */ +interface ExperimentalOptions { + /** + * send a websocket message with svelte compiler warnings during dev + * + */ + sendWarningsToBrowser?: boolean; + /** + * disable svelte field resolve warnings + * + * @default false + */ + disableSvelteResolveWarnings?: boolean; + + /** + * disable api.sveltePreprocess deprecation warnings + * + * @default false + */ + disableApiSveltePreprocessWarnings?: boolean; + + compileModule?: CompileModuleOptions; +} + +interface CompileModuleOptions { + /** + * infix that must be present in filename + * @default ['.svelte.'] + */ + infixes?: string[]; + /** + * module extensions + * @default ['.ts','.js'] + */ + extensions?: string[]; + include?: Arrayable; + exclude?: Arrayable; +} + +type Arrayable = T | T[]; + +export interface VitePreprocessOptions { + /** + * preprocess script block with vite pipeline. + * Since svelte5 this is not needed for typescript anymore + * + * @default false + */ + script?: boolean; + /** + * preprocess style blocks with vite pipeline + */ + style?: boolean | InlineConfig | ResolvedConfig; +} +// eslint-disable-next-line n/no-missing-import +export * from './index.js'; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..422a979b69e16911502dcb79990c46ef7b6744a2 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/compile.d.ts @@ -0,0 +1,37 @@ +import type { Processed, CompileResult } from 'svelte/compiler'; +import type { SvelteRequest } from './id.d.ts'; +import type { ResolvedOptions } from './options.d.ts'; +import type { CustomPluginOptionsVite, Rollup } from 'vite'; + +export type CompileSvelte = ( + svelteRequest: SvelteRequest, + code: string, + options: Partial, + sourcemap?: Rollup.SourceMap +) => Promise; + +export type PreprocessSvelte = ( + svelteRequest: SvelteRequest, + code: string, + options: Partial +) => Promise; + +export interface Code { + code: string; + map?: any; + dependencies?: any[]; + hasGlobal?: boolean; + moduleType?: string; //rolldown-vite + meta?: { + vite?: CustomPluginOptionsVite; + }; +} + +export interface CompileData { + filename: string; + normalizedFilename: string; + cssId: string; + lang: string; + compiled: CompileResult; + ssr: boolean | undefined; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8434c7e9ed3ca9cddbe1fcb54f4fe766517935d --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/id.d.ts @@ -0,0 +1,46 @@ +export type SvelteQueryTypes = 'style'; + +export interface RequestQuery { + // our own + svelte?: boolean; + type?: SvelteQueryTypes; + // vite specific + url?: boolean; + raw?: boolean; + direct?: boolean; + inline?: boolean; +} + +export interface SvelteRequest { + id: string; + cssId: string; + filename: string; + normalizedFilename: string; + query: RequestQuery; + timestamp: number; + ssr: boolean; + raw: boolean; +} + +export interface SvelteModuleRequest { + id: string; + filename: string; + normalizedFilename: string; + query: RequestQuery; + timestamp: number; + ssr: boolean; +} + +export type IdParser = (id: string, ssr: boolean, timestamp?: number) => SvelteRequest | undefined; + +export type IdFilter = { + id: { + include: Array; + exclude: Array; + }; +}; +export type ModuleIdParser = ( + id: string, + ssr: boolean, + timestamp?: number +) => SvelteModuleRequest | undefined; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd4f13e69bd3a28126229e922a39e11a57837b56 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/log.d.ts @@ -0,0 +1,24 @@ +import type { Warning } from 'svelte/compiler'; + +export interface LogFn extends SimpleLogFn { + (message: string, payload?: unknown, namespace?: string): void; + + enabled: boolean; + once: SimpleLogFn; +} + +export interface SimpleLogFn { + (message: string, payload?: unknown, namespace?: string): void; +} + +export type SvelteWarningsMessage = { + id: string; + filename: string; + normalizedFilename: string; + timestamp: number; + warnings: Warning[]; // allWarnings filtered by warnings where onwarn did not call the default handler + allWarnings: Warning[]; // includes warnings filtered by onwarn and our extra vite plugin svelte warnings + rawWarnings: Warning[]; // raw compiler output +}; + +export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b4ca4274b866b69f5f48773fdb4bc737f10c4cc --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/options.d.ts @@ -0,0 +1,21 @@ +import type { CompileOptions } from 'svelte/compiler'; +import type { ViteDevServer } from 'vite'; +// eslint-disable-next-line n/no-missing-import +import { VitePluginSvelteStats } from '../utils/vite-plugin-svelte-stats.js'; +import type { Options } from '../public.d.ts'; + +export interface PreResolvedOptions extends Options { + // these options are non-nullable after resolve + compilerOptions: CompileOptions; + // extra options + root: string; + isBuild: boolean; + isServe: boolean; + isDebug: boolean; +} + +export interface ResolvedOptions extends PreResolvedOptions { + isProduction: boolean; + server?: ViteDevServer; + stats?: VitePluginSvelteStats; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61869436e52045584e01c62eec68c0124474eb08 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/plugin-api.d.ts @@ -0,0 +1,15 @@ +import type { ResolvedOptions } from './options.d.ts'; +import type { IdFilter, IdParser } from './id.d.ts'; +import type { CompileSvelte } from './compile.d.ts'; + +export interface PluginAPI { + options: ResolvedOptions; + filter: IdFilter; + idParser: IdParser; + compileSvelte: CompileSvelte; + /** + * @deprecated use 'filter' instead + * // TODO remove in next major + */ + idFilter: IdFilter; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b69ebd457947014af8ecd50ca16c0372abcf9fc --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/types/vite-plugin-svelte-stats.d.ts @@ -0,0 +1,30 @@ +export interface Stat { + file: string; + pkg?: string; + start: number; + end: number; +} + +export interface StatCollection { + name: string; + options: CollectionOptions; + + start: (file: string) => () => void; + stats: Stat[]; + packageStats?: PackageStats[]; + collectionStart: number; + duration?: number; + finish: () => Promise | void; + finished: boolean; +} + +export interface PackageStats { + pkg: string; + files: number; + duration: number; +} + +export interface CollectionOptions { + logInProgress: (collection: StatCollection, now: number) => boolean; + logResult: (collection: StatCollection) => boolean; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js new file mode 100644 index 0000000000000000000000000000000000000000..29c11d052387ee8ba00df5438f2de64eea0aa6ce --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js @@ -0,0 +1,152 @@ +import * as svelte from 'svelte/compiler'; +import { safeBase64Hash } from './hash.js'; +import { log } from './log.js'; + +import { mapToRelative } from './sourcemaps.js'; +import { enhanceCompileError } from './error.js'; + +// TODO this is a patched version of https://github.com/sveltejs/vite-plugin-svelte/pull/796/files#diff-3bce0b33034aad4b35ca094893671f7e7ddf4d27254ae7b9b0f912027a001b15R10 +// which is closer to the other regexes in at least not falling into commented script +// but ideally would be shared exactly with svelte and other tools that use it +const scriptLangRE = + /|]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/g; + +/** + * @returns {import('../types/compile.d.ts').CompileSvelte} + */ +export function createCompileSvelte() { + /** @type {import('../types/vite-plugin-svelte-stats.d.ts').StatCollection | undefined} */ + let stats; + /** @type {import('../types/compile.d.ts').CompileSvelte} */ + return async function compileSvelte(svelteRequest, code, options, sourcemap) { + const { filename, normalizedFilename, cssId, ssr, raw } = svelteRequest; + const { emitCss = true } = options; + /** @type {import('svelte/compiler').Warning[]} */ + const warnings = []; + + if (options.stats) { + if (options.isBuild) { + if (!stats) { + // build is either completely ssr or csr, create stats collector on first compile + // it is then finished in the buildEnd hook. + stats = options.stats.startCollection(`${ssr ? 'ssr' : 'dom'} compile`, { + logInProgress: () => false + }); + } + } else { + // dev time ssr, it's a ssr request and there are no stats, assume new page load and start collecting + if (ssr && !stats) { + stats = options.stats.startCollection('ssr compile'); + } + // stats are being collected but this isn't an ssr request, assume page loaded and stop collecting + if (!ssr && stats) { + stats.finish(); + stats = undefined; + } + // TODO find a way to trace dom compile during dev + // problem: we need to call finish at some point but have no way to tell if page load finished + // also they for hmr updates too + } + } + + /** @type {import('svelte/compiler').CompileOptions} */ + const compileOptions = { + ...options.compilerOptions, + filename, + generate: ssr ? 'server' : 'client' + }; + + let finalCode = code; + if (compileOptions.hmr && options.emitCss) { + const hash = `s-${safeBase64Hash(normalizedFilename)}`; + compileOptions.cssHash = () => hash; + const closeStylePos = code.lastIndexOf(''); + if (closeStylePos > -1) { + // inject rule that forces compile to attach scope class to every node in the template + // this reduces the amount of js hot updates when editing css in .svelte files + finalCode = finalCode.slice(0, closeStylePos) + ' *{}' + finalCode.slice(closeStylePos); + } + } + + const dynamicCompileOptions = await options?.dynamicCompileOptions?.({ + filename, + code: finalCode, + compileOptions + }); + if (dynamicCompileOptions && log.debug.enabled) { + log.debug( + `dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`, + undefined, + 'compile' + ); + } + const finalCompileOptions = dynamicCompileOptions + ? { + ...compileOptions, + ...dynamicCompileOptions + } + : compileOptions; + if (sourcemap) { + finalCompileOptions.sourcemap = sourcemap; + } + const endStat = stats?.start(filename); + /** @type {import('svelte/compiler').CompileResult} */ + let compiled; + try { + compiled = svelte.compile(finalCode, { ...finalCompileOptions, filename }); + + // patch output with partial accept until svelte does it + // TODO remove later + if ( + options.server?.config.experimental.hmrPartialAccept && + compiled.js.code.includes('import.meta.hot.accept(') + ) { + compiled.js.code = compiled.js.code.replaceAll( + 'import.meta.hot.accept(', + 'import.meta.hot.acceptExports(["default"],' + ); + } + } catch (e) { + enhanceCompileError(e, code, options.preprocess); + throw e; + } + + if (endStat) { + endStat(); + } + mapToRelative(compiled.js?.map, filename); + mapToRelative(compiled.css?.map, filename); + if (warnings.length) { + if (!compiled.warnings) { + compiled.warnings = []; + } + compiled.warnings.push(...warnings); + } + if (!raw) { + // wire css import and code for hmr + const hasCss = compiled.css?.code?.trim()?.length ?? 0 > 0; + // compiler might not emit css with mode none or it may be empty + if (emitCss && hasCss) { + // TODO properly update sourcemap? + compiled.js.code += `\nimport ${JSON.stringify(cssId)};\n`; + } + } + + let lang = 'js'; + for (const match of code.matchAll(scriptLangRE)) { + if (match[2]) { + lang = match[2]; + break; + } + } + + return { + filename, + normalizedFilename, + cssId, + lang, + compiled, + ssr + }; + }; +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..eb53a7106f4668cd5228edbfc205ad14bd51c6c1 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/constants.js @@ -0,0 +1,36 @@ +import { createRequire } from 'node:module'; + +const sveltePkg = createRequire(import.meta.url)('svelte/package.json'); + +// list of svelte runtime dependencies to optimize together with svelte itself +export const SVELTE_RUNTIME_DEPENDENCIES = [ + 'clsx' // avoids dev server restart after page load with npm + vite6 (see #1067) +].filter((dep) => !!sveltePkg.dependencies?.[dep]); + +export const SVELTE_IMPORTS = Object.entries(sveltePkg.exports) + .map(([name, config]) => { + // ignore type only + if (typeof config === 'object' && Object.keys(config).length === 1 && config.types) { + return ''; + } + // ignore names + if (name === './package.json' || name === './compiler') { + return ''; + } + return name.replace(/^\./, 'svelte'); + }) + .filter((s) => s.length > 0); + +export const SVELTE_EXPORT_CONDITIONS = ['svelte']; + +export const FAQ_LINK_MISSING_EXPORTS_CONDITION = + 'https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition'; + +export const LINK_TRANSFORM_WITH_PLUGIN = + 'https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/advanced-usage.md#transform-svelte-files-with-vite-plugins'; + +export const DEFAULT_SVELTE_EXT = ['.svelte']; +export const DEFAULT_SVELTE_MODULE_INFIX = ['.svelte.']; +export const DEFAULT_SVELTE_MODULE_EXT = ['.js', '.ts']; + +export const SVELTE_VIRTUAL_STYLE_ID_REGEX = /[?&]svelte&type=style&lang.css$/; diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js new file mode 100644 index 0000000000000000000000000000000000000000..341bf3cd044e7926dbf04c8743d4a9fc7a100fa8 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/dependencies.js @@ -0,0 +1,60 @@ +const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [ + '@lukeed/uuid', + '@playwright/test', + '@sveltejs/kit', + '@sveltejs/package', + '@sveltejs/vite-plugin-svelte', + 'autoprefixer', + 'cookie', + 'dotenv', + 'esbuild', + 'eslint', + 'jest', + 'mdsvex', + 'playwright', + 'postcss', + 'prettier', + 'svelte', + 'svelte2tsx', + 'svelte-check', + 'svelte-preprocess', + 'tslib', + 'typescript', + 'vite', + 'vitest', + '__vite-browser-external' // see https://github.com/sveltejs/vite-plugin-svelte/issues/362 +]; +const COMMON_PREFIXES_WITHOUT_SVELTE_FIELD = [ + '@fontsource/', + '@postcss-plugins/', + '@rollup/', + '@sveltejs/adapter-', + '@types/', + '@typescript-eslint/', + 'eslint-', + 'jest-', + 'postcss-plugin-', + 'prettier-plugin-', + 'rollup-plugin-', + 'vite-plugin-' +]; + +/** + * Test for common dependency names that tell us it is not a package including a svelte field, eg. eslint + plugins. + * + * This speeds up the find process as we don't have to try and require the package.json for all of them + * + * @param {string} dependency + * @returns {boolean} true if it is a dependency without a svelte field + */ +export function isCommonDepWithoutSvelteField(dependency) { + return ( + COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD.includes(dependency) || + COMMON_PREFIXES_WITHOUT_SVELTE_FIELD.some( + (prefix) => + prefix.startsWith('@') + ? dependency.startsWith(prefix) + : dependency.substring(dependency.lastIndexOf('/') + 1).startsWith(prefix) // check prefix omitting @scope/ + ) + ); +} diff --git a/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js new file mode 100644 index 0000000000000000000000000000000000000000..6f943ae061f2b7863e7352b8ad6a4d542d5a8996 --- /dev/null +++ b/tools/ui/node_modules/@sveltejs/vite-plugin-svelte/src/utils/error.js @@ -0,0 +1,167 @@ +import { buildExtendedLogMessage } from './log.js'; + +/** + * convert an error thrown by svelte.compile to a RollupError so that vite displays it in a user friendly way + * @param {import('svelte/compiler').Warning & Error & {frame?: string}} error a svelte compiler error, which is a mix of Warning and an error + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @returns {import('vite').Rollup.RollupError} the converted error + */ +export function toRollupError(error, options) { + const { filename, frame, start, code, name, stack } = error; + /** @type {import('vite').Rollup.RollupError} */ + const rollupError = { + name, // needed otherwise sveltekit coalesce_to_error turns it into a string + id: filename, + message: buildExtendedLogMessage(error), // include filename:line:column so that it's clickable + frame: formatFrameForVite(frame), + code, + stack: options.isBuild || options.isDebug || !frame ? stack : '' + }; + if (start) { + rollupError.loc = { + line: start.line, + column: start.column, + file: filename + }; + } + return rollupError; +} + +/** + * convert an error thrown by svelte.compile to an esbuild PartialMessage + * @param {import('svelte/compiler').Warning & Error & {frame?: string}} error a svelte compiler error, which is a mix of Warning and an error + * @param {import('../types/options.d.ts').ResolvedOptions} options + * @returns {any} the converted error as esbuild PartialMessage + * + * note: typed any to avoid esbuild devDependency for a single internal type import + */ +export function toESBuildError(error, options) { + const { filename, frame, start, stack } = error; + /** @type any */ + const partialMessage = { + text: buildExtendedLogMessage(error) + }; + if (start) { + partialMessage.location = { + line: start.line, + column: start.column, + file: filename, + lineText: lineFromFrame(start.line, frame) // needed to get a meaningful error message on cli + }; + } + if (options.isBuild || options.isDebug || !frame) { + partialMessage.detail = stack; + } + return partialMessage; +} + +/** + * extract line with number from codeframe + * + * @param {number} lineNo + * @param {string} [frame] + * @returns {string} + */ +function lineFromFrame(lineNo, frame) { + if (!frame) { + return ''; + } + const lines = frame.split('\n'); + const errorLine = lines.find((line) => line.trimStart().startsWith(`${lineNo}: `)); + return errorLine ? errorLine.substring(errorLine.indexOf(': ') + 3) : ''; +} + +/** + * vite error overlay expects a specific format to show frames + * this reformats svelte frame (colon separated, less whitespace) + * to one that vite displays on overlay ( pipe separated, more whitespace) + * e.g. + * ``` + * 1: foo + * 2: bar; + * ^ + * 3: baz + * ``` + * to + * ``` + * 1 | foo + * 2 | bar; + * ^ + * 3 | baz + * ``` + * @see https://github.com/vitejs/vite/blob/96591bf9989529de839ba89958755eafe4c445ae/packages/vite/src/client/overlay.ts#L116 + * @param {string} [frame] + * @returns {string} + */ +function formatFrameForVite(frame) { + if (!frame) { + return ''; + } + return frame + .split('\n') + .map((line) => (line.match(/^\s+\^/) ? ' ' + line : ' ' + line.replace(':', ' | '))) + .join('\n'); +} + +/** + * + * @param {string} code the svelte error code + * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/errors.js + * @returns {boolean} + */ +function couldBeFixedByCssPreprocessor(code) { + return code === 'expected_token' || code === 'unexpected_eof' || code?.startsWith('css_'); +} + +/** + * @param {import('svelte/compiler').Warning & Error} err a svelte compiler error, which is a mix of Warning and an error + * @param {string} originalCode + * @param {import('../public.d.ts').Options['preprocess']} [preprocessors] + */ +export function enhanceCompileError(err, originalCode, preprocessors) { + preprocessors = arraify(preprocessors ?? []); + + /** @type {string[]} */ + const additionalMessages = []; + + // Handle incorrect CSS preprocessor usage + if (couldBeFixedByCssPreprocessor(err.code)) { + // Reference from Svelte: https://github.com/sveltejs/svelte/blob/9926347ad9dbdd0f3324d5538e25dcb7f5e442f8/packages/svelte/src/compiler/preprocess/index.js#L257 + const styleRe = + /|'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"/]+)*\s*)(?:\/>|>([\S\s]*?)<\/style>)/g; + + let m; + while ((m = styleRe.exec(originalCode))) { + if (m[0]?.startsWith('")} ${filename}:${func_range.start.line + 1}:${func_range.start.column + 1}`, + "", + ...text, + "", + `${chalk.bold("note:")} The exported name should be the same as the filename.`, + "", + ] + .join("\n"), + ); +} + +/** + * @param {string} filename + * @param {SgNode} match + */ +function report_import_mismatch(filename, match) { + const binding_range = match.getMatch("BINDING").range(); + const source_range = match.getMatch("SOURCE").range(); + + errors.push( + [ + `${chalk.bold.red("error")}: mismatch imported binding name.`, + "", + `${chalk.blue("-->")} ${filename}:${match.range().start.line + 1}`, + "", + match.text(), + [ + " ".repeat(binding_range.start.column), + chalk.red("^".repeat(binding_range.end.column - binding_range.start.column)), + " ".repeat(source_range.start.column - binding_range.end.column), + chalk.blue("-".repeat(source_range.end.column - source_range.start.column)), + ] + .join(""), + `${chalk.bold("note:")} The imported binding name should be the same as the import source basename.`, + "", + ] + .join("\n"), + ); +} + +/** + * @param {string} filename + */ +function report_noexport(filename) { + errors.push( + [`${chalk.bold.red("error")}: exported name not found`, `${chalk.blue("-->")} ${filename}`].join("\n"), + ); +} diff --git a/tools/ui/node_modules/@swc/helpers/scripts/build.js b/tools/ui/node_modules/@swc/helpers/scripts/build.js new file mode 100644 index 0000000000000000000000000000000000000000..32005a8331e8477509bc150e1b7ef136b8bd1e01 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/scripts/build.js @@ -0,0 +1,133 @@ +#!/usr/bin/env zx + +import { $, fs, glob } from "zx"; +import { ast_grep } from "./ast_grep.js"; +import { errors } from "./errors.js"; +import { root } from "./utils.js"; + +// clear generated content +await Promise.all([ + fs.remove(root("cjs")), + fs.remove(root("_")), + fs.remove(root("src")), +]); + +let modules = await glob("*.js", { cwd: root("esm") }); + +const task_queue = []; + +const NO_MODIFY = [ + "/* This file is automatically generated and should not be manually edited. */", + "/* To modify this file, please run the `npm run build` command instead. */", +]; + +// generate index.js +const indexESM = [...NO_MODIFY, ""]; + +const indexCJS = [`"use strict";`, "", ...NO_MODIFY, ""]; + +const cjs_export_list = []; +const cjs_module_lexer = []; + +const main_package_json = fs.readJSONSync(root("package.json")); + +main_package_json.exports = { + "./package.json": "./package.json", + "./esm/*": "./esm/*", + "./cjs/*": "./cjs/*", + "./src/*": "./src/*", + ".": { + "module-sync": "./esm/index.js", + webpack: "./esm/index.js", + import: "./esm/index.js", + default: "./cjs/index.cjs", + }, + "./_": { + "module-sync": "./esm/index.js", + webpack: "./esm/index.js", + import: "./esm/index.js", + default: "./cjs/index.cjs", + }, +}; + +modules.forEach((p) => { + const importBinding = p.slice(0, -3); + + main_package_json.exports[`./_/${importBinding}`] = { + "module-sync": `./esm/${importBinding}.js`, + webpack: `./esm/${importBinding}.js`, + import: `./esm/${importBinding}.js`, + default: `./cjs/${importBinding}.cjs`, + }; + + const alias_package = { + main: `../../cjs/${importBinding}.cjs`, + module: `../../esm/${importBinding}.js`, + }; + task_queue.push( + fs.outputJSON(root("_", importBinding, "package.json"), alias_package, { + encoding: "utf-8", + spaces: 4, + }), + ); + + if (importBinding === "index") { + return; + } + + task_queue.push( + fs.outputFile(root("src", `${importBinding}.mjs`), re_export_esm(importBinding), { + encoding: "utf-8", + }), + ); + + indexESM.push(`export { _ as ${importBinding} } from "./${importBinding}.js";`); + + cjs_module_lexer.push(`${importBinding}: null,`); + cjs_export_list.push(`get ${importBinding}() { + return require("./${importBinding}.cjs")._; + },`); +}); + +indexCJS.push( + `0 && (module.exports = {`, + "/* @Annotate_start: the CommonJS named exports for ESM import in node */", + ...cjs_module_lexer, + "/* @Annotate_end */", + `});`, + `module.exports = {`, + ...cjs_export_list, + `};`, +); + +task_queue.push( + fs.outputJSON(root("package.json"), main_package_json, { spaces: 4 }), + fs.outputFile(root("esm", "index.js"), indexESM.join("\n") + "\n", { + encoding: "utf-8", + }), + fs.outputFile(root("cjs", "index.cjs"), indexCJS.join("\n") + "\n", { + encoding: "utf-8", + }), + fs.outputFile(root("src", "index.mjs"), `export * from "../esm/index.js"`, { + encoding: "utf-8", + }), +); + +task_queue.push(...ast_grep()); + +await Promise.all(task_queue); + +if (errors.length > 0) { + errors.forEach((e) => { + console.error(e); + }); + process.exitCode = 1; +} else { + $.cwd = root("."); + await $`dprint fmt`; + await $`dprint fmt "scripts/*.js" -c scripts/.dprint.json`; +} + +function re_export_esm(importBinding) { + return `export { _ as default } from "../esm/${importBinding}.js"`; +} diff --git a/tools/ui/node_modules/@swc/helpers/scripts/errors.js b/tools/ui/node_modules/@swc/helpers/scripts/errors.js new file mode 100644 index 0000000000000000000000000000000000000000..b5b3c15937ed8898692244cccea7240dcaae1ebb --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/scripts/errors.js @@ -0,0 +1 @@ +export const errors = []; diff --git a/tools/ui/node_modules/@swc/helpers/scripts/utils.js b/tools/ui/node_modules/@swc/helpers/scripts/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..479b100ce30bd88647aed1475be95fef2129e45f --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/scripts/utils.js @@ -0,0 +1,3 @@ +export function root(...p) { + return path.resolve(__dirname, "..", ...p); +} diff --git a/tools/ui/node_modules/@swc/helpers/src/_apply_decorated_descriptor.mjs b/tools/ui/node_modules/@swc/helpers/src/_apply_decorated_descriptor.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e4839a154f839c83f9ad9e3caa3eb98acad12bc7 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_apply_decorated_descriptor.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_apply_decorated_descriptor.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2203_r.mjs b/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2203_r.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c10cb5619351b9460f740db5a4811f09b15cbdf2 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2203_r.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_apply_decs_2203_r.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2311.mjs b/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2311.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b9aec565d3410891aa9af033c85a2907f4497c5f --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_apply_decs_2311.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_apply_decs_2311.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_array_like_to_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_array_like_to_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7691b3201856cb14d8064c34ff6d4a356d79d972 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_array_like_to_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_array_like_to_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_array_with_holes.mjs b/tools/ui/node_modules/@swc/helpers/src/_array_with_holes.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1a622996dd2107d07ccf6a97a3b46b21242c977d --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_array_with_holes.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_array_with_holes.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_array_without_holes.mjs b/tools/ui/node_modules/@swc/helpers/src/_array_without_holes.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ee2f265ee78d338cc2e4a42c5f766c3c6394323f --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_array_without_holes.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_array_without_holes.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_assert_this_initialized.mjs b/tools/ui/node_modules/@swc/helpers/src/_assert_this_initialized.mjs new file mode 100644 index 0000000000000000000000000000000000000000..36772535e42670f86bbb351b24ef5b402ef237de --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_assert_this_initialized.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_assert_this_initialized.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_async_generator.mjs b/tools/ui/node_modules/@swc/helpers/src/_async_generator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b3ced536baf839a663df32be644a3206c18c3bb8 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_async_generator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_async_generator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_async_generator_delegate.mjs b/tools/ui/node_modules/@swc/helpers/src/_async_generator_delegate.mjs new file mode 100644 index 0000000000000000000000000000000000000000..29dd8b2230e90da9b8560d9ba238b3b1d9a3a221 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_async_generator_delegate.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_async_generator_delegate.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_async_iterator.mjs b/tools/ui/node_modules/@swc/helpers/src/_async_iterator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d1300321c17bb8934c7e6cc42a559721ecb1c01b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_async_iterator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_async_iterator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_async_to_generator.mjs b/tools/ui/node_modules/@swc/helpers/src/_async_to_generator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..18adef559169baa84723edc8f954b70489badd1d --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_async_to_generator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_async_to_generator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_await_async_generator.mjs b/tools/ui/node_modules/@swc/helpers/src/_await_async_generator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..da13a9fbdaca80544dae905cc12b77935706768f --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_await_async_generator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_await_async_generator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_await_value.mjs b/tools/ui/node_modules/@swc/helpers/src/_await_value.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3c2416176d572acbb144c717c5a4b0ed05c43b13 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_await_value.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_await_value.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_call_super.mjs b/tools/ui/node_modules/@swc/helpers/src/_call_super.mjs new file mode 100644 index 0000000000000000000000000000000000000000..da6071660c392fe04dda61a1aead8f8763db20c3 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_call_super.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_call_super.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_check_private_redeclaration.mjs b/tools/ui/node_modules/@swc/helpers/src/_check_private_redeclaration.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7d78cfe173fc3eccb36c19126752a142c3ab046a --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_check_private_redeclaration.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_check_private_redeclaration.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_destructure.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_destructure.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b606b53792b91b99a02af6d63c7c42dc0d0dbe0b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_destructure.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_apply_descriptor_destructure.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f888b6bef005107aef6ece6b311b532cadb0e908 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_apply_descriptor_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_set.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_set.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fb0067998aa7817f7e3701802a61e5e9f274d3dd --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_set.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_apply_descriptor_set.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_update.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_update.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e7a9915b2f9d7b0671716834e1d76141580fa2fa --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_apply_descriptor_update.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_apply_descriptor_update.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_call_check.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_call_check.mjs new file mode 100644 index 0000000000000000000000000000000000000000..220c3c81f0ff4d3e955d0d2fa929f75dde407543 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_call_check.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_call_check.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_access.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_access.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a52a4d8d6d109fba265e9e36a520532de81b1b67 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_access.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_check_private_static_access.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_field_descriptor.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_field_descriptor.mjs new file mode 100644 index 0000000000000000000000000000000000000000..cb8a623dc776747525ad601bd98ff874653eec18 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_check_private_static_field_descriptor.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_check_private_static_field_descriptor.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_extract_field_descriptor.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_extract_field_descriptor.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7586ce8211cd95b0da1acf472fcacb0409574472 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_extract_field_descriptor.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_extract_field_descriptor.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_name_tdz_error.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_name_tdz_error.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c211d7fb5d51e41913d960f7bc689a032a3c595a --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_name_tdz_error.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_name_tdz_error.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_destructure.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_destructure.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b06b763f8bdc824e2ea0c24de0760201eb3dbb9e --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_destructure.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_destructure.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1f8854a81cd2c9ecc4aac02e58498eb1a78e59cb --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_init.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_init.mjs new file mode 100644 index 0000000000000000000000000000000000000000..48d4d17b93a515e39518a58f00adeca0c724fd58 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_init.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_init.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_base.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_base.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a10b033f37bb151dbaa031a375c1e9b72b816337 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_base.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_loose_base.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_key.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_key.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6e80fd9835d817043f1e7c7a8c44ba8ccdb7018b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_loose_key.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_loose_key.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_set.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_set.mjs new file mode 100644 index 0000000000000000000000000000000000000000..cb54a1be34aebb9df26979d96db4980bb81f1ace --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_set.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_set.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_field_update.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_update.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c5f0c633e0ee9d8b3cbe49fc51ed1be62b3551ad --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_field_update.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_field_update.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_method_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9f5248a53d824b6f0fbf0b1c57b6cd46c89b05d6 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_method_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_method_init.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_init.mjs new file mode 100644 index 0000000000000000000000000000000000000000..afce453b890ae1fd887e3920a5203507c6c28677 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_init.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_method_init.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_private_method_set.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_set.mjs new file mode 100644 index 0000000000000000000000000000000000000000..327252dae17c7e4e2348081595b5af7ad9b41fca --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_private_method_set.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_private_method_set.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_destructure.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_destructure.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c35376d2dc8eee18ddcb3b322d423734172a70dc --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_destructure.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_static_private_field_destructure.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0cc7854d6e0a5e2d8d46b06a9213eec6652ecec2 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_static_private_field_spec_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_set.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_set.mjs new file mode 100644 index 0000000000000000000000000000000000000000..208cf9730a3c2265dccf8e9c42a6feace7fa1fb6 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_spec_set.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_static_private_field_spec_set.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_update.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_update.mjs new file mode 100644 index 0000000000000000000000000000000000000000..87e043817674aa712f46736b85e2c27fd8835908 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_field_update.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_static_private_field_update.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_class_static_private_method_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_method_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2241a1a84a2863cbd974e94efd5647703bfa0bf9 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_class_static_private_method_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_class_static_private_method_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_construct.mjs b/tools/ui/node_modules/@swc/helpers/src/_construct.mjs new file mode 100644 index 0000000000000000000000000000000000000000..54acb64d632828fb35c0273bdb7427262a79a9f5 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_construct.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_construct.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_create_class.mjs b/tools/ui/node_modules/@swc/helpers/src/_create_class.mjs new file mode 100644 index 0000000000000000000000000000000000000000..78c2af2273b8198e611978bec75b3e27b9912f89 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_create_class.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_create_class.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_create_for_of_iterator_helper_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_create_for_of_iterator_helper_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..303e056c5a26660873b4566d546bb02785207213 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_create_for_of_iterator_helper_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_create_for_of_iterator_helper_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_create_super.mjs b/tools/ui/node_modules/@swc/helpers/src/_create_super.mjs new file mode 100644 index 0000000000000000000000000000000000000000..44a06bfe18eaa069c86c7b2c85d482a155f06a12 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_create_super.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_create_super.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_decorate.mjs b/tools/ui/node_modules/@swc/helpers/src/_decorate.mjs new file mode 100644 index 0000000000000000000000000000000000000000..087899164b69fef93291302e293475dde067c99e --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_decorate.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_decorate.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_defaults.mjs b/tools/ui/node_modules/@swc/helpers/src/_defaults.mjs new file mode 100644 index 0000000000000000000000000000000000000000..624e68460fb3ea1e0fafae83db5dfc40a448ecf6 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_defaults.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_defaults.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_define_enumerable_properties.mjs b/tools/ui/node_modules/@swc/helpers/src/_define_enumerable_properties.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b6a87fc8db4d396bbf555c31fd319693b0e2f1ce --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_define_enumerable_properties.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_define_enumerable_properties.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_define_property.mjs b/tools/ui/node_modules/@swc/helpers/src/_define_property.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b60b2c824d6438cddd671ac08e21777adf1917ef --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_define_property.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_define_property.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_dispose.mjs b/tools/ui/node_modules/@swc/helpers/src/_dispose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2f217e87221b1bed86ef2014d60ca9cdd5f8f023 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_dispose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_dispose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_export_star.mjs b/tools/ui/node_modules/@swc/helpers/src/_export_star.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c7011c2f61a7f4173912a29a62bd7109cf089ca8 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_export_star.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_export_star.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_extends.mjs b/tools/ui/node_modules/@swc/helpers/src/_extends.mjs new file mode 100644 index 0000000000000000000000000000000000000000..804a28bab3d1cd3e01dfc065af3afd40214ed08d --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_extends.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_extends.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_get.mjs b/tools/ui/node_modules/@swc/helpers/src/_get.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fae4b22b5279e24a7c15ae631a7f4b56fa759784 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_get.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_get.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_get_prototype_of.mjs b/tools/ui/node_modules/@swc/helpers/src/_get_prototype_of.mjs new file mode 100644 index 0000000000000000000000000000000000000000..57e820cebb170ec6831f6c73dd137a7a10e4a783 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_get_prototype_of.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_get_prototype_of.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_identity.mjs b/tools/ui/node_modules/@swc/helpers/src/_identity.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5ab4a08a7e7207e27cfcc921940a069757d73e8e --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_identity.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_identity.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_inherits.mjs b/tools/ui/node_modules/@swc/helpers/src/_inherits.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d5e3767700736ad2a5305d6138ca93d9bb704d2c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_inherits.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_inherits.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_inherits_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_inherits_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4f5187d98db0c35363d36e5ffaaaf049ea04f673 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_inherits_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_inherits_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_initializer_define_property.mjs b/tools/ui/node_modules/@swc/helpers/src/_initializer_define_property.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fa0a3b8e2e1de0caef9b8d9f42e711a1b743ca89 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_initializer_define_property.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_initializer_define_property.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_initializer_warning_helper.mjs b/tools/ui/node_modules/@swc/helpers/src/_initializer_warning_helper.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f9251ab5bb30a1d403daf2c1297a065b22dd2bcb --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_initializer_warning_helper.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_initializer_warning_helper.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_instanceof.mjs b/tools/ui/node_modules/@swc/helpers/src/_instanceof.mjs new file mode 100644 index 0000000000000000000000000000000000000000..609f78692e0778dacf43f68178b5680800535ce5 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_instanceof.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_instanceof.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_interop_require_default.mjs b/tools/ui/node_modules/@swc/helpers/src/_interop_require_default.mjs new file mode 100644 index 0000000000000000000000000000000000000000..454ce7154f35618f3d90529075a33705c1ec252c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_interop_require_default.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_interop_require_default.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_interop_require_wildcard.mjs b/tools/ui/node_modules/@swc/helpers/src/_interop_require_wildcard.mjs new file mode 100644 index 0000000000000000000000000000000000000000..07f7a7ed50d966a913b170c51e2788fcd2303a3b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_interop_require_wildcard.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_interop_require_wildcard.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_is_native_function.mjs b/tools/ui/node_modules/@swc/helpers/src/_is_native_function.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8bacb3ab51baf5b97c00041a13b8941f36398175 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_is_native_function.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_is_native_function.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_is_native_reflect_construct.mjs b/tools/ui/node_modules/@swc/helpers/src/_is_native_reflect_construct.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7c0394d9c46319c4cc90b44ac782f0eb40ce3a0c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_is_native_reflect_construct.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_is_native_reflect_construct.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4baf94afb72d4e69c75859c799c435fa319380f4 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_iterable_to_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit.mjs b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit.mjs new file mode 100644 index 0000000000000000000000000000000000000000..45f70f503fdfc7a1b748ff477df426e697553a9c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_iterable_to_array_limit.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..400a9e019fa62d55e697898982b8416fc4b8db80 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_iterable_to_array_limit_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_iterable_to_array_limit_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_jsx.mjs b/tools/ui/node_modules/@swc/helpers/src/_jsx.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8b0646a0f85ffce214b69ddc1eabb738650aa99c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_jsx.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_jsx.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_new_arrow_check.mjs b/tools/ui/node_modules/@swc/helpers/src/_new_arrow_check.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e694d150cf518a9a826c74be35233e907346d2e5 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_new_arrow_check.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_new_arrow_check.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_non_iterable_rest.mjs b/tools/ui/node_modules/@swc/helpers/src/_non_iterable_rest.mjs new file mode 100644 index 0000000000000000000000000000000000000000..83218078cb83ac7ad740d4991143db7a5237074b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_non_iterable_rest.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_non_iterable_rest.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_non_iterable_spread.mjs b/tools/ui/node_modules/@swc/helpers/src/_non_iterable_spread.mjs new file mode 100644 index 0000000000000000000000000000000000000000..12993f133d0d19cafe2279dc1dc30b43ecfcde7b --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_non_iterable_spread.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_non_iterable_spread.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_object_destructuring_empty.mjs b/tools/ui/node_modules/@swc/helpers/src/_object_destructuring_empty.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b8aed9ce98d6933a22b9951013eab1315dd558d3 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_object_destructuring_empty.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_object_destructuring_empty.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_object_spread.mjs b/tools/ui/node_modules/@swc/helpers/src/_object_spread.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9b536f58d64da93abc86b8d1050baabe8f79133d --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_object_spread.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_object_spread.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_object_spread_props.mjs b/tools/ui/node_modules/@swc/helpers/src/_object_spread_props.mjs new file mode 100644 index 0000000000000000000000000000000000000000..799de3f688769af054dabb5f16accc42e1713c45 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_object_spread_props.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_object_spread_props.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_object_without_properties.mjs b/tools/ui/node_modules/@swc/helpers/src/_object_without_properties.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f0ce12c6c1d4060268f13d452cb98efccff35df7 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_object_without_properties.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_object_without_properties.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_object_without_properties_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_object_without_properties_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f6f26696e521cd5959979a55b2be6c97c804e1f3 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_object_without_properties_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_object_without_properties_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_overload_yield.mjs b/tools/ui/node_modules/@swc/helpers/src/_overload_yield.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d854c354454ebc5620c1cc556a092b867f5f11c3 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_overload_yield.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_overload_yield.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_possible_constructor_return.mjs b/tools/ui/node_modules/@swc/helpers/src/_possible_constructor_return.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ee9657d256cfa0ce49ba8fa14b3d718fd6ae17e9 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_possible_constructor_return.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_possible_constructor_return.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_read_only_error.mjs b/tools/ui/node_modules/@swc/helpers/src/_read_only_error.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3e95329b1430b6d42833466404eac08f997bd3b5 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_read_only_error.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_read_only_error.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_set.mjs b/tools/ui/node_modules/@swc/helpers/src/_set.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5cc033773f86b25240a88b6eaf3e68c7611b90d6 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_set.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_set.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_set_prototype_of.mjs b/tools/ui/node_modules/@swc/helpers/src/_set_prototype_of.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f244856c06d0e81b10b9e2af893ec186d13bbc7c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_set_prototype_of.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_set_prototype_of.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_skip_first_generator_next.mjs b/tools/ui/node_modules/@swc/helpers/src/_skip_first_generator_next.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f437b3ce8d22a24157f65ae86f68fdcc6b0d46e6 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_skip_first_generator_next.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_skip_first_generator_next.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..34f97233d08a7aca1b05c49c633d8082288f0e16 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_sliced_to_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..116211bc5e8d53fb6df1b836ac6bb968c2a11992 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_sliced_to_array_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_sliced_to_array_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_super_prop_base.mjs b/tools/ui/node_modules/@swc/helpers/src/_super_prop_base.mjs new file mode 100644 index 0000000000000000000000000000000000000000..25a1b4b471aa70874f7903b58213fa215f2b4007 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_super_prop_base.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_super_prop_base.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal.mjs b/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ea788727152e810036920619a7d3206d53acf5b9 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_tagged_template_literal.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal_loose.mjs b/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal_loose.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f65c3bb96cb74697023650709cb99c917af31626 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_tagged_template_literal_loose.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_tagged_template_literal_loose.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_throw.mjs b/tools/ui/node_modules/@swc/helpers/src/_throw.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a0b50e049821d3616ee6cb659d28eaa153ceddfd --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_throw.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_throw.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_to_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_to_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d42cba535fc0174c5574b916c711790400350f86 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_to_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_to_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_to_consumable_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_to_consumable_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e23f2ebc610b6fcca2eb82191ebe59e080c8ca78 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_to_consumable_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_to_consumable_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_to_primitive.mjs b/tools/ui/node_modules/@swc/helpers/src/_to_primitive.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0d4a248636fc7338159a5b0368c35fec30bbed51 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_to_primitive.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_to_primitive.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_to_property_key.mjs b/tools/ui/node_modules/@swc/helpers/src/_to_property_key.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7b767073fe22d03acba912f6ea0fd6676dd7d4e0 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_to_property_key.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_to_property_key.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_add_disposable_resource.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_add_disposable_resource.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b059656ed4f603ce9f2e0e6604b5d461edbd0922 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_add_disposable_resource.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_add_disposable_resource.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_decorate.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_decorate.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2d7763f3516b49384460263ea06c64f127a04c9c --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_decorate.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_decorate.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_dispose_resources.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_dispose_resources.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ba5ec13678ca62b0644c48cbdf0a98644714bae0 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_dispose_resources.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_dispose_resources.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_generator.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_generator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f595f6d8753215b2a79f2da4cf49f184d2daf5ba --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_generator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_generator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_metadata.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_metadata.mjs new file mode 100644 index 0000000000000000000000000000000000000000..424457eba9d0fa2c29b2ed25b383808841f2187f --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_metadata.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_metadata.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_param.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_param.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1806317955415fb518eca6bb4cae127028347142 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_param.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_param.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_rewrite_relative_import_extension.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_rewrite_relative_import_extension.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d135817f9749b8009239f72d26adf478ed815d59 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_rewrite_relative_import_extension.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_rewrite_relative_import_extension.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_ts_values.mjs b/tools/ui/node_modules/@swc/helpers/src/_ts_values.mjs new file mode 100644 index 0000000000000000000000000000000000000000..126c78379e63dd43b24acbcc25f6e0599b2eec44 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_ts_values.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_ts_values.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_type_of.mjs b/tools/ui/node_modules/@swc/helpers/src/_type_of.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4f8a93659e2c913833a8bdcc9018f4e878c6b2f1 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_type_of.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_type_of.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_unsupported_iterable_to_array.mjs b/tools/ui/node_modules/@swc/helpers/src/_unsupported_iterable_to_array.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9e4222212cd297cb99ae171756f0aae9f3e723d8 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_unsupported_iterable_to_array.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_unsupported_iterable_to_array.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_update.mjs b/tools/ui/node_modules/@swc/helpers/src/_update.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6adb4a428daadcf4d8a340f101cd0da3afa19b92 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_update.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_update.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_using.mjs b/tools/ui/node_modules/@swc/helpers/src/_using.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f71681556fd04759dc6b2d0e0279318f172d4c9a --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_using.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_using.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_using_ctx.mjs b/tools/ui/node_modules/@swc/helpers/src/_using_ctx.mjs new file mode 100644 index 0000000000000000000000000000000000000000..87e80979e1a8fed77a193cc930bbbccd014ed668 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_using_ctx.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_using_ctx.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_wrap_async_generator.mjs b/tools/ui/node_modules/@swc/helpers/src/_wrap_async_generator.mjs new file mode 100644 index 0000000000000000000000000000000000000000..44acb1ab4aac6c7aa242be492b621cdbb4418ded --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_wrap_async_generator.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_wrap_async_generator.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_wrap_native_super.mjs b/tools/ui/node_modules/@swc/helpers/src/_wrap_native_super.mjs new file mode 100644 index 0000000000000000000000000000000000000000..266f5d3b74eda2dd9c46f3ff904a6ccc63ec3993 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_wrap_native_super.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_wrap_native_super.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_wrap_reg_exp.mjs b/tools/ui/node_modules/@swc/helpers/src/_wrap_reg_exp.mjs new file mode 100644 index 0000000000000000000000000000000000000000..772afe9d1ae525a5d4c0427223484c9c643ca926 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_wrap_reg_exp.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_wrap_reg_exp.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/_write_only_error.mjs b/tools/ui/node_modules/@swc/helpers/src/_write_only_error.mjs new file mode 100644 index 0000000000000000000000000000000000000000..68c8af268662b7f0a016ce35f5c3ea6e388cf352 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/_write_only_error.mjs @@ -0,0 +1 @@ +export { _ as default } from "../esm/_write_only_error.js"; diff --git a/tools/ui/node_modules/@swc/helpers/src/index.mjs b/tools/ui/node_modules/@swc/helpers/src/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d0d0812948c6fe0d4ce5f0fde507a21166548781 --- /dev/null +++ b/tools/ui/node_modules/@swc/helpers/src/index.mjs @@ -0,0 +1 @@ +export * from "../esm/index.js"; diff --git a/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/1.bug_report.yml b/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/1.bug_report.yml new file mode 100644 index 0000000000000000000000000000000000000000..72207f75b1f297e658e8aa9326eb4b677ef268fb --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -0,0 +1,38 @@ +name: Bug Report +description: Create a bug report for @tailwindcss/forms. +labels: [] +body: + - type: input + attributes: + label: What version of @tailwindcss/forms are you using? + description: 'For example: v0.1.4' + validations: + required: true + - type: input + attributes: + label: What version of Node.js are you using? + description: 'For example: v12.0.0' + validations: + required: true + - type: input + attributes: + label: What browser are you using? + description: 'For example: Chrome, Safari, or N/A' + validations: + required: true + - type: input + attributes: + label: What operating system are you using? + description: 'For example: macOS, Windows' + validations: + required: true + - type: input + attributes: + label: Reproduction repository + description: A public GitHub repo that includes a minimal reproduction of the bug. Unfortunately we can't provide support without a reproduction, and your issue will be closed and locked with no comment if this is not provided. + validations: + required: true + - type: textarea + attributes: + label: Describe your issue + description: Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead diff --git a/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/config.yml b/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..23765818bbae1772f8d07b6944cbc298062f9480 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Feature Request + url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=ideas + about: 'Suggest any ideas you have using our discussion forums.' + - name: Help + url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=help + about: 'If you have a question or need help, ask a question on the discussion forums.' + - name: Kind Words + url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=kind-words + about: "Have something nice to say about @tailwindcss/forms or Tailwind CSS in general? We'd love to hear it!" diff --git a/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/prepare-release.yml b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/prepare-release.yml new file mode 100644 index 0000000000000000000000000000000000000000..ae24c124c94adb2b891a232d481c58637bf31184 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/prepare-release.yml @@ -0,0 +1,56 @@ +name: Prepare Release + +on: + workflow_dispatch: + push: + tags: + - 'v*' + +permissions: + contents: read + +jobs: + prepare: + permissions: + contents: write # for softprops/action-gh-release to create GitHub release + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Test + run: npm test + + - name: Resolve version + id: vars + run: | + echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + + - name: Get release notes + run: | + RELEASE_NOTES=$(npm run release-notes --silent) + echo "RELEASE_NOTES<> $GITHUB_ENV + echo "$RELEASE_NOTES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + tag_name: ${{ env.TAG_NAME }} + body: ${{ env.RELEASE_NOTES }} diff --git a/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release-insiders.yml b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release-insiders.yml new file mode 100644 index 0000000000000000000000000000000000000000..1a9a2b1efcd8759e2ad4a213084de267fa7960a4 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release-insiders.yml @@ -0,0 +1,42 @@ +name: Release Insiders + +on: + push: + branches: [main] + +permissions: + contents: read + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Resolve version + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: 'Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}' + run: npm version 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version + + - name: Publish + run: npm publish --provenance --tag insiders + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release.yml b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release.yml new file mode 100644 index 0000000000000000000000000000000000000000..a4482d0caa371fb141218fa6c797e83a39fd99bc --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: read + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Test + run: npm test + + - name: Calculate environment variables + run: | + echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV + + - name: Publish + run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/tools/ui/node_modules/@tailwindcss/forms/CHANGELOG.md b/tools/ui/node_modules/@tailwindcss/forms/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..01cafed7ae8a587c6327c14b4ecf89a98e0c8116 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/CHANGELOG.md @@ -0,0 +1,194 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +- Nothing yet! + +## [0.5.10] - 2025-01-07 + +### Fixed + +- Support installing with beta versions of Tailwind CSS v4 ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163)) + +## [0.5.9] - 2024-09-05 + +### Fixed + +- Fallback to static chevron color if theme is using variables ([#167](https://github.com/tailwindlabs/tailwindcss-forms/pull/167)) + +## [0.5.8] - 2024-08-28 + +### Fixed + +- Support installing with alpha versions of Tailwind CSS v4 ([#163](https://github.com/tailwindlabs/tailwindcss-forms/pull/163)) + +## [0.5.7] - 2023-11-10 + +### Fixed + +- Use normal `checkbox` and `radio` appearance in `forced-colors` mode ([#152](https://github.com/tailwindlabs/tailwindcss-forms/pull/152)) + +## [0.5.6] - 2023-08-28 + +### Fixed + +- Fix date time bottom spacing on MacOS Safari ([#146](https://github.com/tailwindlabs/tailwindcss-forms/pull/146)) + +## [0.5.5] - 2023-08-22 + +### Fixed + +- Fix text alignment on date and time inputs on iOS ([#144](https://github.com/tailwindlabs/tailwindcss-forms/pull/144)) + +## [0.5.4] - 2023-07-13 + +### Fixed + +- Remove chevron for selects with a non-default size ([#137](https://github.com/tailwindlabs/tailwindcss-forms/pull/137)) +- Allow for without `type` ([#141](https://github.com/tailwindlabs/tailwindcss-forms/pull/141)) + +## [0.5.3] - 2022-09-02 + +### Fixed + +- Update TypeScript types ([#126](https://github.com/tailwindlabs/tailwindcss-forms/pull/126)) + +## [0.5.2] - 2022-05-18 + +### Added + +- Add TypeScript type declarations ([#118](https://github.com/tailwindlabs/tailwindcss-forms/pull/118)) + +## [0.5.1] - 2022-05-03 + +### Fixed + +- Remove duplicate `outline` property ([#116](https://github.com/tailwindlabs/tailwindcss-forms/pull/116)) +- Fix autoprefixer warning about `color-adjust` ([#115](https://github.com/tailwindlabs/tailwindcss-forms/pull/115)) + +## [0.5.0] - 2022-03-02 + +### Changed + +- Generate both global styles and classes by default ([#71](https://github.com/tailwindlabs/tailwindcss-forms/pull/71)) + +## [0.4.1] - 2022-03-02 + +### Added + +- Remove `dist` folder and related dependencies ([#96](https://github.com/tailwindlabs/tailwindcss-forms/pull/96)) + +### Fixed + +- Use `addComponents` for class strategy ([#91](https://github.com/tailwindlabs/tailwindcss-forms/pull/91)) +- Fix extra height on Safari date/time inputs ([#109](https://github.com/tailwindlabs/tailwindcss-forms/pull/109)) + +## [0.4.0] - 2021-12-09 + +### Changed + +- Update color palette references for v3 ([#83](https://github.com/tailwindlabs/tailwindcss-forms/pull/83)) +- Don't read outline.none value from config ([#89](https://github.com/tailwindlabs/tailwindcss-forms/pull/89)) + +## [0.3.4] - 2021-09-28 + +### Fixed + +- Fix compatibility with `optimizeUniversalDefaults` experimental feature in Tailwind CSS v2.2 ([#81](https://github.com/tailwindlabs/tailwindcss-forms/pull/81)) + +## [0.3.3] - 2021-06-03 + +### Fixed + +- Fix typo in selector when using `class` strategy that breaks background colors on checkboxes and radio buttons ([#72](https://github.com/tailwindlabs/tailwindcss-forms/pull/72)) + +## [0.3.2] - 2021-03-26 + +### Fixed + +- Filter `null` rules for JIT compatibility ([b4c4e03](https://github.com/tailwindlabs/tailwindcss-forms/commit/b4c4e039337c3a5599f5b6d9eabbcc8ab9e8c8d9)) + +## [0.3.1] - 2021-03-26 + +### Fixed + +- Use `base` as default strategy, not `class` ([#61](https://github.com/tailwindlabs/tailwindcss-forms/pull/61)) + +## [0.3.0] - 2021-03-25 + +### Added + +- Add `class` strategy for you babies and your custom select and date picker libraries ;) ([#39](https://github.com/tailwindlabs/tailwindcss-forms/pull/39)) + +## [0.2.1] - 2020-11-17 + +### Fixed + +- Fix issue where default checkbox/radio border color took precedence over user border color on focus ([d0b9fd9](https://github.com/tailwindlabs/tailwindcss-forms/commit/d0b9fd9)) + +## [0.2.0] - 2020-11-16 + +### Changed + +- Update form styles to be less opinionated and encourage custom styling ([3288709](https://github.com/tailwindlabs/tailwindcss-forms/commit/3288709b59f4101511ec19f30cb2dafe7738251e)) +- Update custom property names to match namespaced variables in Tailwind CSS v2.0 ([adb9807](https://github.com/tailwindlabs/tailwindcss-forms/commit/adb98078fc830d0416cb5ea2c895e997d5f0a5ec), [bbd8510](https://github.com/tailwindlabs/tailwindcss-forms/commit/bbd85102ef4a402b3c39d997c025208a33694cc4)) + +## [0.1.4] - 2020-11-12 + +### Fixed + +- Fix SVG background images not rendering properly in all browsers ([#5](https://github.com/tailwindlabs/tailwindcss-forms/pull/5)) + +## [0.1.3] - 2020-11-12 + +### Changed + +- Update focus styles to account for changes to `ring` API in latest Tailwind CSS 2.0 alpha ([5c16689](https://github.com/tailwindlabs/tailwindcss-forms/commit/5c166896b06475832bd8364f9f3ef5c4baec585f)) + +## [0.1.2] - 2020-11-11 + +### Fixed + +- Work around iOS Safari bug that causes date inputs to render with no height when empty ([b98365b](https://github.com/tailwindlabs/tailwindcss-forms/commit/b98365b903b586bfbe7a6ae745ba64b5d87e23e3)) + +## [0.1.1] - 2020-11-11 + +### Changed + +- Move `tailwindcss` to dependencies, hoping to get it working with Tailwind Play ([d625ea1](https://github.com/tailwindlabs/tailwindcss-forms/commit/d625ea11bd111a4d8cde937e36f3d229ecdf7c6a)) + +## [0.1.0] - 2020-11-11 + +Initial release! + +[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.10...HEAD +[0.5.10]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.9...v0.5.10 +[0.5.9]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.8...v0.5.9 +[0.5.8]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.7...v0.5.8 +[0.5.7]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.6...v0.5.7 +[0.5.6]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.5...v0.5.6 +[0.5.5]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.4...v0.5.5 +[0.5.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.3...v0.5.4 +[0.5.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.2...v0.5.3 +[0.5.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.1...v0.5.2 +[0.5.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.1...v0.5.0 +[0.4.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.4.0 +[0.3.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.1...v0.3.0 +[0.2.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.4...v0.2.0 +[0.1.4]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/tailwindlabs/tailwindcss-forms/releases/tag/v0.1.0 diff --git a/tools/ui/node_modules/@tailwindcss/forms/LICENSE b/tools/ui/node_modules/@tailwindcss/forms/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/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/tools/ui/node_modules/@tailwindcss/forms/README.md b/tools/ui/node_modules/@tailwindcss/forms/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d20b50d4522e4daff336d767d6a71acacd16fb0f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/README.md @@ -0,0 +1,122 @@ +# @tailwindcss/forms + +A plugin that provides a basic reset for form styles that makes form elements easy to override with utilities. + +## Installation + +Install the plugin from npm: + +```sh +npm install -D @tailwindcss/forms +``` + +Then add the plugin to your `tailwind.config.js` file: + +```js +// tailwind.config.js +module.exports = { + theme: { + // ... + }, + plugins: [ + require('@tailwindcss/forms'), + // ... + ], +} +``` + +## Basic usage + +[**View the live demo**](https://tailwindcss-forms.vercel.app/) + +All of the basic form elements you use will now have some simple default styles that are easy to override with utilities. + +Currently we add basic utility-friendly form styles for the following form element types: + +- `input[type='text']` +- `input[type='password']` +- `input[type='email']` +- `input[type='number']` +- `input[type='url']` +- `input[type='date']` +- `input[type='datetime-local']` +- `input[type='month']` +- `input[type='week']` +- `input[type='time']` +- `input[type='search']` +- `input[type='tel']` +- `input[type='checkbox']` +- `input[type='radio']` +- `select` +- `select[multiple]` +- `textarea` + +Every element has been normalized/reset to a simple visually consistent style that is easy to customize with utilities, even elements like `` that normally need to be reset with `appearance: none` and customized using custom CSS: + +```html + + + + + +``` + +More customization examples and best practices coming soon. + +### Using classes to style + +In addition to the global styles, we also generate a set of corresponding classes which can be used to explicitly apply the form styles to an element. This can be useful in situations where you need to make a non-form element, such as a `
`, look like a form element. + +```html + + + + + +``` + +Here is a complete table of the provided `form-*` classes for reference: + +| Base | Class | +| ------------------------- | ------------------ | +| `[type='text']` | `form-input` | +| `[type='email']` | `form-input` | +| `[type='url']` | `form-input` | +| `[type='password']` | `form-input` | +| `[type='number']` | `form-input` | +| `[type='date']` | `form-input` | +| `[type='datetime-local']` | `form-input` | +| `[type='month']` | `form-input` | +| `[type='search']` | `form-input` | +| `[type='tel']` | `form-input` | +| `[type='time']` | `form-input` | +| `[type='week']` | `form-input` | +| `textarea` | `form-textarea` | +| `select` | `form-select` | +| `select[multiple]` | `form-multiselect` | +| `[type='checkbox']` | `form-checkbox` | +| `[type='radio']` | `form-radio` | + +### Using only global styles or only classes + +Although we recommend thinking of this plugin as a "form reset" rather than a collection of form component styles, in some cases our default approach may be too heavy-handed, especially when integrating this plugin into existing projects. + +If generating both the global (base) styles and classes doesn't work well with your project, you can use the `strategy` option to limit the plugin to just one of these approaches. + +```js +// tailwind.config.js +plugins: [ + require("@tailwindcss/forms")({ + strategy: 'base', // only generate global styles + strategy: 'class', // only generate classes + }), +], +``` + +When using the `base` strategy, form elements are styled globally, and no `form-{name}` classes are generated. + +When using the `class` strategy, form elements are not styled globally, and instead must be styled using the generated `form-{name}` classes. diff --git a/tools/ui/node_modules/@tailwindcss/forms/index.html b/tools/ui/node_modules/@tailwindcss/forms/index.html new file mode 100644 index 0000000000000000000000000000000000000000..c51b94dba4ff859c9e5b3fd633b0eb4691b95caa --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/index.html @@ -0,0 +1,255 @@ + + + + + + @tailwindcss/forms examples + + + +
+
+
+

@tailwindcss/forms examples

+

+ An opinionated form reset designed to make form elements easy to style with utility + classes. +

+ +
+
+

Unstyled

+

This is how form elements look out of the box.

+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
+
+

Simple

+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
+
+

Underline

+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
+
+

Solid

+
+
+ + + + + +
+
+
+ +
+
+
+
+
+
+
+
+ + diff --git a/tools/ui/node_modules/@tailwindcss/forms/kitchen-sink.html b/tools/ui/node_modules/@tailwindcss/forms/kitchen-sink.html new file mode 100644 index 0000000000000000000000000000000000000000..2b98657c1cc9f49ba39b90c5de96ae65f118dcc8 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/kitchen-sink.html @@ -0,0 +1,222 @@ + + + + + + @tailwindcss/forms Kitchen Sink + + + +
+
+

Reset styles

+

+ These are form elements this plugin styles by default. +

+
+
+ + + + + + + + + + + +
+
+ + + + + + + +
+ Checkboxes +
+
+ +
+
+ +
+
+ +
+
+
+
+ Radio Buttons +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+

Untouched

+

+ These are form elements we don't handle (yet?), but we use this to make sure we haven't + accidentally styled them by mistake. +

+
+
+ + + + +
+
+
+
+ + diff --git a/tools/ui/node_modules/@tailwindcss/forms/package.json b/tools/ui/node_modules/@tailwindcss/forms/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6dec43c2882e9a00743ffa4a353fcf47430fb5c9 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/package.json @@ -0,0 +1,45 @@ +{ + "name": "@tailwindcss/forms", + "version": "0.5.10", + "main": "src/index.js", + "types": "src/index.d.ts", + "license": "MIT", + "repository": "https://github.com/tailwindlabs/tailwindcss-forms", + "publishConfig": { + "access": "public" + }, + "prettier": { + "printWidth": 100, + "semi": false, + "singleQuote": true, + "trailingComma": "es5", + "plugins": [ + "prettier-plugin-tailwindcss" + ] + }, + "scripts": { + "dev": "concurrently \"npm run serve\" \"npm run watch\"", + "serve": "live-server .", + "watch": "npm run build -- -w", + "build": "tailwindcss -o dist/tailwind.css", + "test": "exit 0", + "release-channel": "node ./scripts/release-channel.js", + "release-notes": "node ./scripts/release-notes.js", + "format": "prettier . --write" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1" + }, + "devDependencies": { + "autoprefixer": "^10.4.6", + "concurrently": "^5.3.0", + "live-server": "^1.2.2", + "postcss": "^8.4.13", + "prettier": "^3.3.3", + "prettier-plugin-tailwindcss": "^0.6.8", + "tailwindcss": "^3.0.24" + }, + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + } +} diff --git a/tools/ui/node_modules/@tailwindcss/forms/scripts/release-channel.js b/tools/ui/node_modules/@tailwindcss/forms/scripts/release-channel.js new file mode 100644 index 0000000000000000000000000000000000000000..0c827f3fda8c55e90ed6267c633c8c6bd8ab1a21 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/scripts/release-channel.js @@ -0,0 +1,18 @@ +// Given a version, figure out what the release channel is so that we can publish to the correct +// channel on npm. +// +// E.g.: +// +// 1.2.3 -> latest (default) +// 0.0.0-insiders.ffaa88 -> insiders +// 4.1.0-alpha.4 -> alpha + +let version = + process.argv[2] || process.env.npm_package_version || require('../package.json').version + +let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version) +if (match) { + console.log(match[1]) +} else { + console.log('latest') +} diff --git a/tools/ui/node_modules/@tailwindcss/forms/scripts/release-notes.js b/tools/ui/node_modules/@tailwindcss/forms/scripts/release-notes.js new file mode 100644 index 0000000000000000000000000000000000000000..23d869bcb5b9271faf9c8b79b8fd5b50de05259e --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/scripts/release-notes.js @@ -0,0 +1,21 @@ +// Given a version, figure out what the release notes are so that we can use this to pre-fill the +// relase notes on a GitHub release for the current version. + +let path = require('path') +let fs = require('fs') + +let version = + process.argv[2] || process.env.npm_package_version || require('../package.json').version + +let changelog = fs.readFileSync(path.resolve(__dirname, '..', 'CHANGELOG.md'), 'utf8') +let match = new RegExp( + `## \\[${version}\\] - (.*)\\n\\n([\\s\\S]*?)\\n(?:(?:##\\s)|(?:\\[))`, + 'g' +).exec(changelog) + +if (match) { + let [, date, notes] = match + console.log(notes.trim()) +} else { + console.log(`Placeholder release notes for version: v${version}`) +} diff --git a/tools/ui/node_modules/@tailwindcss/forms/src/index.d.ts b/tools/ui/node_modules/@tailwindcss/forms/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..496b81fb8fa807b9d34291144b8c1281baaaef0e --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/src/index.d.ts @@ -0,0 +1,9 @@ +declare function plugin(options?: Partial<{ strategy: 'base' | 'class' }>): { + handler: () => void +} + +declare namespace plugin { + const __isOptionsFunction: true +} + +export = plugin diff --git a/tools/ui/node_modules/@tailwindcss/forms/src/index.js b/tools/ui/node_modules/@tailwindcss/forms/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b86a224da5e9a6841e060b73f48931eb8b123d14 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/src/index.js @@ -0,0 +1,368 @@ +const svgToDataUri = require('mini-svg-data-uri') +const plugin = require('tailwindcss/plugin') +const defaultTheme = require('tailwindcss/defaultTheme') +const colors = require('tailwindcss/colors') +const [baseFontSize, { lineHeight: baseLineHeight }] = defaultTheme.fontSize.base +const { spacing, borderWidth, borderRadius } = defaultTheme + +function resolveColor(color, opacityVariableName) { + return color.replace('', `var(${opacityVariableName}, 1)`) +} + +const forms = plugin.withOptions(function (options = { strategy: undefined }) { + return function ({ addBase, addComponents, theme }) { + function resolveChevronColor(color, fallback) { + let resolved = theme(color) + + if (!resolved || resolved.includes('var(')) { + return fallback + } + + return resolved.replace('', '1') + } + + const strategy = options.strategy === undefined ? ['base', 'class'] : [options.strategy] + + const rules = [ + { + base: [ + "[type='text']", + 'input:where(:not([type]))', + "[type='email']", + "[type='url']", + "[type='password']", + "[type='number']", + "[type='date']", + "[type='datetime-local']", + "[type='month']", + "[type='search']", + "[type='tel']", + "[type='time']", + "[type='week']", + '[multiple]', + 'textarea', + 'select', + ], + class: ['.form-input', '.form-textarea', '.form-select', '.form-multiselect'], + styles: { + appearance: 'none', + 'background-color': '#fff', + 'border-color': resolveColor( + theme('colors.gray.500', colors.gray[500]), + '--tw-border-opacity' + ), + 'border-width': borderWidth['DEFAULT'], + 'border-radius': borderRadius.none, + 'padding-top': spacing[2], + 'padding-right': spacing[3], + 'padding-bottom': spacing[2], + 'padding-left': spacing[3], + 'font-size': baseFontSize, + 'line-height': baseLineHeight, + '--tw-shadow': '0 0 #0000', + '&:focus': { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '0px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': resolveColor( + theme('colors.blue.600', colors.blue[600]), + '--tw-ring-opacity' + ), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + 'border-color': resolveColor( + theme('colors.blue.600', colors.blue[600]), + '--tw-border-opacity' + ), + }, + }, + }, + { + base: ['input::placeholder', 'textarea::placeholder'], + class: ['.form-input::placeholder', '.form-textarea::placeholder'], + styles: { + color: resolveColor(theme('colors.gray.500', colors.gray[500]), '--tw-text-opacity'), + opacity: '1', + }, + }, + { + base: ['::-webkit-datetime-edit-fields-wrapper'], + class: ['.form-input::-webkit-datetime-edit-fields-wrapper'], + styles: { + padding: '0', + }, + }, + { + // Unfortunate hack until https://bugs.webkit.org/show_bug.cgi?id=198959 is fixed. + // This sucks because users can't change line-height with a utility on date inputs now. + // Reference: https://github.com/twbs/bootstrap/pull/31993 + base: ['::-webkit-date-and-time-value'], + class: ['.form-input::-webkit-date-and-time-value'], + styles: { + 'min-height': '1.5em', + }, + }, + { + // In Safari on iOS date and time inputs are centered instead of left-aligned and can't be + // changed with `text-align` utilities on the input by default. Resetting this to `inherit` + // makes them left-aligned by default and makes it possible to override the alignment with + // utility classes without using an arbitrary variant to target the pseudo-elements. + base: ['::-webkit-date-and-time-value'], + class: ['.form-input::-webkit-date-and-time-value'], + styles: { + 'text-align': 'inherit', + }, + }, + { + // In Safari on macOS date time inputs that are set to `display: block` have unexpected + // extra bottom spacing. This can be corrected by setting the `::-webkit-datetime-edit` + // pseudo-element to `display: inline-flex`, instead of the browser default of + // `display: inline-block`. + base: ['::-webkit-datetime-edit'], + class: ['.form-input::-webkit-datetime-edit'], + styles: { + display: 'inline-flex', + }, + }, + { + // In Safari on macOS date time inputs are 4px taller than normal inputs + // This is because there is extra padding on the datetime-edit and datetime-edit-{part}-field pseudo elements + // See https://github.com/tailwindlabs/tailwindcss-forms/issues/95 + base: [ + '::-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', + ], + class: [ + '.form-input::-webkit-datetime-edit', + '.form-input::-webkit-datetime-edit-year-field', + '.form-input::-webkit-datetime-edit-month-field', + '.form-input::-webkit-datetime-edit-day-field', + '.form-input::-webkit-datetime-edit-hour-field', + '.form-input::-webkit-datetime-edit-minute-field', + '.form-input::-webkit-datetime-edit-second-field', + '.form-input::-webkit-datetime-edit-millisecond-field', + '.form-input::-webkit-datetime-edit-meridiem-field', + ], + styles: { + 'padding-top': 0, + 'padding-bottom': 0, + }, + }, + { + base: ['select'], + class: ['.form-select'], + styles: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-position': `right ${spacing[2]} center`, + 'background-repeat': `no-repeat`, + 'background-size': `1.5em 1.5em`, + 'padding-right': spacing[10], + 'print-color-adjust': `exact`, + }, + }, + { + base: ['[multiple]', '[size]:where(select:not([size="1"]))'], + class: ['.form-select:where([size]:not([size="1"]))'], + styles: { + 'background-image': 'initial', + 'background-position': 'initial', + 'background-repeat': 'unset', + 'background-size': 'initial', + 'padding-right': spacing[3], + 'print-color-adjust': 'unset', + }, + }, + { + base: [`[type='checkbox']`, `[type='radio']`], + class: ['.form-checkbox', '.form-radio'], + styles: { + appearance: 'none', + padding: '0', + 'print-color-adjust': 'exact', + display: 'inline-block', + 'vertical-align': 'middle', + 'background-origin': 'border-box', + 'user-select': 'none', + 'flex-shrink': '0', + height: spacing[4], + width: spacing[4], + color: resolveColor(theme('colors.blue.600', colors.blue[600]), '--tw-text-opacity'), + 'background-color': '#fff', + 'border-color': resolveColor( + theme('colors.gray.500', colors.gray[500]), + '--tw-border-opacity' + ), + 'border-width': borderWidth['DEFAULT'], + '--tw-shadow': '0 0 #0000', + }, + }, + { + base: [`[type='checkbox']`], + class: ['.form-checkbox'], + styles: { + 'border-radius': borderRadius['none'], + }, + }, + { + base: [`[type='radio']`], + class: ['.form-radio'], + styles: { + 'border-radius': '100%', + }, + }, + { + base: [`[type='checkbox']:focus`, `[type='radio']:focus`], + class: ['.form-checkbox:focus', '.form-radio:focus'], + styles: { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '2px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': resolveColor( + theme('colors.blue.600', colors.blue[600]), + '--tw-ring-opacity' + ), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + }, + }, + { + base: [`[type='checkbox']:checked`, `[type='radio']:checked`], + class: ['.form-checkbox:checked', '.form-radio:checked'], + styles: { + 'border-color': `transparent`, + 'background-color': `currentColor`, + 'background-size': `100% 100%`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + }, + }, + { + base: [`[type='checkbox']:checked`], + class: ['.form-checkbox:checked'], + styles: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + + '@media (forced-colors: active) ': { + appearance: 'auto', + }, + }, + }, + { + base: [`[type='radio']:checked`], + class: ['.form-radio:checked'], + styles: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + + '@media (forced-colors: active) ': { + appearance: 'auto', + }, + }, + }, + { + base: [ + `[type='checkbox']:checked:hover`, + `[type='checkbox']:checked:focus`, + `[type='radio']:checked:hover`, + `[type='radio']:checked:focus`, + ], + class: [ + '.form-checkbox:checked:hover', + '.form-checkbox:checked:focus', + '.form-radio:checked:hover', + '.form-radio:checked:focus', + ], + styles: { + 'border-color': 'transparent', + 'background-color': 'currentColor', + }, + }, + { + base: [`[type='checkbox']:indeterminate`], + class: ['.form-checkbox:indeterminate'], + styles: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'border-color': `transparent`, + 'background-color': `currentColor`, + 'background-size': `100% 100%`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + + '@media (forced-colors: active) ': { + appearance: 'auto', + }, + }, + }, + { + base: [`[type='checkbox']:indeterminate:hover`, `[type='checkbox']:indeterminate:focus`], + class: ['.form-checkbox:indeterminate:hover', '.form-checkbox:indeterminate:focus'], + styles: { + 'border-color': 'transparent', + 'background-color': 'currentColor', + }, + }, + { + base: [`[type='file']`], + class: null, + styles: { + background: 'unset', + 'border-color': 'inherit', + 'border-width': '0', + 'border-radius': '0', + padding: '0', + 'font-size': 'unset', + 'line-height': 'inherit', + }, + }, + { + base: [`[type='file']:focus`], + class: null, + styles: { + outline: [`1px solid ButtonText`, `1px auto -webkit-focus-ring-color`], + }, + }, + ] + + const getStrategyRules = (strategy) => + rules + .map((rule) => { + if (rule[strategy] === null) return null + + return { [rule[strategy]]: rule.styles } + }) + .filter(Boolean) + + if (strategy.includes('base')) { + addBase(getStrategyRules('base')) + } + + if (strategy.includes('class')) { + addComponents(getStrategyRules('class')) + } + } +}) + +module.exports = forms diff --git a/tools/ui/node_modules/@tailwindcss/forms/tailwind.config.js b/tools/ui/node_modules/@tailwindcss/forms/tailwind.config.js new file mode 100644 index 0000000000000000000000000000000000000000..5ef17d5d03dab82764b772fd69192a9d2be97e9d --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/forms/tailwind.config.js @@ -0,0 +1,9 @@ +module.exports = { + content: ['./index.html', './kitchen-sink.html'], + theme: { + extend: { + // + }, + }, + plugins: [require('./src')], +} diff --git a/tools/ui/node_modules/@tailwindcss/node/LICENSE b/tools/ui/node_modules/@tailwindcss/node/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/node/README.md b/tools/ui/node_modules/@tailwindcss/node/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95ec9d87ddcc59defeaed61b39cbb49869220c9f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/README.md @@ -0,0 +1,40 @@ +

+ + + + + 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 any other conversation that would benefit from being searchable: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +For chatting with others using the framework: + +[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## 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/tools/ui/node_modules/@tailwindcss/node/dist/esm-cache.loader.d.mts b/tools/ui/node_modules/@tailwindcss/node/dist/esm-cache.loader.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..55f2bad3998c5f2eba64c46feb6a964140553f7b --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs b/tools/ui/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f9ae1082c016a72068fa3c800b8a4b075b11e36b --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/node/dist/index.d.mts b/tools/ui/node_modules/@tailwindcss/node/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a41e0a91d97ed91e553b30d9df5abd5fbe2e63e4 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/dist/index.d.mts @@ -0,0 +1,247 @@ +import { Candidate, Variant } from './candidate'; +import { compileAstNodes } from './compile'; +import { ClassEntry, VariantEntry } 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 }; +} + +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): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + candidatesToCss(classes: string[]): (string | null)[]; +}; + +/** + * 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; +} + +/** + * 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 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/tools/ui/node_modules/@tailwindcss/node/dist/index.d.ts b/tools/ui/node_modules/@tailwindcss/node/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a41e0a91d97ed91e553b30d9df5abd5fbe2e63e4 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/dist/index.d.ts @@ -0,0 +1,247 @@ +import { Candidate, Variant } from './candidate'; +import { compileAstNodes } from './compile'; +import { ClassEntry, VariantEntry } 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 }; +} + +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): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + candidatesToCss(classes: string[]): (string | null)[]; +}; + +/** + * 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; +} + +/** + * 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 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/tools/ui/node_modules/@tailwindcss/node/dist/index.js b/tools/ui/node_modules/@tailwindcss/node/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8e40cfd7450be19b675362d7ad9131645972a88f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/dist/index.js @@ -0,0 +1,16 @@ +"use strict";var Ct=Object.create;var Q=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Nt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Oe=(e,r)=>{for(var t in r)Q(e,t,{get:r[t],enumerable:!0})},_e=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of St(r))!Et.call(e,n)&&n!==t&&Q(e,n,{get:()=>r[n],enumerable:!(i=$t(r,n))||i.enumerable});return e};var x=(e,r,t)=>(t=e!=null?Ct(Nt(e)):{},_e(r||!e||!e.__esModule?Q(t,"default",{value:e,enumerable:!0}):t,e)),Vt=e=>_e(Q({},"__esModule",{value:!0}),e);var Br={};Oe(Br,{Features:()=>V.Features,Instrumentation:()=>Pe,Polyfills:()=>V.Polyfills,__unstable__loadDesignSystem:()=>Ur,compile:()=>Dr,compileAst:()=>_r,env:()=>X,loadModule:()=>Te,normalizePath:()=>ue,optimize:()=>jr,toSourceMap:()=>Wr});module.exports=Vt(Br);var xt=x(require("module")),At=require("url");var X={};Oe(X,{DEBUG:()=>pe});var pe=Tt(process.env.DEBUG);function Tt(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 L=x(require("enhanced-resolve")),mt=require("jiti"),ce=x(require("fs")),Ve=x(require("fs/promises")),M=x(require("path")),Ne=require("url"),V=require("tailwindcss");var ee=x(require("fs/promises")),F=x(require("path")),Rt=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],Pt=[".js",".cjs",".mjs"],Ot=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],_t=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Dt(e,r){for(let t of r){let i=`${e}${t}`;if((await ee.default.stat(i).catch(()=>null))?.isFile())return i}for(let t of r){let i=`${e}/index${t}`;if(await ee.default.access(i).then(()=>!0,()=>!1))return i}return null}async function De(e,r,t,i){let n=Pt.includes(i)?Ot:_t,l=await Dt(F.default.resolve(t,r),n);if(l===null||e.has(l))return;e.add(l),t=F.default.dirname(l),i=F.default.extname(l);let o=await ee.default.readFile(l,"utf-8"),s=[];for(let a of Rt)for(let u of o.matchAll(a))u[1].startsWith(".")&&s.push(De(e,u[1],t,i));await Promise.all(s)}async function Ue(e){let r=new Set;return await De(r,e,F.default.dirname(e),F.default.extname(e)),Array.from(r)}var $e=x(require("path"));function de(e){return{kind:"word",value:e}}function Ut(e,r){return{kind:"function",value:e,nodes:r}}function Kt(e){return{kind:"separator",value:e}}function T(e,r,t=null){for(let i=0;i0){let c=de(n);i?i.nodes.push(c):r.push(c),n=""}let a=o,u=o+1;for(;u0){let u=de(n);a?.nodes.push(u),n=""}t.length>0?i=t[t.length-1]:i=null;break}default:n+=String.fromCharCode(s)}}return n.length>0&&r.push(de(n)),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 Xr=new Uint8Array(256);var te=new Uint8Array(256);function k(e,r){let t=0,i=[],n=0,l=e.length,o=r.charCodeAt(0);for(let s=0;s0&&a===te[t-1]&&t--;break}}return i.push(e.slice(n)),i}var si=new g(e=>{let r=A(e),t=new Set;return T(r,(i,{parent:n})=>{let l=n===null?r:n.nodes??[];if(i.kind==="word"&&(i.value==="+"||i.value==="-"||i.value==="*"||i.value==="/")){let o=l.indexOf(i)??-1;if(o===-1)return;let s=l[o-1];if(s?.kind!=="separator"||s.value!==" ")return;let a=l[o+1];if(a?.kind!=="separator"||a.value!==" ")return;t.add(s),t.add(a)}else i.kind==="separator"&&i.value.trim()==="/"?i.value="/":i.kind==="separator"&&i.value.length>0&&i.value.trim()===""?(l[0]===i||l[l.length-1]===i)&&t.add(i):i.kind==="separator"&&i.value.trim()===","&&(i.value=",")}),t.size>0&&T(r,(i,{replaceWith:n})=>{t.has(i)&&(t.delete(i),n([]))}),me(r),E(r)});var ui=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"?E(r[2].nodes):e});function me(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=B(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=B(r.value);for(let t=0;t{let r=A(e);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function jt(e){throw new Error(`Unexpected value: ${e}`)}function B(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var R=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,ki=new RegExp(`^${R.source}$`);var yi=new RegExp(`^${R.source}%$`);var bi=new RegExp(`^${R.source}s*/s*${R.source}$`);var Mt=["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"],xi=new RegExp(`^${R.source}(${Mt.join("|")})$`);var Wt=["deg","rad","grad","turn"],Ai=new RegExp(`^${R.source}(${Wt.join("|")})$`);var Ci=new RegExp(`^${R.source} +${R.source} +${R.source}$`);function b(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 Gt={"--alpha":qt,"--spacing":Jt,"--theme":Yt,theme:Zt};function qt(e,r,t,...i){let[n,l]=k(t,"/").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(i.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${l||"50%"})\``);return H(n,l)}function Jt(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 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} * ${t})`}function Yt(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 n=!1;t.endsWith(" inline")&&(n=!0,t=t.slice(0,-7)),r.kind==="at-rule"&&(n=!0);let l=e.resolveThemeValue(t,n);if(!l){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 l;let o=i.join(", ");if(o==="initial")return l;if(l==="initial")return o;if(l.startsWith("var(")||l.startsWith("theme(")||l.startsWith("--theme(")){let s=A(l);return Xt(s,o),E(s)}return l}function Zt(e,r,t,...i){t=Qt(t);let n=e.resolveThemeValue(t);if(!n&&i.length>0)return i.join(", ");if(!n)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 n}var Mi=new RegExp(Object.keys(Gt).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 q=92,ie=47,ne=42,Ze=34,Qe=39,or=58,le=59,$=10,ae=13,J=32,oe=9,Xe=123,we=125,be=40,et=41,lr=91,ar=93,tt=45,ke=64,sr=33;function Z(e,r){let t=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let i=[],n=[],l=[],o=null,s=null,a="",u="",p=0,c;for(let f=0;f0&&e[v]===d[d.length-1]&&(d=d.slice(0,-1));let W=ye(a,h);if(!W)throw new Error("Invalid custom property, expected a value");t&&(W.src=[t,N,f],W.dst=[t,N,f]),o?o.nodes.push(W):i.push(W),a=""}else if(m===le&&a.charCodeAt(0)===ke)s=Y(a),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o?o.nodes.push(s):i.push(s),a="",s=null;else if(m===le&&u[u.length-1]!==")"){let d=ye(a);if(!d)throw a.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${a.trim()}\``);t&&(d.src=[t,p,f],d.dst=[t,p,f]),o?o.nodes.push(d):i.push(d),a=""}else if(m===Xe&&u[u.length-1]!==")")u+="}",s=O(a.trim()),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o&&o.nodes.push(s),l.push(o),o=s,a="",s=null;else if(m===we&&u[u.length-1]!==")"){if(u==="")throw new Error("Missing opening {");if(u=u.slice(0,-1),a.length>0)if(a.charCodeAt(0)===ke)s=Y(a),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o?o.nodes.push(s):i.push(s),a="",s=null;else{let N=a.indexOf(":");if(o){let h=ye(a,N);if(!h)throw new Error(`Invalid declaration: \`${a.trim()}\``);t&&(h.src=[t,p,f],h.dst=[t,p,f]),o.nodes.push(h)}}let d=l.pop()??null;d===null&&o&&i.push(o),o=d,a="",s=null}else if(m===be)u+=")",a+="(";else if(m===et){if(u[u.length-1]!==")")throw new Error("Missing opening (");u=u.slice(0,-1),a+=")"}else{if(a.length===0&&(m===J||m===$||m===oe))continue;a===""&&(p=f),a+=String.fromCharCode(m)}}}if(a.charCodeAt(0)===ke){let f=Y(a);t&&(f.src=[t,p,e.length],f.dst=[t,p,e.length]),i.push(f)}if(u.length>0&&o){if(o.kind==="rule")throw new Error(`Missing closing } at ${o.selector}`);if(o.kind==="at-rule")throw new Error(`Missing closing } at ${o.name} ${o.params}`)}return n.length>0?n.concat(i):i}function Y(e,r=[]){let t=e,i="";for(let n=5;n{if(b(e.value))return e.value}),w=K(e=>{if(b(e.value))return`${e.value}%`}),_=K(e=>{if(b(e.value))return`${e.value}px`}),nt=K(e=>{if(b(e.value))return`${e.value}ms`}),se=K(e=>{if(b(e.value))return`${e.value}deg`}),hr=K(e=>{if(e.fraction===null)return;let[r,t]=k(e.fraction,"/");if(!(!b(r)||!b(t)))return e.fraction}),ot=K(e=>{if(b(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),vr={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",...hr},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...w}),backdropContrast:({theme:e})=>({...e("contrast"),...w}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...w}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...se}),backdropInvert:({theme:e})=>({...e("invert"),...w}),backdropOpacity:({theme:e})=>({...e("opacity"),...w}),backdropSaturate:({theme:e})=>({...e("saturate"),...w}),backdropSepia:({theme:e})=>({...e("sepia"),...w}),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",...w},caretColor:({theme:e})=>e("colors"),colors:()=>({...Ce}),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",...S},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...w},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",...S},flexShrink:{0:"0",DEFAULT:"1",...S},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%",...w},grayscale:{0:"0",DEFAULT:"100%",...w},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",...S},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",...S},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",...S},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",...S},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))",...ot},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))",...ot},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",...se},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%",...w},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",...S},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",...w},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",...S},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",...se},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...w},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",...w},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%",...w},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...se},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",...S},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",...nt},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...nt},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",...S}};var wr=64;function z(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function C(e,r="",t=[]){return{kind:"at-rule",name:e,params:r,nodes:t}}function O(e,r=[]){return e.charCodeAt(0)===wr?Y(e,r):z(e,r)}function P(e,r,t=!1){return{kind:"declaration",property:e,value:r,important:t}}function Ae(e){return{kind:"comment",value:e}}function y(e,r,t=[],i={}){for(let n=0;n4&&e[3]==="\\"){var n=e[2];(n==="?"||n===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//")}var l=e.split(/[/\\]+/);return r!==!1&&l[l.length-1]===""&&l.pop(),i+l.join("/")}function ue(e){let r=kr(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var Se=/(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g,$r=/(?br.test(e),Er=e=>xr.test(e);async function at({css:e,base:r,root:t}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let i=Z(e),n=[];function l(o){if(o[0]==="/")return o;let s=$e.posix.join(ue(r),o),a=$e.posix.relative(ue(t),s);return a.startsWith(".")||(a="./"+a),a}return y(i,o=>{if(o.kind!=="declaration"||!o.value)return;let s=Se.test(o.value),a=lt.test(o.value);if(s||a){let u=a?Vr:st;n.push(u(o.value,l).then(p=>{o.value=p}))}}),n.length&&await Promise.all(n),j(i)}function st(e,r){return ct(e,Se,async t=>{let[i,n]=t;return await ut(n.trim(),i,r)})}async function Vr(e,r){return await ct(e,lt,async t=>{let[,i]=t;return await Rr(i,async({url:l})=>Se.test(l)?await st(l,r):yr.test(l)?l:await ut(l,l,r))})}async function ut(e,r,t,i="url"){let n="",l=e[0];if((l==='"'||l==="'")&&(n=l,e=e.slice(1,-1)),Tr(e))return r;let o=await t(e);return n===""&&o!==encodeURI(o)&&(n='"'),n==="'"&&o.includes("'")&&(n='"'),n==='"'&&o.includes('"')&&(o=o.replace($r,'\\"')),`${i}(${n}${o}${n})`}function Tr(e,r){return Er(e)||Nr(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||Ar.test(e)}function Rr(e,r){return Promise.all(Pr(e).map(async({url:t,descriptor:i})=>({url:await r({url:t,descriptor:i}),descriptor:i}))).then(Or)}function Pr(e){let r=e.trim().replace(Sr," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(Cr);return Array.from(r,({groups:t})=>({url:t?.url?.trim()??"",descriptor:t?.descriptor?.trim()??""})).filter(({url:t})=>!!t)}function Or(e){return e.map(({url:r,descriptor:t})=>r+(t?` ${t}`:"")).join(", ")}async function ct(e,r,t){let i,n=e,l="";for(;i=r.exec(n);)l+=n.slice(0,i.index),l+=await t(i),n=n.slice(i.index+i[0].length);return l+=n,l}var zr={};function gt({base:e,from:r,polyfills:t,onDependency:i,shouldRewriteUrls:n,customCssResolver:l,customJsResolver:o}){return{base:e,polyfills:t,from:r,async loadModule(s,a){return Te(s,a,i,o)},async loadStylesheet(s,a){let u=await vt(s,a,i,l);return n&&(u.content=await at({css:u.content,root:e,base:u.base})),u}}}async function ht(e,r){if(e.root&&e.root!=="none"){let t=/[*{]/,i=[];for(let l of e.root.pattern.split("/")){if(t.test(l))break;i.push(l)}if(!await Ve.default.stat(M.default.resolve(r,i.join("/"))).then(l=>l.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function _r(e,r){let t=await(0,V.compileAst)(e,gt(r));return await ht(t,r.base),t}async function Dr(e,r){let t=await(0,V.compile)(e,gt(r));return await ht(t,r.base),t}async function Ur(e,{base:r}){return(0,V.__unstable__loadDesignSystem)(e,{base:r,async loadModule(t,i){return Te(t,i,()=>{})},async loadStylesheet(t,i){return vt(t,i,()=>{})}})}async function Te(e,r,t,i){if(e[0]!=="."){let s=await dt(e,r,i);if(!s)throw new Error(`Could not resolve '${e}' from '${r}'`);let a=await pt((0,Ne.pathToFileURL)(s).href);return{path:s,base:M.default.dirname(s),module:a.default??a}}let n=await dt(e,r,i);if(!n)throw new Error(`Could not resolve '${e}' from '${r}'`);let[l,o]=await Promise.all([pt((0,Ne.pathToFileURL)(n).href+"?id="+Date.now()),Ue(n)]);for(let s of o)t(s);return{path:n,base:M.default.dirname(n),module:l.default??l}}async function vt(e,r,t,i){let n=await Lr(e,r,i);if(!n)throw new Error(`Could not resolve '${e}' from '${r}'`);if(t(n),typeof globalThis.__tw_readFile=="function"){let o=await globalThis.__tw_readFile(n,"utf-8");if(o)return{path:n,base:M.default.dirname(n),content:o}}let l=await Ve.default.readFile(n,"utf-8");return{path:n,base:M.default.dirname(n),content:l}}var ft=null;async function pt(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 ft??=(0,mt.createJiti)(zr.url,{moduleCache:!1,fsCache:!1}),await ft.import(e)}}var Re=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],Kr=L.default.ResolverFactory.createResolver({fileSystem:new L.default.CachedInputFileSystem(ce.default,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:Re});async function Lr(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 Ee(Kr,e,r)}var Ir=L.default.ResolverFactory.createResolver({fileSystem:new L.default.CachedInputFileSystem(ce.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:Re}),Fr=L.default.ResolverFactory.createResolver({fileSystem:new L.default.CachedInputFileSystem(ce.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:Re});async function dt(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 Ee(Ir,e,r).catch(()=>Ee(Fr,e,r))}function Ee(e,r,t){return new Promise((i,n)=>e.resolve({},t,r,{},(l,o)=>{if(l)return n(l);i(o)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Pe=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(n=>n.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(),n=t-i.value;this.#t.get(i.id).value+=n}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(r=this.defaultFlush){let t=[],i=!1;for(let o=this.#e.length-1;o>=0;o--)this.end(this.#e[o].label);for(let[o,{value:s}]of this.#r.entries()){if(this.#t.has(o))continue;t.length===0&&(i=!0,t.push("Hits:"));let a=o.split("//").length;t.push(`${" ".repeat(a)}${o} ${fe(wt(`\xD7 ${s}`))}`)}this.#t.size>0&&i&&t.push(` +Timers:`);let n=-1/0,l=new Map;for(let[o,{value:s}]of this.#t){let a=`${(Number(s)/1e6).toFixed(2)}ms`;l.set(o,a),n=Math.max(n,a.length)}for(let o of this.#t.keys()){let s=o.split("//").length;t.push(`${fe(`[${l.get(o).padStart(n," ")}]`)}${" ".repeat(s-1)}${s===1?" ":fe(" \u21B3 ")}${o.split("//").pop()} ${this.#r.get(o).value===1?"":fe(wt(`\xD7 ${this.#r.get(o).value}`))}`.trimEnd())}r(` +${t.join(` +`)} +`),this.reset()}[Symbol.dispose](){pe&&this.report()}};function fe(e){return`\x1B[2m${e}\x1B[22m`}function wt(e){return`\x1B[34m${e}\x1B[39m`}var kt=x(require("@ampproject/remapping")),D=require("lightningcss"),yt=x(require("magic-string"));function jr(e,{file:r="input.css",minify:t=!1,map:i}={}){function n(a,u){return(0,D.transform)({filename:r,code:a,minify:t,sourceMap:typeof u<"u",inputSourceMap:u,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:D.Features.Nesting|D.Features.MediaQueries,exclude:D.Features.LogicalProperties|D.Features.DirSelector|D.Features.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0})}let l=n(Buffer.from(e),i);i=l.map?.toString(),l=n(l.code,i),i=l.map?.toString();let o=l.code.toString(),s=new yt.default(o);if(s.replaceAll("@media not (","@media not all and ("),i!==void 0&&s.hasChanged()){let a=s.generateMap({source:"original",hires:"boundary"}).toString();i=(0,kt.default)([a,i],()=>null).toString()}return o=s.toString(),{code:o,map:i}}var bt=require("source-map-js");function Mr(e){let r=new bt.SourceMapGenerator,t=1,i=new g(n=>({url:n?.url??``,content:n?.content??""}));for(let n of e.mappings){let l=i.get(n.originalPosition?.source??null);r.addMapping({generated:n.generatedPosition,original:n.originalPosition,source:l.url,name:n.name}),r.setSourceContent(l.url,l.content)}return r.toString()}function Wr(e){let r=typeof e=="string"?e:Mr(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||xt.register?.((0,At.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/tools/ui/node_modules/@tailwindcss/node/dist/index.mjs b/tools/ui/node_modules/@tailwindcss/node/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5af6f351a9f4c421afbb80a23826bf70467b3139 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/dist/index.mjs @@ -0,0 +1,16 @@ +var mt=Object.defineProperty;var gt=(e,r)=>{for(var t in r)mt(e,t,{get:r[t],enumerable:!0})};import*as oe from"module";import{pathToFileURL as Or}from"url";var ae={};gt(ae,{DEBUG:()=>le});var le=ht(process.env.DEBUG);function ht(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 L from"enhanced-resolve";import{createJiti as yr}from"jiti";import $e from"fs";import at from"fs/promises";import G from"path";import{pathToFileURL as it}from"url";import{__unstable__loadDesignSystem as br,compile as xr,compileAst as Ar,Features as ya,Polyfills as ba}from"tailwindcss";import se from"fs/promises";import F from"path";var vt=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],wt=[".js",".cjs",".mjs"],kt=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],yt=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function bt(e,r){for(let t of r){let i=`${e}${t}`;if((await se.stat(i).catch(()=>null))?.isFile())return i}for(let t of r){let i=`${e}/index${t}`;if(await se.access(i).then(()=>!0,()=>!1))return i}return null}async function Ne(e,r,t,i){let n=wt.includes(i)?kt:yt,l=await bt(F.resolve(t,r),n);if(l===null||e.has(l))return;e.add(l),t=F.dirname(l),i=F.extname(l);let o=await se.readFile(l,"utf-8"),s=[];for(let a of vt)for(let u of o.matchAll(a))u[1].startsWith(".")&&s.push(Ne(e,u[1],t,i));await Promise.all(s)}async function Ee(e){let r=new Set;return await Ne(r,e,F.dirname(e),F.extname(e)),Array.from(r)}import*as xe from"path";function ue(e){return{kind:"word",value:e}}function xt(e,r){return{kind:"function",value:e,nodes:r}}function At(e){return{kind:"separator",value:e}}function E(e,r,t=null){for(let i=0;i0){let c=ue(n);i?i.nodes.push(c):r.push(c),n=""}let a=o,u=o+1;for(;u0){let u=ue(n);a?.nodes.push(u),n=""}t.length>0?i=t[t.length-1]:i=null;break}default:n+=String.fromCharCode(s)}}return n.length>0&&r.push(ue(n)),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 Mr=new Uint8Array(256);var Y=new Uint8Array(256);function k(e,r){let t=0,i=[],n=0,l=e.length,o=r.charCodeAt(0);for(let s=0;s0&&a===Y[t-1]&&t--;break}}return i.push(e.slice(n)),i}var Qr=new g(e=>{let r=x(e),t=new Set;return E(r,(i,{parent:n})=>{let l=n===null?r:n.nodes??[];if(i.kind==="word"&&(i.value==="+"||i.value==="-"||i.value==="*"||i.value==="/")){let o=l.indexOf(i)??-1;if(o===-1)return;let s=l[o-1];if(s?.kind!=="separator"||s.value!==" ")return;let a=l[o+1];if(a?.kind!=="separator"||a.value!==" ")return;t.add(s),t.add(a)}else i.kind==="separator"&&i.value.trim()==="/"?i.value="/":i.kind==="separator"&&i.value.length>0&&i.value.trim()===""?(l[0]===i||l[l.length-1]===i)&&t.add(i):i.kind==="separator"&&i.value.trim()===","&&(i.value=",")}),t.size>0&&E(r,(i,{replaceWith:n})=>{t.has(i)&&(t.delete(i),n([]))}),ce(r),N(r)});var Xr=new g(e=>{let r=x(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"?N(r[2].nodes):e});function ce(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=z(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=z(r.value);for(let t=0;t{let r=x(e);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function Et(e){throw new Error(`Unexpected value: ${e}`)}function z(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var V=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,ui=new RegExp(`^${V.source}$`);var ci=new RegExp(`^${V.source}%$`);var fi=new RegExp(`^${V.source}s*/s*${V.source}$`);var Vt=["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"],pi=new RegExp(`^${V.source}(${Vt.join("|")})$`);var Tt=["deg","rad","grad","turn"],di=new RegExp(`^${V.source}(${Tt.join("|")})$`);var mi=new RegExp(`^${V.source} +${V.source} +${V.source}$`);function b(e){let r=Number(e);return Number.isInteger(r)&&r>=0&&String(r)===String(e)}function j(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 Ot={"--alpha":_t,"--spacing":Dt,"--theme":Ut,theme:Kt};function _t(e,r,t,...i){let[n,l]=k(t,"/").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(i.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 Dt(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 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} * ${t})`}function Ut(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 n=!1;t.endsWith(" inline")&&(n=!0,t=t.slice(0,-7)),r.kind==="at-rule"&&(n=!0);let l=e.resolveThemeValue(t,n);if(!l){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 l;let o=i.join(", ");if(o==="initial")return l;if(l==="initial")return o;if(l.startsWith("var(")||l.startsWith("theme(")||l.startsWith("--theme(")){let s=x(l);return It(s,o),N(s)}return l}function Kt(e,r,t,...i){t=Lt(t);let n=e.resolveThemeValue(t);if(!n&&i.length>0)return i.join(", ");if(!n)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 n}var Oi=new RegExp(Object.keys(Ot).map(e=>`${e}\\(`).join("|"));function Lt(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 W=92,Q=47,X=42,Me=34,We=39,Bt=58,te=59,C=10,re=13,B=32,ee=9,Be=123,me=125,ve=40,He=41,Ht=91,qt=93,qe=45,ge=64,Gt=33;function q(e,r){let t=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let i=[],n=[],l=[],o=null,s=null,a="",u="",p=0,c;for(let f=0;f0&&e[v]===d[d.length-1]&&(d=d.slice(0,-1));let I=he(a,h);if(!I)throw new Error("Invalid custom property, expected a value");t&&(I.src=[t,S,f],I.dst=[t,S,f]),o?o.nodes.push(I):i.push(I),a=""}else if(m===te&&a.charCodeAt(0)===ge)s=H(a),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o?o.nodes.push(s):i.push(s),a="",s=null;else if(m===te&&u[u.length-1]!==")"){let d=he(a);if(!d)throw a.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${a.trim()}\``);t&&(d.src=[t,p,f],d.dst=[t,p,f]),o?o.nodes.push(d):i.push(d),a=""}else if(m===Be&&u[u.length-1]!==")")u+="}",s=R(a.trim()),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o&&o.nodes.push(s),l.push(o),o=s,a="",s=null;else if(m===me&&u[u.length-1]!==")"){if(u==="")throw new Error("Missing opening {");if(u=u.slice(0,-1),a.length>0)if(a.charCodeAt(0)===ge)s=H(a),t&&(s.src=[t,p,f],s.dst=[t,p,f]),o?o.nodes.push(s):i.push(s),a="",s=null;else{let S=a.indexOf(":");if(o){let h=he(a,S);if(!h)throw new Error(`Invalid declaration: \`${a.trim()}\``);t&&(h.src=[t,p,f],h.dst=[t,p,f]),o.nodes.push(h)}}let d=l.pop()??null;d===null&&o&&i.push(o),o=d,a="",s=null}else if(m===ve)u+=")",a+="(";else if(m===He){if(u[u.length-1]!==")")throw new Error("Missing opening (");u=u.slice(0,-1),a+=")"}else{if(a.length===0&&(m===B||m===C||m===ee))continue;a===""&&(p=f),a+=String.fromCharCode(m)}}}if(a.charCodeAt(0)===ge){let f=H(a);t&&(f.src=[t,p,e.length],f.dst=[t,p,e.length]),i.push(f)}if(u.length>0&&o){if(o.kind==="rule")throw new Error(`Missing closing } at ${o.selector}`);if(o.kind==="at-rule")throw new Error(`Missing closing } at ${o.name} ${o.params}`)}return n.length>0?n.concat(i):i}function H(e,r=[]){let t=e,i="";for(let n=5;n{if(b(e.value))return e.value}),w=_(e=>{if(b(e.value))return`${e.value}%`}),P=_(e=>{if(b(e.value))return`${e.value}px`}),Ye=_(e=>{if(b(e.value))return`${e.value}ms`}),ie=_(e=>{if(b(e.value))return`${e.value}deg`}),rr=_(e=>{if(e.fraction===null)return;let[r,t]=k(e.fraction,"/");if(!(!b(r)||!b(t)))return e.fraction}),Ze=_(e=>{if(b(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",...rr},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...w}),backdropContrast:({theme:e})=>({...e("contrast"),...w}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...w}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...ie}),backdropInvert:({theme:e})=>({...e("invert"),...w}),backdropOpacity:({theme:e})=>({...e("opacity"),...w}),backdropSaturate:({theme:e})=>({...e("saturate"),...w}),backdropSepia:({theme:e})=>({...e("sepia"),...w}),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",...P},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",...w},caretColor:({theme:e})=>e("colors"),colors:()=>({...ye}),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",...$},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...w},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"),...P}),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",...$},flexShrink:{0:"0",DEFAULT:"1",...$},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%",...w},grayscale:{0:"0",DEFAULT:"100%",...w},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",...$},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",...$},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",...$},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",...$},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))",...Ze},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))",...Ze},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",...ie},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%",...w},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",...$},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",...w},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",...$},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...P},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...P},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",...P},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...P},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...ie},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2",...w},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",...w},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%",...w},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...ie},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",...$},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",...P},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...P},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",...Ye},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...Ye},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",...$}};var nr=64;function U(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function A(e,r="",t=[]){return{kind:"at-rule",name:e,params:r,nodes:t}}function R(e,r=[]){return e.charCodeAt(0)===nr?H(e,r):U(e,r)}function T(e,r,t=!1){return{kind:"declaration",property:e,value:r,important:t}}function ke(e){return{kind:"comment",value:e}}function y(e,r,t=[],i={}){for(let n=0;n4&&e[3]==="\\"){var n=e[2];(n==="?"||n===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//")}var l=e.split(/[/\\]+/);return r!==!1&&l[l.length-1]===""&&l.pop(),i+l.join("/")}function be(e){let r=or(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var Ae=/(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g,fr=/(?ar.test(e),mr=e=>sr.test(e);async function Xe({css:e,base:r,root:t}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let i=q(e),n=[];function l(o){if(o[0]==="/")return o;let s=xe.posix.join(be(r),o),a=xe.posix.relative(be(t),s);return a.startsWith(".")||(a="./"+a),a}return y(i,o=>{if(o.kind!=="declaration"||!o.value)return;let s=Ae.test(o.value),a=Qe.test(o.value);if(s||a){let u=a?gr:et;n.push(u(o.value,l).then(p=>{o.value=p}))}}),n.length&&await Promise.all(n),K(i)}function et(e,r){return rt(e,Ae,async t=>{let[i,n]=t;return await tt(n.trim(),i,r)})}async function gr(e,r){return await rt(e,Qe,async t=>{let[,i]=t;return await vr(i,async({url:l})=>Ae.test(l)?await et(l,r):lr.test(l)?l:await tt(l,l,r))})}async function tt(e,r,t,i="url"){let n="",l=e[0];if((l==='"'||l==="'")&&(n=l,e=e.slice(1,-1)),hr(e))return r;let o=await t(e);return n===""&&o!==encodeURI(o)&&(n='"'),n==="'"&&o.includes("'")&&(n='"'),n==='"'&&o.includes('"')&&(o=o.replace(fr,'\\"')),`${i}(${n}${o}${n})`}function hr(e,r){return mr(e)||dr(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||ur.test(e)}function vr(e,r){return Promise.all(wr(e).map(async({url:t,descriptor:i})=>({url:await r({url:t,descriptor:i}),descriptor:i}))).then(kr)}function wr(e){let r=e.trim().replace(pr," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(cr);return Array.from(r,({groups:t})=>({url:t?.url?.trim()??"",descriptor:t?.descriptor?.trim()??""})).filter(({url:t})=>!!t)}function kr(e){return e.map(({url:r,descriptor:t})=>r+(t?` ${t}`:"")).join(", ")}async function rt(e,r,t){let i,n=e,l="";for(;i=r.exec(n);)l+=n.slice(0,i.index),l+=await t(i),n=n.slice(i.index+i[0].length);return l+=n,l}function st({base:e,from:r,polyfills:t,onDependency:i,shouldRewriteUrls:n,customCssResolver:l,customJsResolver:o}){return{base:e,polyfills:t,from:r,async loadModule(s,a){return ct(s,a,i,o)},async loadStylesheet(s,a){let u=await ft(s,a,i,l);return n&&(u.content=await Xe({css:u.content,root:e,base:u.base})),u}}}async function ut(e,r){if(e.root&&e.root!=="none"){let t=/[*{]/,i=[];for(let l of e.root.pattern.split("/")){if(t.test(l))break;i.push(l)}if(!await at.stat(G.resolve(r,i.join("/"))).then(l=>l.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function Ca(e,r){let t=await Ar(e,st(r));return await ut(t,r.base),t}async function $a(e,r){let t=await xr(e,st(r));return await ut(t,r.base),t}async function Sa(e,{base:r}){return br(e,{base:r,async loadModule(t,i){return ct(t,i,()=>{})},async loadStylesheet(t,i){return ft(t,i,()=>{})}})}async function ct(e,r,t,i){if(e[0]!=="."){let s=await lt(e,r,i);if(!s)throw new Error(`Could not resolve '${e}' from '${r}'`);let a=await ot(it(s).href);return{path:s,base:G.dirname(s),module:a.default??a}}let n=await lt(e,r,i);if(!n)throw new Error(`Could not resolve '${e}' from '${r}'`);let[l,o]=await Promise.all([ot(it(n).href+"?id="+Date.now()),Ee(n)]);for(let s of o)t(s);return{path:n,base:G.dirname(n),module:l.default??l}}async function ft(e,r,t,i){let n=await $r(e,r,i);if(!n)throw new Error(`Could not resolve '${e}' from '${r}'`);if(t(n),typeof globalThis.__tw_readFile=="function"){let o=await globalThis.__tw_readFile(n,"utf-8");if(o)return{path:n,base:G.dirname(n),content:o}}let l=await at.readFile(n,"utf-8");return{path:n,base:G.dirname(n),content:l}}var nt=null;async function ot(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 nt??=yr(import.meta.url,{moduleCache:!1,fsCache:!1}),await nt.import(e)}}var Se=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],Cr=L.ResolverFactory.createResolver({fileSystem:new L.CachedInputFileSystem($e,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:Se});async function $r(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 Ce(Cr,e,r)}var Sr=L.ResolverFactory.createResolver({fileSystem:new L.CachedInputFileSystem($e,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:Se}),Nr=L.ResolverFactory.createResolver({fileSystem:new L.CachedInputFileSystem($e,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:Se});async function lt(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 Ce(Sr,e,r).catch(()=>Ce(Nr,e,r))}function Ce(e,r,t){return new Promise((i,n)=>e.resolve({},t,r,{},(l,o)=>{if(l)return n(l);i(o)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var pt=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(n=>n.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(),n=t-i.value;this.#t.get(i.id).value+=n}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(r=this.defaultFlush){let t=[],i=!1;for(let o=this.#e.length-1;o>=0;o--)this.end(this.#e[o].label);for(let[o,{value:s}]of this.#r.entries()){if(this.#t.has(o))continue;t.length===0&&(i=!0,t.push("Hits:"));let a=o.split("//").length;t.push(`${" ".repeat(a)}${o} ${ne(dt(`\xD7 ${s}`))}`)}this.#t.size>0&&i&&t.push(` +Timers:`);let n=-1/0,l=new Map;for(let[o,{value:s}]of this.#t){let a=`${(Number(s)/1e6).toFixed(2)}ms`;l.set(o,a),n=Math.max(n,a.length)}for(let o of this.#t.keys()){let s=o.split("//").length;t.push(`${ne(`[${l.get(o).padStart(n," ")}]`)}${" ".repeat(s-1)}${s===1?" ":ne(" \u21B3 ")}${o.split("//").pop()} ${this.#r.get(o).value===1?"":ne(dt(`\xD7 ${this.#r.get(o).value}`))}`.trimEnd())}r(` +${t.join(` +`)} +`),this.reset()}[Symbol.dispose](){le&&this.report()}};function ne(e){return`\x1B[2m${e}\x1B[22m`}function dt(e){return`\x1B[34m${e}\x1B[39m`}import Er from"@ampproject/remapping";import{Features as J,transform as Vr}from"lightningcss";import Tr from"magic-string";function Oa(e,{file:r="input.css",minify:t=!1,map:i}={}){function n(a,u){return Vr({filename:r,code:a,minify:t,sourceMap:typeof u<"u",inputSourceMap:u,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:J.Nesting|J.MediaQueries,exclude:J.LogicalProperties|J.DirSelector|J.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0})}let l=n(Buffer.from(e),i);i=l.map?.toString(),l=n(l.code,i),i=l.map?.toString();let o=l.code.toString(),s=new Tr(o);if(s.replaceAll("@media not (","@media not all and ("),i!==void 0&&s.hasChanged()){let a=s.generateMap({source:"original",hires:"boundary"}).toString();i=Er([a,i],()=>null).toString()}return o=s.toString(),{code:o,map:i}}import{SourceMapGenerator as Rr}from"source-map-js";function Pr(e){let r=new Rr,t=1,i=new g(n=>({url:n?.url??``,content:n?.content??""}));for(let n of e.mappings){let l=i.get(n.originalPosition?.source??null);r.addMapping({generated:n.generatedPosition,original:n.originalPosition,source:l.url,name:n.name}),r.setSourceContent(l.url,l.content)}return r.toString()}function Ka(e){let r=typeof e=="string"?e:Pr(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=oe.createRequire(import.meta.url);oe.register?.(Or(e.resolve("@tailwindcss/node/esm-cache-loader")))}export{ya as Features,pt as Instrumentation,ba as Polyfills,Sa as __unstable__loadDesignSystem,$a as compile,Ca as compileAst,ae as env,ct as loadModule,be as normalizePath,Oa as optimize,Ka as toSourceMap}; diff --git a/tools/ui/node_modules/@tailwindcss/node/dist/require-cache.d.ts b/tools/ui/node_modules/@tailwindcss/node/dist/require-cache.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de970b93e0e3de5fee1c7bbd0e90557a749626d9 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/dist/require-cache.d.ts @@ -0,0 +1,3 @@ +declare function clearRequireCache(files: string[]): void; + +export { clearRequireCache }; diff --git a/tools/ui/node_modules/@tailwindcss/node/dist/require-cache.js b/tools/ui/node_modules/@tailwindcss/node/dist/require-cache.js new file mode 100644 index 0000000000000000000000000000000000000000..398995fad99874c69392bbc01629281fb348c796 --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/LICENSE b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/README.md b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95ec9d87ddcc59defeaed61b39cbb49869220c9f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/README.md @@ -0,0 +1,40 @@ +

+ + + + + 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 any other conversation that would benefit from being searchable: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +For chatting with others using the framework: + +[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## 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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bf291d6dcbcba58fb36a7f6c3339af4f67c97705 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs @@ -0,0 +1,35 @@ +import{a as Tt,b as D,c as J,d as E,e as lt,f as de,g as Ue,h as Pt}from"./chunk-G32FJCSR.mjs";import{a as Et}from"./chunk-HTB5LLOP.mjs";var Rt="4.1.11";var Ve=92,Ie=47,Fe=42,Ot=34,Kt=39,ii=58,ze=59,ie=10,Me=13,Ne=32,Le=9,_t=123,at=125,ft=40,jt=41,ni=91,oi=93,Dt=45,st=64,li=33;function me(r,t){let i=t?.from?{file:t.from,code:r}:null;r[0]==="\uFEFF"&&(r=" "+r.slice(1));let e=[],n=[],s=[],a=null,c=null,u="",f="",g=0,d;for(let m=0;m0&&r[b]===v[v.length-1]&&(v=v.slice(0,-1));let N=ut(u,k);if(!N)throw new Error("Invalid custom property, expected a value");i&&(N.src=[i,x,m],N.dst=[i,x,m]),a?a.nodes.push(N):e.push(N),u=""}else if(w===ze&&u.charCodeAt(0)===st)c=Se(u),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a?a.nodes.push(c):e.push(c),u="",c=null;else if(w===ze&&f[f.length-1]!==")"){let v=ut(u);if(!v)throw u.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${u.trim()}\``);i&&(v.src=[i,g,m],v.dst=[i,g,m]),a?a.nodes.push(v):e.push(v),u=""}else if(w===_t&&f[f.length-1]!==")")f+="}",c=H(u.trim()),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a&&a.nodes.push(c),s.push(a),a=c,u="",c=null;else if(w===at&&f[f.length-1]!==")"){if(f==="")throw new Error("Missing opening {");if(f=f.slice(0,-1),u.length>0)if(u.charCodeAt(0)===st)c=Se(u),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a?a.nodes.push(c):e.push(c),u="",c=null;else{let x=u.indexOf(":");if(a){let k=ut(u,x);if(!k)throw new Error(`Invalid declaration: \`${u.trim()}\``);i&&(k.src=[i,g,m],k.dst=[i,g,m]),a.nodes.push(k)}}let v=s.pop()??null;v===null&&a&&e.push(a),a=v,u="",c=null}else if(w===ft)f+=")",u+="(";else if(w===jt){if(f[f.length-1]!==")")throw new Error("Missing opening (");f=f.slice(0,-1),u+=")"}else{if(u.length===0&&(w===Ne||w===ie||w===Le))continue;u===""&&(g=m),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===st){let m=Se(u);i&&(m.src=[i,g,r.length],m.dst=[i,g,r.length]),e.push(m)}if(f.length>0&&a){if(a.kind==="rule")throw new Error(`Missing closing } at ${a.selector}`);if(a.kind==="at-rule")throw new Error(`Missing closing } at ${a.name} ${a.params}`)}return n.length>0?n.concat(e):e}function Se(r,t=[]){let i=r,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+=t.charAt(e);continue}s+="\\"+t.charAt(e)}return s}function ge(r){return r.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,t=>t.length>2?String.fromCodePoint(Number.parseInt(t.slice(1).trim(),16)):t[1])}var Ft=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"]]]);function It(r,t){return(Ft.get(t)??[]).some(i=>r===i||r.startsWith(`${i}-`))}var Be=class{constructor(t=new Map,i=new Set([])){this.values=t;this.keyframes=i}prefix=null;get size(){return this.values.size}add(t,i,e=0,n){if(t.endsWith("-*")){if(i!=="initial")throw new Error(`Invalid theme value \`${i}\` for namespace \`${t}\``);t==="--*"?this.values.clear():this.clearNamespace(t.slice(0,-2),0)}if(e&4){let s=this.values.get(t);if(s&&!(s.options&4))return}i==="initial"?this.values.delete(t):this.values.set(t,{value:i,options:e,src:n})}keysInNamespaces(t){let i=[];for(let e of t){let n=`${e}-`;for(let s of this.values.keys())s.startsWith(n)&&s.indexOf("--",2)===-1&&(It(s,e)||i.push(s.slice(n.length)))}return i}get(t){for(let i of t){let e=this.values.get(i);if(e)return e.value}return null}hasDefault(t){return(this.getOptions(t)&4)===4}getOptions(t){return t=ge(this.#r(t)),this.values.get(t)?.options??0}entries(){return this.prefix?Array.from(this.values,t=>(t[0]=this.prefixKey(t[0]),t)):this.values.entries()}prefixKey(t){return this.prefix?`--${this.prefix}-${t.slice(2)}`:t}#r(t){return this.prefix?`--${t.slice(3+this.prefix.length)}`:t}clearNamespace(t,i){let e=Ft.get(t)??[];e:for(let n of this.values.keys())if(n.startsWith(t)){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(t,i){for(let e of i){let n=t!==null?`${e}-${t}`:e;if(!this.values.has(n))if(t!==null&&t.includes(".")){if(n=`${e}-${t.replaceAll(".","_")}`,!this.values.has(n))continue}else continue;if(!It(n,e))return n}return null}#t(t){let i=this.values.get(t);if(!i)return null;let e=null;return i.options&2&&(e=i.value),`var(${fe(this.prefixKey(t))}${e?`, ${e}`:""})`}markUsedVariable(t){let i=ge(this.#r(t)),e=this.values.get(i);if(!e)return!1;let n=e.options&16;return e.options|=16,!n}resolve(t,i,e=0){let n=this.#e(t,i);if(!n)return null;let s=this.values.get(n);return(e|s.options)&1?s.value:this.#t(n)}resolveValue(t,i){let e=this.#e(t,i);return e?this.values.get(e).value:null}resolveWith(t,i,e=[]){let n=this.#e(t,i);if(!n)return null;let s={};for(let c of e){let u=`${n}${c}`,f=this.values.get(u);f&&(f.options&1?s[c]=f.value:s[c]=this.#t(u))}let a=this.values.get(n);return a.options&1?[a.value,s]:[this.#t(n),s]}namespace(t){let i=new Map,e=`${t}-`;for(let[n,s]of this.values)n===t?i.set(null,s.value):n.startsWith(`${e}-`)?i.set(n.slice(t.length),s.value):n.startsWith(e)&&i.set(n.slice(e.length),s.value);return i}addKeyframes(t){this.keyframes.add(t)}getKeyframes(){return Array.from(this.keyframes)}};var B=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 pt(r){return{kind:"word",value:r}}function ai(r,t){return{kind:"function",value:r,nodes:t}}function si(r){return{kind:"separator",value:r}}function ee(r,t,i=null){for(let e=0;e0){let d=pt(n);e?e.nodes.push(d):t.push(d),n=""}let u=a,f=a+1;for(;f0){let f=pt(n);u?.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(c)}}return n.length>0&&t.push(pt(n)),t}function qe(r){let t=[];return ee(q(r),i=>{if(!(i.kind!=="function"||i.value!=="var"))return ee(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||t.push(e.value)}),1}),t}var mi=64;function M(r,t=[]){return{kind:"rule",selector:r,nodes:t}}function z(r,t="",i=[]){return{kind:"at-rule",name:r,params:t,nodes:i}}function H(r,t=[]){return r.charCodeAt(0)===mi?Se(r,t):M(r,t)}function l(r,t,i=!1){return{kind:"declaration",property:r,value:t,important:i}}function We(r){return{kind:"comment",value:r}}function le(r,t){return{kind:"context",context:r,nodes:t}}function L(r){return{kind:"at-root",nodes:r}}function F(r,t,i=[],e={}){for(let n=0;nnew Set),a=new B(()=>new Set),c=new Set,u=new Set,f=[],g=[],d=new B(()=>new Set);function m(v,x,k={},N=0){if(v.kind==="declaration"){if(v.property==="--tw-sort"||v.value===void 0||v.value===null)return;if(k.theme&&v.property[0]==="-"&&v.property[1]==="-"){if(v.value==="initial"){v.value=void 0;return}k.keyframes||s.get(x).add(v)}if(v.value.includes("var("))if(k.theme&&v.property[0]==="-"&&v.property[1]==="-")for(let b of qe(v.value))d.get(b).add(v.property);else t.trackUsedVariables(v.value);if(v.property==="animation")for(let b of Zt(v.value))u.add(b);i&2&&v.value.includes("color-mix(")&&a.get(x).add(v),x.push(v)}else if(v.kind==="rule")if(v.selector==="&")for(let b of v.nodes){let S=[];m(b,S,k,N+1),S.length>0&&x.push(...S)}else{let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);b.nodes.length>0&&x.push(b)}else if(v.kind==="at-rule"&&v.name==="@property"&&N===0){if(n.has(v.params))return;if(i&1){let S=v.params,P=null,U=!1;for(let _ of v.nodes)_.kind==="declaration"&&(_.property==="initial-value"?P=_.value:_.property==="inherits"&&(U=_.value==="true"));let R=l(S,P??"initial");R.src=v.src,U?f.push(R):g.push(R)}n.add(v.params);let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);x.push(b)}else if(v.kind==="at-rule"){v.name==="@keyframes"&&(k={...k,keyframes:!0});let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);v.name==="@keyframes"&&k.theme&&c.add(b),(b.nodes.length>0||b.name==="@layer"||b.name==="@charset"||b.name==="@custom-media"||b.name==="@namespace"||b.name==="@import")&&x.push(b)}else if(v.kind==="at-root")for(let b of v.nodes){let S=[];m(b,S,k,0);for(let P of S)e.push(P)}else if(v.kind==="context"){if(v.context.reference)return;for(let b of v.nodes)m(b,x,{...k,...v.context},N)}else v.kind==="comment"&&x.push(v)}let w=[];for(let v of r)m(v,w,{},0);e:for(let[v,x]of s)for(let k of x){if(Qt(k.property,t.theme,d)){if(k.property.startsWith(t.theme.prefixKey("--animate-")))for(let S of Zt(k.value))u.add(S);continue}let b=v.indexOf(k);if(v.splice(b,1),v.length===0){let S=gi(w,P=>P.kind==="rule"&&P.nodes===v);if(!S||S.length===0)continue e;S.unshift({kind:"at-root",nodes:w});do{let P=S.pop();if(!P)break;let U=S[S.length-1];if(!U||U.kind!=="at-root"&&U.kind!=="at-rule")break;let R=U.nodes.indexOf(P);if(R===-1)break;U.nodes.splice(R,1)}while(!0);continue e}}for(let v of c)if(!u.has(v.params)){let x=e.indexOf(v);e.splice(x,1)}if(w=w.concat(e),i&2)for(let[v,x]of a)for(let k of x){let N=v.indexOf(k);if(N===-1||k.value==null)continue;let b=q(k.value),S=!1;if(ee(b,(R,{replaceWith:_})=>{if(R.kind!=="function"||R.value!=="color-mix")return;let K=!1,G=!1;if(ee(R.nodes,(I,{replaceWith:W})=>{if(I.kind=="word"&&I.value.toLowerCase()==="currentcolor"){G=!0,S=!0;return}let Z=I,re=null,o=new Set;do{if(Z.kind!=="function"||Z.value!=="var")return;let p=Z.nodes[0];if(!p||p.kind!=="word")return;let h=p.value;if(o.has(h)){K=!0;return}if(o.add(h),S=!0,re=t.theme.resolveValue(null,[p.value]),!re){K=!0;return}if(re.toLowerCase()==="currentcolor"){G=!0;return}re.startsWith("var(")?Z=q(re)[0]:Z=null}while(Z);W({kind:"word",value:re})}),K||G){let I=R.nodes.findIndex(Z=>Z.kind==="separator"&&Z.value.trim().includes(","));if(I===-1)return;let W=R.nodes.length>I?R.nodes[I+1]:null;if(!W)return;_(W)}else if(S){let I=R.nodes[2];I.kind==="word"&&(I.value==="oklab"||I.value==="oklch"||I.value==="lab"||I.value==="lch")&&(I.value="srgb")}}),!S)continue;let P={...k,value:Y(b)},U=H("@supports (color: color-mix(in lab, red, red))",[k]);U.src=k.src,v.splice(N,1,P,U)}if(i&1){let v=[];if(f.length>0){let x=H(":root, :host",f);x.src=f[0].src,v.push(x)}if(g.length>0){let x=H("*, ::before, ::after, ::backdrop",g);x.src=g[0].src,v.push(x)}if(v.length>0){let x=w.findIndex(b=>!(b.kind==="comment"||b.kind==="at-rule"&&(b.name==="@charset"||b.name==="@import"))),k=z("@layer","properties",[]);k.src=v[0].src,w.splice(x<0?w.length:x,0,k);let N=H("@layer properties",[z("@supports","((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))",v)]);N.src=v[0].src,N.nodes[0].src=v[0].src,w.push(N)}}return w}function ne(r,t){let i=0,e={file:null,code:""};function n(a,c=0){let u="",f=" ".repeat(c);if(a.kind==="declaration"){if(u+=`${f}${a.property}: ${a.value}${a.important?" !important":""}; +`,t){i+=f.length;let g=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let d=i;i+=2,a.dst=[e,g,d]}}else if(a.kind==="rule"){if(u+=`${f}${a.selector} { +`,t){i+=f.length;let g=i;i+=a.selector.length,i+=1;let d=i;a.dst=[e,g,d],i+=2}for(let g of a.nodes)u+=n(g,c+1);u+=`${f}} +`,t&&(i+=f.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let g=`${f}${a.name} ${a.params}; +`;if(t){i+=f.length;let d=i;i+=a.name.length,i+=1,i+=a.params.length;let m=i;i+=2,a.dst=[e,d,m]}return g}if(u+=`${f}${a.name}${a.params?` ${a.params} `:" "}{ +`,t){i+=f.length;let g=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let d=i;a.dst=[e,g,d],i+=2}for(let g of a.nodes)u+=n(g,c+1);u+=`${f}} +`,t&&(i+=f.length,i+=2)}else if(a.kind==="comment"){if(u+=`${f}/*${a.value}*/ +`,t){i+=f.length;let g=i;i+=2+a.value.length+2;let d=i;a.dst=[e,g,d],i+=1}}else if(a.kind==="context"||a.kind==="at-root")return"";return u}let s="";for(let a of r)s+=n(a,0);return e.code=s,s}function gi(r,t){let i=[];return F(r,(e,{path:n})=>{if(t(e))return i=[...n],2}),i}function Qt(r,t,i,e=new Set){if(e.has(r)||(e.add(r),t.getOptions(r)&24))return!0;{let s=i.get(r)??[];for(let a of s)if(Qt(a,t,i,e))return!0}return!1}function Zt(r){return r.split(/[\s,]+/)}function ce(r){if(r.indexOf("(")===-1)return be(r);let t=q(r);return mt(t),r=Y(t),r=Tt(r),r}function be(r,t=!1){let i="";for(let e=0;e0&&n===gt[t-1]&&t--;break;case 59:if(t===0)return!1;break}}return!0}var vi=58,Xt=45,er=97,tr=122;function*rr(r,t){let i=D(r,":");if(t.theme.prefix){if(i.length===1||i[0]!==t.theme.prefix)return null;i.shift()}let e=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let m=t.parseVariant(i[d]);if(m===null)return;n.push(m)}let s=!1;e[e.length-1]==="!"?(s=!0,e=e.slice(0,-1)):e[0]==="!"&&(s=!0,e=e.slice(1)),t.utilities.has(e,"static")&&!e.includes("[")&&(yield{kind:"static",root:e,variants:n,important:s,raw:r});let[a,c=null,u]=D(e,"/");if(u)return;let f=c===null?null:ht(c);if(c!==null&&f===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let d=a.charCodeAt(1);if(d!==Xt&&!(d>=er&&d<=tr))return;a=a.slice(1,-1);let m=a.indexOf(":");if(m===-1||m===0||m===a.length-1)return;let w=a.slice(0,m),v=ce(a.slice(m+1));if(!se(v))return;yield{kind:"arbitrary",property:w,value:v,modifier:f,variants:n,important:s,raw:r};return}let g;if(a[a.length-1]==="]"){let d=a.indexOf("-[");if(d===-1)return;let m=a.slice(0,d);if(!t.utilities.has(m,"functional"))return;let w=a.slice(d+1);g=[[m,w]]}else if(a[a.length-1]===")"){let d=a.indexOf("-(");if(d===-1)return;let m=a.slice(0,d);if(!t.utilities.has(m,"functional"))return;let w=a.slice(d+2,-1),v=D(w,":"),x=null;if(v.length===2&&(x=v[0],w=v[1]),w[0]!=="-"||w[1]!=="-"||!se(w))return;g=[[m,x===null?`[var(${w})]`:`[${x}:var(${w})]`]]}else g=nr(a,d=>t.utilities.has(d,"functional"));for(let[d,m]of g){let w={kind:"functional",root:d,modifier:f,value:null,variants:n,important:s,raw:r};if(m===null){yield w;continue}{let v=m.indexOf("[");if(v!==-1){if(m[m.length-1]!=="]")return;let k=ce(m.slice(v+1,-1));if(!se(k))continue;let N="";for(let b=0;b=er&&S<=tr))break}if(k.length===0||k.trim().length===0)continue;w.value={kind:"arbitrary",dataType:N||null,value:k}}else{let k=c===null||w.modifier?.kind==="arbitrary"?null:`${m}/${c}`;w.value={kind:"named",value:m,fraction:k}}}yield w}}function ht(r){if(r[0]==="["&&r[r.length-1]==="]"){let t=ce(r.slice(1,-1));return!se(t)||t.length===0||t.trim().length===0?null:{kind:"arbitrary",value:t}}return r[0]==="("&&r[r.length-1]===")"?(r=r.slice(1,-1),r[0]!=="-"||r[1]!=="-"||!se(r)?null:(r=`var(${r})`,{kind:"arbitrary",value:ce(r)})):{kind:"named",value:r}}function ir(r,t){if(r[0]==="["&&r[r.length-1]==="]"){if(r[1]==="@"&&r.includes("&"))return null;let i=ce(r.slice(1,-1));if(!se(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]=D(r,"/");if(n)return null;let s=nr(i,a=>t.variants.has(a));for(let[a,c]of s)switch(t.variants.kind(a)){case"static":return c!==null||e!==null?null:{kind:"static",root:a};case"functional":{let u=e===null?null:ht(e);if(e!==null&&u===null)return null;if(c===null)return{kind:"functional",root:a,modifier:u,value:null};if(c[c.length-1]==="]"){if(c[0]!=="[")continue;let f=ce(c.slice(1,-1));return!se(f)||f.length===0||f.trim().length===0?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:f}}}if(c[c.length-1]===")"){if(c[0]!=="(")continue;let f=ce(c.slice(1,-1));return!se(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})`}}}return{kind:"functional",root:a,modifier:u,value:{kind:"named",value:c}}}case"compound":{if(c===null)return null;let u=t.parseVariant(c);if(u===null||!t.variants.compoundsWith(a,u))return null;let f=e===null?null:ht(e);return e!==null&&f===null?null:{kind:"compound",root:a,modifier:f,variant:u}}}}return null}function*nr(r,t){t(r)&&(yield[r,null]);let i=r.lastIndexOf("-");for(;i>0;){let e=r.slice(0,i);if(t(e)){let n=[e,r.slice(i+1)];if(n[1]==="")break;yield n}i=r.lastIndexOf("-",i-1)}r[0]==="@"&&t("@")&&(yield["@",r.slice(1)])}function or(r,t){let i=[];for(let n of t.variants)i.unshift(He(n));r.theme.prefix&&i.unshift(r.theme.prefix);let e="";if(t.kind==="static"&&(e+=t.root),t.kind==="functional"&&(e+=t.root,t.value))if(t.value.kind==="arbitrary"){if(t.value!==null){let n=wt(t.value.value),s=n?t.value.value.slice(4,-1):t.value.value,[a,c]=n?["(",")"]:["[","]"];t.value.dataType?e+=`-${a}${t.value.dataType}:${ke(s)}${c}`:e+=`-${a}${ke(s)}${c}`}}else t.value.kind==="named"&&(e+=`-${t.value.value}`);return t.kind==="arbitrary"&&(e+=`[${t.property}:${ke(t.value)}]`),(t.kind==="arbitrary"||t.kind==="functional")&&(e+=lr(t.modifier)),t.important&&(e+="!"),i.push(e),i.join(":")}function lr(r){if(r===null)return"";let t=wt(r.value),i=t?r.value.slice(4,-1):r.value,[e,n]=t?["(",")"]:["[","]"];return r.kind==="arbitrary"?`/${e}${ke(i)}${n}`:r.kind==="named"?`/${r.value}`:""}function He(r){if(r.kind==="static")return r.root;if(r.kind==="arbitrary")return`[${ke(bi(r.selector))}]`;let t="";if(r.kind==="functional"){t+=r.root;let i=r.root!=="@";if(r.value)if(r.value.kind==="arbitrary"){let e=wt(r.value.value),n=e?r.value.value.slice(4,-1):r.value.value,[s,a]=e?["(",")"]:["[","]"];t+=`${i?"-":""}${s}${ke(n)}${a}`}else r.value.kind==="named"&&(t+=`${i?"-":""}${r.value.value}`)}return r.kind==="compound"&&(t+=r.root,t+="-",t+=He(r.variant)),(r.kind==="functional"||r.kind==="compound")&&(t+=lr(r.modifier)),t}var wi=new B(r=>{let t=q(r),i=new Set;return ee(t,(e,{parent:n})=>{let s=n===null?t:n.nodes??[];if(e.kind==="word"&&(e.value==="+"||e.value==="-"||e.value==="*"||e.value==="/")){let a=s.indexOf(e)??-1;if(a===-1)return;let c=s[a-1];if(c?.kind!=="separator"||c.value!==" ")return;let u=s[a+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(c),i.add(u)}else e.kind==="separator"&&e.value.trim()==="/"?e.value="/":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&&ee(t,(e,{replaceWith:n})=>{i.has(e)&&(i.delete(e),n([]))}),vt(t),Y(t)});function ke(r){return wi.get(r)}var yi=new B(r=>{let t=q(r);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"?Y(t[2].nodes):r});function bi(r){return yi.get(r)}function vt(r){for(let t of r)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=Te(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=Te(t.value);for(let i=0;i{let t=q(r);return t.length===1&&t[0].kind==="function"&&t[0].value==="var"});function wt(r){return ki.get(r)}function xi(r){throw new Error(`Unexpected value: ${r}`)}function Te(r){return r.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function we(r,t,i){if(r===t)return 0;let e=r.indexOf("("),n=t.indexOf("("),s=e===-1?r.replace(/[\d.]+/g,""):r.slice(0,e),a=n===-1?t.replace(/[\d.]+/g,""):t.slice(0,n),c=(s===a?0:s{e=e.trim();let n=D(e," ").filter(f=>f.trim()!==""),s=null,a=null,c=null;for(let f of n)Ai.has(f)||(ar.test(f)?(a===null?a=f:c===null&&(c=f),ar.lastIndex=0):s===null&&(s=f));if(a===null||c===null)return e;let u=t(s??"currentcolor");return s!==null?e.replace(s,u):`${e} ${u}`}).join(", ")}var Ci=/^-?[a-z][a-zA-Z0-9/%._-]*$/,$i=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,Ze=["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"],yt=class{utilities=new B(()=>[]);completions=new Map;static(t,i){this.utilities.get(t).push({kind:"static",compileFn:i})}functional(t,i,e){this.utilities.get(t).push({kind:"functional",compileFn:i,options:e})}has(t,i){return this.utilities.has(t)&&this.utilities.get(t).some(e=>e.kind===i)}get(t){return this.utilities.has(t)?this.utilities.get(t):[]}getCompletions(t){return this.completions.get(t)?.()??[]}suggest(t,i){this.completions.set(t,i)}keys(t){let i=[];for(let[e,n]of this.utilities.entries())for(let s of n)if(s.kind===t){i.push(e);break}return i}};function $(r,t,i){return z("@property",r,[l("syntax",i?`"${i}"`:'"*"'),l("inherits","false"),...t?[l("initial-value",t)]:[]])}function Q(r,t){if(t===null)return r;let i=Number(t);return Number.isNaN(i)||(t=`${i*100}%`),t==="100%"?r:`color-mix(in oklab, ${r} ${t}, transparent)`}function ur(r,t){let i=Number(t);return Number.isNaN(i)||(t=`${i*100}%`),`oklab(from ${r} l a b / ${t})`}function X(r,t,i){if(!t)return r;if(t.kind==="arbitrary")return Q(r,t.value);let e=i.resolve(t.value,["--opacity"]);return e?Q(r,e):Ue(t.value)?Q(r,`${t.value}%`):null}function te(r,t,i){let e=null;switch(r.value.value){case"inherit":{e="inherit";break}case"transparent":{e="transparent";break}case"current":{e="currentcolor";break}default:{e=t.resolve(r.value.value,i);break}}return e?X(e,r.modifier,t):null}var fr=/(\d+)_(\d+)/g;function cr(r){let t=new yt;function i(o,p){function*h(y){for(let C of r.keysInNamespaces(y))yield C.replace(fr,(O,V,T)=>`${V}.${T}`)}let A=["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"];t.suggest(o,()=>{let y=[];for(let C of p()){if(typeof C=="string"){y.push({values:[C],modifiers:[]});continue}let O=[...C.values??[],...h(C.valueThemeKeys??[])],V=[...C.modifiers??[],...h(C.modifierThemeKeys??[])];C.supportsFractions&&O.push(...A),C.hasDefaultValue&&O.unshift(null),y.push({supportsNegative:C.supportsNegative,values:O,modifiers:V})}return y})}function e(o,p){t.static(o,()=>p.map(h=>typeof h=="function"?h():l(h[0],h[1])))}function n(o,p){function h({negative:A}){return y=>{let C=null,O=null;if(y.value)if(y.value.kind==="arbitrary"){if(y.modifier)return;C=y.value.value,O=y.value.dataType}else{if(C=r.resolve(y.value.fraction??y.value.value,p.themeKeys??[]),C===null&&p.supportsFractions&&y.value.fraction){let[V,T]=D(y.value.fraction,"/");if(!E(V)||!E(T))return;C=`calc(${y.value.fraction} * 100%)`}if(C===null&&A&&p.handleNegativeBareValue){if(C=p.handleNegativeBareValue(y.value),!C?.includes("/")&&y.modifier)return;if(C!==null)return p.handle(C,null)}if(C===null&&p.handleBareValue&&(C=p.handleBareValue(y.value),!C?.includes("/")&&y.modifier))return}else{if(y.modifier)return;C=p.defaultValue!==void 0?p.defaultValue:r.resolve(null,p.themeKeys??[])}if(C!==null)return p.handle(A?`calc(${C} * -1)`:C,O)}}p.supportsNegative&&t.functional(`-${o}`,h({negative:!0})),t.functional(o,h({negative:!1})),i(o,()=>[{supportsNegative:p.supportsNegative,valueThemeKeys:p.themeKeys??[],hasDefaultValue:p.defaultValue!==void 0&&p.defaultValue!==null,supportsFractions:p.supportsFractions}])}function s(o,p){t.functional(o,h=>{if(!h.value)return;let A=null;if(h.value.kind==="arbitrary"?(A=h.value.value,A=X(A,h.modifier,r)):A=te(h,r,p.themeKeys),A!==null)return p.handle(A)}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:p.themeKeys,modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}function a(o,p,h,{supportsNegative:A=!1,supportsFractions:y=!1}={}){A&&t.static(`-${o}-px`,()=>h("-1px")),t.static(`${o}-px`,()=>h("1px")),n(o,{themeKeys:p,supportsFractions:y,supportsNegative:A,defaultValue:null,handleBareValue:({value:C})=>{let O=r.resolve(null,["--spacing"]);return!O||!de(C)?null:`calc(${O} * ${C})`},handleNegativeBareValue:({value:C})=>{let O=r.resolve(null,["--spacing"]);return!O||!de(C)?null:`calc(${O} * -${C})`},handle:h}),i(o,()=>[{values:r.get(["--spacing"])?Ze:[],supportsNegative:A,supportsFractions:y,valueThemeKeys:p}])}e("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip","rect(0, 0, 0, 0)"],["white-space","nowrap"],["border-width","0"]]),e("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip","auto"],["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[o,p]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(`${o}-auto`,[[p,"auto"]]),e(`${o}-full`,[[p,"100%"]]),e(`-${o}-full`,[[p,"-100%"]]),a(o,["--inset","--spacing"],h=>[l(p,h)],{supportsNegative:!0,supportsFractions:!0});e("isolate",[["isolation","isolate"]]),e("isolation-auto",[["isolation","auto"]]),e("z-auto",[["z-index","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--z-index"],handle:o=>[l("z-index",o)]}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),e("order-first",[["order","-9999"]]),e("order-last",[["order","9999"]]),n("order",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--order"],handle:o=>[l("order",o)]}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--order"]}]),e("col-auto",[["grid-column","auto"]]),n("col",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column"],handle:o=>[l("grid-column",o)]}),e("col-span-full",[["grid-column","1 / -1"]]),n("col-span",{handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("grid-column",`span ${o} / span ${o}`)]}),e("col-start-auto",[["grid-column-start","auto"]]),n("col-start",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column-start"],handle:o=>[l("grid-column-start",o)]}),e("col-end-auto",[["grid-column-end","auto"]]),n("col-end",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column-end"],handle:o=>[l("grid-column-end",o)]}),i("col-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-end"]}]),e("row-auto",[["grid-row","auto"]]),n("row",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row"],handle:o=>[l("grid-row",o)]}),e("row-span-full",[["grid-row","1 / -1"]]),n("row-span",{themeKeys:[],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("grid-row",`span ${o} / span ${o}`)]}),e("row-start-auto",[["grid-row-start","auto"]]),n("row-start",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row-start"],handle:o=>[l("grid-row-start",o)]}),e("row-end-auto",[["grid-row-end","auto"]]),n("row-end",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row-end"],handle:o=>[l("grid-row-end",o)]}),i("row-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+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[o,p]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(`${o}-auto`,[[p,"auto"]]),a(o,["--margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});e("box-border",[["box-sizing","border-box"]]),e("box-content",[["box-sizing","content-box"]]),e("line-clamp-none",[["overflow","visible"],["display","block"],["-webkit-box-orient","horizontal"],["-webkit-line-clamp","unset"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("overflow","hidden"),l("display","-webkit-box"),l("-webkit-box-orient","vertical"),l("-webkit-line-clamp",o)]}),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"]]),e("aspect-auto",[["aspect-ratio","auto"]]),e("aspect-square",[["aspect-ratio","1 / 1"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:o})=>{if(o===null)return null;let[p,h]=D(o,"/");return!E(p)||!E(h)?null:o},handle:o=>[l("aspect-ratio",o)]});for(let[o,p]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-${o}`,[["--tw-sort","size"],["width",p],["height",p]]),e(`w-${o}`,[["width",p]]),e(`h-${o}`,[["height",p]]),e(`min-w-${o}`,[["min-width",p]]),e(`min-h-${o}`,[["min-height",p]]),e(`max-w-${o}`,[["max-width",p]]),e(`max-h-${o}`,[["max-height",p]]);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"],o=>[l("--tw-sort","size"),l("width",o),l("height",o)],{supportsFractions:!0});for(let[o,p,h]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(o,p,A=>[l(h,A)],{supportsFractions:!0});t.static("container",()=>{let o=[...r.namespace("--breakpoint").values()];o.sort((h,A)=>we(h,A,"asc"));let p=[l("--tw-sort","--tw-container-component"),l("width","100%")];for(let h of o)p.push(z("@media",`(width >= ${h})`,[l("max-width",h)]));return p}),e("flex-auto",[["flex","auto"]]),e("flex-initial",[["flex","0 auto"]]),e("flex-none",[["flex","none"]]),t.functional("flex",o=>{if(o.value){if(o.value.kind==="arbitrary")return o.modifier?void 0:[l("flex",o.value.value)];if(o.value.fraction){let[p,h]=D(o.value.fraction,"/");return!E(p)||!E(h)?void 0:[l("flex",`calc(${o.value.fraction} * 100%)`)]}if(E(o.value.value))return o.modifier?void 0:[l("flex",o.value.value)]}}),i("flex",()=>[{supportsFractions:!0}]),n("shrink",{defaultValue:"1",handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("flex-shrink",o)]}),n("grow",{defaultValue:"1",handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("flex-grow",o)]}),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"],o=>[l("flex-basis",o)],{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 c=()=>L([$("--tw-border-spacing-x","0",""),$("--tw-border-spacing-y","0","")]);a("border-spacing",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-x",o),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-x",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-x",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-y",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),e("origin-center",[["transform-origin","center"]]),e("origin-top",[["transform-origin","top"]]),e("origin-top-right",[["transform-origin","top right"]]),e("origin-right",[["transform-origin","right"]]),e("origin-bottom-right",[["transform-origin","bottom right"]]),e("origin-bottom",[["transform-origin","bottom"]]),e("origin-bottom-left",[["transform-origin","bottom left"]]),e("origin-left",[["transform-origin","left"]]),e("origin-top-left",[["transform-origin","top left"]]),n("origin",{themeKeys:["--transform-origin"],handle:o=>[l("transform-origin",o)]}),e("perspective-origin-center",[["perspective-origin","center"]]),e("perspective-origin-top",[["perspective-origin","top"]]),e("perspective-origin-top-right",[["perspective-origin","top right"]]),e("perspective-origin-right",[["perspective-origin","right"]]),e("perspective-origin-bottom-right",[["perspective-origin","bottom right"]]),e("perspective-origin-bottom",[["perspective-origin","bottom"]]),e("perspective-origin-bottom-left",[["perspective-origin","bottom left"]]),e("perspective-origin-left",[["perspective-origin","left"]]),e("perspective-origin-top-left",[["perspective-origin","top left"]]),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:o=>[l("perspective-origin",o)]}),e("perspective-none",[["perspective","none"]]),n("perspective",{themeKeys:["--perspective"],handle:o=>[l("perspective",o)]});let u=()=>L([$("--tw-translate-x","0"),$("--tw-translate-y","0"),$("--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"],o=>[u(),l("--tw-translate-x",o),l("--tw-translate-y",o),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let o of["x","y"])e(`-translate-${o}-full`,[u,[`--tw-translate-${o}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e(`translate-${o}-full`,[u,[`--tw-translate-${o}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a(`translate-${o}`,["--translate","--spacing"],p=>[u(),l(`--tw-translate-${o}`,p),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});a("translate-z",["--translate","--spacing"],o=>[u(),l("--tw-translate-z",o),l("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=()=>L([$("--tw-scale-x","1"),$("--tw-scale-y","1"),$("--tw-scale-z","1")]);e("scale-none",[["scale","none"]]);function g({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;return p.value.kind==="arbitrary"?(h=p.value.value,h=o?`calc(${h} * -1)`:h,[l("scale",h)]):(h=r.resolve(p.value.value,["--scale"]),!h&&E(p.value.value)&&(h=`${p.value.value}%`),h?(h=o?`calc(${h} * -1)`:h,[f(),l("--tw-scale-x",h),l("--tw-scale-y",h),l("--tw-scale-z",h),l("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}t.functional("-scale",g({negative:!0})),t.functional("scale",g({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let o of["x","y","z"])n(`scale-${o}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:p})=>E(p)?`${p}%`:null,handle:p=>[f(),l(`--tw-scale-${o}`,p),l("scale",`var(--tw-scale-x) var(--tw-scale-y)${o==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${o}`,()=>[{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:o}){return p=>{if(!p.value||p.modifier)return;let h;if(p.value.kind==="arbitrary"){h=p.value.value;let A=p.value.dataType??J(h,["angle","vector"]);if(A==="vector")return[l("rotate",`${h} var(--tw-rotate)`)];if(A!=="angle")return[l("rotate",o?`calc(${h} * -1)`:h)]}else if(h=r.resolve(p.value.value,["--rotate"]),!h&&E(p.value.value)&&(h=`${p.value.value}deg`),!h)return;return[l("rotate",o?`calc(${h} * -1)`:h)]}}t.functional("-rotate",d({negative:!0})),t.functional("rotate",d({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let o=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),p=()=>L([$("--tw-rotate-x"),$("--tw-rotate-y"),$("--tw-rotate-z"),$("--tw-skew-x"),$("--tw-skew-y")]);for(let h of["x","y","z"])n(`rotate-${h}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:A})=>E(A)?`${A}deg`:null,handle:A=>[p(),l(`--tw-rotate-${h}`,`rotate${h.toUpperCase()}(${A})`),l("transform",o)]}),i(`rotate-${h}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("transform",o)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),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"]}]),t.functional("transform",h=>{if(h.modifier)return;let A=null;if(h.value?h.value.kind==="arbitrary"&&(A=h.value.value):A=o,A!==null)return[p(),l("transform",A)]}),i("transform",()=>[{hasDefaultValue:!0}]),e("transform-cpu",[["transform",o]]),e("transform-gpu",[["transform",`translateZ(0) ${o}`]]),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 o 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-${o}`,[["cursor",o]]);n("cursor",{themeKeys:["--cursor"],handle:o=>[l("cursor",o)]});for(let o of["auto","none","manipulation"])e(`touch-${o}`,[["touch-action",o]]);let m=()=>L([$("--tw-pan-x"),$("--tw-pan-y"),$("--tw-pinch-zoom")]);for(let o of["x","left","right"])e(`touch-pan-${o}`,[m,["--tw-pan-x",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["y","up","down"])e(`touch-pan-${o}`,[m,["--tw-pan-y",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);e("touch-pinch-zoom",[m,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["none","text","all","auto"])e(`select-${o}`,[["-webkit-user-select",o],["user-select",o]]);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=()=>L([$("--tw-scroll-snap-strictness","proximity","*")]);for(let o of["x","y","both"])e(`snap-${o}`,[w,["scroll-snap-type",`${o} 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[o,p]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(o,["--scroll-margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});for(let[o,p]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(o,["--scroll-padding","--spacing"],h=>[l(p,h)]);e("list-inside",[["list-style-position","inside"]]),e("list-outside",[["list-style-position","outside"]]),e("list-none",[["list-style-type","none"]]),e("list-disc",[["list-style-type","disc"]]),e("list-decimal",[["list-style-type","decimal"]]),n("list",{themeKeys:["--list-style-type"],handle:o=>[l("list-style-type",o)]}),e("list-image-none",[["list-style-image","none"]]),n("list-image",{themeKeys:["--list-style-image"],handle:o=>[l("list-style-image",o)]}),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"]]),e("columns-auto",[["columns","auto"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("columns",o)]}),i("columns",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--columns","--container"]}]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-before-${o}`,[["break-before",o]]);for(let o of["auto","avoid","avoid-page","avoid-column"])e(`break-inside-${o}`,[["break-inside",o]]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-after-${o}`,[["break-after",o]]);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"]]),e("auto-cols-auto",[["grid-auto-columns","auto"]]),e("auto-cols-min",[["grid-auto-columns","min-content"]]),e("auto-cols-max",[["grid-auto-columns","max-content"]]),e("auto-cols-fr",[["grid-auto-columns","minmax(0, 1fr)"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:o=>[l("grid-auto-columns",o)]}),e("auto-rows-auto",[["grid-auto-rows","auto"]]),e("auto-rows-min",[["grid-auto-rows","min-content"]]),e("auto-rows-max",[["grid-auto-rows","max-content"]]),e("auto-rows-fr",[["grid-auto-rows","minmax(0, 1fr)"]]),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:o=>[l("grid-auto-rows",o)]}),e("grid-cols-none",[["grid-template-columns","none"]]),e("grid-cols-subgrid",[["grid-template-columns","subgrid"]]),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:o})=>lt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-columns",o)]}),e("grid-rows-none",[["grid-template-rows","none"]]),e("grid-rows-subgrid",[["grid-template-rows","subgrid"]]),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:o})=>lt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-rows",o)]}),i("grid-cols",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(o,p)=>`${p+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"],o=>[l("gap",o)]),a("gap-x",["--gap","--spacing"],o=>[l("column-gap",o)]),a("gap-y",["--gap","--spacing"],o=>[l("row-gap",o)]),a("space-x",["--space","--spacing"],o=>[L([$("--tw-space-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","0"),l("margin-inline-start",`calc(${o} * var(--tw-space-x-reverse))`),l("margin-inline-end",`calc(${o} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),a("space-y",["--space","--spacing"],o=>[L([$("--tw-space-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","0"),l("margin-block-start",`calc(${o} * var(--tw-space-y-reverse))`),l("margin-block-end",`calc(${o} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),e("space-x-reverse",[()=>L([$("--tw-space-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","1")])]),e("space-y-reverse",[()=>L([$("--tw-space-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","1")])]),e("accent-auto",[["accent-color","auto"]]),s("accent",{themeKeys:["--accent-color","--color"],handle:o=>[l("accent-color",o)]}),s("caret",{themeKeys:["--caret-color","--color"],handle:o=>[l("caret-color",o)]}),s("divide",{themeKeys:["--divide-color","--color"],handle:o=>[M(":where(& > :not(:last-child))",[l("--tw-sort","divide-color"),l("border-color",o)])]}),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 o of["auto","hidden","clip","visible","scroll"])e(`overflow-${o}`,[["overflow",o]]),e(`overflow-x-${o}`,[["overflow-x",o]]),e(`overflow-y-${o}`,[["overflow-y",o]]);for(let o of["auto","contain","none"])e(`overscroll-${o}`,[["overscroll-behavior",o]]),e(`overscroll-x-${o}`,[["overscroll-behavior-x",o]]),e(`overscroll-y-${o}`,[["overscroll-behavior-y",o]]);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-words",[["overflow-wrap","break-word"]]),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[o,p]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"]]])e(`${o}-none`,p.map(h=>[h,"0"])),e(`${o}-full`,p.map(h=>[h,"calc(infinity * 1px)"])),n(o,{themeKeys:["--radius"],handle:h=>p.map(A=>l(A,h))});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 p=function(h,A){t.functional(h,y=>{if(!y.value){if(y.modifier)return;let C=r.get(["--default-border-width"])??"1px",O=A.width(C);return O?[o(),...O]:void 0}if(y.value.kind==="arbitrary"){let C=y.value.value;switch(y.value.dataType??J(C,["color","line-width","length"])){case"line-width":case"length":{if(y.modifier)return;let V=A.width(C);return V?[o(),...V]:void 0}default:return C=X(C,y.modifier,r),C===null?void 0:A.color(C)}}{let C=te(y,r,["--border-color","--color"]);if(C)return A.color(C)}{if(y.modifier)return;let C=r.resolve(y.value.value,["--border-width"]);if(C){let O=A.width(C);return O?[o(),...O]:void 0}if(E(y.value.value)){let O=A.width(`${y.value.value}px`);return O?[o(),...O]:void 0}}}),i(h,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(y,C)=>`${C*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var K=p;let o=()=>L([$("--tw-border-style","solid")]);p("border",{width:h=>[l("border-style","var(--tw-border-style)"),l("border-width",h)],color:h=>[l("border-color",h)]}),p("border-x",{width:h=>[l("border-inline-style","var(--tw-border-style)"),l("border-inline-width",h)],color:h=>[l("border-inline-color",h)]}),p("border-y",{width:h=>[l("border-block-style","var(--tw-border-style)"),l("border-block-width",h)],color:h=>[l("border-block-color",h)]}),p("border-s",{width:h=>[l("border-inline-start-style","var(--tw-border-style)"),l("border-inline-start-width",h)],color:h=>[l("border-inline-start-color",h)]}),p("border-e",{width:h=>[l("border-inline-end-style","var(--tw-border-style)"),l("border-inline-end-width",h)],color:h=>[l("border-inline-end-color",h)]}),p("border-t",{width:h=>[l("border-top-style","var(--tw-border-style)"),l("border-top-width",h)],color:h=>[l("border-top-color",h)]}),p("border-r",{width:h=>[l("border-right-style","var(--tw-border-style)"),l("border-right-width",h)],color:h=>[l("border-right-color",h)]}),p("border-b",{width:h=>[l("border-bottom-style","var(--tw-border-style)"),l("border-bottom-width",h)],color:h=>[l("border-bottom-color",h)]}),p("border-l",{width:h=>[l("border-left-style","var(--tw-border-style)"),l("border-left-width",h)],color:h=>[l("border-left-color",h)]}),n("divide-x",{defaultValue:r.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>E(h)?`${h}px`:null,handle:h=>[L([$("--tw-divide-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-x-width"),o(),l("--tw-divide-x-reverse","0"),l("border-inline-style","var(--tw-border-style)"),l("border-inline-start-width",`calc(${h} * var(--tw-divide-x-reverse))`),l("border-inline-end-width",`calc(${h} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:r.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>E(h)?`${h}px`:null,handle:h=>[L([$("--tw-divide-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-y-width"),o(),l("--tw-divide-y-reverse","0"),l("border-bottom-style","var(--tw-border-style)"),l("border-top-style","var(--tw-border-style)"),l("border-top-width",`calc(${h} * var(--tw-divide-y-reverse))`),l("border-bottom-width",`calc(${h} * 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",[()=>L([$("--tw-divide-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-x-reverse","1")])]),e("divide-y-reverse",[()=>L([$("--tw-divide-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-y-reverse","1")])]);for(let h of["solid","dashed","dotted","double","none"])e(`divide-${h}`,[()=>M(":where(& > :not(:last-child))",[l("--tw-sort","divide-style"),l("--tw-border-style",h),l("border-style",h)])])}e("bg-auto",[["background-size","auto"]]),e("bg-cover",[["background-size","cover"]]),e("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(o){if(o)return[l("background-size",o)]}}),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(o){if(o)return[l("background-position",o)]}}),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 h=function(C){let O="in oklab";if(C?.kind==="named")switch(C.value){case"longer":case"shorter":case"increasing":case"decreasing":O=`in oklch ${C.value} hue`;break;default:O=`in ${C.value}`}else C?.kind==="arbitrary"&&(O=C.value);return O},A=function({negative:C}){return O=>{if(!O.value)return;if(O.value.kind==="arbitrary"){if(O.modifier)return;let j=O.value.value;switch(O.value.dataType??J(j,["angle"])){case"angle":return j=C?`calc(${j} * -1)`:`${j}`,[l("--tw-gradient-position",j),l("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)];default:return C?void 0:[l("--tw-gradient-position",j),l("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)]}}let V=O.value.value;if(!C&&p.has(V))V=p.get(V);else if(E(V))V=C?`calc(${V}deg * -1)`:`${V}deg`;else return;let T=h(O.modifier);return[l("--tw-gradient-position",`${V}`),H("@supports (background-image: linear-gradient(in lab, red, red))",[l("--tw-gradient-position",`${V} ${T}`)]),l("background-image","linear-gradient(var(--tw-gradient-stops))")]}},y=function({negative:C}){return O=>{if(O.value?.kind==="arbitrary"){if(O.modifier)return;let j=O.value.value;return[l("--tw-gradient-position",j),l("background-image",`conic-gradient(var(--tw-gradient-stops,${j}))`)]}let V=h(O.modifier);if(!O.value)return[l("--tw-gradient-position",V),l("background-image","conic-gradient(var(--tw-gradient-stops))")];let T=O.value.value;if(E(T))return T=C?`calc(${T}deg * -1)`:`${T}deg`,[l("--tw-gradient-position",`from ${T} ${V}`),l("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var G=h,I=A,W=y;let o=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],p=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"]]);t.functional("-bg-linear",A({negative:!0})),t.functional("bg-linear",A({negative:!1})),i("bg-linear",()=>[{values:[...p.keys()],modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),t.functional("-bg-conic",y({negative:!0})),t.functional("bg-conic",y({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),t.functional("bg-radial",C=>{if(!C.value){let O=h(C.modifier);return[l("--tw-gradient-position",O),l("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(C.value.kind==="arbitrary"){if(C.modifier)return;let O=C.value.value;return[l("--tw-gradient-position",O),l("background-image",`radial-gradient(var(--tw-gradient-stops,${O}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:o}])}t.functional("bg",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("background-position",p)];case"bg-size":case"length":case"size":return o.modifier?void 0:[l("background-size",p)];case"image":case"url":return o.modifier?void 0:[l("background-image",p)];default:return p=X(p,o.modifier,r),p===null?void 0:[l("background-color",p)]}}{let p=te(o,r,["--background-color","--color"]);if(p)return[l("background-color",p)]}{if(o.modifier)return;let p=r.resolve(o.value.value,["--background-image"]);if(p)return[l("background-image",p)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let v=()=>L([$("--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 x(o,p){t.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??J(A,["color","length","percentage"])){case"length":case"percentage":return h.modifier?void 0:p.position(A);default:return A=X(A,h.modifier,r),A===null?void 0:p.color(A)}}{let A=te(h,r,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=r.resolve(h.value.value,["--gradient-color-stop-positions"]);if(A)return p.position(A);if(h.value.value[h.value.value.length-1]==="%"&&E(h.value.value.slice(0,-1)))return p.position(h.value.value)}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}x("from",{color:o=>[v(),l("--tw-sort","--tw-gradient-from"),l("--tw-gradient-from",o),l("--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:o=>[v(),l("--tw-gradient-from-position",o)]}),e("via-none",[["--tw-gradient-via-stops","initial"]]),x("via",{color:o=>[v(),l("--tw-sort","--tw-gradient-via"),l("--tw-gradient-via",o),l("--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)"),l("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:o=>[v(),l("--tw-gradient-via-position",o)]}),x("to",{color:o=>[v(),l("--tw-sort","--tw-gradient-to"),l("--tw-gradient-to",o),l("--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:o=>[v(),l("--tw-gradient-to-position",o)]}),e("mask-none",[["mask-image","none"]]),t.functional("mask",o=>{if(!o.value||o.modifier||o.value.kind!=="arbitrary")return;let p=o.value.value;switch(o.value.dataType??J(p,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("mask-position",p)];case"bg-size":case"length":case"size":return[l("mask-size",p)];case"image":case"url":default:return[l("mask-image",p)]}}),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(o){if(o)return[l("mask-size",o)]}}),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(o){if(o)return[l("mask-position",o)]}}),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 k=()=>L([$("--tw-mask-linear","linear-gradient(#fff, #fff)"),$("--tw-mask-radial","linear-gradient(#fff, #fff)"),$("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function N(o,p){t.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??J(A,["length","percentage","color"])){case"color":return A=X(A,h.modifier,r),A===null?void 0:p.color(A);case"percentage":return h.modifier||!E(A.slice(0,-1))?void 0:p.position(A);default:return h.modifier?void 0:p.position(A)}}{let A=te(h,r,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=J(h.value.value,["number","percentage"]);if(!A)return;switch(A){case"number":{let y=r.resolve(null,["--spacing"]);return!y||!de(h.value.value)?void 0:p.position(`calc(${y} * ${h.value.value})`)}case"percentage":return E(h.value.value.slice(0,-1))?p.position(h.value.value):void 0;default:return}}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(o,()=>[{values:Array.from({length:21},(h,A)=>`${A*5}%`)},{values:r.get(["--spacing"])?Ze:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}let b=()=>L([$("--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 S(o,p,h){N(o,{color(A){let y=[k(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(y.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),y.push(L([$(`--tw-mask-${C}-from-position`,"0%"),$(`--tw-mask-${C}-to-position`,"100%"),$(`--tw-mask-${C}-from-color`,"black"),$(`--tw-mask-${C}-to-color`,"transparent")])),y.push(l(`--tw-mask-${C}-${p}-color`,A)));return y},position(A){let y=[k(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(y.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),y.push(L([$(`--tw-mask-${C}-from-position`,"0%"),$(`--tw-mask-${C}-to-position`,"100%"),$(`--tw-mask-${C}-from-color`,"black"),$(`--tw-mask-${C}-to-color`,"transparent")])),y.push(l(`--tw-mask-${C}-${p}-position`,A)));return y}})}S("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),S("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let P=()=>L([$("--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(o){return E(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return E(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),l("--tw-mask-linear-position",o)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),N("mask-linear-from",{color:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-color",o)],position:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-position",o)]}),N("mask-linear-to",{color:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-color",o)],position:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-position",o)]});let U=()=>L([$("--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")]);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:o=>[l("--tw-mask-radial-position",o)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),l("--tw-mask-radial-size",o)]}),N("mask-radial-from",{color:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-color",o)],position:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-position",o)]}),N("mask-radial-to",{color:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-color",o)],position:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-position",o)]});let R=()=>L([$("--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(o){return E(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return E(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),l("--tw-mask-conic-position",o)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),N("mask-conic-from",{color:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-color",o)],position:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-position",o)]}),N("mask-conic-to",{color:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-color",o)],position:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-position",o)]}),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 o of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])e(`bg-blend-${o}`,[["background-blend-mode",o]]),e(`mix-blend-${o}`,[["mix-blend-mode",o]]);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"]]),t.functional("fill",o=>{if(!o.value)return;if(o.value.kind==="arbitrary"){let h=X(o.value.value,o.modifier,r);return h===null?void 0:[l("fill",h)]}let p=te(o,r,["--fill","--color"]);if(p)return[l("fill",p)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)}]),e("stroke-none",[["stroke","none"]]),t.functional("stroke",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","number","length","percentage"])){case"number":case"length":case"percentage":return o.modifier?void 0:[l("stroke-width",p)];default:return p=X(o.value.value,o.modifier,r),p===null?void 0:[l("stroke",p)]}}{let p=te(o,r,["--stroke","--color"]);if(p)return[l("stroke",p)]}{let p=r.resolve(o.value.value,["--stroke-width"]);if(p)return[l("stroke-width",p)];if(E(o.value.value))return[l("stroke-width",o.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*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"]]),e("object-top",[["object-position","top"]]),e("object-top-left",[["object-position","left top"]]),e("object-top-right",[["object-position","right top"]]),e("object-bottom",[["object-position","bottom"]]),e("object-bottom-left",[["object-position","left bottom"]]),e("object-bottom-right",[["object-position","right bottom"]]),e("object-left",[["object-position","left"]]),e("object-right",[["object-position","right"]]),e("object-center",[["object-position","center"]]),n("object",{themeKeys:["--object-position"],handle:o=>[l("object-position",o)]});for(let[o,p]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(o,["--padding","--spacing"],h=>[l(p,h)]);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"],o=>[l("text-indent",o)],{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:o=>[l("vertical-align",o)]}),t.functional("font",o=>{if(!(!o.value||o.modifier)){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[l("font-family",p)];default:return[L([$("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}{let p=r.resolveWith(o.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(p){let[h,A={}]=p;return[l("font-family",h),l("font-feature-settings",A["--font-feature-settings"]),l("font-variation-settings",A["--font-variation-settings"])]}}{let p=r.resolve(o.value.value,["--font-weight"]);if(p)return[L([$("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}}),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:o})=>{if(!o.endsWith("%"))return null;let p=Number(o.slice(0,-1));return!E(p)||Number.isNaN(p)||p<50||p>200?null:o},handle:o=>[l("font-stretch",o)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),s("placeholder",{themeKeys:["--background-color","--color"],handle:o=>[M("&::placeholder",[l("--tw-sort","placeholder-color"),l("color",o)])]}),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"]]),t.functional("decoration",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","length","percentage"])){case"length":case"percentage":return o.modifier?void 0:[l("text-decoration-thickness",p)];default:return p=X(p,o.modifier,r),p===null?void 0:[l("text-decoration-color",p)]}}{let p=r.resolve(o.value.value,["--text-decoration-thickness"]);if(p)return o.modifier?void 0:[l("text-decoration-thickness",p)];if(E(o.value.value))return o.modifier?void 0:[l("text-decoration-thickness",`${o.value.value}px`)]}{let p=te(o,r,["--text-decoration-color","--color"]);if(p)return[l("text-decoration-color",p)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),e("animate-none",[["animation","none"]]),n("animate",{themeKeys:["--animate"],handle:o=>[l("animation",o)]});{let o=["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(" "),p=["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(" "),h=()=>L([$("--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")]),A=()=>L([$("--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")]);t.functional("filter",y=>{if(!y.modifier){if(y.value===null)return[h(),l("filter",o)];if(y.value.kind==="arbitrary")return[l("filter",y.value.value)];switch(y.value.value){case"none":return[l("filter","none")]}}}),t.functional("backdrop-filter",y=>{if(!y.modifier){if(y.value===null)return[A(),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)];if(y.value.kind==="arbitrary")return[l("-webkit-backdrop-filter",y.value.value),l("backdrop-filter",y.value.value)];switch(y.value.value){case"none":return[l("-webkit-backdrop-filter","none"),l("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:y=>[h(),l("--tw-blur",`blur(${y})`),l("filter",o)]}),e("blur-none",[h,["--tw-blur"," "],["filter",o]]),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:y=>[A(),l("--tw-backdrop-blur",`blur(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),e("backdrop-blur-none",[A,["--tw-backdrop-blur"," "],["-webkit-backdrop-filter",p],["backdrop-filter",p]]),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-brightness",`brightness(${y})`),l("filter",o)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-brightness",`brightness(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-contrast",`contrast(${y})`),l("filter",o)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-contrast",`contrast(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-grayscale",`grayscale(${y})`),l("filter",o)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-grayscale",`grayscale(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}deg`:null,handle:y=>[h(),l("--tw-hue-rotate",`hue-rotate(${y})`),l("filter",o)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:y})=>E(y)?`${y}deg`:null,handle:y=>[A(),l("--tw-backdrop-hue-rotate",`hue-rotate(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-invert",`invert(${y})`),l("filter",o)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-invert",`invert(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-saturate",`saturate(${y})`),l("filter",o)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-saturate",`saturate(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-sepia",`sepia(${y})`),l("filter",o)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-sepia",`sepia(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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",[h,["--tw-drop-shadow"," "],["filter",o]]),t.functional("drop-shadow",y=>{let C;if(y.modifier&&(y.modifier.kind==="arbitrary"?C=y.modifier.value:E(y.modifier.value)&&(C=`${y.modifier.value}%`)),!y.value){let O=r.get(["--drop-shadow"]),V=r.resolve(null,["--drop-shadow"]);return O===null||V===null?void 0:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow",D(V,",").map(T=>`drop-shadow(${T})`).join(" ")),l("filter",o)]}if(y.value.kind==="arbitrary"){let O=y.value.value;switch(y.value.dataType??J(O,["color"])){case"color":return O=X(O,y.modifier,r),O===null?void 0:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return y.modifier&&!C?void 0:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]}}{let O=r.get([`--drop-shadow-${y.value.value}`]),V=r.resolve(y.value.value,["--drop-shadow"]);if(O&&V)return y.modifier&&!C?void 0:C?[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow",D(V,",").map(T=>`drop-shadow(${T})`).join(" ")),l("filter",o)]}{let O=te(y,r,["--drop-shadow-color","--color"]);if(O)return O==="inherit"?[h(),l("--tw-drop-shadow-color","inherit"),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--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},(y,C)=>`${C*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:y})=>Ue(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-opacity",`opacity(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(y,C)=>`${C*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let o=`var(--tw-ease, ${r.resolve(null,["--default-transition-timing-function"])??"ease"})`,p=`var(--tw-duration, ${r.resolve(null,["--default-transition-duration"])??"0s"})`;e("transition-none",[["transition-property","none"]]),e("transition-all",[["transition-property","all"],["transition-timing-function",o],["transition-duration",p]]),e("transition-colors",[["transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"],["transition-timing-function",o],["transition-duration",p]]),e("transition-opacity",[["transition-property","opacity"],["transition-timing-function",o],["transition-duration",p]]),e("transition-shadow",[["transition-property","box-shadow"],["transition-timing-function",o],["transition-duration",p]]),e("transition-transform",[["transition-property","transform, translate, scale, rotate"],["transition-timing-function",o],["transition-duration",p]]),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, visibility, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:h=>[l("transition-property",h),l("transition-timing-function",o),l("transition-duration",p)]}),e("transition-discrete",[["transition-behavior","allow-discrete"]]),e("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:h})=>E(h)?`${h}ms`:null,themeKeys:["--transition-delay"],handle:h=>[l("transition-delay",h)]});{let h=()=>L([$("--tw-duration")]);e("duration-initial",[h,["--tw-duration","initial"]]),t.functional("duration",A=>{if(A.modifier||!A.value)return;let y=null;if(A.value.kind==="arbitrary"?y=A.value.value:(y=r.resolve(A.value.fraction??A.value.value,["--transition-duration"]),y===null&&E(A.value.value)&&(y=`${A.value.value}ms`)),y!==null)return[h(),l("--tw-duration",y),l("transition-duration",y)]})}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 o=()=>L([$("--tw-ease")]);e("ease-initial",[o,["--tw-ease","initial"]]),e("ease-linear",[o,["--tw-ease","linear"],["transition-timing-function","linear"]]),n("ease",{themeKeys:["--ease"],handle:p=>[o(),l("--tw-ease",p),l("transition-timing-function",p)]})}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:o=>[l("will-change",o)]}),e("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:[],handle:o=>[L([$("--tw-content",'""')]),l("--tw-content",o),l("content","var(--tw-content)")]});{let o="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",p=()=>L([$("--tw-contain-size"),$("--tw-contain-layout"),$("--tw-contain-paint"),$("--tw-contain-style")]);e("contain-none",[["contain","none"]]),e("contain-content",[["contain","content"]]),e("contain-strict",[["contain","strict"]]),e("contain-size",[p,["--tw-contain-size","size"],["contain",o]]),e("contain-inline-size",[p,["--tw-contain-size","inline-size"],["contain",o]]),e("contain-layout",[p,["--tw-contain-layout","layout"],["contain",o]]),e("contain-paint",[p,["--tw-contain-paint","paint"],["contain",o]]),e("contain-style",[p,["--tw-contain-style","style"],["contain",o]]),n("contain",{themeKeys:[],handle:h=>[l("contain",h)]})}e("forced-color-adjust-none",[["forced-color-adjust","none"]]),e("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),e("leading-none",[()=>L([$("--tw-leading")]),["--tw-leading","1"],["line-height","1"]]),a("leading",["--leading","--spacing"],o=>[L([$("--tw-leading")]),l("--tw-leading",o),l("line-height",o)]),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:o=>[L([$("--tw-tracking")]),l("--tw-tracking",o),l("letter-spacing",o)]}),e("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),e("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let o="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",p=()=>L([$("--tw-ordinal"),$("--tw-slashed-zero"),$("--tw-numeric-figure"),$("--tw-numeric-spacing"),$("--tw-numeric-fraction")]);e("normal-nums",[["font-variant-numeric","normal"]]),e("ordinal",[p,["--tw-ordinal","ordinal"],["font-variant-numeric",o]]),e("slashed-zero",[p,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",o]]),e("lining-nums",[p,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",o]]),e("oldstyle-nums",[p,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",o]]),e("proportional-nums",[p,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",o]]),e("tabular-nums",[p,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",o]]),e("diagonal-fractions",[p,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",o]]),e("stacked-fractions",[p,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",o]])}{let o=()=>L([$("--tw-outline-style","solid")]);t.static("outline-hidden",()=>[l("--tw-outline-style","none"),l("outline-style","none"),z("@media","(forced-colors: active)",[l("outline","2px solid transparent"),l("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"]]),t.functional("outline",p=>{if(p.value===null){if(p.modifier)return;let h=r.get(["--default-outline-width"])??"1px";return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)]}if(p.value.kind==="arbitrary"){let h=p.value.value;switch(p.value.dataType??J(h,["color","length","number","percentage"])){case"length":case"number":case"percentage":return p.modifier?void 0:[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];default:return h=X(h,p.modifier,r),h===null?void 0:[l("outline-color",h)]}}{let h=te(p,r,["--outline-color","--color"]);if(h)return[l("outline-color",h)]}{if(p.modifier)return;let h=r.resolve(p.value.value,["--outline-width"]);if(h)return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];if(E(p.value.value))return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",`${p.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(p,h)=>`${h*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:p})=>E(p)?`${p}px`:null,handle:p=>[l("outline-offset",p)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:o})=>Ue(o)?`${o}%`:null,handle:o=>[l("opacity",o)]}),i("opacity",()=>[{values:Array.from({length:21},(o,p)=>`${p*5}`),valueThemeKeys:["--opacity"]}]),e("underline-offset-auto",[["text-underline-offset","auto"]]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:o})=>E(o)?`${o}px`:null,handle:o=>[l("text-underline-offset",o)]}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),t.functional("text",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(o.modifier){let A=o.modifier.kind==="arbitrary"?o.modifier.value:r.resolve(o.modifier.value,["--leading"]);if(!A&&de(o.modifier.value)){let y=r.resolve(null,["--spacing"]);if(!y)return null;A=`calc(${y} * ${o.modifier.value})`}return!A&&o.modifier.value==="none"&&(A="1"),A?[l("font-size",p),l("line-height",A)]:null}return[l("font-size",p)]}default:return p=X(p,o.modifier,r),p===null?void 0:[l("color",p)]}}{let p=te(o,r,["--text-color","--color"]);if(p)return[l("color",p)]}{let p=r.resolveWith(o.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(p){let[h,A={}]=Array.isArray(p)?p:[p];if(o.modifier){let y=o.modifier.kind==="arbitrary"?o.modifier.value:r.resolve(o.modifier.value,["--leading"]);if(!y&&de(o.modifier.value)){let O=r.resolve(null,["--spacing"]);if(!O)return null;y=`calc(${O} * ${o.modifier.value})`}if(!y&&o.modifier.value==="none"&&(y="1"),!y)return null;let C=[l("font-size",h)];return y&&C.push(l("line-height",y)),C}return typeof A=="string"?[l("font-size",h),l("line-height",A)]:[l("font-size",h),l("line-height",A["--line-height"]?`var(--tw-leading, ${A["--line-height"]})`:void 0),l("letter-spacing",A["--letter-spacing"]?`var(--tw-tracking, ${A["--letter-spacing"]})`:void 0),l("font-weight",A["--font-weight"]?`var(--tw-font-weight, ${A["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let _=()=>L([$("--tw-text-shadow-color"),$("--tw-text-shadow-alpha","100%","")]);e("text-shadow-initial",[_,["--tw-text-shadow-color","initial"]]),t.functional("text-shadow",o=>{let p;if(o.modifier&&(o.modifier.kind==="arbitrary"?p=o.modifier.value:E(o.modifier.value)&&(p=`${o.modifier.value}%`)),!o.value){let h=r.get(["--text-shadow"]);return h===null?void 0:[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}if(o.value.kind==="arbitrary"){let h=o.value.value;switch(o.value.dataType??J(h,["color"])){case"color":return h=X(h,o.modifier,r),h===null?void 0:[_(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))];default:return[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,y=>`var(--tw-text-shadow-color, ${y})`)]}}switch(o.value.value){case"none":return o.modifier?void 0:[_(),l("text-shadow","none")];case"inherit":return o.modifier?void 0:[_(),l("--tw-text-shadow-color","inherit")]}{let h=r.get([`--text-shadow-${o.value.value}`]);if(h)return[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}{let h=te(o,r,["--text-shadow-color","--color"]);if(h)return[_(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`),hasDefaultValue:r.get(["--text-shadow"])!==null}]);{let y=function(V){return`var(--tw-ring-inset,) 0 0 0 calc(${V} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${A})`},C=function(V){return`inset 0 0 0 ${V} var(--tw-inset-ring-color, currentcolor)`};var Z=y,re=C;let o=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),p="0 0 #0000",h=()=>L([$("--tw-shadow",p),$("--tw-shadow-color"),$("--tw-shadow-alpha","100%",""),$("--tw-inset-shadow",p),$("--tw-inset-shadow-color"),$("--tw-inset-shadow-alpha","100%",""),$("--tw-ring-color"),$("--tw-ring-shadow",p),$("--tw-inset-ring-color"),$("--tw-inset-ring-shadow",p),$("--tw-ring-inset"),$("--tw-ring-offset-width","0px",""),$("--tw-ring-offset-color","#fff"),$("--tw-ring-offset-shadow",p)]);e("shadow-initial",[h,["--tw-shadow-color","initial"]]),t.functional("shadow",V=>{let T;if(V.modifier&&(V.modifier.kind==="arbitrary"?T=V.modifier.value:E(V.modifier.value)&&(T=`${V.modifier.value}%`)),!V.value){let j=r.get(["--shadow"]);return j===null?void 0:[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,oe=>`var(--tw-shadow-color, ${oe})`),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let j=V.value.value;switch(V.value.dataType??J(j,["color"])){case"color":return j=X(j,V.modifier,r),j===null?void 0:[h(),l("--tw-shadow-color",Q(j,"var(--tw-shadow-alpha)"))];default:return[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,ot=>`var(--tw-shadow-color, ${ot})`),l("box-shadow",o)]}}switch(V.value.value){case"none":return V.modifier?void 0:[h(),l("--tw-shadow",p),l("box-shadow",o)];case"inherit":return V.modifier?void 0:[h(),l("--tw-shadow-color","inherit")]}{let j=r.get([`--shadow-${V.value.value}`]);if(j)return[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,oe=>`var(--tw-shadow-color, ${oe})`),l("box-shadow",o)]}{let j=te(V,r,["--box-shadow-color","--color"]);if(j)return[h(),l("--tw-shadow-color",Q(j,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`),hasDefaultValue:r.get(["--shadow"])!==null}]),e("inset-shadow-initial",[h,["--tw-inset-shadow-color","initial"]]),t.functional("inset-shadow",V=>{let T;if(V.modifier&&(V.modifier.kind==="arbitrary"?T=V.modifier.value:E(V.modifier.value)&&(T=`${V.modifier.value}%`)),!V.value){let j=r.get(["--inset-shadow"]);return j===null?void 0:[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,oe=>`var(--tw-inset-shadow-color, ${oe})`),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let j=V.value.value;switch(V.value.dataType??J(j,["color"])){case"color":return j=X(j,V.modifier,r),j===null?void 0:[h(),l("--tw-inset-shadow-color",Q(j,"var(--tw-inset-shadow-alpha)"))];default:return[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,ot=>`var(--tw-inset-shadow-color, ${ot})`,"inset "),l("box-shadow",o)]}}switch(V.value.value){case"none":return V.modifier?void 0:[h(),l("--tw-inset-shadow",p),l("box-shadow",o)];case"inherit":return V.modifier?void 0:[h(),l("--tw-inset-shadow-color","inherit")]}{let j=r.get([`--inset-shadow-${V.value.value}`]);if(j)return[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,oe=>`var(--tw-inset-shadow-color, ${oe})`),l("box-shadow",o)]}{let j=te(V,r,["--box-shadow-color","--color"]);if(j)return[h(),l("--tw-inset-shadow-color",Q(j,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`),hasDefaultValue:r.get(["--inset-shadow"])!==null}]),e("ring-inset",[h,["--tw-ring-inset","inset"]]);let A=r.get(["--default-ring-color"])??"currentcolor";t.functional("ring",V=>{if(!V.value){if(V.modifier)return;let T=r.get(["--default-ring-width"])??"1px";return[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-ring-color",T)]}}{let T=te(V,r,["--ring-color","--color"]);if(T)return[l("--tw-ring-color",T)]}{if(V.modifier)return;let T=r.resolve(V.value.value,["--ring-width"]);if(T===null&&E(V.value.value)&&(T=`${V.value.value}px`),T)return[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),t.functional("inset-ring",V=>{if(!V.value)return V.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C("1px")),l("box-shadow",o)];if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C(T)),l("box-shadow",o)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-inset-ring-color",T)]}}{let T=te(V,r,["--ring-color","--color"]);if(T)return[l("--tw-inset-ring-color",T)]}{if(V.modifier)return;let T=r.resolve(V.value.value,["--ring-width"]);if(T===null&&E(V.value.value)&&(T=`${V.value.value}px`),T)return[h(),l("--tw-inset-ring-shadow",C(T)),l("box-shadow",o)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let O="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";t.functional("ring-offset",V=>{if(V.value){if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[l("--tw-ring-offset-width",T),l("--tw-ring-offset-shadow",O)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-ring-offset-color",T)]}}{let T=r.resolve(V.value.value,["--ring-offset-width"]);if(T)return V.modifier?void 0:[l("--tw-ring-offset-width",T),l("--tw-ring-offset-shadow",O)];if(E(V.value.value))return V.modifier?void 0:[l("--tw-ring-offset-width",`${V.value.value}px`),l("--tw-ring-offset-shadow",O)]}{let T=te(V,r,["--ring-offset-color","--color"]);if(T)return[l("--tw-ring-offset-color",T)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),t.functional("@container",o=>{let p=null;if(o.value===null?p="inline-size":o.value.kind==="arbitrary"?p=o.value.value:o.value.kind==="named"&&o.value.value==="normal"&&(p="normal"),p!==null)return o.modifier?[l("container-type",p),l("container-name",o.modifier.value)]:[l("container-type",p)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),t}var bt=["number","integer","ratio","percentage"];function pr(r){let t=r.params;return $i.test(t)?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}};F(r.nodes,n=>{if(n.kind!=="declaration"||!n.value||!n.value.includes("--value(")&&!n.value.includes("--modifier("))return;let s=q(n.value);ee(s,a=>{if(a.kind!=="function")return;if(a.value==="--spacing"&&!(e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return ee(a.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let f=u.value;for(let g of u.nodes)if(g.kind==="word"){if(g.value==="integer")e[f].usedSpacingInteger||=!0;else if(g.value==="number"&&(e[f].usedSpacingNumber||=!0,e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return 2}}),0;if(a.value!=="--value"&&a.value!=="--modifier")return;let c=D(Y(a.nodes),",");for(let[u,f]of c.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+="-*"),c[u]=f;a.nodes=q(c.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]==="]")&&!bt.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${bt.map(x=>`"${x}"`).join(", ")}. +`);let f=u.value,g=structuredClone(a),d="\xB6";ee(g.nodes,(x,{replaceWith:k})=>{x.kind==="word"&&x.value===f&&k({kind:"word",value:d})});let m="^".repeat(Y([u]).length),w=Y([g]).indexOf(d),v=["```css",Y([a])," ".repeat(w)+m,"```"].join(` +`);console.warn(v)}}),n.value=Y(s)}),i.utilities.functional(t.slice(0,-2),n=>{let s=structuredClone(r),a=n.value,c=n.modifier;if(a===null)return;let u=!1,f=!1,g=!1,d=!1,m=new Map,w=!1;if(F([s],(v,{parent:x,replaceWith:k})=>{if(x?.kind!=="rule"&&x?.kind!=="at-rule"||v.kind!=="declaration"||!v.value)return;let N=q(v.value);(ee(N,(S,{replaceWith:P})=>{if(S.kind==="function"){if(S.value==="--value"){u=!0;let U=sr(a,S,i);return U?(f=!0,U.ratio?w=!0:m.set(v,x),P(U.nodes),1):(u||=!1,k([]),2)}else if(S.value==="--modifier"){if(c===null)return k([]),2;g=!0;let U=sr(c,S,i);return U?(d=!0,P(U.nodes),1):(g||=!1,k([]),2)}}})??0)===0&&(v.value=Y(N))}),u&&!f||g&&!d||w&&d||c&&!w&&!d)return null;if(w)for(let[v,x]of m){let k=x.nodes.indexOf(v);k!==-1&&x.nodes.splice(k,1)}return s.nodes}),i.utilities.suggest(t.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:c,usedSpacingNumber:u,usedSpacingInteger:f,themeKeys:g}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let d of c)a.push(d);if(u)a.push(...Ze);else if(f)for(let d of Ze)E(d)&&a.push(d);for(let d of i.theme.keysInNamespaces(g))a.push(d.replace(fr,(m,w,v)=>`${w}.${v}`))}return[{values:n,modifiers:s}]})}:Ci.test(t)?i=>{i.utilities.static(t,()=>structuredClone(r.nodes))}:null}function sr(r,t,i){for(let e of t.nodes){if(r.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)===r.value)return{nodes:q(r.value)};if(r.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(r.value,[n]);if(s)return{nodes:q(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],c=i.theme.resolveWith(r.value,a,s);if(c){let[,u={}]=c;{let f=u[s.pop()];if(f)return{nodes:q(f)}}}}}else if(r.kind==="named"&&e.kind==="word"){if(!bt.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in r?r.fraction:r.value;if(!n)continue;let s=J(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[a,c]=D(n,"/");if(!E(a)||!E(c))continue}else{if(s==="number"&&!de(n))continue;if(s==="percentage"&&!E(n.slice(0,-1)))continue}return{nodes:q(n),ratio:s==="ratio"}}else if(r.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:q(r.value)};if("dataType"in r&&r.dataType&&r.dataType!==n)continue;if("dataType"in r&&r.dataType)return{nodes:q(r.value)};if(J(r.value,[n])!==null)return{nodes:q(r.value)}}}}function ue(r,t,i,e,n=""){let s=!1,a=Ee(t,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(ur(u,i))));function c(u){return n?D(u,",").map(f=>n+f).join(","):u}return s?[l(r,c(Ee(t,e))),H("@supports (color: lab(from red l a b))",[l(r,c(a))])]:[l(r,c(a))]}function Ye(r,t,i,e,n=""){let s=!1,a=D(t,",").map(c=>Ee(c,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(ur(u,i))))).map(c=>`drop-shadow(${c})`).join(" ");return s?[l(r,n+D(t,",").map(c=>`drop-shadow(${Ee(c,e)})`).join(" ")),H("@supports (color: lab(from red l a b))",[l(r,n+a)])]:[l(r,n+a)]}var kt={"--alpha":Vi,"--spacing":Ni,"--theme":Si,theme:Ti};function Vi(r,t,i,...e){let[n,s]=D(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 Ni(r,t,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=r.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 Si(r,t,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)),t.kind==="at-rule"&&(n=!0);let s=r.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 c=q(s);return Pi(c,a),Y(c)}return s}function Ti(r,t,i,...e){i=Ei(i);let n=r.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 dr=new RegExp(Object.keys(kt).map(r=>`${r}\\(`).join("|"));function xe(r,t){let i=0;return F(r,e=>{if(e.kind==="declaration"&&e.value&&dr.test(e.value)){i|=8,e.value=mr(e.value,e,t);return}e.kind==="at-rule"&&(e.name==="@media"||e.name==="@custom-media"||e.name==="@container"||e.name==="@supports")&&dr.test(e.params)&&(i|=8,e.params=mr(e.params,e,t))}),i}function mr(r,t,i){let e=q(r);return ee(e,(n,{replaceWith:s})=>{if(n.kind==="function"&&n.value in kt){let a=D(Y(n.nodes).trim(),",").map(u=>u.trim()),c=kt[n.value](i,t,...a);return s(q(c))}}),Y(e)}function Ei(r){if(r[0]!=="'"&&r[0]!=='"')return r;let t="",i=r[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:`, ${t}`});else{let e=i.nodes[i.nodes.length-1];e.kind==="word"&&e.value==="initial"&&(e.value=t)}})}function Qe(r,t){let i=r.length,e=t.length,n=i=48&&a<=57&&c>=48&&c<=57){let u=s,f=s+1,g=s,d=s+1;for(a=r.charCodeAt(f);a>=48&&a<=57;)a=r.charCodeAt(++f);for(c=t.charCodeAt(d);c>=48&&c<=57;)c=t.charCodeAt(++d);let m=r.slice(u,f),w=t.slice(g,d),v=Number(m)-Number(w);if(v)return v;if(mw)return 1;continue}if(a!==c)return a-c}return r.length-t.length}var Ri=/^\d+\/\d+$/;function gr(r){let t=new B(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of r.utilities.keys("static")){let s=t.get(n);s.fraction=!1,s.modifiers=[]}for(let n of r.utilities.keys("functional")){let s=r.utilities.getCompletions(n);for(let a of s)for(let c of a.values){let u=c!==null&&Ri.test(c),f=c===null?n:`${n}-${c}`,g=t.get(f);if(g.utility=n,g.fraction||=u,g.modifiers.push(...a.modifiers),a.supportsNegative){let d=t.get(`-${f}`);d.utility=`-${n}`,d.fraction||=u,d.modifiers.push(...a.modifiers)}}}if(t.size===0)return[];let i=Array.from(t.values());return i.sort((n,s)=>Qe(n.name,s.name)),Oi(i)}function Oi(r){let t=[],i=null,e=new Map,n=new B(()=>[]);for(let a of r){let{utility:c,fraction:u}=a;i||(i={utility:c,items:[]},e.set(c,i)),c!==i.utility&&(t.push(i),i={utility:c,items:[]},e.set(c,i)),u?n.get(c).push(a):i.items.push(a)}i&&t[t.length-1]!==i&&t.push(i);for(let[a,c]of n){let u=e.get(a);u&&u.items.push(...c)}let s=[];for(let a of t)for(let c of a.items)s.push([c.name,{modifiers:c.modifiers}]);return s}function hr(r){let t=[];for(let[e,n]of r.variants.entries()){let c=function({value:u,modifier:f}={}){let g=e;u&&(g+=s?`-${u}`:u),f&&(g+=`/${f}`);let d=r.parseVariant(g);if(!d)return[];let m=M(".__placeholder__",[]);if(Ae(m,d,r.variants)===null)return[];let w=[];return Ge(m.nodes,(v,{path:x})=>{if(v.kind!=="rule"&&v.kind!=="at-rule"||v.nodes.length>0)return;x.sort((b,S)=>{let P=b.kind==="at-rule",U=S.kind==="at-rule";return P&&!U?-1:!P&&U?1:0});let k=x.flatMap(b=>b.kind==="rule"?b.selector==="&"?[]:[b.selector]:b.kind==="at-rule"?[`${b.name} ${b.params}`]:[]),N="";for(let b=k.length-1;b>=0;b--)N=N===""?k[b]:`${k[b]} { ${N} }`;w.push(N)}),w};var i=c;if(n.kind==="arbitrary")continue;let s=e!=="@",a=r.variants.getCompletions(e);switch(n.kind){case"static":{t.push({name:e,values:a,isArbitrary:!1,hasDash:s,selectors:c});break}case"functional":{t.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:c});break}case"compound":{t.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:c});break}}}return t}function vr(r,t){let{astNodes:i,nodeSorting:e}=pe(Array.from(t),r),n=new Map(t.map(a=>[a,null])),s=0n;for(let a of i){let c=e.get(a)?.candidate;c&&n.set(c,n.get(c)??s++)}return t.map(a=>[a,n.get(a)??null])}var Xe=/^@?[a-zA-Z0-9_-]*$/;var xt=class{compareFns=new Map;variants=new Map;completions=new Map;groupOrder=null;lastOrder=0;static(t,i,{compounds:e,order:n}={}){this.set(t,{kind:"static",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}fromAst(t,i){let e=[];F(i,n=>{n.kind==="rule"?e.push(n.selector):n.kind==="at-rule"&&n.name!=="@slot"&&e.push(`${n.name} ${n.params}`)}),this.static(t,n=>{let s=structuredClone(i);At(s,n.nodes),n.nodes=s},{compounds:ye(e)})}functional(t,i,{compounds:e,order:n}={}){this.set(t,{kind:"functional",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}compound(t,i,e,{compounds:n,order:s}={}){this.set(t,{kind:"compound",applyFn:e,compoundsWith:i,compounds:n??2,order:s})}group(t,i){this.groupOrder=this.nextOrder(),i&&this.compareFns.set(this.groupOrder,i),t(),this.groupOrder=null}has(t){return this.variants.has(t)}get(t){return this.variants.get(t)}kind(t){return this.variants.get(t)?.kind}compoundsWith(t,i){let e=this.variants.get(t),n=typeof i=="string"?this.variants.get(i):i.kind==="arbitrary"?{compounds:ye([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(t,i){this.completions.set(t,i)}getCompletions(t){return this.completions.get(t)?.()??[]}compare(t,i){if(t===i)return 0;if(t===null)return-1;if(i===null)return 1;if(t.kind==="arbitrary"&&i.kind==="arbitrary")return t.selector{m.nodes=g.map(w=>H(w,m.nodes))},{compounds:d})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function e(f,g){return g.map(d=>{d=d.trim();let m=D(d," ");return m[0]==="not"?m.slice(1).join(" "):f==="@container"?m[0][0]==="("?`not ${d}`:m[1]==="not"?`${m[0]} ${m.slice(2).join(" ")}`:`${m[0]} not ${m.slice(1).join(" ")}`:`not ${d}`})}let n=["@media","@supports","@container"];function s(f){for(let g of n){if(g!==f.name)continue;let d=D(f.params,",");return d.length>1?null:(d=e(f.name,d),z(f.name,d.join(", ")))}return null}function a(f){return f.includes("::")?null:`&:not(${D(f,",").map(d=>(d=d.replaceAll("&","*"),d)).join(", ")})`}t.compound("not",3,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative||g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule"&&m.kind!=="at-rule")return 0;if(m.nodes.length>0)return 0;let v=[],x=[];for(let N of w)N.kind==="at-rule"?v.push(N):N.kind==="rule"&&x.push(N);if(v.length>1)return 2;if(x.length>1)return 2;let k=[];for(let N of x){let b=a(N.selector);if(!b)return d=!1,2;k.push(M(b,[]))}for(let N of v){let b=s(N);if(!b)return d=!1,2;k.push(b)}return Object.assign(f,M("&",k)),d=!0,1}),f.kind==="rule"&&f.selector==="&"&&f.nodes.length===1&&Object.assign(f,f.nodes[0]),!d)return null}),t.suggest("not",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("not",f))),t.compound("group",2,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative)return null;let d=g.modifier?`:where(.${r.prefix?`${r.prefix}\\:`:""}group\\/${g.modifier.value})`:`:where(.${r.prefix?`${r.prefix}\\:`:""}group)`,m=!1;if(F([f],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let k of v.slice(0,-1))if(k.kind==="rule")return m=!1,2;let x=w.selector.replaceAll("&",d);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} *)`,m=!0}),!m)return null}),t.suggest("group",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("group",f))),t.compound("peer",2,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative)return null;let d=g.modifier?`:where(.${r.prefix?`${r.prefix}\\:`:""}peer\\/${g.modifier.value})`:`:where(.${r.prefix?`${r.prefix}\\:`:""}peer)`,m=!1;if(F([f],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let k of v.slice(0,-1))if(k.kind==="rule")return m=!1,2;let x=w.selector.replaceAll("&",d);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} ~ *)`,m=!0}),!m)return null}),t.suggest("peer",()=>Array.from(t.keys()).filter(f=>t.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 L([z("@property","--tw-content",[l("syntax",'"*"'),l("initial-value",'""'),l("inherits","false")])])};var c=f;t.static("before",g=>{g.nodes=[M("&::before",[f(),l("content","var(--tw-content)"),...g.nodes])]},{compounds:0}),t.static("after",g=>{g.nodes=[M("&::after",[f(),l("content","var(--tw-content)"),...g.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"]),t.static("hover",f=>{f.nodes=[M("&:hover",[z("@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] *)"]),t.compound("in",2,(f,g)=>{if(g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return d=!1,2;m.selector=`:where(${m.selector.replaceAll("&","*")}) &`,d=!0}),!d)return null}),t.suggest("in",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("in",f))),t.compound("has",2,(f,g)=>{if(g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return d=!1,2;m.selector=`&:has(${m.selector.replaceAll("&","*")})`,d=!0}),!d)return null}),t.suggest("has",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("has",f))),t.functional("aria",(f,g)=>{if(!g.value||g.modifier)return null;g.value.kind==="arbitrary"?f.nodes=[M(`&[aria-${wr(g.value.value)}]`,f.nodes)]:f.nodes=[M(`&[aria-${g.value.value}="true"]`,f.nodes)]}),t.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),t.functional("data",(f,g)=>{if(!g.value||g.modifier)return null;f.nodes=[M(`&[data-${wr(g.value.value)}]`,f.nodes)]}),t.functional("nth",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-child(${g.value.value})`,f.nodes)]}),t.functional("nth-last",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-last-child(${g.value.value})`,f.nodes)]}),t.functional("nth-of-type",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-of-type(${g.value.value})`,f.nodes)]}),t.functional("nth-last-of-type",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-last-of-type(${g.value.value})`,f.nodes)]}),t.functional("supports",(f,g)=>{if(!g.value||g.modifier)return null;let d=g.value.value;if(d===null)return null;if(/^[\w-]*\s*\(/.test(d)){let m=d.replace(/\b(and|or|not)\b/g," $1 ");f.nodes=[z("@supports",m,f.nodes)];return}d.includes(":")||(d=`${d}: var(--tw)`),(d[0]!=="("||d[d.length-1]!==")")&&(d=`(${d})`),f.nodes=[z("@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(g,d,m,w){if(g===d)return 0;let v=w.get(g);if(v===null)return m==="asc"?-1:1;let x=w.get(d);return x===null?m==="asc"?1:-1:we(v,x,m)};var u=f;{let g=r.namespace("--breakpoint"),d=new B(m=>{switch(m.kind){case"static":return r.resolveValue(m.root,["--breakpoint"])??null;case"functional":{if(!m.value||m.modifier)return null;let w=null;return m.value.kind==="arbitrary"?w=m.value.value:m.value.kind==="named"&&(w=r.resolveValue(m.value.value,["--breakpoint"])),!w||w.includes("var(")?null:w}case"arbitrary":case"compound":return null}});t.group(()=>{t.functional("max",(m,w)=>{if(w.modifier)return null;let v=d.get(w);if(v===null)return null;m.nodes=[z("@media",`(width < ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"desc",d)),t.suggest("max",()=>Array.from(g.keys()).filter(m=>m!==null)),t.group(()=>{for(let[m,w]of r.namespace("--breakpoint"))m!==null&&t.static(m,v=>{v.nodes=[z("@media",`(width >= ${w})`,v.nodes)]},{compounds:1});t.functional("min",(m,w)=>{if(w.modifier)return null;let v=d.get(w);if(v===null)return null;m.nodes=[z("@media",`(width >= ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"asc",d)),t.suggest("min",()=>Array.from(g.keys()).filter(m=>m!==null))}{let g=r.namespace("--container"),d=new B(m=>{switch(m.kind){case"functional":{if(m.value===null)return null;let w=null;return m.value.kind==="arbitrary"?w=m.value.value:m.value.kind==="named"&&(w=r.resolveValue(m.value.value,["--container"])),!w||w.includes("var(")?null:w}case"static":case"arbitrary":case"compound":return null}});t.group(()=>{t.functional("@max",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width < ${v})`:`(width < ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"desc",d)),t.suggest("@max",()=>Array.from(g.keys()).filter(m=>m!==null)),t.group(()=>{t.functional("@",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,m.nodes)]},{compounds:1}),t.functional("@min",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"asc",d)),t.suggest("@min",()=>Array.from(g.keys()).filter(m=>m!==null)),t.suggest("@",()=>Array.from(g.keys()).filter(m=>m!==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)"]),t}function wr(r){if(r.includes("=")){let[t,...i]=D(r,"="),e=i.join("=").trim();if(e[0]==="'"||e[0]==='"')return r;if(e.length>1){let n=e[e.length-1];if(e[e.length-2]===" "&&(n==="i"||n==="I"||n==="s"||n==="S"))return`${t}="${e.slice(0,-2)}" ${n}`}return`${t}="${e}"`}return r}function At(r,t){F(r,(i,{replaceWith:e})=>{if(i.kind==="at-rule"&&i.name==="@slot")e(t);else if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,L([z(i.name,i.params,i.nodes)])),1})}function br(r){let t=cr(r),i=yr(r),e=new B(u=>ir(u,c)),n=new B(u=>Array.from(rr(u,c))),s=new B(u=>{let f=kr(u,c);try{xe(f.map(({node:g})=>g),c)}catch{return[]}return f}),a=new B(u=>{for(let f of qe(u))r.markUsedVariable(f)}),c={theme:r,utilities:t,variants:i,invalidCandidates:new Set,important:!1,candidatesToCss(u){let f=[];for(let g of u){let d=!1,{astNodes:m}=pe([g],this,{onInvalidCandidate(){d=!0}});m=ve(m,c,0),m.length===0||d?f.push(null):f.push(ne(m))}return f},getClassOrder(u){return vr(this,u)},getClassList(){return gr(this)},getVariants(){return hr(this)},parseCandidate(u){return n.get(u)},parseVariant(u){return e.get(u)},compileAstNodes(u){return s.get(u)},printCandidate(u){return or(c,u)},printVariant(u){return He(u)},getVariantOrder(){let u=Array.from(e.values());u.sort((m,w)=>this.variants.compare(m,w));let f=new Map,g,d=0;for(let m of u)m!==null&&(g!==void 0&&this.variants.compare(g,m)!==0&&d++,f.set(m,d),g=m);return f},resolveThemeValue(u,f=!0){let g=u.lastIndexOf("/"),d=null;g!==-1&&(d=u.slice(g+1).trim(),u=u.slice(0,g).trim());let m=r.resolve(null,[u],f?1:0)??void 0;return d&&m?Q(m,d):m},trackUsedVariables(u){a.get(u)}};return c}var Ct=["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 pe(r,t,{onInvalidCandidate:i}={}){let e=new Map,n=[],s=new Map;for(let c of r){if(t.invalidCandidates.has(c)){i?.(c);continue}let u=t.parseCandidate(c);if(u.length===0){i?.(c);continue}s.set(c,u)}let a=t.getVariantOrder();for(let[c,u]of s){let f=!1;for(let g of u){let d=t.compileAstNodes(g);if(d.length!==0){f=!0;for(let{node:m,propertySort:w}of d){let v=0n;for(let x of g.variants)v|=1n<{let f=e.get(c),g=e.get(u);if(f.variants-g.variants!==0n)return Number(f.variants-g.variants);let d=0;for(;d1)return null;for(let u of a.nodes)if(u.kind!=="rule"&&u.kind!=="at-rule"||n(u,t)===null)return null;F(a.nodes,u=>{if((u.kind==="rule"||u.kind==="at-rule")&&u.nodes.length<=0)return u.nodes=r.nodes,1}),r.nodes=a.nodes;return}if(n(r,t)===null)return null}function xr(r){let t=r.options?.types??[];return t.length>1&&t.includes("any")}function Ki(r,t){if(r.kind==="arbitrary"){let a=r.value;return r.modifier&&(a=X(a,r.modifier,t.theme)),a===null?[]:[[l(r.property,a)]]}let i=t.utilities.get(r.root)??[],e=[],n=i.filter(a=>!xr(a));for(let a of n){if(a.kind!==r.kind)continue;let c=a.compileFn(r);if(c!==void 0){if(c===null)return e;e.push(c)}}if(e.length>0)return e;let s=i.filter(a=>xr(a));for(let a of s){if(a.kind!==r.kind)continue;let c=a.compileFn(r);if(c!==void 0){if(c===null)return e;e.push(c)}}return e}function Ar(r){for(let t of r)t.kind!=="at-root"&&(t.kind==="declaration"?t.important=!0:(t.kind==="rule"||t.kind==="at-rule")&&Ar(t.nodes))}function _i(r){let t=new Set,i=0,e=r.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 c=Ct.indexOf(s.value??"");if(c!==-1){t.add(c),n=!0;continue}}let a=Ct.indexOf(s.property);a!==-1&&t.add(a)}else if(s.kind==="rule"||s.kind==="at-rule")for(let a of s.nodes)e.push(a)}return{order:Array.from(t).sort((s,a)=>s-a),count:i}}function Oe(r,t){let i=0,e=H("&",r),n=new Set,s=new B(()=>new Set),a=new B(()=>new Set);F([e],(d,{parent:m,path:w})=>{if(d.kind==="at-rule"){if(d.name==="@keyframes")return F(d.nodes,v=>{if(v.kind==="at-rule"&&v.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),1;if(d.name==="@utility"){let v=d.params.replace(/-\*$/,"");a.get(v).add(d),F(d.nodes,x=>{if(!(x.kind!=="at-rule"||x.name!=="@apply")){n.add(d);for(let k of Cr(x,t))s.get(d).add(k)}});return}if(d.name==="@apply"){if(m===null)return;i|=1,n.add(m);for(let v of Cr(d,t))for(let x of w)x!==d&&n.has(x)&&s.get(x).add(v)}}});let c=new Set,u=[],f=new Set;function g(d,m=[]){if(!c.has(d)){if(f.has(d)){let w=m[(m.indexOf(d)+1)%m.length];throw d.kind==="at-rule"&&d.name==="@utility"&&w.kind==="at-rule"&&w.name==="@utility"&&F(d.nodes,v=>{if(v.kind!=="at-rule"||v.name!=="@apply")return;let x=v.params.split(/\s+/g);for(let k of x)for(let N of t.parseCandidate(k))switch(N.kind){case"arbitrary":break;case"static":case"functional":if(w.params.replace(/-\*$/,"")===N.root)throw new Error(`You cannot \`@apply\` the \`${k}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${ne([d])} +Relies on: + +${ne([w])}`)}f.add(d);for(let w of s.get(d))for(let v of a.get(w))m.push(d),g(v,m),m.pop();c.add(d),f.delete(d),u.push(d)}}for(let d of n)g(d);for(let d of u)"nodes"in d&&F(d.nodes,(m,{replaceWith:w})=>{if(m.kind!=="at-rule"||m.name!=="@apply")return;let v=m.params.split(/(\s+)/g),x={},k=0;for(let[N,b]of v.entries())N%2===0&&(x[b]=k),k+=b.length;{let N=Object.keys(x),b=pe(N,t,{onInvalidCandidate:R=>{if(t.theme.prefix&&!R.startsWith(t.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${R}\`. Did you mean \`${t.theme.prefix}:${R}\`?`);if(t.invalidCandidates.has(R))throw new Error(`Cannot apply utility class \`${R}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let _=D(R,":");if(_.length>1){let K=_.pop();if(t.candidatesToCss([K])[0]){let G=t.candidatesToCss(_.map(W=>`${W}:[--tw-variant-check:1]`)),I=_.filter((W,Z)=>G[Z]===null);if(I.length>0){if(I.length===1)throw new Error(`Cannot apply utility class \`${R}\` because the ${I.map(W=>`\`${W}\``)} variant does not exist.`);{let W=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${R}\` because the ${W.format(I.map(Z=>`\`${Z}\``))} variants do not exist.`)}}}}throw t.theme.size===0?new Error(`Cannot apply unknown utility class \`${R}\`. 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 \`${R}\``)}}),S=m.src,P=b.astNodes.map(R=>{let _=b.nodeSorting.get(R)?.candidate,K=_?x[_]:void 0;if(R=structuredClone(R),!S||!_||K===void 0)return F([R],I=>{I.src=S}),R;let G=[S[0],S[1],S[2]];return G[1]+=7+K,G[2]=G[1]+_.length,F([R],I=>{I.src=G}),R}),U=[];for(let R of P)if(R.kind==="rule")for(let _ of R.nodes)U.push(_);else U.push(R);w(U)}});return i}function*Cr(r,t){for(let i of r.params.split(/\s+/g))for(let e of t.parseCandidate(i))switch(e.kind){case"arbitrary":break;case"static":case"functional":yield e.root;break;default:}}async function $t(r,t,i,e=0,n=!1){let s=0,a=[];return F(r,(c,{replaceWith:u})=>{if(c.kind==="at-rule"&&(c.name==="@import"||c.name==="@reference")){let f=ji(q(c.params));if(f===null)return;c.name==="@reference"&&(f.media="reference"),s|=2;let{uri:g,layer:d,media:m,supports:w}=f;if(g.startsWith("data:")||g.startsWith("http://")||g.startsWith("https://"))return;let v=le({},[]);return a.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${g}\` in \`${t}\`)`);let x=await i(g,t),k=me(x.content,{from:n?x.path:void 0});await $t(k,x.base,i,e+1,n),v.nodes=Di(c,[le({base:x.base},k)],d,m,w)})()),u(v),1}}),a.length>0&&await Promise.all(a),s}function ji(r){let t,i=null,e=null,n=null;for(let s=0;s/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=et(e);s&&r.theme.add(`--${s}`,""+n,7)}if(Object.hasOwn(t,"fontFamily")){let e=5;{let n=Ce(t.fontFamily.sans);n&&r.theme.hasDefault("--font-sans")&&(r.theme.add("--default-font-family",n,e),r.theme.add("--default-font-feature-settings",Ce(t.fontFamily.sans,"fontFeatureSettings")??"normal",e),r.theme.add("--default-font-variation-settings",Ce(t.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let n=Ce(t.fontFamily.mono);n&&r.theme.hasDefault("--font-mono")&&(r.theme.add("--default-mono-font-family",n,e),r.theme.add("--default-mono-font-feature-settings",Ce(t.fontFamily.mono,"fontFeatureSettings")??"normal",e),r.theme.add("--default-mono-font-variation-settings",Ce(t.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return t}function Ui(r){let t=[];return Vr(r,[],(i,e)=>{if(Fi(i))return t.push([e,i]),1;if(Li(i)){t.push([e,i[0]]);for(let n of Reflect.ownKeys(i[1]))t.push([[...e,`-${n}`],i[1][n]]);return 1}if(Array.isArray(i)&&i.every(n=>typeof n=="string"))return e[0]==="fontSize"?(t.push([e,i[0]]),i.length>=2&&t.push([[...e,"-line-height"],i[1]])):t.push([e,i.join(", ")]),1}),t}var Ii=/^[a-zA-Z0-9-_%/\.]+$/;function et(r){if(r[0]==="container")return null;r=structuredClone(r),r[0]==="animation"&&(r[0]="animate"),r[0]==="aspectRatio"&&(r[0]="aspect"),r[0]==="borderRadius"&&(r[0]="radius"),r[0]==="boxShadow"&&(r[0]="shadow"),r[0]==="colors"&&(r[0]="color"),r[0]==="containers"&&(r[0]="container"),r[0]==="fontFamily"&&(r[0]="font"),r[0]==="fontSize"&&(r[0]="text"),r[0]==="letterSpacing"&&(r[0]="tracking"),r[0]==="lineHeight"&&(r[0]="leading"),r[0]==="maxWidth"&&(r[0]="container"),r[0]==="screens"&&(r[0]="breakpoint"),r[0]==="transitionTimingFunction"&&(r[0]="ease");for(let t of r)if(!Ii.test(t))return null;return r.map((t,i,e)=>t==="1"&&i!==e.length-1?"":t).map(t=>t.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(i,e,n)=>`${e}-${n.toLowerCase()}`)).filter((t,i)=>t!=="DEFAULT"||i!==r.length-1).join("-")}function Fi(r){return typeof r=="number"||typeof r=="string"}function Li(r){if(!Array.isArray(r)||r.length!==2||typeof r[0]!="string"&&typeof r[0]!="number"||r[1]===void 0||r[1]===null||typeof r[1]!="object")return!1;for(let t of Reflect.ownKeys(r[1]))if(typeof t!="string"||typeof r[1][t]!="string"&&typeof r[1][t]!="number")return!1;return!0}function Vr(r,t=[],i){for(let e of Reflect.ownKeys(r)){let n=r[e];if(n==null)continue;let s=[...t,e],a=i(n,s)??0;if(a!==1){if(a===2)return 2;if(!(!Array.isArray(n)&&typeof n!="object")&&Vr(n,s,i)===2)return 2}}}function tt(r){let t=[];for(let i of D(r,".")){if(!i.includes("[")){t.push(i);continue}let e=0;for(;;){let n=i.indexOf("[",e),s=i.indexOf("]",n);if(n===-1||s===-1)break;n>e&&t.push(i.slice(e,n)),t.push(i.slice(n+1,s)),e=s+1}e<=i.length-1&&t.push(i.slice(e))}return t}function $e(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let t=Object.getPrototypeOf(r);return t===null||Object.getPrototypeOf(t)===null}function Ke(r,t,i,e=[]){for(let n of t)if(n!=null)for(let s of Reflect.ownKeys(n)){e.push(s);let a=i(r[s],n[s],e);a!==void 0?r[s]=a:!$e(r[s])||!$e(n[s])?r[s]=n[s]:r[s]=Ke({},[r[s],n[s]],i,e),e.pop()}return r}function rt(r,t,i){return function(n,s){let a=n.lastIndexOf("/"),c=null;a!==-1&&(c=n.slice(a+1).trim(),n=n.slice(0,a).trim());let u=(()=>{let f=tt(n),[g,d]=zi(r.theme,f),m=i(Nr(t()??{},f)??null);if(typeof m=="string"&&(m=m.replace("","1")),typeof g!="object")return typeof d!="object"&&d&4?m??g:g;if(m!==null&&typeof m=="object"&&!Array.isArray(m)){let w=Ke({},[m],(v,x)=>x);if(g===null&&Object.hasOwn(m,"__CSS_VALUES__")){let v={};for(let x in m.__CSS_VALUES__)v[x]=m[x],delete w[x];g=v}for(let v in g)v!=="__CSS_VALUES__"&&(m?.__CSS_VALUES__?.[v]&4&&Nr(w,v.split("-"))!==void 0||(w[ge(v)]=g[v]));return w}if(Array.isArray(g)&&Array.isArray(d)&&Array.isArray(m)){let w=g[0],v=g[1];d[0]&4&&(w=m[0]??w);for(let x of Object.keys(v))d[1][x]&4&&(v[x]=m[1][x]??v[x]);return[w,v]}return g??m})();return c&&typeof u=="string"&&(u=Q(u,c)),u??s}}function zi(r,t){if(t.length===1&&t[0].startsWith("--"))return[r.get([t[0]]),r.getOptions(t[0])];let i=et(t),e=new Map,n=new B(()=>new Map),s=r.namespace(`--${i}`);if(s.size===0)return[null,0];let a=new Map;for(let[g,d]of s){if(!g||!g.includes("--")){e.set(g,d),a.set(g,r.getOptions(g?`--${i}-${g}`:`--${i}`));continue}let m=g.indexOf("--"),w=g.slice(0,m),v=g.slice(m+2);v=v.replace(/-([a-z])/g,(x,k)=>k.toUpperCase()),n.get(w===""?null:w).set(v,[d,r.getOptions(`--${i}${g}`)])}let c=r.getOptions(`--${i}`);for(let[g,d]of n){let m=e.get(g);if(typeof m!="string")continue;let w={},v={};for(let[x,[k,N]]of d)w[x]=k,v[x]=N;e.set(g,[m,w]),a.set(g,[c,v])}let u={},f={};for(let[g,d]of e)Sr(u,[g??"DEFAULT"],d);for(let[g,d]of a)Sr(f,[g??"DEFAULT"],d);return t[t.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 Nr(r,t){for(let i=0;i0){let m=_e(n);e?e.nodes.push(m):t.push(m),n=""}let u=a,f=a+1;for(;f0){let f=_e(n);u.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Yi:case Ji:case Zi:{if(n.length>0){let u=_e(n);e?e.nodes.push(u):t.push(u)}n=String.fromCharCode(c);break}case Kr:{if(n.length>0){let g=_e(n);e?e.nodes.push(g):t.push(g)}n="";let u=a,f=0;for(let g=a+1;g0&&t.push(_e(n)),t}var Fr=/^[a-z@][a-zA-Z0-9/%._-]*$/;function Vt({designSystem:r,ast:t,resolvedConfig:i,featuresRef:e,referenceMode:n}){let s={addBase(a){if(n)return;let c=ae(a);e.current|=xe(c,r),t.push(z("@layer","base",c))},addVariant(a,c){if(!Xe.test(a))throw new Error(`\`addVariant('${a}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(typeof c=="string"){if(c.includes(":merge("))return}else if(Array.isArray(c)){if(c.some(f=>f.includes(":merge(")))return}else if(typeof c=="object"){let f=function(g,d){return Object.entries(g).some(([m,w])=>m.includes(d)||typeof w=="object"&&f(w,d))};var u=f;if(f(c,":merge("))return}typeof c=="string"||Array.isArray(c)?r.variants.static(a,f=>{f.nodes=Lr(c,f.nodes)},{compounds:ye(typeof c=="string"?[c]:c)}):typeof c=="object"&&r.variants.fromAst(a,ae(c))},matchVariant(a,c,u){function f(d,m,w){let v=c(d,{modifier:m?.value??null});return Lr(v,w)}try{let d=c("a",{modifier:null});if(typeof d=="string"&&d.includes(":merge("))return;if(Array.isArray(d)&&d.some(m=>m.includes(":merge(")))return}catch{}let g=Object.keys(u?.values??{});r.variants.group(()=>{r.variants.functional(a,(d,m)=>{if(!m.value){if(u?.values&&"DEFAULT"in u.values){d.nodes=f(u.values.DEFAULT,m.modifier,d.nodes);return}return null}if(m.value.kind==="arbitrary")d.nodes=f(m.value.value,m.modifier,d.nodes);else if(m.value.kind==="named"&&u?.values){let w=u.values[m.value.value];if(typeof w!="string")return;d.nodes=f(w,m.modifier,d.nodes)}})},(d,m)=>{if(d.kind!=="functional"||m.kind!=="functional")return 0;let w=d.value?d.value.value:"DEFAULT",v=m.value?m.value.value:"DEFAULT",x=u?.values?.[w]??w,k=u?.values?.[v]??v;if(u&&typeof u.sort=="function")return u.sort({value:x,modifier:d.modifier?.value??null},{value:k,modifier:m.modifier?.value??null});let N=g.indexOf(w),b=g.indexOf(v);return N=N===-1?g.length:N,b=b===-1?g.length:b,N!==b?N-b:xObject.entries(f));c=c.flatMap(([f,g])=>D(f,",").map(d=>[d.trim(),g]));let u=new B(()=>[]);for(let[f,g]of c){if(f.startsWith("@keyframes ")){n||t.push(H(f,ae(g)));continue}let d=it(f),m=!1;if(je(d,w=>{if(w.kind==="selector"&&w.value[0]==="."&&Fr.test(w.value.slice(1))){let v=w.value;w.value="&";let x=De(d),k=v.slice(1),N=x==="&"?ae(g):[H(x,ae(g))];u.get(k).push(...N),m=!0,w.value=v;return}if(w.kind==="function"&&w.value===":not")return 1}),!m)throw new Error(`\`addUtilities({ '${f}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[f,g]of u)r.theme.prefix&&F(g,d=>{if(d.kind==="rule"){let m=it(d.selector);je(m,w=>{w.kind==="selector"&&w.value[0]==="."&&(w.value=`.${r.theme.prefix}\\:${w.value.slice(1)}`)}),d.selector=De(m)}}),r.utilities.static(f,d=>{let m=structuredClone(g);return zr(m,f,d.raw),e.current|=Oe(m,r),m})},matchUtilities(a,c){let u=c?.type?Array.isArray(c?.type)?c.type:[c.type]:["any"];for(let[g,d]of Object.entries(a)){let m=function({negative:w}){return v=>{if(v.value?.kind==="arbitrary"&&u.length>0&&!u.includes("any")&&(v.value.dataType&&!u.includes(v.value.dataType)||!v.value.dataType&&!J(v.value.value,u)))return;let x=u.includes("color"),k=null,N=!1;{let P=c?.values??{};x&&(P=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},P)),v.value?v.value.kind==="arbitrary"?k=v.value.value:v.value.fraction&&P[v.value.fraction]?(k=P[v.value.fraction],N=!0):P[v.value.value]?k=P[v.value.value]:P.__BARE_VALUE__&&(k=P.__BARE_VALUE__(v.value)??null,N=(v.value.fraction!==null&&k?.includes("/"))??!1):k=P.DEFAULT??null}if(k===null)return;let b;{let P=c?.modifiers??null;v.modifier?P==="any"||v.modifier.kind==="arbitrary"?b=v.modifier.value:P?.[v.modifier.value]?b=P[v.modifier.value]:x&&!Number.isNaN(Number(v.modifier.value))?b=`${v.modifier.value}%`:b=null:b=null}if(v.modifier&&b===null&&!N)return v.value?.kind==="arbitrary"?null:void 0;x&&b!==null&&(k=Q(k,b)),w&&(k=`calc(${k} * -1)`);let S=ae(d(k,{modifier:b}));return zr(S,g,v.raw),e.current|=Oe(S,r),S}};var f=m;if(!Fr.test(g))throw new Error(`\`matchUtilities({ '${g}' : \u2026 })\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter, eg. \`scrollbar\`.`);c?.supportsNegativeValues&&r.utilities.functional(`-${g}`,m({negative:!0}),{types:u}),r.utilities.functional(g,m({negative:!1}),{types:u}),r.utilities.suggest(g,()=>{let w=c?.values??{},v=new Set(Object.keys(w));v.delete("__BARE_VALUE__"),v.has("DEFAULT")&&(v.delete("DEFAULT"),v.add(null));let x=c?.modifiers??{},k=x==="any"?[]:Object.keys(x);return[{supportsNegative:c?.supportsNegativeValues??!1,values:Array.from(v),modifiers:k}]})}},addComponents(a,c){this.addUtilities(a,c)},matchComponents(a,c){this.matchUtilities(a,c)},theme:rt(r,()=>i.theme??{},a=>a),prefix(a){return a},config(a,c){let u=i;if(!a)return u;let f=tt(a);for(let g=0;gObject.entries(e));for(let[e,n]of i)if(typeof n!="object"){if(!e.startsWith("--")){if(n==="@slot"){t.push(H(e,[z("@slot")]));continue}e=e.replace(/([A-Z])/g,"-$1").toLowerCase()}t.push(l(e,String(n)))}else if(Array.isArray(n))for(let s of n)typeof s=="string"?t.push(l(e,s)):t.push(H(e,ae(s)));else n!==null&&t.push(H(e,ae(n)));return t}function Lr(r,t){return(typeof r=="string"?[r]:r).flatMap(e=>{if(e.trim().endsWith("}")){let n=e.replace("}","{@slot}}"),s=me(n);return At(s,t),s}else return H(e,t)})}function zr(r,t,i){F(r,e=>{if(e.kind==="rule"){let n=it(e.selector);je(n,s=>{s.kind==="selector"&&s.value===`.${t}`&&(s.value=`.${fe(i)}`)}),e.selector=De(n)}})}function Mr(r,t,i){for(let e of en(t))r.theme.addKeyframes(e)}function en(r){let t=[];if("keyframes"in r.theme)for(let[i,e]of Object.entries(r.theme.keyframes))t.push(z("@keyframes",i,ae(e)));return t}function Wr(r){return{theme:{...Pt,colors:({theme:t})=>t("color",{}),extend:{fontSize:({theme:t})=>({...t("text",{})}),boxShadow:({theme:t})=>({...t("shadow",{})}),animation:({theme:t})=>({...t("animate",{})}),aspectRatio:({theme:t})=>({...t("aspect",{})}),borderRadius:({theme:t})=>({...t("radius",{})}),screens:({theme:t})=>({...t("breakpoint",{})}),letterSpacing:({theme:t})=>({...t("tracking",{})}),lineHeight:({theme:t})=>({...t("leading",{})}),transitionDuration:{DEFAULT:r.get(["--default-transition-duration"])??null},transitionTimingFunction:{DEFAULT:r.get(["--default-transition-timing-function"])??null},maxWidth:({theme:t})=>({...t("container",{})})}}}}var tn={blocklist:[],future:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function St(r,t){let i={design:r,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(tn)};for(let n of t)Nt(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=nn(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:e}}function rn(r,t){if(Array.isArray(r)&&$e(r[0]))return r.concat(t);if(Array.isArray(t)&&$e(t[0])&&$e(r))return[r,...t];if(Array.isArray(t))return t}function Nt(r,{config:t,base:i,path:e,reference:n}){let s=[];for(let u of t.plugins??[])"__isOptionsFunction"in u?s.push({...u(),reference:n}):"handler"in u?s.push({...u,reference:n}):s.push({handler:u,reference:n});if(Array.isArray(t.presets)&&t.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let u of t.presets??[])Nt(r,{path:e,base:i,config:u,reference:n});for(let u of s)r.plugins.push(u),u.config&&Nt(r,{path:e,base:i,config:u.config,reference:!!u.reference});let a=t.content??[],c=Array.isArray(a)?a:a.files;for(let u of c)r.content.files.push(typeof u=="object"?u:{base:i,pattern:u});r.configs.push(t)}function nn(r){let t=new Set,i=rt(r.design,()=>r.theme,n),e=Object.assign(i,{theme:i,colors:Et});function n(s){return typeof s=="function"?s(e)??null:s??null}for(let s of r.configs){let a=s.theme??{},c=a.extend??{};for(let u in a)u!=="extend"&&t.add(u);Object.assign(r.theme,a);for(let u in c)r.extend[u]??=[],r.extend[u].push(c[u])}delete r.theme.extend;for(let s in r.extend){let a=[r.theme[s],...r.extend[s]];r.theme[s]=()=>{let c=a.map(n);return Ke({},c,rn)}}for(let s in r.theme)r.theme[s]=n(r.theme[s]);if(r.theme.screens&&typeof r.theme.screens=="object")for(let s of Object.keys(r.theme.screens)){let a=r.theme.screens[s];a&&typeof a=="object"&&("raw"in a||"max"in a||"min"in a&&(r.theme.screens[s]=a.min))}return t}function Br(r,t){let i=r.theme.container||{};if(typeof i!="object"||i===null)return;let e=on(i,t);e.length!==0&&t.utilities.static("container",()=>structuredClone(e))}function on({center:r,padding:t,screens:i},e){let n=[],s=null;if(r&&n.push(l("margin-inline","auto")),(typeof t=="string"||typeof t=="object"&&t!==null&&"DEFAULT"in t)&&n.push(l("padding-inline",typeof t=="string"?t:t.DEFAULT)),typeof i=="object"&&i!==null){s=new Map;let a=Array.from(e.theme.namespace("--breakpoint").entries());if(a.sort((c,u)=>we(c[1],u[1],"asc")),a.length>0){let[c]=a[0];n.push(z("@media",`(width >= --theme(--breakpoint-${c}))`,[l("max-width","none")]))}for(let[c,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;s.set(c,z("@media",`(width >= ${u})`,[l("max-width",u)]))}}if(typeof t=="object"&&t!==null){let a=Object.entries(t).filter(([c])=>c!=="DEFAULT").map(([c,u])=>[c,e.theme.resolveValue(c,["--breakpoint"]),u]).filter(Boolean);a.sort((c,u)=>we(c[1],u[1],"asc"));for(let[c,,u]of a)if(s&&s.has(c))s.get(c).nodes.push(l("padding-inline",u));else{if(s)continue;n.push(z("@media",`(width >= theme(--breakpoint-${c}))`,[l("padding-inline",u)]))}}if(s)for(let[,a]of s)n.push(a);return n}function qr({addVariant:r,config:t}){let i=t("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"?r("dark",`&:where(${n}, ${n} *)`):e==="media"?r("dark","@media (prefers-color-scheme: dark)"):e==="variant"?r("dark",n):e==="class"&&r("dark",`&:is(${n} *)`))}function Gr(r){for(let[t,i]of[["t","top"],["tr","top right"],["r","right"],["br","bottom right"],["b","bottom"],["bl","bottom left"],["l","left"],["tl","top left"]])r.utilities.static(`bg-gradient-to-${t}`,()=>[l("--tw-gradient-position",`to ${i} in oklab`),l("background-image","linear-gradient(var(--tw-gradient-stops))")]);r.utilities.static("bg-left-top",()=>[l("background-position","left top")]),r.utilities.static("bg-right-top",()=>[l("background-position","right top")]),r.utilities.static("bg-left-bottom",()=>[l("background-position","left bottom")]),r.utilities.static("bg-right-bottom",()=>[l("background-position","right bottom")]),r.utilities.static("object-left-top",()=>[l("object-position","left top")]),r.utilities.static("object-right-top",()=>[l("object-position","right top")]),r.utilities.static("object-left-bottom",()=>[l("object-position","left bottom")]),r.utilities.static("object-right-bottom",()=>[l("object-position","right bottom")]),r.utilities.functional("max-w-screen",t=>{if(!t.value||t.value.kind==="arbitrary")return;let i=r.theme.resolve(t.value.value,["--breakpoint"]);if(i)return[l("max-width",i)]}),r.utilities.static("overflow-ellipsis",()=>[l("text-overflow","ellipsis")]),r.utilities.static("decoration-slice",()=>[l("-webkit-box-decoration-break","slice"),l("box-decoration-break","slice")]),r.utilities.static("decoration-clone",()=>[l("-webkit-box-decoration-break","clone"),l("box-decoration-break","clone")]),r.utilities.functional("flex-shrink",t=>{if(!t.modifier){if(!t.value)return[l("flex-shrink","1")];if(t.value.kind==="arbitrary")return[l("flex-shrink",t.value.value)];if(E(t.value.value))return[l("flex-shrink",t.value.value)]}}),r.utilities.functional("flex-grow",t=>{if(!t.modifier){if(!t.value)return[l("flex-grow","1")];if(t.value.kind==="arbitrary")return[l("flex-grow",t.value.value)];if(E(t.value.value))return[l("flex-grow",t.value.value)]}}),r.utilities.static("order-none",()=>[l("order","0")])}function Jr(r,t){let i=r.theme.screens||{},e=t.variants.get("min")?.order??0,n=[];for(let[a,c]of Object.entries(i)){let m=function(w){t.variants.static(a,v=>{v.nodes=[z("@media",d,v.nodes)]},{order:w})};var s=m;let u=t.variants.get(a),f=t.theme.resolveValue(a,["--breakpoint"]);if(u&&f&&!t.theme.hasDefault(`--breakpoint-${a}`))continue;let g=!0;typeof c=="string"&&(g=!1);let d=ln(c);g?n.push(m):m(e)}if(n.length!==0){for(let[,a]of t.variants.variants)a.order>e&&(a.order+=n.length);t.variants.compareFns=new Map(Array.from(t.variants.compareFns).map(([a,c])=>(a>e&&(a+=n.length),[a,c])));for(let[a,c]of n.entries())c(e+a+1)}}function ln(r){return(Array.isArray(r)?r:[r]).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 Hr(r,t){let i=r.theme.aria||{},e=r.theme.supports||{},n=r.theme.data||{};if(Object.keys(i).length>0){let s=t.variants.get("aria"),a=s?.applyFn,c=s?.compounds;t.variants.functional("aria",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in i?a?.(u,{...f,value:{kind:"arbitrary",value:i[g.value]}}):a?.(u,f)},{compounds:c})}if(Object.keys(e).length>0){let s=t.variants.get("supports"),a=s?.applyFn,c=s?.compounds;t.variants.functional("supports",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in e?a?.(u,{...f,value:{kind:"arbitrary",value:e[g.value]}}):a?.(u,f)},{compounds:c})}if(Object.keys(n).length>0){let s=t.variants.get("data"),a=s?.applyFn,c=s?.compounds;t.variants.functional("data",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in n?a?.(u,{...f,value:{kind:"arbitrary",value:n[g.value]}}):a?.(u,f)},{compounds:c})}}var an=/^[a-z]+$/;async function Zr({designSystem:r,base:t,ast:i,loadModule:e,sources:n}){let s=0,a=[],c=[];F(i,(d,{parent:m,replaceWith:w,context:v})=>{if(d.kind==="at-rule"){if(d.name==="@plugin"){if(m!==null)throw new Error("`@plugin` cannot be nested.");let x=d.params.slice(1,-1);if(x.length===0)throw new Error("`@plugin` must have a path.");let k={};for(let N of d.nodes??[]){if(N.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${ne([N])} + +\`@plugin\` options must be a flat list of declarations.`);if(N.value===void 0)continue;let b=N.value,S=D(b,",").map(P=>{if(P=P.trim(),P==="null")return null;if(P==="true")return!0;if(P==="false")return!1;if(Number.isNaN(Number(P))){if(P[0]==='"'&&P[P.length-1]==='"'||P[0]==="'"&&P[P.length-1]==="'")return P.slice(1,-1);if(P[0]==="{"&&P[P.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${ne([N]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(P);return P});k[N.property]=S.length===1?S[0]:S}a.push([{id:x,base:v.base,reference:!!v.reference},Object.keys(k).length>0?k:null]),w([]),s|=4;return}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(m!==null)throw new Error("`@config` cannot be nested.");c.push({id:d.params.slice(1,-1),base:v.base,reference:!!v.reference}),w([]),s|=4;return}}}),Gr(r);let u=r.resolveThemeValue;if(r.resolveThemeValue=function(m,w){return m.startsWith("--")?u(m,w):(s|=Yr({designSystem:r,base:t,ast:i,sources:n,configs:[],pluginDetails:[]}),r.resolveThemeValue(m,w))},!a.length&&!c.length)return 0;let[f,g]=await Promise.all([Promise.all(c.map(async({id:d,base:m,reference:w})=>{let v=await e(d,m,"config");return{path:d,base:v.base,config:v.module,reference:w}})),Promise.all(a.map(async([{id:d,base:m,reference:w},v])=>{let x=await e(d,m,"plugin");return{path:d,base:x.base,plugin:x.module,options:v,reference:w}}))]);return s|=Yr({designSystem:r,base:t,ast:i,sources:n,configs:f,pluginDetails:g}),s}function Yr({designSystem:r,base:t,ast:i,sources:e,configs:n,pluginDetails:s}){let a=0,u=[...s.map(k=>{if(!k.options)return{config:{plugins:[k.plugin]},base:k.base,reference:k.reference};if("__isOptionsFunction"in k.plugin)return{config:{plugins:[k.plugin(k.options)]},base:k.base,reference:k.reference};throw new Error(`The plugin "${k.path}" does not accept options`)}),...n],{resolvedConfig:f}=St(r,[{config:Wr(r.theme),base:t,reference:!0},...u,{config:{plugins:[qr]},base:t,reference:!0}]),{resolvedConfig:g,replacedThemeKeys:d}=St(r,u),m=r.resolveThemeValue;r.resolveThemeValue=function(N,b){if(N[0]==="-"&&N[1]==="-")return m(N,b);let S=v.theme(N,void 0);if(Array.isArray(S)&&S.length===2)return S[0];if(Array.isArray(S))return S.join(", ");if(typeof S=="string")return S};let w={designSystem:r,ast:i,resolvedConfig:f,featuresRef:{set current(k){a|=k}}},v=Vt({...w,referenceMode:!1}),x;for(let{handler:k,reference:N}of f.plugins)N?(x||=Vt({...w,referenceMode:!0}),k(x)):k(v);if($r(r,g,d),Mr(r,g,d),Hr(g,r),Jr(g,r),Br(g,r),!r.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.`)),!an.test(f.prefix))throw new Error(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);r.theme.prefix=f.prefix}if(!r.important&&f.important===!0&&(r.important=!0),typeof f.important=="string"){let k=f.important;F(i,(N,{replaceWith:b,parent:S})=>{if(N.kind==="at-rule"&&!(N.name!=="@tailwind"||N.params!=="utilities"))return S?.kind==="rule"&&S.selector===k?2:(b(M(k,[N])),2)})}for(let k of f.blocklist)r.invalidCandidates.add(k);for(let k of f.content.files){if("raw"in k)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry: + +${JSON.stringify(k,null,2)} + +This feature is not currently supported.`);let N=!1;k.pattern[0]=="!"&&(N=!0,k.pattern=k.pattern.slice(1)),e.push({...k,negated:N})}return a}function Qr(r){let t=[0];for(let n=0;n0;){let u=(a|0)>>1,f=s+u;t[f]<=n?(s=f+1,a=a-u-1):a=u}s-=1;let c=n-t[s];return{line:s+1,column:c}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),t.length-1);let a=t[n],c=t[n+1]??a;return Math.min(Math.max(a+s,0),c)}return{find:i,findOffset:e}}function Xr({ast:r}){let t=new B(n=>Qr(n.code)),i=new B(n=>({url:n.file,content:n.code,ignore:!1})),e={file:null,sources:[],mappings:[]};F(r,n=>{if(!n.src||!n.dst)return;let s=i.get(n.src[0]);if(!s.content)return;let a=t.get(n.src[0]),c=t.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),f=0;for(let m of u.split(` +`)){if(m.trim()!==""){let w=a.find(n.src[1]+f),v=c.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:v})}f+=m.length,f+=1}let g=a.find(n.src[2]),d=c.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...g},generatedPosition:d})});for(let n of t.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 ei=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function nt(r){let t=r.indexOf("{");if(t===-1)return[r];let i=[],e=r.slice(0,t),n=r.slice(t),s=0,a=n.lastIndexOf("}");for(let d=0;dnt(d));let g=nt(u);for(let d of g)for(let m of f)i.push(e+m+d);return i}function sn(r){return ei.test(r)}function un(r){let t=r.match(ei);if(!t)return[r];let[,i,e,n]=t,s=n?parseInt(n,10):void 0,a=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(e)){let c=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=c<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let f=c0&&(s=-s);for(let g=c;f?g<=u:g>=u;g+=s)a.push(g.toString())}return a}var fn=/^[a-z]+$/,dt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(dt||{});function cn(){throw new Error("No `loadModule` function provided to `compile`")}function pn(){throw new Error("No `loadStylesheet` function provided to `compile`")}function dn(r){let t=0,i=null;for(let e of D(r," "))e==="reference"?t|=2:e==="inline"?t|=1:e==="default"?t|=4:e==="static"?t|=8:e.startsWith("prefix(")&&e.endsWith(")")&&(i=e.slice(7,-1));return[t,i]}var Pe=(c=>(c[c.None=0]="None",c[c.AtApply=1]="AtApply",c[c.AtImport=2]="AtImport",c[c.JsPluginCompat=4]="JsPluginCompat",c[c.ThemeFunction=8]="ThemeFunction",c[c.Utilities=16]="Utilities",c[c.Variants=32]="Variants",c))(Pe||{});async function ti(r,{base:t="",from:i,loadModule:e=cn,loadStylesheet:n=pn}={}){let s=0;r=[le({base:t},r)],s|=await $t(r,t,n,0,i!==void 0);let a=null,c=new Be,u=[],f=[],g=null,d=null,m=[],w=[],v=[],x=[],k=null;F(r,(b,{parent:S,replaceWith:P,context:U})=>{if(b.kind==="at-rule"){if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(d!==null){P([]);return}if(U.reference){P([]);return}let R=D(b.params," ");for(let _ of R)if(_.startsWith("source(")){let K=_.slice(7,-1);if(K==="none"){k=K;continue}if(K[0]==='"'&&K[K.length-1]!=='"'||K[0]==="'"&&K[K.length-1]!=="'"||K[0]!=="'"&&K[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");k={base:U.sourceBase??U.base,pattern:K.slice(1,-1)}}d=b,s|=16}if(b.name==="@utility"){if(S!==null)throw new Error("`@utility` cannot be nested.");if(b.nodes.length===0)throw new Error(`\`@utility ${b.params}\` is empty. Utilities should include at least one property.`);let R=pr(b);if(R===null)throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);f.push(R)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.");if(S!==null)throw new Error("`@source` cannot be nested.");let R=!1,_=!1,K=b.params;if(K[0]==="n"&&K.startsWith("not ")&&(R=!0,K=K.slice(4)),K[0]==="i"&&K.startsWith("inline(")&&(_=!0,K=K.slice(7,-1)),K[0]==='"'&&K[K.length-1]!=='"'||K[0]==="'"&&K[K.length-1]!=="'"||K[0]!=="'"&&K[0]!=='"')throw new Error("`@source` paths must be quoted.");let G=K.slice(1,-1);if(_){let I=R?x:v,W=D(G," ");for(let Z of W)for(let re of nt(Z))I.push(re)}else w.push({base:U.base,pattern:G,negated:R});P([]);return}if(b.name==="@variant"&&(S===null?b.nodes.length===0?b.name="@custom-variant":(F(b.nodes,R=>{if(R.kind==="at-rule"&&R.name==="@slot")return b.name="@custom-variant",2}),b.name==="@variant"&&m.push(b)):m.push(b)),b.name==="@custom-variant"){if(S!==null)throw new Error("`@custom-variant` cannot be nested.");P([]);let[R,_]=D(b.params," ");if(!Xe.test(R))throw new Error(`\`@custom-variant ${R}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(b.nodes.length>0&&_)throw new Error(`\`@custom-variant ${R}\` cannot have both a selector and a body.`);if(b.nodes.length===0){if(!_)throw new Error(`\`@custom-variant ${R}\` has no selector or body.`);let K=D(_.slice(1,-1),",");if(K.length===0||K.some(W=>W.trim()===""))throw new Error(`\`@custom-variant ${R} (${K.join(",")})\` selector is invalid.`);let G=[],I=[];for(let W of K)W=W.trim(),W[0]==="@"?G.push(W):I.push(W);u.push(W=>{W.variants.static(R,Z=>{let re=[];I.length>0&&re.push(M(I.join(", "),Z.nodes));for(let o of G)re.push(H(o,Z.nodes));Z.nodes=re},{compounds:ye([...I,...G])})});return}else{u.push(K=>{K.variants.fromAst(R,b.nodes)});return}}if(b.name==="@media"){let R=D(b.params," "),_=[];for(let K of R)if(K.startsWith("source(")){let G=K.slice(7,-1);F(b.nodes,(I,{replaceWith:W})=>{if(I.kind==="at-rule"&&I.name==="@tailwind"&&I.params==="utilities")return I.params+=` source(${G})`,W([le({sourceBase:U.base},[I])]),2})}else if(K.startsWith("theme(")){let G=K.slice(6,-1),I=G.includes("reference");F(b.nodes,W=>{if(W.kind!=="at-rule"){if(I)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return 0}if(W.name==="@theme")return W.params+=" "+G,1})}else if(K.startsWith("prefix(")){let G=K.slice(7,-1);F(b.nodes,I=>{if(I.kind==="at-rule"&&I.name==="@theme")return I.params+=` prefix(${G})`,1})}else K==="important"?a=!0:K==="reference"?b.nodes=[le({reference:!0},b.nodes)]:_.push(K);_.length>0?b.params=_.join(" "):R.length>0&&P(b.nodes)}if(b.name==="@theme"){let[R,_]=dn(b.params);if(U.reference&&(R|=2),_){if(!fn.test(_))throw new Error(`The prefix "${_}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);c.prefix=_}return F(b.nodes,K=>{if(K.kind==="at-rule"&&K.name==="@keyframes")return c.addKeyframes(K),1;if(K.kind==="comment")return;if(K.kind==="declaration"&&K.property.startsWith("--")){c.add(ge(K.property),K.value??"",R,K.src);return}let G=ne([z(b.name,b.params,[K])]).split(` +`).map((I,W,Z)=>`${W===0||W>=Z.length-2?" ":">"} ${I}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${G}`)}),g?P([]):(g=M(":root, :host",[]),g.src=b.src,P([g])),1}}});let N=br(c);if(a&&(N.important=a),x.length>0)for(let b of x)N.invalidCandidates.add(b);s|=await Zr({designSystem:N,base:t,ast:r,loadModule:e,sources:w});for(let b of u)b(N);for(let b of f)b(N);if(g){let b=[];for(let[P,U]of N.theme.entries()){if(U.options&2)continue;let R=l(fe(P),U.value);R.src=U.src,b.push(R)}let S=N.theme.getKeyframes();for(let P of S)r.push(le({theme:!0},[L([P])]));g.nodes=[le({theme:!0},b)]}if(m.length>0){for(let b of m){let S=M("&",b.nodes),P=b.params,U=N.parseVariant(P);if(U===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${P}`);if(Ae(S,U,N.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${P}`);Object.assign(b,S)}s|=32}if(s|=xe(r,N),s|=Oe(r,N),d){let b=d;b.kind="context",b.context={}}return F(r,(b,{replaceWith:S})=>{if(b.kind==="at-rule")return b.name==="@utility"&&S([]),1}),{designSystem:N,ast:r,sources:w,root:k,utilitiesNode:d,features:s,inlineCandidates:v}}async function mn(r,t={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:a,features:c,inlineCandidates:u}=await ti(r,t);e.unshift(We(`! tailwindcss v${Rt} | MIT License | https://tailwindcss.com `));function f(v){i.invalidCandidates.add(v)}let g=new Set,d=null,m=0,w=!1;for(let v of u)i.invalidCandidates.has(v)||(g.add(v),w=!0);return{sources:n,root:s,features:c,build(v){if(c===0)return r;if(!a)return d??=ve(e,i,t.polyfills),d;let x=w,k=!1;w=!1;let N=g.size;for(let S of v)if(!i.invalidCandidates.has(S))if(S[0]==="-"&&S[1]==="-"){let P=i.theme.markUsedVariable(S);x||=P,k||=P}else g.add(S),x||=g.size!==N;if(!x)return d??=ve(e,i,t.polyfills),d;let b=pe(g,i,{onInvalidCandidate:f}).astNodes;return t.from&&F(b,S=>{S.src??=a.src}),!k&&m===b.length?(d??=ve(e,i,t.polyfills),d):(m=b.length,a.nodes=b,d=ve(e,i,t.polyfills),d)}}}async function Ca(r,t={}){let i=me(r,{from:t.from}),e=await mn(i,t),n=i,s=r;return{...e,build(a){let c=e.build(a);return c===n||(s=ne(c,!!t.from),n=c),s},buildSourceMap(){return Xr({ast:n})}}}async function $a(r,t={}){return(await ti(me(r),t)).designSystem}function gn(){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{dt as a,Pe as b,mn as c,Ca as d,$a as e,gn as f}; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-G32FJCSR.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-G32FJCSR.mjs new file mode 100644 index 0000000000000000000000000000000000000000..86a6941776b8da27765976361615eb80a5e11c9b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-G32FJCSR.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,u as d,pe as e,ge as f,ue as g,be as h}; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8a95483a290362f50a01eec98ac3ab7aa77b5f1b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f187dc6ae350a405031960170ca84d4ae9bc982 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5ea47011a52263416f81387cdddea6f829234b55 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9d15d3de324a3fe932fc98067270ebe8fa27b21 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.js b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.js new file mode 100644 index 0000000000000000000000000000000000000000..409c0d5185a807d593a91f58521a55d10491d086 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9d20fbc2ba033db5c180b5eaaef1f95190be63af --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/colors.mjs @@ -0,0 +1 @@ +import{a}from"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1b80d8aefd36f985bb401ff78163dd6136010b49 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d36e26e34069bb65bf83118153bdbcc6839d74f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.js b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.js new file mode 100644 index 0000000000000000000000000000000000000000..48982db90f68fe43d7ee1bebb002aa39e7261d8f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2fca4a65a7996f5acbd5d661371437d977d8974a --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/default-theme.mjs @@ -0,0 +1 @@ +import{h as a}from"./chunk-G32FJCSR.mjs";import"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1151604860f5cedb146a45057c69f388a43b4553 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1151604860f5cedb146a45057c69f388a43b4553 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.js b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.js new file mode 100644 index 0000000000000000000000000000000000000000..b9e6c33c1669735d03d9cb90e02d54a08c6915c4 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.js @@ -0,0 +1,3 @@ +"use strict";function _(e){return{kind:"word",value:e}}function se(e,t){return{kind:"function",value:e,nodes:t}}function ue(e){return{kind:"separator",value:e}}function v(e,t,i=null){for(let r=0;r0){let M=_(n);r?r.nodes.push(M):t.push(M),n=""}let a=l,u=l+1;for(;u0){let u=_(n);a?.nodes.push(u),n=""}i.length>0?r=i[i.length-1]:r=null;break}default:n+=String.fromCharCode(s)}}return n.length>0&&t.push(_(n)),t}var c=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 He=new Uint8Array(256);var T=new Uint8Array(256);function p(e,t){let i=0,r=[],n=0,o=e.length,l=t.charCodeAt(0);for(let s=0;s0&&a===T[i-1]&&i--;break}}return r.push(e.slice(n)),r}var tt=new c(e=>{let t=m(e),i=new Set;return v(t,(r,{parent:n})=>{let o=n===null?t:n.nodes??[];if(r.kind==="word"&&(r.value==="+"||r.value==="-"||r.value==="*"||r.value==="/")){let l=o.indexOf(r)??-1;if(l===-1)return;let s=o[l-1];if(s?.kind!=="separator"||s.value!==" ")return;let a=o[l+1];if(a?.kind!=="separator"||a.value!==" ")return;i.add(s),i.add(a)}else r.kind==="separator"&&r.value.trim()==="/"?r.value="/":r.kind==="separator"&&r.value.length>0&&r.value.trim()===""?(o[0]===r||o[o.length-1]===r)&&i.add(r):r.kind==="separator"&&r.value.trim()===","&&(r.value=",")}),i.size>0&&v(t,(r,{replaceWith:n})=>{i.has(r)&&(i.delete(r),n([]))}),D(t),h(t)});var rt=new c(e=>{let t=m(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"?h(t[2].nodes):e});function D(e){for(let t of e)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=N(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=N(t.value);for(let i=0;i{let t=m(e);return t.length===1&&t[0].kind==="function"&&t[0].value==="var"});function me(e){throw new Error(`Unexpected value: ${e}`)}function N(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var w=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,pt=new RegExp(`^${w.source}$`);var dt=new RegExp(`^${w.source}%$`);var mt=new RegExp(`^${w.source}s*/s*${w.source}$`);var ge=["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"],gt=new RegExp(`^${w.source}(${ge.join("|")})$`);var he=["deg","rad","grad","turn"],ht=new RegExp(`^${w.source}(${he.join("|")})$`);var vt=new RegExp(`^${w.source} +${w.source} +${w.source}$`);function d(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===String(e)}function S(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 ke={"--alpha":be,"--spacing":ye,"--theme":xe,theme:Ae};function be(e,t,i,...r){let[n,o]=p(i,"/").map(l=>l.trim());if(!n||!o)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${o||"50%"})\``);if(r.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${o||"50%"})\``);return S(n,o)}function ye(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 xe(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 o=e.resolveThemeValue(i,n);if(!o){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 o;let l=r.join(", ");if(l==="initial")return o;if(o==="initial")return l;if(o.startsWith("var(")||o.startsWith("theme(")||o.startsWith("--theme(")){let s=m(o);return $e(s,l),h(s)}return o}function Ae(e,t,i,...r){i=Ce(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 Ut=new RegExp(Object.keys(ke).map(e=>`${e}\\(`).join("|"));function Ce(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 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 C(e){return{__BARE_VALUE__:e}}var g=C(e=>{if(d(e.value))return e.value}),f=C(e=>{if(d(e.value))return`${e.value}%`}),y=C(e=>{if(d(e.value))return`${e.value}px`}),le=C(e=>{if(d(e.value))return`${e.value}ms`}),P=C(e=>{if(d(e.value))return`${e.value}deg`}),Ie=C(e=>{if(e.fraction===null)return;let[t,i]=p(e.fraction,"/");if(!(!d(t)||!d(i)))return e.fraction}),ae=C(e=>{if(d(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),ze={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",...Ie},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...f}),backdropContrast:({theme:e})=>({...e("contrast"),...f}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...f}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...P}),backdropInvert:({theme:e})=>({...e("invert"),...f}),backdropOpacity:({theme:e})=>({...e("opacity"),...f}),backdropSaturate:({theme:e})=>({...e("saturate"),...f}),backdropSepia:({theme:e})=>({...e("sepia"),...f}),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",...y},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",...f},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",...g},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...f},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"),...y}),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%",...f},grayscale:{0:"0",DEFAULT:"100%",...f},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))",...ae},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))",...ae},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%",...f},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",...f},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",...y},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...y},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...f},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",...f},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%",...f},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",...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",...y},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...le},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...le},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}};function O(e){let t={};for(let[i,r]of Object.entries(e??{}))if(i!=="__CSS_VALUES__")if(typeof r=="object"&&r!==null)for(let[n,o]of Object.entries(O(r)))t[`${i}${n==="DEFAULT"?"":`-${n}`}`]=o;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=O; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d047645d27aaecbeb2b9f4f11177786610ce7ae3 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/flatten-color-palette.mjs @@ -0,0 +1 @@ +import"./chunk-4WXWQT6Y.mjs";import"./chunk-G32FJCSR.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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..df2c5634e2410af8def3583a699feeb160a97323 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.mts @@ -0,0 +1,373 @@ +import { U as UserConfig, P as Plugin } from './types-B254mqw1.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[]): 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): "static" | "arbitrary" | "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): { + node: AstNode; + propertySort: { + order: number[]; + count: number; + }; +}[]; + +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[]; +} + +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): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + candidatesToCss(classes: string[]): (string | null)[]; +}; + +/** + * 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 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 +} +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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..411ce0604b0e875ee7073327db0d8d9ad895896f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.d.ts @@ -0,0 +1,3 @@ +declare function postcssPluginWarning(): void; + +export { postcssPluginWarning as default }; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.js b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.js new file mode 100644 index 0000000000000000000000000000000000000000..c62b83b6a177876fadcc58e6f53b06210f462409 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.js @@ -0,0 +1,35 @@ +"use strict";var xi=Object.defineProperty;var Ai=(t,r)=>{for(var i in r)xi(t,i,{get:r[i],enumerable:!0})};var vt={};Ai(vt,{Features:()=>Se,Polyfills:()=>tt,__unstable__loadDesignSystem:()=>uo,compile:()=>so,compileAst:()=>yi,default:()=>We});var Mt="4.1.11";var Pe=92,Be=47,qe=42,Wt=34,Bt=39,Ni=58,Ge=59,ne=10,Ye=13,Oe=32,He=9,qt=123,kt=125,xt=40,Ht=41,$i=91,Vi=93,Gt=45,bt=64,Si=33;function ve(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,f=null,u="",c="",d=0,m;for(let g=0;g0&&t[b]===v[v.length-1]&&(v=v.slice(0,-1));let V=yt(u,y);if(!V)throw new Error("Invalid custom property, expected a value");i&&(V.src=[i,x,g],V.dst=[i,x,g]),a?a.nodes.push(V):e.push(V),u=""}else if(w===Ge&&u.charCodeAt(0)===bt)f=_e(u),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a?a.nodes.push(f):e.push(f),u="",f=null;else if(w===Ge&&c[c.length-1]!==")"){let v=yt(u);if(!v)throw u.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${u.trim()}\``);i&&(v.src=[i,d,g],v.dst=[i,d,g]),a?a.nodes.push(v):e.push(v),u=""}else if(w===qt&&c[c.length-1]!==")")c+="}",f=G(u.trim()),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a&&a.nodes.push(f),s.push(a),a=f,u="",f=null;else if(w===kt&&c[c.length-1]!==")"){if(c==="")throw new Error("Missing opening {");if(c=c.slice(0,-1),u.length>0)if(u.charCodeAt(0)===bt)f=_e(u),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a?a.nodes.push(f):e.push(f),u="",f=null;else{let x=u.indexOf(":");if(a){let y=yt(u,x);if(!y)throw new Error(`Invalid declaration: \`${u.trim()}\``);i&&(y.src=[i,d,g],y.dst=[i,d,g]),a.nodes.push(y)}}let v=s.pop()??null;v===null&&a&&e.push(a),a=v,u="",f=null}else if(w===xt)c+=")",u+="(";else if(w===Ht){if(c[c.length-1]!==")")throw new Error("Missing opening (");c=c.slice(0,-1),u+=")"}else{if(u.length===0&&(w===Oe||w===ne||w===He))continue;u===""&&(d=g),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===bt){let g=_e(u);i&&(g.src=[i,d,t.length],g.dst=[i,d,t.length]),e.push(g)}if(c.length>0&&a){if(a.kind==="rule")throw new Error(`Missing closing } at ${a.selector}`);if(a.kind==="at-rule")throw new Error(`Missing closing } at ${a.name} ${a.params}`)}return n.length>0?n.concat(e):e}function _e(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 we(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 Jt=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"]]]);function Zt(t,r){return(Jt.get(r)??[]).some(i=>t===i||t.startsWith(`${i}-`))}var Je=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&&(Zt(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=we(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=Jt.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(!Zt(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(${de(this.prefixKey(r))}${e?`, ${e}`:""})`}markUsedVariable(r){let i=we(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 f of e){let u=`${n}${f}`,c=this.values.get(u);c&&(c.options&1?s[f]=c.value:s[f]=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 B=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 Ct(t){return{kind:"word",value:t}}function Ei(t,r){return{kind:"function",value:t,nodes:r}}function Ti(t){return{kind:"separator",value:t}}function ee(t,r,i=null){for(let e=0;e0){let m=Ct(n);e?e.nodes.push(m):r.push(m),n=""}let u=a,c=a+1;for(;c0){let c=Ct(n);u?.nodes.push(c),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(f)}}return n.length>0&&r.push(Ct(n)),r}function Qe(t){let r=[];return ee(q(t),i=>{if(!(i.kind!=="function"||i.value!=="var"))return ee(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||r.push(e.value)}),1}),r}var Ki=64;function M(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 G(t,r=[]){return t.charCodeAt(0)===Ki?_e(t,r):M(t,r)}function l(t,r,i=!1){return{kind:"declaration",property:t,value:r,important:i}}function Ze(t){return{kind:"comment",value:t}}function se(t,r){return{kind:"context",context:t,nodes:r}}function z(t){return{kind:"at-root",nodes:t}}function I(t,r,i=[],e={}){for(let n=0;nnew Set),a=new B(()=>new Set),f=new Set,u=new Set,c=[],d=[],m=new B(()=>new Set);function g(v,x,y={},V=0){if(v.kind==="declaration"){if(v.property==="--tw-sort"||v.value===void 0||v.value===null)return;if(y.theme&&v.property[0]==="-"&&v.property[1]==="-"){if(v.value==="initial"){v.value=void 0;return}y.keyframes||s.get(x).add(v)}if(v.value.includes("var("))if(y.theme&&v.property[0]==="-"&&v.property[1]==="-")for(let b of Qe(v.value))m.get(b).add(v.property);else r.trackUsedVariables(v.value);if(v.property==="animation")for(let b of sr(v.value))u.add(b);i&2&&v.value.includes("color-mix(")&&a.get(x).add(v),x.push(v)}else if(v.kind==="rule")if(v.selector==="&")for(let b of v.nodes){let S=[];g(b,S,y,V+1),S.length>0&&x.push(...S)}else{let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);b.nodes.length>0&&x.push(b)}else if(v.kind==="at-rule"&&v.name==="@property"&&V===0){if(n.has(v.params))return;if(i&1){let S=v.params,R=null,L=!1;for(let K of v.nodes)K.kind==="declaration"&&(K.property==="initial-value"?R=K.value:K.property==="inherits"&&(L=K.value==="true"));let P=l(S,R??"initial");P.src=v.src,L?c.push(P):d.push(P)}n.add(v.params);let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);x.push(b)}else if(v.kind==="at-rule"){v.name==="@keyframes"&&(y={...y,keyframes:!0});let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);v.name==="@keyframes"&&y.theme&&f.add(b),(b.nodes.length>0||b.name==="@layer"||b.name==="@charset"||b.name==="@custom-media"||b.name==="@namespace"||b.name==="@import")&&x.push(b)}else if(v.kind==="at-root")for(let b of v.nodes){let S=[];g(b,S,y,0);for(let R of S)e.push(R)}else if(v.kind==="context"){if(v.context.reference)return;for(let b of v.nodes)g(b,x,{...y,...v.context},V)}else v.kind==="comment"&&x.push(v)}let w=[];for(let v of t)g(v,w,{},0);e:for(let[v,x]of s)for(let y of x){if(ur(y.property,r.theme,m)){if(y.property.startsWith(r.theme.prefixKey("--animate-")))for(let S of sr(y.value))u.add(S);continue}let b=v.indexOf(y);if(v.splice(b,1),v.length===0){let S=Ui(w,R=>R.kind==="rule"&&R.nodes===v);if(!S||S.length===0)continue e;S.unshift({kind:"at-root",nodes:w});do{let R=S.pop();if(!R)break;let L=S[S.length-1];if(!L||L.kind!=="at-root"&&L.kind!=="at-rule")break;let P=L.nodes.indexOf(R);if(P===-1)break;L.nodes.splice(P,1)}while(!0);continue e}}for(let v of f)if(!u.has(v.params)){let x=e.indexOf(v);e.splice(x,1)}if(w=w.concat(e),i&2)for(let[v,x]of a)for(let y of x){let V=v.indexOf(y);if(V===-1||y.value==null)continue;let b=q(y.value),S=!1;if(ee(b,(P,{replaceWith:K})=>{if(P.kind!=="function"||P.value!=="color-mix")return;let _=!1,H=!1;if(ee(P.nodes,(j,{replaceWith:W})=>{if(j.kind=="word"&&j.value.toLowerCase()==="currentcolor"){H=!0,S=!0;return}let J=j,ie=null,o=new Set;do{if(J.kind!=="function"||J.value!=="var")return;let p=J.nodes[0];if(!p||p.kind!=="word")return;let h=p.value;if(o.has(h)){_=!0;return}if(o.add(h),S=!0,ie=r.theme.resolveValue(null,[p.value]),!ie){_=!0;return}if(ie.toLowerCase()==="currentcolor"){H=!0;return}ie.startsWith("var(")?J=q(ie)[0]:J=null}while(J);W({kind:"word",value:ie})}),_||H){let j=P.nodes.findIndex(J=>J.kind==="separator"&&J.value.trim().includes(","));if(j===-1)return;let W=P.nodes.length>j?P.nodes[j+1]:null;if(!W)return;K(W)}else if(S){let j=P.nodes[2];j.kind==="word"&&(j.value==="oklab"||j.value==="oklch"||j.value==="lab"||j.value==="lch")&&(j.value="srgb")}}),!S)continue;let R={...y,value:Z(b)},L=G("@supports (color: color-mix(in lab, red, red))",[y]);L.src=y.src,v.splice(V,1,R,L)}if(i&1){let v=[];if(c.length>0){let x=G(":root, :host",c);x.src=c[0].src,v.push(x)}if(d.length>0){let x=G("*, ::before, ::after, ::backdrop",d);x.src=d[0].src,v.push(x)}if(v.length>0){let x=w.findIndex(b=>!(b.kind==="comment"||b.kind==="at-rule"&&(b.name==="@charset"||b.name==="@import"))),y=F("@layer","properties",[]);y.src=v[0].src,w.splice(x<0?w.length:x,0,y);let V=G("@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))))",v)]);V.src=v[0].src,V.nodes[0].src=v[0].src,w.push(V)}}return w}function oe(t,r){let i=0,e={file:null,code:""};function n(a,f=0){let u="",c=" ".repeat(f);if(a.kind==="declaration"){if(u+=`${c}${a.property}: ${a.value}${a.important?" !important":""}; +`,r){i+=c.length;let d=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let m=i;i+=2,a.dst=[e,d,m]}}else if(a.kind==="rule"){if(u+=`${c}${a.selector} { +`,r){i+=c.length;let d=i;i+=a.selector.length,i+=1;let m=i;a.dst=[e,d,m],i+=2}for(let d of a.nodes)u+=n(d,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let d=`${c}${a.name} ${a.params}; +`;if(r){i+=c.length;let m=i;i+=a.name.length,i+=1,i+=a.params.length;let g=i;i+=2,a.dst=[e,m,g]}return d}if(u+=`${c}${a.name}${a.params?` ${a.params} `:" "}{ +`,r){i+=c.length;let d=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let m=i;a.dst=[e,d,m],i+=2}for(let d of a.nodes)u+=n(d,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(a.kind==="comment"){if(u+=`${c}/*${a.value}*/ +`,r){i+=c.length;let d=i;i+=2+a.value.length+2;let m=i;a.dst=[e,d,m],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 Ui(t,r){let i=[];return I(t,(e,{path:n})=>{if(r(e))return i=[...n],2}),i}function ur(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(ur(a,r,i,e))return!0}return!1}function sr(t){return t.split(/[\s,]+/)}var Nt=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"];function De(t){return t.indexOf("(")!==-1&&Nt.some(r=>t.includes(`${r}(`))}function cr(t){if(!Nt.some(s=>t.includes(s)))return t;let r="",i=[],e=null,n=null;for(let s=0;s=48&&a<=57||e!==null&&(a===37||a>=97&&a<=122||a>=65&&a<=90)?e=s:(n=e,e=null),a===40){r+=t[s];let f=s;for(let c=s-1;c>=0;c--){let d=t.charCodeAt(c);if(d>=48&&d<=57)f=c;else if(d>=97&&d<=122)f=c;else break}let u=t.slice(f,s);if(Nt.includes(u)){i.unshift(!0);continue}else if(i[0]&&u===""){i.unshift(!0);continue}i.unshift(!1);continue}else if(a===41)r+=t[s],i.shift();else if(a===44&&i[0]){r+=", ";continue}else{if(a===32&&i[0]&&r.charCodeAt(r.length-1)===32)continue;if((a===43||a===42||a===47||a===45)&&i[0]){let f=r.trimEnd(),u=f.charCodeAt(f.length-1),c=f.charCodeAt(f.length-2),d=t.charCodeAt(s+1);if((u===101||u===69)&&c>=48&&c<=57){r+=t[s];continue}else if(u===43||u===42||u===47||u===45){r+=t[s];continue}else if(u===40||u===44){r+=t[s];continue}else t.charCodeAt(s-1)===32?r+=`${t[s]} `:u>=48&&u<=57||d>=48&&d<=57||u===41||d===40||d===43||d===42||d===47||d===45||n!==null&&n===s-1?r+=` ${t[s]} `:r+=t[s]}else r+=t[s]}}return r}function me(t){if(t.indexOf("(")===-1)return Ne(t);let r=q(t);return $t(r),t=Z(r),t=cr(t),t}function Ne(t,r=!1){let i="";for(let e=0;e0&&n===Vt[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var rt=new Uint8Array(256);function D(t,r){let i=0,e=[],n=0,s=t.length,a=r.charCodeAt(0);for(let f=0;f0&&u===rt[i-1]&&i--;break}}return e.push(t.slice(n)),e}var ji=58,fr=45,pr=97,dr=122;function*mr(t,r){let i=D(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 m=i.length-1;m>=0;--m){let g=r.parseVariant(i[m]);if(g===null)return;n.push(g)}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,f=null,u]=D(e,"/");if(u)return;let c=f===null?null:St(f);if(f!==null&&c===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let m=a.charCodeAt(1);if(m!==fr&&!(m>=pr&&m<=dr))return;a=a.slice(1,-1);let g=a.indexOf(":");if(g===-1||g===0||g===a.length-1)return;let w=a.slice(0,g),v=me(a.slice(g+1));if(!ce(v))return;yield{kind:"arbitrary",property:w,value:v,modifier:c,variants:n,important:s,raw:t};return}let d;if(a[a.length-1]==="]"){let m=a.indexOf("-[");if(m===-1)return;let g=a.slice(0,m);if(!r.utilities.has(g,"functional"))return;let w=a.slice(m+1);d=[[g,w]]}else if(a[a.length-1]===")"){let m=a.indexOf("-(");if(m===-1)return;let g=a.slice(0,m);if(!r.utilities.has(g,"functional"))return;let w=a.slice(m+2,-1),v=D(w,":"),x=null;if(v.length===2&&(x=v[0],w=v[1]),w[0]!=="-"||w[1]!=="-"||!ce(w))return;d=[[g,x===null?`[var(${w})]`:`[${x}:var(${w})]`]]}else d=hr(a,m=>r.utilities.has(m,"functional"));for(let[m,g]of d){let w={kind:"functional",root:m,modifier:c,value:null,variants:n,important:s,raw:t};if(g===null){yield w;continue}{let v=g.indexOf("[");if(v!==-1){if(g[g.length-1]!=="]")return;let y=me(g.slice(v+1,-1));if(!ce(y))continue;let V="";for(let b=0;b=pr&&S<=dr))break}if(y.length===0||y.trim().length===0)continue;w.value={kind:"arbitrary",dataType:V||null,value:y}}else{let y=f===null||w.modifier?.kind==="arbitrary"?null:`${g}/${f}`;w.value={kind:"named",value:g,fraction:y}}}yield w}}function St(t){if(t[0]==="["&&t[t.length-1]==="]"){let r=me(t.slice(1,-1));return!ce(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]!=="-"||!ce(t)?null:(t=`var(${t})`,{kind:"arbitrary",value:me(t)})):{kind:"named",value:t}}function gr(t,r){if(t[0]==="["&&t[t.length-1]==="]"){if(t[1]==="@"&&t.includes("&"))return null;let i=me(t.slice(1,-1));if(!ce(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]=D(t,"/");if(n)return null;let s=hr(i,a=>r.variants.has(a));for(let[a,f]of s)switch(r.variants.kind(a)){case"static":return f!==null||e!==null?null:{kind:"static",root:a};case"functional":{let u=e===null?null:St(e);if(e!==null&&u===null)return null;if(f===null)return{kind:"functional",root:a,modifier:u,value:null};if(f[f.length-1]==="]"){if(f[0]!=="[")continue;let c=me(f.slice(1,-1));return!ce(c)||c.length===0||c.trim().length===0?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:c}}}if(f[f.length-1]===")"){if(f[0]!=="(")continue;let c=me(f.slice(1,-1));return!ce(c)||c.length===0||c.trim().length===0||c[0]!=="-"||c[1]!=="-"?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:`var(${c})`}}}return{kind:"functional",root:a,modifier:u,value:{kind:"named",value:f}}}case"compound":{if(f===null)return null;let u=r.parseVariant(f);if(u===null||!r.variants.compoundsWith(a,u))return null;let c=e===null?null:St(e);return e!==null&&c===null?null:{kind:"compound",root:a,modifier:c,variant:u}}}}return null}function*hr(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]==="")break;yield n}i=t.lastIndexOf("-",i-1)}t[0]==="@"&&r("@")&&(yield["@",t.slice(1)])}function vr(t,r){let i=[];for(let n of r.variants)i.unshift(it(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=Tt(r.value.value),s=n?r.value.value.slice(4,-1):r.value.value,[a,f]=n?["(",")"]:["[","]"];r.value.dataType?e+=`-${a}${r.value.dataType}:${$e(s)}${f}`:e+=`-${a}${$e(s)}${f}`}}else r.value.kind==="named"&&(e+=`-${r.value.value}`);return r.kind==="arbitrary"&&(e+=`[${r.property}:${$e(r.value)}]`),(r.kind==="arbitrary"||r.kind==="functional")&&(e+=wr(r.modifier)),r.important&&(e+="!"),i.push(e),i.join(":")}function wr(t){if(t===null)return"";let r=Tt(t.value),i=r?t.value.slice(4,-1):t.value,[e,n]=r?["(",")"]:["[","]"];return t.kind==="arbitrary"?`/${e}${$e(i)}${n}`:t.kind==="named"?`/${t.value}`:""}function it(t){if(t.kind==="static")return t.root;if(t.kind==="arbitrary")return`[${$e(Fi(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=Tt(t.value.value),n=e?t.value.value.slice(4,-1):t.value.value,[s,a]=e?["(",")"]:["[","]"];r+=`${i?"-":""}${s}${$e(n)}${a}`}else t.value.kind==="named"&&(r+=`${i?"-":""}${t.value.value}`)}return t.kind==="compound"&&(r+=t.root,r+="-",r+=it(t.variant)),(t.kind==="functional"||t.kind==="compound")&&(r+=wr(t.modifier)),r}var Ii=new B(t=>{let r=q(t),i=new Set;return ee(r,(e,{parent:n})=>{let s=n===null?r:n.nodes??[];if(e.kind==="word"&&(e.value==="+"||e.value==="-"||e.value==="*"||e.value==="/")){let a=s.indexOf(e)??-1;if(a===-1)return;let f=s[a-1];if(f?.kind!=="separator"||f.value!==" ")return;let u=s[a+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(f),i.add(u)}else e.kind==="separator"&&e.value.trim()==="/"?e.value="/":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&&ee(r,(e,{replaceWith:n})=>{i.has(e)&&(i.delete(e),n([]))}),Et(r),Z(r)});function $e(t){return Ii.get(t)}var zi=new B(t=>{let r=q(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 Fi(t){return zi.get(t)}function Et(t){for(let r of t)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=Ke(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=Ke(r.value);for(let i=0;i{let r=q(t);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function Tt(t){return Mi.get(t)}function Wi(t){throw new Error(`Unexpected value: ${t}`)}function Ke(t){return t.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function ye(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),f=(s===a?0:snt(r)||yr(r)||r==="thin"||r==="medium"||r==="thick")}var Zi=/^(?:element|image|cross-fade|image-set)\(/,Ji=/^(repeating-)?(conic|linear|radial)-gradient\(/;function Qi(t){let r=0;for(let i of D(t,","))if(!i.startsWith("var(")){if(br(i)){r+=1;continue}if(Ji.test(i)){r+=1;continue}if(Zi.test(i)){r+=1;continue}return!1}return r>0}function Xi(t){return t==="serif"||t==="sans-serif"||t==="monospace"||t==="cursive"||t==="fantasy"||t==="system-ui"||t==="ui-serif"||t==="ui-sans-serif"||t==="ui-monospace"||t==="ui-rounded"||t==="math"||t==="emoji"||t==="fangsong"}function en(t){let r=0;for(let i of D(t,",")){let e=i.charCodeAt(0);if(e>=48&&e<=57)return!1;i.startsWith("var(")||(r+=1)}return r>0}function tn(t){return t==="xx-small"||t==="x-small"||t==="small"||t==="medium"||t==="large"||t==="x-large"||t==="xx-large"||t==="xxx-large"}function rn(t){return t==="larger"||t==="smaller"}var fe=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,nn=new RegExp(`^${fe.source}$`);function yr(t){return nn.test(t)||De(t)}var on=new RegExp(`^${fe.source}%$`);function Rt(t){return on.test(t)||De(t)}var ln=new RegExp(`^${fe.source}s*/s*${fe.source}$`);function an(t){return ln.test(t)||De(t)}var sn=["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"],un=new RegExp(`^${fe.source}(${sn.join("|")})$`);function nt(t){return un.test(t)||De(t)}function cn(t){let r=0;for(let i of D(t," ")){if(i==="center"||i==="top"||i==="right"||i==="bottom"||i==="left"){r+=1;continue}if(!i.startsWith("var(")){if(nt(i)||Rt(i)){r+=1;continue}return!1}}return r>0}function fn(t){let r=0;for(let i of D(t,",")){if(i==="cover"||i==="contain"){r+=1;continue}let e=D(i," ");if(e.length!==1&&e.length!==2)return!1;if(e.every(n=>n==="auto"||nt(n)||Rt(n))){r+=1;continue}}return r>0}var pn=["deg","rad","grad","turn"],dn=new RegExp(`^${fe.source}(${pn.join("|")})$`);function mn(t){return dn.test(t)}var gn=new RegExp(`^${fe.source} +${fe.source} +${fe.source}$`);function hn(t){return gn.test(t)}function T(t){let r=Number(t);return Number.isInteger(r)&&r>=0&&String(r)===String(t)}function Pt(t){let r=Number(t);return Number.isInteger(r)&&r>0&&String(r)===String(t)}function xe(t){return xr(t,.25)}function ot(t){return xr(t,.25)}function xr(t,r){let i=Number(t);return i>=0&&i%r===0&&String(i)===String(t)}var vn=new Set(["inset","inherit","initial","revert","unset"]),Ar=/^-?(\d+|\.\d+)(.*?)$/g;function Ue(t,r){return D(t,",").map(e=>{e=e.trim();let n=D(e," ").filter(c=>c.trim()!==""),s=null,a=null,f=null;for(let c of n)vn.has(c)||(Ar.test(c)?(a===null?a=c:f===null&&(f=c),Ar.lastIndex=0):s===null&&(s=c));if(a===null||f===null)return e;let u=r(s??"currentcolor");return s!==null?e.replace(s,u):`${e} ${u}`}).join(", ")}var wn=/^-?[a-z][a-zA-Z0-9/%._-]*$/,kn=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,at=["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"],Ot=class{utilities=new B(()=>[]);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.completions.get(r)?.()??[]}suggest(r,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 N(t,r,i){return F("@property",t,[l("syntax",i?`"${i}"`:'"*"'),l("inherits","false"),...r?[l("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 Nr(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):ot(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 Vr(t){let r=new Ot;function i(o,p){function*h(k){for(let C of t.keysInNamespaces(k))yield C.replace($r,(O,$,E)=>`${$}.${E}`)}let A=["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(o,()=>{let k=[];for(let C of p()){if(typeof C=="string"){k.push({values:[C],modifiers:[]});continue}let O=[...C.values??[],...h(C.valueThemeKeys??[])],$=[...C.modifiers??[],...h(C.modifierThemeKeys??[])];C.supportsFractions&&O.push(...A),C.hasDefaultValue&&O.unshift(null),k.push({supportsNegative:C.supportsNegative,values:O,modifiers:$})}return k})}function e(o,p){r.static(o,()=>p.map(h=>typeof h=="function"?h():l(h[0],h[1])))}function n(o,p){function h({negative:A}){return k=>{let C=null,O=null;if(k.value)if(k.value.kind==="arbitrary"){if(k.modifier)return;C=k.value.value,O=k.value.dataType}else{if(C=t.resolve(k.value.fraction??k.value.value,p.themeKeys??[]),C===null&&p.supportsFractions&&k.value.fraction){let[$,E]=D(k.value.fraction,"/");if(!T($)||!T(E))return;C=`calc(${k.value.fraction} * 100%)`}if(C===null&&A&&p.handleNegativeBareValue){if(C=p.handleNegativeBareValue(k.value),!C?.includes("/")&&k.modifier)return;if(C!==null)return p.handle(C,null)}if(C===null&&p.handleBareValue&&(C=p.handleBareValue(k.value),!C?.includes("/")&&k.modifier))return}else{if(k.modifier)return;C=p.defaultValue!==void 0?p.defaultValue:t.resolve(null,p.themeKeys??[])}if(C!==null)return p.handle(A?`calc(${C} * -1)`:C,O)}}p.supportsNegative&&r.functional(`-${o}`,h({negative:!0})),r.functional(o,h({negative:!1})),i(o,()=>[{supportsNegative:p.supportsNegative,valueThemeKeys:p.themeKeys??[],hasDefaultValue:p.defaultValue!==void 0&&p.defaultValue!==null,supportsFractions:p.supportsFractions}])}function s(o,p){r.functional(o,h=>{if(!h.value)return;let A=null;if(h.value.kind==="arbitrary"?(A=h.value.value,A=X(A,h.modifier,t)):A=te(h,t,p.themeKeys),A!==null)return p.handle(A)}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:p.themeKeys,modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}function a(o,p,h,{supportsNegative:A=!1,supportsFractions:k=!1}={}){A&&r.static(`-${o}-px`,()=>h("-1px")),r.static(`${o}-px`,()=>h("1px")),n(o,{themeKeys:p,supportsFractions:k,supportsNegative:A,defaultValue:null,handleBareValue:({value:C})=>{let O=t.resolve(null,["--spacing"]);return!O||!xe(C)?null:`calc(${O} * ${C})`},handleNegativeBareValue:({value:C})=>{let O=t.resolve(null,["--spacing"]);return!O||!xe(C)?null:`calc(${O} * -${C})`},handle:h}),i(o,()=>[{values:t.get(["--spacing"])?at:[],supportsNegative:A,supportsFractions:k,valueThemeKeys:p}])}e("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip","rect(0, 0, 0, 0)"],["white-space","nowrap"],["border-width","0"]]),e("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip","auto"],["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[o,p]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(`${o}-auto`,[[p,"auto"]]),e(`${o}-full`,[[p,"100%"]]),e(`-${o}-full`,[[p,"-100%"]]),a(o,["--inset","--spacing"],h=>[l(p,h)],{supportsNegative:!0,supportsFractions:!0});e("isolate",[["isolation","isolate"]]),e("isolation-auto",[["isolation","auto"]]),e("z-auto",[["z-index","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--z-index"],handle:o=>[l("z-index",o)]}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),e("order-first",[["order","-9999"]]),e("order-last",[["order","9999"]]),n("order",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--order"],handle:o=>[l("order",o)]}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--order"]}]),e("col-auto",[["grid-column","auto"]]),n("col",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column"],handle:o=>[l("grid-column",o)]}),e("col-span-full",[["grid-column","1 / -1"]]),n("col-span",{handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("grid-column",`span ${o} / span ${o}`)]}),e("col-start-auto",[["grid-column-start","auto"]]),n("col-start",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column-start"],handle:o=>[l("grid-column-start",o)]}),e("col-end-auto",[["grid-column-end","auto"]]),n("col-end",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column-end"],handle:o=>[l("grid-column-end",o)]}),i("col-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-end"]}]),e("row-auto",[["grid-row","auto"]]),n("row",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row"],handle:o=>[l("grid-row",o)]}),e("row-span-full",[["grid-row","1 / -1"]]),n("row-span",{themeKeys:[],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("grid-row",`span ${o} / span ${o}`)]}),e("row-start-auto",[["grid-row-start","auto"]]),n("row-start",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row-start"],handle:o=>[l("grid-row-start",o)]}),e("row-end-auto",[["grid-row-end","auto"]]),n("row-end",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row-end"],handle:o=>[l("grid-row-end",o)]}),i("row-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+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[o,p]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(`${o}-auto`,[[p,"auto"]]),a(o,["--margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});e("box-border",[["box-sizing","border-box"]]),e("box-content",[["box-sizing","content-box"]]),e("line-clamp-none",[["overflow","visible"],["display","block"],["-webkit-box-orient","horizontal"],["-webkit-line-clamp","unset"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("overflow","hidden"),l("display","-webkit-box"),l("-webkit-box-orient","vertical"),l("-webkit-line-clamp",o)]}),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"]]),e("aspect-auto",[["aspect-ratio","auto"]]),e("aspect-square",[["aspect-ratio","1 / 1"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:o})=>{if(o===null)return null;let[p,h]=D(o,"/");return!T(p)||!T(h)?null:o},handle:o=>[l("aspect-ratio",o)]});for(let[o,p]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-${o}`,[["--tw-sort","size"],["width",p],["height",p]]),e(`w-${o}`,[["width",p]]),e(`h-${o}`,[["height",p]]),e(`min-w-${o}`,[["min-width",p]]),e(`min-h-${o}`,[["min-height",p]]),e(`max-w-${o}`,[["max-width",p]]),e(`max-h-${o}`,[["max-height",p]]);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"],o=>[l("--tw-sort","size"),l("width",o),l("height",o)],{supportsFractions:!0});for(let[o,p,h]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(o,p,A=>[l(h,A)],{supportsFractions:!0});r.static("container",()=>{let o=[...t.namespace("--breakpoint").values()];o.sort((h,A)=>ye(h,A,"asc"));let p=[l("--tw-sort","--tw-container-component"),l("width","100%")];for(let h of o)p.push(F("@media",`(width >= ${h})`,[l("max-width",h)]));return p}),e("flex-auto",[["flex","auto"]]),e("flex-initial",[["flex","0 auto"]]),e("flex-none",[["flex","none"]]),r.functional("flex",o=>{if(o.value){if(o.value.kind==="arbitrary")return o.modifier?void 0:[l("flex",o.value.value)];if(o.value.fraction){let[p,h]=D(o.value.fraction,"/");return!T(p)||!T(h)?void 0:[l("flex",`calc(${o.value.fraction} * 100%)`)]}if(T(o.value.value))return o.modifier?void 0:[l("flex",o.value.value)]}}),i("flex",()=>[{supportsFractions:!0}]),n("shrink",{defaultValue:"1",handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("flex-shrink",o)]}),n("grow",{defaultValue:"1",handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("flex-grow",o)]}),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"],o=>[l("flex-basis",o)],{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 f=()=>z([N("--tw-border-spacing-x","0",""),N("--tw-border-spacing-y","0","")]);a("border-spacing",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-x",o),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-x",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-x",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-y",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),e("origin-center",[["transform-origin","center"]]),e("origin-top",[["transform-origin","top"]]),e("origin-top-right",[["transform-origin","top right"]]),e("origin-right",[["transform-origin","right"]]),e("origin-bottom-right",[["transform-origin","bottom right"]]),e("origin-bottom",[["transform-origin","bottom"]]),e("origin-bottom-left",[["transform-origin","bottom left"]]),e("origin-left",[["transform-origin","left"]]),e("origin-top-left",[["transform-origin","top left"]]),n("origin",{themeKeys:["--transform-origin"],handle:o=>[l("transform-origin",o)]}),e("perspective-origin-center",[["perspective-origin","center"]]),e("perspective-origin-top",[["perspective-origin","top"]]),e("perspective-origin-top-right",[["perspective-origin","top right"]]),e("perspective-origin-right",[["perspective-origin","right"]]),e("perspective-origin-bottom-right",[["perspective-origin","bottom right"]]),e("perspective-origin-bottom",[["perspective-origin","bottom"]]),e("perspective-origin-bottom-left",[["perspective-origin","bottom left"]]),e("perspective-origin-left",[["perspective-origin","left"]]),e("perspective-origin-top-left",[["perspective-origin","top left"]]),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:o=>[l("perspective-origin",o)]}),e("perspective-none",[["perspective","none"]]),n("perspective",{themeKeys:["--perspective"],handle:o=>[l("perspective",o)]});let u=()=>z([N("--tw-translate-x","0"),N("--tw-translate-y","0"),N("--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"],o=>[u(),l("--tw-translate-x",o),l("--tw-translate-y",o),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let o of["x","y"])e(`-translate-${o}-full`,[u,[`--tw-translate-${o}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e(`translate-${o}-full`,[u,[`--tw-translate-${o}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a(`translate-${o}`,["--translate","--spacing"],p=>[u(),l(`--tw-translate-${o}`,p),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});a("translate-z",["--translate","--spacing"],o=>[u(),l("--tw-translate-z",o),l("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 c=()=>z([N("--tw-scale-x","1"),N("--tw-scale-y","1"),N("--tw-scale-z","1")]);e("scale-none",[["scale","none"]]);function d({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;return p.value.kind==="arbitrary"?(h=p.value.value,h=o?`calc(${h} * -1)`:h,[l("scale",h)]):(h=t.resolve(p.value.value,["--scale"]),!h&&T(p.value.value)&&(h=`${p.value.value}%`),h?(h=o?`calc(${h} * -1)`:h,[c(),l("--tw-scale-x",h),l("--tw-scale-y",h),l("--tw-scale-z",h),l("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}r.functional("-scale",d({negative:!0})),r.functional("scale",d({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let o of["x","y","z"])n(`scale-${o}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:p})=>T(p)?`${p}%`:null,handle:p=>[c(),l(`--tw-scale-${o}`,p),l("scale",`var(--tw-scale-x) var(--tw-scale-y)${o==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${o}`,()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);e("scale-3d",[c,["scale","var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z)"]]),e("rotate-none",[["rotate","none"]]);function m({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;if(p.value.kind==="arbitrary"){h=p.value.value;let A=p.value.dataType??Y(h,["angle","vector"]);if(A==="vector")return[l("rotate",`${h} var(--tw-rotate)`)];if(A!=="angle")return[l("rotate",o?`calc(${h} * -1)`:h)]}else if(h=t.resolve(p.value.value,["--rotate"]),!h&&T(p.value.value)&&(h=`${p.value.value}deg`),!h)return;return[l("rotate",o?`calc(${h} * -1)`:h)]}}r.functional("-rotate",m({negative:!0})),r.functional("rotate",m({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let o=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),p=()=>z([N("--tw-rotate-x"),N("--tw-rotate-y"),N("--tw-rotate-z"),N("--tw-skew-x"),N("--tw-skew-y")]);for(let h of["x","y","z"])n(`rotate-${h}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:A})=>T(A)?`${A}deg`:null,handle:A=>[p(),l(`--tw-rotate-${h}`,`rotate${h.toUpperCase()}(${A})`),l("transform",o)]}),i(`rotate-${h}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("transform",o)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),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",h=>{if(h.modifier)return;let A=null;if(h.value?h.value.kind==="arbitrary"&&(A=h.value.value):A=o,A!==null)return[p(),l("transform",A)]}),i("transform",()=>[{hasDefaultValue:!0}]),e("transform-cpu",[["transform",o]]),e("transform-gpu",[["transform",`translateZ(0) ${o}`]]),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 o 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-${o}`,[["cursor",o]]);n("cursor",{themeKeys:["--cursor"],handle:o=>[l("cursor",o)]});for(let o of["auto","none","manipulation"])e(`touch-${o}`,[["touch-action",o]]);let g=()=>z([N("--tw-pan-x"),N("--tw-pan-y"),N("--tw-pinch-zoom")]);for(let o of["x","left","right"])e(`touch-pan-${o}`,[g,["--tw-pan-x",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["y","up","down"])e(`touch-pan-${o}`,[g,["--tw-pan-y",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);e("touch-pinch-zoom",[g,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["none","text","all","auto"])e(`select-${o}`,[["-webkit-user-select",o],["user-select",o]]);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=()=>z([N("--tw-scroll-snap-strictness","proximity","*")]);for(let o of["x","y","both"])e(`snap-${o}`,[w,["scroll-snap-type",`${o} 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[o,p]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(o,["--scroll-margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});for(let[o,p]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(o,["--scroll-padding","--spacing"],h=>[l(p,h)]);e("list-inside",[["list-style-position","inside"]]),e("list-outside",[["list-style-position","outside"]]),e("list-none",[["list-style-type","none"]]),e("list-disc",[["list-style-type","disc"]]),e("list-decimal",[["list-style-type","decimal"]]),n("list",{themeKeys:["--list-style-type"],handle:o=>[l("list-style-type",o)]}),e("list-image-none",[["list-style-image","none"]]),n("list-image",{themeKeys:["--list-style-image"],handle:o=>[l("list-style-image",o)]}),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"]]),e("columns-auto",[["columns","auto"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("columns",o)]}),i("columns",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--columns","--container"]}]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-before-${o}`,[["break-before",o]]);for(let o of["auto","avoid","avoid-page","avoid-column"])e(`break-inside-${o}`,[["break-inside",o]]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-after-${o}`,[["break-after",o]]);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"]]),e("auto-cols-auto",[["grid-auto-columns","auto"]]),e("auto-cols-min",[["grid-auto-columns","min-content"]]),e("auto-cols-max",[["grid-auto-columns","max-content"]]),e("auto-cols-fr",[["grid-auto-columns","minmax(0, 1fr)"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:o=>[l("grid-auto-columns",o)]}),e("auto-rows-auto",[["grid-auto-rows","auto"]]),e("auto-rows-min",[["grid-auto-rows","min-content"]]),e("auto-rows-max",[["grid-auto-rows","max-content"]]),e("auto-rows-fr",[["grid-auto-rows","minmax(0, 1fr)"]]),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:o=>[l("grid-auto-rows",o)]}),e("grid-cols-none",[["grid-template-columns","none"]]),e("grid-cols-subgrid",[["grid-template-columns","subgrid"]]),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:o})=>Pt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-columns",o)]}),e("grid-rows-none",[["grid-template-rows","none"]]),e("grid-rows-subgrid",[["grid-template-rows","subgrid"]]),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:o})=>Pt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-rows",o)]}),i("grid-cols",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(o,p)=>`${p+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"],o=>[l("gap",o)]),a("gap-x",["--gap","--spacing"],o=>[l("column-gap",o)]),a("gap-y",["--gap","--spacing"],o=>[l("row-gap",o)]),a("space-x",["--space","--spacing"],o=>[z([N("--tw-space-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","0"),l("margin-inline-start",`calc(${o} * var(--tw-space-x-reverse))`),l("margin-inline-end",`calc(${o} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),a("space-y",["--space","--spacing"],o=>[z([N("--tw-space-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","0"),l("margin-block-start",`calc(${o} * var(--tw-space-y-reverse))`),l("margin-block-end",`calc(${o} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),e("space-x-reverse",[()=>z([N("--tw-space-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","1")])]),e("space-y-reverse",[()=>z([N("--tw-space-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","1")])]),e("accent-auto",[["accent-color","auto"]]),s("accent",{themeKeys:["--accent-color","--color"],handle:o=>[l("accent-color",o)]}),s("caret",{themeKeys:["--caret-color","--color"],handle:o=>[l("caret-color",o)]}),s("divide",{themeKeys:["--divide-color","--color"],handle:o=>[M(":where(& > :not(:last-child))",[l("--tw-sort","divide-color"),l("border-color",o)])]}),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 o of["auto","hidden","clip","visible","scroll"])e(`overflow-${o}`,[["overflow",o]]),e(`overflow-x-${o}`,[["overflow-x",o]]),e(`overflow-y-${o}`,[["overflow-y",o]]);for(let o of["auto","contain","none"])e(`overscroll-${o}`,[["overscroll-behavior",o]]),e(`overscroll-x-${o}`,[["overscroll-behavior-x",o]]),e(`overscroll-y-${o}`,[["overscroll-behavior-y",o]]);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-words",[["overflow-wrap","break-word"]]),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[o,p]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"]]])e(`${o}-none`,p.map(h=>[h,"0"])),e(`${o}-full`,p.map(h=>[h,"calc(infinity * 1px)"])),n(o,{themeKeys:["--radius"],handle:h=>p.map(A=>l(A,h))});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 p=function(h,A){r.functional(h,k=>{if(!k.value){if(k.modifier)return;let C=t.get(["--default-border-width"])??"1px",O=A.width(C);return O?[o(),...O]:void 0}if(k.value.kind==="arbitrary"){let C=k.value.value;switch(k.value.dataType??Y(C,["color","line-width","length"])){case"line-width":case"length":{if(k.modifier)return;let $=A.width(C);return $?[o(),...$]:void 0}default:return C=X(C,k.modifier,t),C===null?void 0:A.color(C)}}{let C=te(k,t,["--border-color","--color"]);if(C)return A.color(C)}{if(k.modifier)return;let C=t.resolve(k.value.value,["--border-width"]);if(C){let O=A.width(C);return O?[o(),...O]:void 0}if(T(k.value.value)){let O=A.width(`${k.value.value}px`);return O?[o(),...O]:void 0}}}),i(h,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(k,C)=>`${C*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var _=p;let o=()=>z([N("--tw-border-style","solid")]);p("border",{width:h=>[l("border-style","var(--tw-border-style)"),l("border-width",h)],color:h=>[l("border-color",h)]}),p("border-x",{width:h=>[l("border-inline-style","var(--tw-border-style)"),l("border-inline-width",h)],color:h=>[l("border-inline-color",h)]}),p("border-y",{width:h=>[l("border-block-style","var(--tw-border-style)"),l("border-block-width",h)],color:h=>[l("border-block-color",h)]}),p("border-s",{width:h=>[l("border-inline-start-style","var(--tw-border-style)"),l("border-inline-start-width",h)],color:h=>[l("border-inline-start-color",h)]}),p("border-e",{width:h=>[l("border-inline-end-style","var(--tw-border-style)"),l("border-inline-end-width",h)],color:h=>[l("border-inline-end-color",h)]}),p("border-t",{width:h=>[l("border-top-style","var(--tw-border-style)"),l("border-top-width",h)],color:h=>[l("border-top-color",h)]}),p("border-r",{width:h=>[l("border-right-style","var(--tw-border-style)"),l("border-right-width",h)],color:h=>[l("border-right-color",h)]}),p("border-b",{width:h=>[l("border-bottom-style","var(--tw-border-style)"),l("border-bottom-width",h)],color:h=>[l("border-bottom-color",h)]}),p("border-l",{width:h=>[l("border-left-style","var(--tw-border-style)"),l("border-left-width",h)],color:h=>[l("border-left-color",h)]}),n("divide-x",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>T(h)?`${h}px`:null,handle:h=>[z([N("--tw-divide-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-x-width"),o(),l("--tw-divide-x-reverse","0"),l("border-inline-style","var(--tw-border-style)"),l("border-inline-start-width",`calc(${h} * var(--tw-divide-x-reverse))`),l("border-inline-end-width",`calc(${h} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>T(h)?`${h}px`:null,handle:h=>[z([N("--tw-divide-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-y-width"),o(),l("--tw-divide-y-reverse","0"),l("border-bottom-style","var(--tw-border-style)"),l("border-top-style","var(--tw-border-style)"),l("border-top-width",`calc(${h} * var(--tw-divide-y-reverse))`),l("border-bottom-width",`calc(${h} * 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",[()=>z([N("--tw-divide-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-x-reverse","1")])]),e("divide-y-reverse",[()=>z([N("--tw-divide-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-y-reverse","1")])]);for(let h of["solid","dashed","dotted","double","none"])e(`divide-${h}`,[()=>M(":where(& > :not(:last-child))",[l("--tw-sort","divide-style"),l("--tw-border-style",h),l("border-style",h)])])}e("bg-auto",[["background-size","auto"]]),e("bg-cover",[["background-size","cover"]]),e("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(o){if(o)return[l("background-size",o)]}}),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(o){if(o)return[l("background-position",o)]}}),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 h=function(C){let O="in oklab";if(C?.kind==="named")switch(C.value){case"longer":case"shorter":case"increasing":case"decreasing":O=`in oklch ${C.value} hue`;break;default:O=`in ${C.value}`}else C?.kind==="arbitrary"&&(O=C.value);return O},A=function({negative:C}){return O=>{if(!O.value)return;if(O.value.kind==="arbitrary"){if(O.modifier)return;let U=O.value.value;switch(O.value.dataType??Y(U,["angle"])){case"angle":return U=C?`calc(${U} * -1)`:`${U}`,[l("--tw-gradient-position",U),l("background-image",`linear-gradient(var(--tw-gradient-stops,${U}))`)];default:return C?void 0:[l("--tw-gradient-position",U),l("background-image",`linear-gradient(var(--tw-gradient-stops,${U}))`)]}}let $=O.value.value;if(!C&&p.has($))$=p.get($);else if(T($))$=C?`calc(${$}deg * -1)`:`${$}deg`;else return;let E=h(O.modifier);return[l("--tw-gradient-position",`${$}`),G("@supports (background-image: linear-gradient(in lab, red, red))",[l("--tw-gradient-position",`${$} ${E}`)]),l("background-image","linear-gradient(var(--tw-gradient-stops))")]}},k=function({negative:C}){return O=>{if(O.value?.kind==="arbitrary"){if(O.modifier)return;let U=O.value.value;return[l("--tw-gradient-position",U),l("background-image",`conic-gradient(var(--tw-gradient-stops,${U}))`)]}let $=h(O.modifier);if(!O.value)return[l("--tw-gradient-position",$),l("background-image","conic-gradient(var(--tw-gradient-stops))")];let E=O.value.value;if(T(E))return E=C?`calc(${E}deg * -1)`:`${E}deg`,[l("--tw-gradient-position",`from ${E} ${$}`),l("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var H=h,j=A,W=k;let o=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],p=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",A({negative:!0})),r.functional("bg-linear",A({negative:!1})),i("bg-linear",()=>[{values:[...p.keys()],modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),r.functional("-bg-conic",k({negative:!0})),r.functional("bg-conic",k({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),r.functional("bg-radial",C=>{if(!C.value){let O=h(C.modifier);return[l("--tw-gradient-position",O),l("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(C.value.kind==="arbitrary"){if(C.modifier)return;let O=C.value.value;return[l("--tw-gradient-position",O),l("background-image",`radial-gradient(var(--tw-gradient-stops,${O}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:o}])}r.functional("bg",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("background-position",p)];case"bg-size":case"length":case"size":return o.modifier?void 0:[l("background-size",p)];case"image":case"url":return o.modifier?void 0:[l("background-image",p)];default:return p=X(p,o.modifier,t),p===null?void 0:[l("background-color",p)]}}{let p=te(o,t,["--background-color","--color"]);if(p)return[l("background-color",p)]}{if(o.modifier)return;let p=t.resolve(o.value.value,["--background-image"]);if(p)return[l("background-image",p)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let v=()=>z([N("--tw-gradient-position"),N("--tw-gradient-from","#0000",""),N("--tw-gradient-via","#0000",""),N("--tw-gradient-to","#0000",""),N("--tw-gradient-stops"),N("--tw-gradient-via-stops"),N("--tw-gradient-from-position","0%",""),N("--tw-gradient-via-position","50%",""),N("--tw-gradient-to-position","100%","")]);function x(o,p){r.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??Y(A,["color","length","percentage"])){case"length":case"percentage":return h.modifier?void 0:p.position(A);default:return A=X(A,h.modifier,t),A===null?void 0:p.color(A)}}{let A=te(h,t,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=t.resolve(h.value.value,["--gradient-color-stop-positions"]);if(A)return p.position(A);if(h.value.value[h.value.value.length-1]==="%"&&T(h.value.value.slice(0,-1)))return p.position(h.value.value)}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}x("from",{color:o=>[v(),l("--tw-sort","--tw-gradient-from"),l("--tw-gradient-from",o),l("--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:o=>[v(),l("--tw-gradient-from-position",o)]}),e("via-none",[["--tw-gradient-via-stops","initial"]]),x("via",{color:o=>[v(),l("--tw-sort","--tw-gradient-via"),l("--tw-gradient-via",o),l("--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)"),l("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:o=>[v(),l("--tw-gradient-via-position",o)]}),x("to",{color:o=>[v(),l("--tw-sort","--tw-gradient-to"),l("--tw-gradient-to",o),l("--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:o=>[v(),l("--tw-gradient-to-position",o)]}),e("mask-none",[["mask-image","none"]]),r.functional("mask",o=>{if(!o.value||o.modifier||o.value.kind!=="arbitrary")return;let p=o.value.value;switch(o.value.dataType??Y(p,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("mask-position",p)];case"bg-size":case"length":case"size":return[l("mask-size",p)];case"image":case"url":default:return[l("mask-image",p)]}}),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(o){if(o)return[l("mask-size",o)]}}),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(o){if(o)return[l("mask-position",o)]}}),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 y=()=>z([N("--tw-mask-linear","linear-gradient(#fff, #fff)"),N("--tw-mask-radial","linear-gradient(#fff, #fff)"),N("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function V(o,p){r.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??Y(A,["length","percentage","color"])){case"color":return A=X(A,h.modifier,t),A===null?void 0:p.color(A);case"percentage":return h.modifier||!T(A.slice(0,-1))?void 0:p.position(A);default:return h.modifier?void 0:p.position(A)}}{let A=te(h,t,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=Y(h.value.value,["number","percentage"]);if(!A)return;switch(A){case"number":{let k=t.resolve(null,["--spacing"]);return!k||!xe(h.value.value)?void 0:p.position(`calc(${k} * ${h.value.value})`)}case"percentage":return T(h.value.value.slice(0,-1))?p.position(h.value.value):void 0;default:return}}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(o,()=>[{values:Array.from({length:21},(h,A)=>`${A*5}%`)},{values:t.get(["--spacing"])?at:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}let b=()=>z([N("--tw-mask-left","linear-gradient(#fff, #fff)"),N("--tw-mask-right","linear-gradient(#fff, #fff)"),N("--tw-mask-bottom","linear-gradient(#fff, #fff)"),N("--tw-mask-top","linear-gradient(#fff, #fff)")]);function S(o,p,h){V(o,{color(A){let k=[y(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(k.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),k.push(z([N(`--tw-mask-${C}-from-position`,"0%"),N(`--tw-mask-${C}-to-position`,"100%"),N(`--tw-mask-${C}-from-color`,"black"),N(`--tw-mask-${C}-to-color`,"transparent")])),k.push(l(`--tw-mask-${C}-${p}-color`,A)));return k},position(A){let k=[y(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(k.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),k.push(z([N(`--tw-mask-${C}-from-position`,"0%"),N(`--tw-mask-${C}-to-position`,"100%"),N(`--tw-mask-${C}-from-color`,"black"),N(`--tw-mask-${C}-to-color`,"transparent")])),k.push(l(`--tw-mask-${C}-${p}-position`,A)));return k}})}S("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),S("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let R=()=>z([N("--tw-mask-linear-position","0deg"),N("--tw-mask-linear-from-position","0%"),N("--tw-mask-linear-to-position","100%"),N("--tw-mask-linear-from-color","black"),N("--tw-mask-linear-to-color","transparent")]);n("mask-linear",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(o){return T(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return T(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),l("--tw-mask-linear-position",o)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),V("mask-linear-from",{color:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-color",o)],position:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-position",o)]}),V("mask-linear-to",{color:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-color",o)],position:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-position",o)]});let L=()=>z([N("--tw-mask-radial-from-position","0%"),N("--tw-mask-radial-to-position","100%"),N("--tw-mask-radial-from-color","black"),N("--tw-mask-radial-to-color","transparent"),N("--tw-mask-radial-shape","ellipse"),N("--tw-mask-radial-size","farthest-corner"),N("--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:o=>[l("--tw-mask-radial-position",o)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),l("--tw-mask-radial-size",o)]}),V("mask-radial-from",{color:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-color",o)],position:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-position",o)]}),V("mask-radial-to",{color:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-color",o)],position:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-position",o)]});let P=()=>z([N("--tw-mask-conic-position","0deg"),N("--tw-mask-conic-from-position","0%"),N("--tw-mask-conic-to-position","100%"),N("--tw-mask-conic-from-color","black"),N("--tw-mask-conic-to-color","transparent")]);n("mask-conic",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(o){return T(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return T(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),l("--tw-mask-conic-position",o)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),V("mask-conic-from",{color:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-color",o)],position:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-position",o)]}),V("mask-conic-to",{color:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-color",o)],position:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-position",o)]}),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 o of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])e(`bg-blend-${o}`,[["background-blend-mode",o]]),e(`mix-blend-${o}`,[["mix-blend-mode",o]]);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",o=>{if(!o.value)return;if(o.value.kind==="arbitrary"){let h=X(o.value.value,o.modifier,t);return h===null?void 0:[l("fill",h)]}let p=te(o,t,["--fill","--color"]);if(p)return[l("fill",p)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)}]),e("stroke-none",[["stroke","none"]]),r.functional("stroke",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","number","length","percentage"])){case"number":case"length":case"percentage":return o.modifier?void 0:[l("stroke-width",p)];default:return p=X(o.value.value,o.modifier,t),p===null?void 0:[l("stroke",p)]}}{let p=te(o,t,["--stroke","--color"]);if(p)return[l("stroke",p)]}{let p=t.resolve(o.value.value,["--stroke-width"]);if(p)return[l("stroke-width",p)];if(T(o.value.value))return[l("stroke-width",o.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*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"]]),e("object-top",[["object-position","top"]]),e("object-top-left",[["object-position","left top"]]),e("object-top-right",[["object-position","right top"]]),e("object-bottom",[["object-position","bottom"]]),e("object-bottom-left",[["object-position","left bottom"]]),e("object-bottom-right",[["object-position","right bottom"]]),e("object-left",[["object-position","left"]]),e("object-right",[["object-position","right"]]),e("object-center",[["object-position","center"]]),n("object",{themeKeys:["--object-position"],handle:o=>[l("object-position",o)]});for(let[o,p]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(o,["--padding","--spacing"],h=>[l(p,h)]);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"],o=>[l("text-indent",o)],{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:o=>[l("vertical-align",o)]}),r.functional("font",o=>{if(!(!o.value||o.modifier)){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[l("font-family",p)];default:return[z([N("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}{let p=t.resolveWith(o.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(p){let[h,A={}]=p;return[l("font-family",h),l("font-feature-settings",A["--font-feature-settings"]),l("font-variation-settings",A["--font-variation-settings"])]}}{let p=t.resolve(o.value.value,["--font-weight"]);if(p)return[z([N("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}}),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:o})=>{if(!o.endsWith("%"))return null;let p=Number(o.slice(0,-1));return!T(p)||Number.isNaN(p)||p<50||p>200?null:o},handle:o=>[l("font-stretch",o)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),s("placeholder",{themeKeys:["--background-color","--color"],handle:o=>[M("&::placeholder",[l("--tw-sort","placeholder-color"),l("color",o)])]}),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",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","length","percentage"])){case"length":case"percentage":return o.modifier?void 0:[l("text-decoration-thickness",p)];default:return p=X(p,o.modifier,t),p===null?void 0:[l("text-decoration-color",p)]}}{let p=t.resolve(o.value.value,["--text-decoration-thickness"]);if(p)return o.modifier?void 0:[l("text-decoration-thickness",p)];if(T(o.value.value))return o.modifier?void 0:[l("text-decoration-thickness",`${o.value.value}px`)]}{let p=te(o,t,["--text-decoration-color","--color"]);if(p)return[l("text-decoration-color",p)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),e("animate-none",[["animation","none"]]),n("animate",{themeKeys:["--animate"],handle:o=>[l("animation",o)]});{let o=["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(" "),p=["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(" "),h=()=>z([N("--tw-blur"),N("--tw-brightness"),N("--tw-contrast"),N("--tw-grayscale"),N("--tw-hue-rotate"),N("--tw-invert"),N("--tw-opacity"),N("--tw-saturate"),N("--tw-sepia"),N("--tw-drop-shadow"),N("--tw-drop-shadow-color"),N("--tw-drop-shadow-alpha","100%",""),N("--tw-drop-shadow-size")]),A=()=>z([N("--tw-backdrop-blur"),N("--tw-backdrop-brightness"),N("--tw-backdrop-contrast"),N("--tw-backdrop-grayscale"),N("--tw-backdrop-hue-rotate"),N("--tw-backdrop-invert"),N("--tw-backdrop-opacity"),N("--tw-backdrop-saturate"),N("--tw-backdrop-sepia")]);r.functional("filter",k=>{if(!k.modifier){if(k.value===null)return[h(),l("filter",o)];if(k.value.kind==="arbitrary")return[l("filter",k.value.value)];switch(k.value.value){case"none":return[l("filter","none")]}}}),r.functional("backdrop-filter",k=>{if(!k.modifier){if(k.value===null)return[A(),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)];if(k.value.kind==="arbitrary")return[l("-webkit-backdrop-filter",k.value.value),l("backdrop-filter",k.value.value)];switch(k.value.value){case"none":return[l("-webkit-backdrop-filter","none"),l("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:k=>[h(),l("--tw-blur",`blur(${k})`),l("filter",o)]}),e("blur-none",[h,["--tw-blur"," "],["filter",o]]),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:k=>[A(),l("--tw-backdrop-blur",`blur(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),e("backdrop-blur-none",[A,["--tw-backdrop-blur"," "],["-webkit-backdrop-filter",p],["backdrop-filter",p]]),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-brightness",`brightness(${k})`),l("filter",o)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-brightness",`brightness(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-contrast",`contrast(${k})`),l("filter",o)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-contrast",`contrast(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-grayscale",`grayscale(${k})`),l("filter",o)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-grayscale",`grayscale(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}deg`:null,handle:k=>[h(),l("--tw-hue-rotate",`hue-rotate(${k})`),l("filter",o)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:k})=>T(k)?`${k}deg`:null,handle:k=>[A(),l("--tw-backdrop-hue-rotate",`hue-rotate(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-invert",`invert(${k})`),l("filter",o)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-invert",`invert(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-saturate",`saturate(${k})`),l("filter",o)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-saturate",`saturate(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-sepia",`sepia(${k})`),l("filter",o)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-sepia",`sepia(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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",[h,["--tw-drop-shadow"," "],["filter",o]]),r.functional("drop-shadow",k=>{let C;if(k.modifier&&(k.modifier.kind==="arbitrary"?C=k.modifier.value:T(k.modifier.value)&&(C=`${k.modifier.value}%`)),!k.value){let O=t.get(["--drop-shadow"]),$=t.resolve(null,["--drop-shadow"]);return O===null||$===null?void 0:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow",D($,",").map(E=>`drop-shadow(${E})`).join(" ")),l("filter",o)]}if(k.value.kind==="arbitrary"){let O=k.value.value;switch(k.value.dataType??Y(O,["color"])){case"color":return O=X(O,k.modifier,t),O===null?void 0:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return k.modifier&&!C?void 0:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]}}{let O=t.get([`--drop-shadow-${k.value.value}`]),$=t.resolve(k.value.value,["--drop-shadow"]);if(O&&$)return k.modifier&&!C?void 0:C?[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow",D($,",").map(E=>`drop-shadow(${E})`).join(" ")),l("filter",o)]}{let O=te(k,t,["--drop-shadow-color","--color"]);if(O)return O==="inherit"?[h(),l("--tw-drop-shadow-color","inherit"),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--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},(k,C)=>`${C*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:k})=>ot(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-opacity",`opacity(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(k,C)=>`${C*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let o=`var(--tw-ease, ${t.resolve(null,["--default-transition-timing-function"])??"ease"})`,p=`var(--tw-duration, ${t.resolve(null,["--default-transition-duration"])??"0s"})`;e("transition-none",[["transition-property","none"]]),e("transition-all",[["transition-property","all"],["transition-timing-function",o],["transition-duration",p]]),e("transition-colors",[["transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"],["transition-timing-function",o],["transition-duration",p]]),e("transition-opacity",[["transition-property","opacity"],["transition-timing-function",o],["transition-duration",p]]),e("transition-shadow",[["transition-property","box-shadow"],["transition-timing-function",o],["transition-duration",p]]),e("transition-transform",[["transition-property","transform, translate, scale, rotate"],["transition-timing-function",o],["transition-duration",p]]),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, visibility, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:h=>[l("transition-property",h),l("transition-timing-function",o),l("transition-duration",p)]}),e("transition-discrete",[["transition-behavior","allow-discrete"]]),e("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:h})=>T(h)?`${h}ms`:null,themeKeys:["--transition-delay"],handle:h=>[l("transition-delay",h)]});{let h=()=>z([N("--tw-duration")]);e("duration-initial",[h,["--tw-duration","initial"]]),r.functional("duration",A=>{if(A.modifier||!A.value)return;let k=null;if(A.value.kind==="arbitrary"?k=A.value.value:(k=t.resolve(A.value.fraction??A.value.value,["--transition-duration"]),k===null&&T(A.value.value)&&(k=`${A.value.value}ms`)),k!==null)return[h(),l("--tw-duration",k),l("transition-duration",k)]})}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 o=()=>z([N("--tw-ease")]);e("ease-initial",[o,["--tw-ease","initial"]]),e("ease-linear",[o,["--tw-ease","linear"],["transition-timing-function","linear"]]),n("ease",{themeKeys:["--ease"],handle:p=>[o(),l("--tw-ease",p),l("transition-timing-function",p)]})}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:o=>[l("will-change",o)]}),e("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:[],handle:o=>[z([N("--tw-content",'""')]),l("--tw-content",o),l("content","var(--tw-content)")]});{let o="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",p=()=>z([N("--tw-contain-size"),N("--tw-contain-layout"),N("--tw-contain-paint"),N("--tw-contain-style")]);e("contain-none",[["contain","none"]]),e("contain-content",[["contain","content"]]),e("contain-strict",[["contain","strict"]]),e("contain-size",[p,["--tw-contain-size","size"],["contain",o]]),e("contain-inline-size",[p,["--tw-contain-size","inline-size"],["contain",o]]),e("contain-layout",[p,["--tw-contain-layout","layout"],["contain",o]]),e("contain-paint",[p,["--tw-contain-paint","paint"],["contain",o]]),e("contain-style",[p,["--tw-contain-style","style"],["contain",o]]),n("contain",{themeKeys:[],handle:h=>[l("contain",h)]})}e("forced-color-adjust-none",[["forced-color-adjust","none"]]),e("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),e("leading-none",[()=>z([N("--tw-leading")]),["--tw-leading","1"],["line-height","1"]]),a("leading",["--leading","--spacing"],o=>[z([N("--tw-leading")]),l("--tw-leading",o),l("line-height",o)]),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:o=>[z([N("--tw-tracking")]),l("--tw-tracking",o),l("letter-spacing",o)]}),e("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),e("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let o="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",p=()=>z([N("--tw-ordinal"),N("--tw-slashed-zero"),N("--tw-numeric-figure"),N("--tw-numeric-spacing"),N("--tw-numeric-fraction")]);e("normal-nums",[["font-variant-numeric","normal"]]),e("ordinal",[p,["--tw-ordinal","ordinal"],["font-variant-numeric",o]]),e("slashed-zero",[p,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",o]]),e("lining-nums",[p,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",o]]),e("oldstyle-nums",[p,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",o]]),e("proportional-nums",[p,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",o]]),e("tabular-nums",[p,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",o]]),e("diagonal-fractions",[p,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",o]]),e("stacked-fractions",[p,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",o]])}{let o=()=>z([N("--tw-outline-style","solid")]);r.static("outline-hidden",()=>[l("--tw-outline-style","none"),l("outline-style","none"),F("@media","(forced-colors: active)",[l("outline","2px solid transparent"),l("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",p=>{if(p.value===null){if(p.modifier)return;let h=t.get(["--default-outline-width"])??"1px";return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)]}if(p.value.kind==="arbitrary"){let h=p.value.value;switch(p.value.dataType??Y(h,["color","length","number","percentage"])){case"length":case"number":case"percentage":return p.modifier?void 0:[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];default:return h=X(h,p.modifier,t),h===null?void 0:[l("outline-color",h)]}}{let h=te(p,t,["--outline-color","--color"]);if(h)return[l("outline-color",h)]}{if(p.modifier)return;let h=t.resolve(p.value.value,["--outline-width"]);if(h)return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];if(T(p.value.value))return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",`${p.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(p,h)=>`${h*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:p})=>T(p)?`${p}px`:null,handle:p=>[l("outline-offset",p)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:o})=>ot(o)?`${o}%`:null,handle:o=>[l("opacity",o)]}),i("opacity",()=>[{values:Array.from({length:21},(o,p)=>`${p*5}`),valueThemeKeys:["--opacity"]}]),e("underline-offset-auto",[["text-underline-offset","auto"]]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:o})=>T(o)?`${o}px`:null,handle:o=>[l("text-underline-offset",o)]}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),r.functional("text",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(o.modifier){let A=o.modifier.kind==="arbitrary"?o.modifier.value:t.resolve(o.modifier.value,["--leading"]);if(!A&&xe(o.modifier.value)){let k=t.resolve(null,["--spacing"]);if(!k)return null;A=`calc(${k} * ${o.modifier.value})`}return!A&&o.modifier.value==="none"&&(A="1"),A?[l("font-size",p),l("line-height",A)]:null}return[l("font-size",p)]}default:return p=X(p,o.modifier,t),p===null?void 0:[l("color",p)]}}{let p=te(o,t,["--text-color","--color"]);if(p)return[l("color",p)]}{let p=t.resolveWith(o.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(p){let[h,A={}]=Array.isArray(p)?p:[p];if(o.modifier){let k=o.modifier.kind==="arbitrary"?o.modifier.value:t.resolve(o.modifier.value,["--leading"]);if(!k&&xe(o.modifier.value)){let O=t.resolve(null,["--spacing"]);if(!O)return null;k=`calc(${O} * ${o.modifier.value})`}if(!k&&o.modifier.value==="none"&&(k="1"),!k)return null;let C=[l("font-size",h)];return k&&C.push(l("line-height",k)),C}return typeof A=="string"?[l("font-size",h),l("line-height",A)]:[l("font-size",h),l("line-height",A["--line-height"]?`var(--tw-leading, ${A["--line-height"]})`:void 0),l("letter-spacing",A["--letter-spacing"]?`var(--tw-tracking, ${A["--letter-spacing"]})`:void 0),l("font-weight",A["--font-weight"]?`var(--tw-font-weight, ${A["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let K=()=>z([N("--tw-text-shadow-color"),N("--tw-text-shadow-alpha","100%","")]);e("text-shadow-initial",[K,["--tw-text-shadow-color","initial"]]),r.functional("text-shadow",o=>{let p;if(o.modifier&&(o.modifier.kind==="arbitrary"?p=o.modifier.value:T(o.modifier.value)&&(p=`${o.modifier.value}%`)),!o.value){let h=t.get(["--text-shadow"]);return h===null?void 0:[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}if(o.value.kind==="arbitrary"){let h=o.value.value;switch(o.value.dataType??Y(h,["color"])){case"color":return h=X(h,o.modifier,t),h===null?void 0:[K(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))];default:return[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,k=>`var(--tw-text-shadow-color, ${k})`)]}}switch(o.value.value){case"none":return o.modifier?void 0:[K(),l("text-shadow","none")];case"inherit":return o.modifier?void 0:[K(),l("--tw-text-shadow-color","inherit")]}{let h=t.get([`--text-shadow-${o.value.value}`]);if(h)return[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}{let h=te(o,t,["--text-shadow-color","--color"]);if(h)return[K(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`),hasDefaultValue:t.get(["--text-shadow"])!==null}]);{let k=function($){return`var(--tw-ring-inset,) 0 0 0 calc(${$} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${A})`},C=function($){return`inset 0 0 0 ${$} var(--tw-inset-ring-color, currentcolor)`};var J=k,ie=C;let o=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),p="0 0 #0000",h=()=>z([N("--tw-shadow",p),N("--tw-shadow-color"),N("--tw-shadow-alpha","100%",""),N("--tw-inset-shadow",p),N("--tw-inset-shadow-color"),N("--tw-inset-shadow-alpha","100%",""),N("--tw-ring-color"),N("--tw-ring-shadow",p),N("--tw-inset-ring-color"),N("--tw-inset-ring-shadow",p),N("--tw-ring-inset"),N("--tw-ring-offset-width","0px",""),N("--tw-ring-offset-color","#fff"),N("--tw-ring-offset-shadow",p)]);e("shadow-initial",[h,["--tw-shadow-color","initial"]]),r.functional("shadow",$=>{let E;if($.modifier&&($.modifier.kind==="arbitrary"?E=$.modifier.value:T($.modifier.value)&&(E=`${$.modifier.value}%`)),!$.value){let U=t.get(["--shadow"]);return U===null?void 0:[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,ae=>`var(--tw-shadow-color, ${ae})`),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let U=$.value.value;switch($.value.dataType??Y(U,["color"])){case"color":return U=X(U,$.modifier,t),U===null?void 0:[h(),l("--tw-shadow-color",Q(U,"var(--tw-shadow-alpha)"))];default:return[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,wt=>`var(--tw-shadow-color, ${wt})`),l("box-shadow",o)]}}switch($.value.value){case"none":return $.modifier?void 0:[h(),l("--tw-shadow",p),l("box-shadow",o)];case"inherit":return $.modifier?void 0:[h(),l("--tw-shadow-color","inherit")]}{let U=t.get([`--shadow-${$.value.value}`]);if(U)return[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,ae=>`var(--tw-shadow-color, ${ae})`),l("box-shadow",o)]}{let U=te($,t,["--box-shadow-color","--color"]);if(U)return[h(),l("--tw-shadow-color",Q(U,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},($,E)=>`${E*5}`),hasDefaultValue:t.get(["--shadow"])!==null}]),e("inset-shadow-initial",[h,["--tw-inset-shadow-color","initial"]]),r.functional("inset-shadow",$=>{let E;if($.modifier&&($.modifier.kind==="arbitrary"?E=$.modifier.value:T($.modifier.value)&&(E=`${$.modifier.value}%`)),!$.value){let U=t.get(["--inset-shadow"]);return U===null?void 0:[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,ae=>`var(--tw-inset-shadow-color, ${ae})`),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let U=$.value.value;switch($.value.dataType??Y(U,["color"])){case"color":return U=X(U,$.modifier,t),U===null?void 0:[h(),l("--tw-inset-shadow-color",Q(U,"var(--tw-inset-shadow-alpha)"))];default:return[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,wt=>`var(--tw-inset-shadow-color, ${wt})`,"inset "),l("box-shadow",o)]}}switch($.value.value){case"none":return $.modifier?void 0:[h(),l("--tw-inset-shadow",p),l("box-shadow",o)];case"inherit":return $.modifier?void 0:[h(),l("--tw-inset-shadow-color","inherit")]}{let U=t.get([`--inset-shadow-${$.value.value}`]);if(U)return[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,ae=>`var(--tw-inset-shadow-color, ${ae})`),l("box-shadow",o)]}{let U=te($,t,["--box-shadow-color","--color"]);if(U)return[h(),l("--tw-inset-shadow-color",Q(U,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},($,E)=>`${E*5}`),hasDefaultValue:t.get(["--inset-shadow"])!==null}]),e("ring-inset",[h,["--tw-ring-inset","inset"]]);let A=t.get(["--default-ring-color"])??"currentcolor";r.functional("ring",$=>{if(!$.value){if($.modifier)return;let E=t.get(["--default-ring-width"])??"1px";return[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-ring-color",E)]}}{let E=te($,t,["--ring-color","--color"]);if(E)return[l("--tw-ring-color",E)]}{if($.modifier)return;let E=t.resolve($.value.value,["--ring-width"]);if(E===null&&T($.value.value)&&(E=`${$.value.value}px`),E)return[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),r.functional("inset-ring",$=>{if(!$.value)return $.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C("1px")),l("box-shadow",o)];if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C(E)),l("box-shadow",o)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-inset-ring-color",E)]}}{let E=te($,t,["--ring-color","--color"]);if(E)return[l("--tw-inset-ring-color",E)]}{if($.modifier)return;let E=t.resolve($.value.value,["--ring-width"]);if(E===null&&T($.value.value)&&(E=`${$.value.value}px`),E)return[h(),l("--tw-inset-ring-shadow",C(E)),l("box-shadow",o)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let O="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";r.functional("ring-offset",$=>{if($.value){if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[l("--tw-ring-offset-width",E),l("--tw-ring-offset-shadow",O)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-ring-offset-color",E)]}}{let E=t.resolve($.value.value,["--ring-offset-width"]);if(E)return $.modifier?void 0:[l("--tw-ring-offset-width",E),l("--tw-ring-offset-shadow",O)];if(T($.value.value))return $.modifier?void 0:[l("--tw-ring-offset-width",`${$.value.value}px`),l("--tw-ring-offset-shadow",O)]}{let E=te($,t,["--ring-offset-color","--color"]);if(E)return[l("--tw-ring-offset-color",E)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),r.functional("@container",o=>{let p=null;if(o.value===null?p="inline-size":o.value.kind==="arbitrary"?p=o.value.value:o.value.kind==="named"&&o.value.value==="normal"&&(p="normal"),p!==null)return o.modifier?[l("container-type",p),l("container-name",o.modifier.value)]:[l("container-type",p)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),r}var _t=["number","integer","ratio","percentage"];function Sr(t){let r=t.params;return kn.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=q(n.value);ee(s,a=>{if(a.kind!=="function")return;if(a.value==="--spacing"&&!(e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return ee(a.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let c=u.value;for(let d of u.nodes)if(d.kind==="word"){if(d.value==="integer")e[c].usedSpacingInteger||=!0;else if(d.value==="number"&&(e[c].usedSpacingNumber||=!0,e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return 2}}),0;if(a.value!=="--value"&&a.value!=="--modifier")return;let f=D(Z(a.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;a.nodes=q(f.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 c=u.value.slice(1,-1);e[a.value].literals.add(c)}else if(u.kind==="word"&&u.value[0]==="-"&&u.value[1]==="-"){let c=u.value.replace(/-\*.*$/g,"");e[a.value].themeKeys.add(c)}else if(u.kind==="word"&&!(u.value[0]==="["&&u.value[u.value.length-1]==="]")&&!_t.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${_t.map(x=>`"${x}"`).join(", ")}. +`);let c=u.value,d=structuredClone(a),m="\xB6";ee(d.nodes,(x,{replaceWith:y})=>{x.kind==="word"&&x.value===c&&y({kind:"word",value:m})});let g="^".repeat(Z([u]).length),w=Z([d]).indexOf(m),v=["```css",Z([a])," ".repeat(w)+g,"```"].join(` +`);console.warn(v)}}),n.value=Z(s)}),i.utilities.functional(r.slice(0,-2),n=>{let s=structuredClone(t),a=n.value,f=n.modifier;if(a===null)return;let u=!1,c=!1,d=!1,m=!1,g=new Map,w=!1;if(I([s],(v,{parent:x,replaceWith:y})=>{if(x?.kind!=="rule"&&x?.kind!=="at-rule"||v.kind!=="declaration"||!v.value)return;let V=q(v.value);(ee(V,(S,{replaceWith:R})=>{if(S.kind==="function"){if(S.value==="--value"){u=!0;let L=Cr(a,S,i);return L?(c=!0,L.ratio?w=!0:g.set(v,x),R(L.nodes),1):(u||=!1,y([]),2)}else if(S.value==="--modifier"){if(f===null)return y([]),2;d=!0;let L=Cr(f,S,i);return L?(m=!0,R(L.nodes),1):(d||=!1,y([]),2)}}})??0)===0&&(v.value=Z(V))}),u&&!c||d&&!m||w&&m||f&&!w&&!m)return null;if(w)for(let[v,x]of g){let y=x.nodes.indexOf(v);y!==-1&&x.nodes.splice(y,1)}return s.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:f,usedSpacingNumber:u,usedSpacingInteger:c,themeKeys:d}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let m of f)a.push(m);if(u)a.push(...at);else if(c)for(let m of at)T(m)&&a.push(m);for(let m of i.theme.keysInNamespaces(d))a.push(m.replace($r,(g,w,v)=>`${w}.${v}`))}return[{values:n,modifiers:s}]})}:wn.test(r)?i=>{i.utilities.static(r,()=>structuredClone(t.nodes))}:null}function Cr(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:q(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:q(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],f=i.theme.resolveWith(t.value,a,s);if(f){let[,u={}]=f;{let c=u[s.pop()];if(c)return{nodes:q(c)}}}}}else if(t.kind==="named"&&e.kind==="word"){if(!_t.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in t?t.fraction:t.value;if(!n)continue;let s=Y(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[a,f]=D(n,"/");if(!T(a)||!T(f))continue}else{if(s==="number"&&!xe(n))continue;if(s==="percentage"&&!T(n.slice(0,-1)))continue}return{nodes:q(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:q(t.value)};if("dataType"in t&&t.dataType&&t.dataType!==n)continue;if("dataType"in t&&t.dataType)return{nodes:q(t.value)};if(Y(t.value,[n])!==null)return{nodes:q(t.value)}}}}function pe(t,r,i,e,n=""){let s=!1,a=Ue(r,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Nr(u,i))));function f(u){return n?D(u,",").map(c=>n+c).join(","):u}return s?[l(t,f(Ue(r,e))),G("@supports (color: lab(from red l a b))",[l(t,f(a))])]:[l(t,f(a))]}function lt(t,r,i,e,n=""){let s=!1,a=D(r,",").map(f=>Ue(f,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Nr(u,i))))).map(f=>`drop-shadow(${f})`).join(" ");return s?[l(t,n+D(r,",").map(f=>`drop-shadow(${Ue(f,e)})`).join(" ")),G("@supports (color: lab(from red l a b))",[l(t,n+a)])]:[l(t,n+a)]}var Dt={"--alpha":bn,"--spacing":yn,"--theme":xn,theme:An};function bn(t,r,i,...e){let[n,s]=D(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 yn(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 xn(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 f=q(s);return Nn(f,a),Z(f)}return s}function An(t,r,i,...e){i=Cn(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 Er=new RegExp(Object.keys(Dt).map(t=>`${t}\\(`).join("|"));function Ve(t,r){let i=0;return I(t,e=>{if(e.kind==="declaration"&&e.value&&Er.test(e.value)){i|=8,e.value=Tr(e.value,e,r);return}e.kind==="at-rule"&&(e.name==="@media"||e.name==="@custom-media"||e.name==="@container"||e.name==="@supports")&&Er.test(e.params)&&(i|=8,e.params=Tr(e.params,e,r))}),i}function Tr(t,r,i){let e=q(t);return ee(e,(n,{replaceWith:s})=>{if(n.kind==="function"&&n.value in Dt){let a=D(Z(n.nodes).trim(),",").map(u=>u.trim()),f=Dt[n.value](i,r,...a);return s(q(f))}}),Z(e)}function Cn(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 st(t,r){let i=t.length,e=r.length,n=i=48&&a<=57&&f>=48&&f<=57){let u=s,c=s+1,d=s,m=s+1;for(a=t.charCodeAt(c);a>=48&&a<=57;)a=t.charCodeAt(++c);for(f=r.charCodeAt(m);f>=48&&f<=57;)f=r.charCodeAt(++m);let g=t.slice(u,c),w=r.slice(d,m),v=Number(g)-Number(w);if(v)return v;if(gw)return 1;continue}if(a!==f)return a-f}return t.length-r.length}var $n=/^\d+\/\d+$/;function Rr(t){let r=new B(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of t.utilities.keys("static")){let s=r.get(n);s.fraction=!1,s.modifiers=[]}for(let n of t.utilities.keys("functional")){let s=t.utilities.getCompletions(n);for(let a of s)for(let f of a.values){let u=f!==null&&$n.test(f),c=f===null?n:`${n}-${f}`,d=r.get(c);if(d.utility=n,d.fraction||=u,d.modifiers.push(...a.modifiers),a.supportsNegative){let m=r.get(`-${c}`);m.utility=`-${n}`,m.fraction||=u,m.modifiers.push(...a.modifiers)}}}if(r.size===0)return[];let i=Array.from(r.values());return i.sort((n,s)=>st(n.name,s.name)),Vn(i)}function Vn(t){let r=[],i=null,e=new Map,n=new B(()=>[]);for(let a of t){let{utility:f,fraction:u}=a;i||(i={utility:f,items:[]},e.set(f,i)),f!==i.utility&&(r.push(i),i={utility:f,items:[]},e.set(f,i)),u?n.get(f).push(a):i.items.push(a)}i&&r[r.length-1]!==i&&r.push(i);for(let[a,f]of n){let u=e.get(a);u&&u.items.push(...f)}let s=[];for(let a of r)for(let f of a.items)s.push([f.name,{modifiers:f.modifiers}]);return s}function Pr(t){let r=[];for(let[e,n]of t.variants.entries()){let f=function({value:u,modifier:c}={}){let d=e;u&&(d+=s?`-${u}`:u),c&&(d+=`/${c}`);let m=t.parseVariant(d);if(!m)return[];let g=M(".__placeholder__",[]);if(Ee(g,m,t.variants)===null)return[];let w=[];return Xe(g.nodes,(v,{path:x})=>{if(v.kind!=="rule"&&v.kind!=="at-rule"||v.nodes.length>0)return;x.sort((b,S)=>{let R=b.kind==="at-rule",L=S.kind==="at-rule";return R&&!L?-1:!R&&L?1:0});let y=x.flatMap(b=>b.kind==="rule"?b.selector==="&"?[]:[b.selector]:b.kind==="at-rule"?[`${b.name} ${b.params}`]:[]),V="";for(let b=y.length-1;b>=0;b--)V=V===""?y[b]:`${y[b]} { ${V} }`;w.push(V)}),w};var i=f;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:f});break}case"functional":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:f});break}case"compound":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:f});break}}}return r}function Or(t,r){let{astNodes:i,nodeSorting:e}=ge(Array.from(r),t),n=new Map(r.map(a=>[a,null])),s=0n;for(let a of i){let f=e.get(a)?.candidate;f&&n.set(f,n.get(f)??s++)}return r.map(a=>[a,n.get(a)??null])}var ut=/^@?[a-zA-Z0-9_-]*$/;var Kt=class{compareFns=new Map;variants=new Map;completions=new Map;groupOrder=null;lastOrder=0;static(r,i,{compounds:e,order:n}={}){this.set(r,{kind:"static",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}fromAst(r,i){let e=[];I(i,n=>{n.kind==="rule"?e.push(n.selector):n.kind==="at-rule"&&n.name!=="@slot"&&e.push(`${n.name} ${n.params}`)}),this.static(r,n=>{let s=structuredClone(i);Ut(s,n.nodes),n.nodes=s},{compounds:Ae(e)})}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:Ae([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{g.nodes=d.map(w=>G(w,g.nodes))},{compounds:m})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function e(c,d){return d.map(m=>{m=m.trim();let g=D(m," ");return g[0]==="not"?g.slice(1).join(" "):c==="@container"?g[0][0]==="("?`not ${m}`:g[1]==="not"?`${g[0]} ${g.slice(2).join(" ")}`:`${g[0]} not ${g.slice(1).join(" ")}`:`not ${m}`})}let n=["@media","@supports","@container"];function s(c){for(let d of n){if(d!==c.name)continue;let m=D(c.params,",");return m.length>1?null:(m=e(c.name,m),F(c.name,m.join(", ")))}return null}function a(c){return c.includes("::")?null:`&:not(${D(c,",").map(m=>(m=m.replaceAll("&","*"),m)).join(", ")})`}r.compound("not",3,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative||d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule"&&g.kind!=="at-rule")return 0;if(g.nodes.length>0)return 0;let v=[],x=[];for(let V of w)V.kind==="at-rule"?v.push(V):V.kind==="rule"&&x.push(V);if(v.length>1)return 2;if(x.length>1)return 2;let y=[];for(let V of x){let b=a(V.selector);if(!b)return m=!1,2;y.push(M(b,[]))}for(let V of v){let b=s(V);if(!b)return m=!1,2;y.push(b)}return Object.assign(c,M("&",y)),m=!0,1}),c.kind==="rule"&&c.selector==="&"&&c.nodes.length===1&&Object.assign(c,c.nodes[0]),!m)return null}),r.suggest("not",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("not",c))),r.compound("group",2,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative)return null;let m=d.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}group\\/${d.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}group)`,g=!1;if(I([c],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let y of v.slice(0,-1))if(y.kind==="rule")return g=!1,2;let x=w.selector.replaceAll("&",m);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} *)`,g=!0}),!g)return null}),r.suggest("group",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("group",c))),r.compound("peer",2,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative)return null;let m=d.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}peer\\/${d.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}peer)`,g=!1;if(I([c],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let y of v.slice(0,-1))if(y.kind==="rule")return g=!1,2;let x=w.selector.replaceAll("&",m);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} ~ *)`,g=!0}),!g)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 z([F("@property","--tw-content",[l("syntax",'"*"'),l("initial-value",'""'),l("inherits","false")])])};var f=c;r.static("before",d=>{d.nodes=[M("&::before",[c(),l("content","var(--tw-content)"),...d.nodes])]},{compounds:0}),r.static("after",d=>{d.nodes=[M("&::after",[c(),l("content","var(--tw-content)"),...d.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=[M("&: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,d)=>{if(d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return m=!1,2;g.selector=`:where(${g.selector.replaceAll("&","*")}) &`,m=!0}),!m)return null}),r.suggest("in",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("in",c))),r.compound("has",2,(c,d)=>{if(d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return m=!1,2;g.selector=`&:has(${g.selector.replaceAll("&","*")})`,m=!0}),!m)return null}),r.suggest("has",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("has",c))),r.functional("aria",(c,d)=>{if(!d.value||d.modifier)return null;d.value.kind==="arbitrary"?c.nodes=[M(`&[aria-${_r(d.value.value)}]`,c.nodes)]:c.nodes=[M(`&[aria-${d.value.value}="true"]`,c.nodes)]}),r.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),r.functional("data",(c,d)=>{if(!d.value||d.modifier)return null;c.nodes=[M(`&[data-${_r(d.value.value)}]`,c.nodes)]}),r.functional("nth",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-child(${d.value.value})`,c.nodes)]}),r.functional("nth-last",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-last-child(${d.value.value})`,c.nodes)]}),r.functional("nth-of-type",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-of-type(${d.value.value})`,c.nodes)]}),r.functional("nth-last-of-type",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-last-of-type(${d.value.value})`,c.nodes)]}),r.functional("supports",(c,d)=>{if(!d.value||d.modifier)return null;let m=d.value.value;if(m===null)return null;if(/^[\w-]*\s*\(/.test(m)){let g=m.replace(/\b(and|or|not)\b/g," $1 ");c.nodes=[F("@supports",g,c.nodes)];return}m.includes(":")||(m=`${m}: var(--tw)`),(m[0]!=="("||m[m.length-1]!==")")&&(m=`(${m})`),c.nodes=[F("@supports",m,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(d,m,g,w){if(d===m)return 0;let v=w.get(d);if(v===null)return g==="asc"?-1:1;let x=w.get(m);return x===null?g==="asc"?1:-1:ye(v,x,g)};var u=c;{let d=t.namespace("--breakpoint"),m=new B(g=>{switch(g.kind){case"static":return t.resolveValue(g.root,["--breakpoint"])??null;case"functional":{if(!g.value||g.modifier)return null;let w=null;return g.value.kind==="arbitrary"?w=g.value.value:g.value.kind==="named"&&(w=t.resolveValue(g.value.value,["--breakpoint"])),!w||w.includes("var(")?null:w}case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("max",(g,w)=>{if(w.modifier)return null;let v=m.get(w);if(v===null)return null;g.nodes=[F("@media",`(width < ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"desc",m)),r.suggest("max",()=>Array.from(d.keys()).filter(g=>g!==null)),r.group(()=>{for(let[g,w]of t.namespace("--breakpoint"))g!==null&&r.static(g,v=>{v.nodes=[F("@media",`(width >= ${w})`,v.nodes)]},{compounds:1});r.functional("min",(g,w)=>{if(w.modifier)return null;let v=m.get(w);if(v===null)return null;g.nodes=[F("@media",`(width >= ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"asc",m)),r.suggest("min",()=>Array.from(d.keys()).filter(g=>g!==null))}{let d=t.namespace("--container"),m=new B(g=>{switch(g.kind){case"functional":{if(g.value===null)return null;let w=null;return g.value.kind==="arbitrary"?w=g.value.value:g.value.kind==="named"&&(w=t.resolveValue(g.value.value,["--container"])),!w||w.includes("var(")?null:w}case"static":case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("@max",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width < ${v})`:`(width < ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"desc",m)),r.suggest("@max",()=>Array.from(d.keys()).filter(g=>g!==null)),r.group(()=>{r.functional("@",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,g.nodes)]},{compounds:1}),r.functional("@min",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"asc",m)),r.suggest("@min",()=>Array.from(d.keys()).filter(g=>g!==null)),r.suggest("@",()=>Array.from(d.keys()).filter(g=>g!==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 _r(t){if(t.includes("=")){let[r,...i]=D(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 Ut(t,r){I(t,(i,{replaceWith:e})=>{if(i.kind==="at-rule"&&i.name==="@slot")e(r);else if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,z([F(i.name,i.params,i.nodes)])),1})}function Kr(t){let r=Vr(t),i=Dr(t),e=new B(u=>gr(u,f)),n=new B(u=>Array.from(mr(u,f))),s=new B(u=>{let c=Ur(u,f);try{Ve(c.map(({node:d})=>d),f)}catch{return[]}return c}),a=new B(u=>{for(let c of Qe(u))t.markUsedVariable(c)}),f={theme:t,utilities:r,variants:i,invalidCandidates:new Set,important:!1,candidatesToCss(u){let c=[];for(let d of u){let m=!1,{astNodes:g}=ge([d],this,{onInvalidCandidate(){m=!0}});g=be(g,f,0),g.length===0||m?c.push(null):c.push(oe(g))}return c},getClassOrder(u){return Or(this,u)},getClassList(){return Rr(this)},getVariants(){return Pr(this)},parseCandidate(u){return n.get(u)},parseVariant(u){return e.get(u)},compileAstNodes(u){return s.get(u)},printCandidate(u){return vr(f,u)},printVariant(u){return it(u)},getVariantOrder(){let u=Array.from(e.values());u.sort((g,w)=>this.variants.compare(g,w));let c=new Map,d,m=0;for(let g of u)g!==null&&(d!==void 0&&this.variants.compare(d,g)!==0&&m++,c.set(g,m),d=g);return c},resolveThemeValue(u,c=!0){let d=u.lastIndexOf("/"),m=null;d!==-1&&(m=u.slice(d+1).trim(),u=u.slice(0,d).trim());let g=t.resolve(null,[u],c?1:0)??void 0;return m&&g?Q(g,m):g},trackUsedVariables(u){a.get(u)}};return f}var Lt=["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 ge(t,r,{onInvalidCandidate:i}={}){let e=new Map,n=[],s=new Map;for(let f of t){if(r.invalidCandidates.has(f)){i?.(f);continue}let u=r.parseCandidate(f);if(u.length===0){i?.(f);continue}s.set(f,u)}let a=r.getVariantOrder();for(let[f,u]of s){let c=!1;for(let d of u){let m=r.compileAstNodes(d);if(m.length!==0){c=!0;for(let{node:g,propertySort:w}of m){let v=0n;for(let x of d.variants)v|=1n<{let c=e.get(f),d=e.get(u);if(c.variants-d.variants!==0n)return Number(c.variants-d.variants);let m=0;for(;m1)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,1}),t.nodes=a.nodes;return}if(n(t,r)===null)return null}function Lr(t){let r=t.options?.types??[];return r.length>1&&r.includes("any")}function Sn(t,r){if(t.kind==="arbitrary"){let a=t.value;return t.modifier&&(a=X(a,t.modifier,r.theme)),a===null?[]:[[l(t.property,a)]]}let i=r.utilities.get(t.root)??[],e=[],n=i.filter(a=>!Lr(a));for(let a of n){if(a.kind!==t.kind)continue;let f=a.compileFn(t);if(f!==void 0){if(f===null)return e;e.push(f)}}if(e.length>0)return e;let s=i.filter(a=>Lr(a));for(let a of s){if(a.kind!==t.kind)continue;let f=a.compileFn(t);if(f!==void 0){if(f===null)return e;e.push(f)}}return e}function jr(t){for(let r of t)r.kind!=="at-root"&&(r.kind==="declaration"?r.important=!0:(r.kind==="rule"||r.kind==="at-rule")&&jr(r.nodes))}function En(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 f=Lt.indexOf(s.value??"");if(f!==-1){r.add(f),n=!0;continue}}let a=Lt.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 je(t,r){let i=0,e=G("&",t),n=new Set,s=new B(()=>new Set),a=new B(()=>new Set);I([e],(m,{parent:g,path:w})=>{if(m.kind==="at-rule"){if(m.name==="@keyframes")return I(m.nodes,v=>{if(v.kind==="at-rule"&&v.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),1;if(m.name==="@utility"){let v=m.params.replace(/-\*$/,"");a.get(v).add(m),I(m.nodes,x=>{if(!(x.kind!=="at-rule"||x.name!=="@apply")){n.add(m);for(let y of Ir(x,r))s.get(m).add(y)}});return}if(m.name==="@apply"){if(g===null)return;i|=1,n.add(g);for(let v of Ir(m,r))for(let x of w)x!==m&&n.has(x)&&s.get(x).add(v)}}});let f=new Set,u=[],c=new Set;function d(m,g=[]){if(!f.has(m)){if(c.has(m)){let w=g[(g.indexOf(m)+1)%g.length];throw m.kind==="at-rule"&&m.name==="@utility"&&w.kind==="at-rule"&&w.name==="@utility"&&I(m.nodes,v=>{if(v.kind!=="at-rule"||v.name!=="@apply")return;let x=v.params.split(/\s+/g);for(let y of x)for(let V of r.parseCandidate(y))switch(V.kind){case"arbitrary":break;case"static":case"functional":if(w.params.replace(/-\*$/,"")===V.root)throw new Error(`You cannot \`@apply\` the \`${y}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${oe([m])} +Relies on: + +${oe([w])}`)}c.add(m);for(let w of s.get(m))for(let v of a.get(w))g.push(m),d(v,g),g.pop();f.add(m),c.delete(m),u.push(m)}}for(let m of n)d(m);for(let m of u)"nodes"in m&&I(m.nodes,(g,{replaceWith:w})=>{if(g.kind!=="at-rule"||g.name!=="@apply")return;let v=g.params.split(/(\s+)/g),x={},y=0;for(let[V,b]of v.entries())V%2===0&&(x[b]=y),y+=b.length;{let V=Object.keys(x),b=ge(V,r,{onInvalidCandidate:P=>{if(r.theme.prefix&&!P.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${P}\`. Did you mean \`${r.theme.prefix}:${P}\`?`);if(r.invalidCandidates.has(P))throw new Error(`Cannot apply utility class \`${P}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let K=D(P,":");if(K.length>1){let _=K.pop();if(r.candidatesToCss([_])[0]){let H=r.candidatesToCss(K.map(W=>`${W}:[--tw-variant-check:1]`)),j=K.filter((W,J)=>H[J]===null);if(j.length>0){if(j.length===1)throw new Error(`Cannot apply utility class \`${P}\` because the ${j.map(W=>`\`${W}\``)} variant does not exist.`);{let W=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${P}\` because the ${W.format(j.map(J=>`\`${J}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${P}\`. 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 \`${P}\``)}}),S=g.src,R=b.astNodes.map(P=>{let K=b.nodeSorting.get(P)?.candidate,_=K?x[K]:void 0;if(P=structuredClone(P),!S||!K||_===void 0)return I([P],j=>{j.src=S}),P;let H=[S[0],S[1],S[2]];return H[1]+=7+_,H[2]=H[1]+K.length,I([P],j=>{j.src=H}),P}),L=[];for(let P of R)if(P.kind==="rule")for(let K of P.nodes)L.push(K);else L.push(P);w(L)}});return i}function*Ir(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 jt(t,r,i,e=0,n=!1){let s=0,a=[];return I(t,(f,{replaceWith:u})=>{if(f.kind==="at-rule"&&(f.name==="@import"||f.name==="@reference")){let c=Tn(q(f.params));if(c===null)return;f.name==="@reference"&&(c.media="reference"),s|=2;let{uri:d,layer:m,media:g,supports:w}=c;if(d.startsWith("data:")||d.startsWith("http://")||d.startsWith("https://"))return;let v=se({},[]);return a.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${d}\` in \`${r}\`)`);let x=await i(d,r),y=ve(x.content,{from:n?x.path:void 0});await jt(y,x.base,i,e+1,n),v.nodes=Rn(f,[se({base:x.base},y)],m,g,w)})()),u(v),1}}),a.length>0&&await Promise.all(a),s}function Tn(t){let r,i=null,e=null,n=null;for(let s=0;s/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=ct(e);s&&t.theme.add(`--${s}`,""+n,7)}if(Object.hasOwn(r,"fontFamily")){let e=5;{let n=Te(r.fontFamily.sans);n&&t.theme.hasDefault("--font-sans")&&(t.theme.add("--default-font-family",n,e),t.theme.add("--default-font-feature-settings",Te(r.fontFamily.sans,"fontFeatureSettings")??"normal",e),t.theme.add("--default-font-variation-settings",Te(r.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let n=Te(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",Te(r.fontFamily.mono,"fontFeatureSettings")??"normal",e),t.theme.add("--default-mono-font-variation-settings",Te(r.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return r}function Pn(t){let r=[];return Fr(t,[],(i,e)=>{if(_n(i))return r.push([e,i]),1;if(Dn(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 On=/^[a-zA-Z0-9-_%/\.]+$/;function ct(t){if(t[0]==="container")return null;t=structuredClone(t),t[0]==="animation"&&(t[0]="animate"),t[0]==="aspectRatio"&&(t[0]="aspect"),t[0]==="borderRadius"&&(t[0]="radius"),t[0]==="boxShadow"&&(t[0]="shadow"),t[0]==="colors"&&(t[0]="color"),t[0]==="containers"&&(t[0]="container"),t[0]==="fontFamily"&&(t[0]="font"),t[0]==="fontSize"&&(t[0]="text"),t[0]==="letterSpacing"&&(t[0]="tracking"),t[0]==="lineHeight"&&(t[0]="leading"),t[0]==="maxWidth"&&(t[0]="container"),t[0]==="screens"&&(t[0]="breakpoint"),t[0]==="transitionTimingFunction"&&(t[0]="ease");for(let r of t)if(!On.test(r))return null;return t.map((r,i,e)=>r==="1"&&i!==e.length-1?"":r).map(r=>r.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(i,e,n)=>`${e}-${n.toLowerCase()}`)).filter((r,i)=>r!=="DEFAULT"||i!==t.length-1).join("-")}function _n(t){return typeof t=="number"||typeof t=="string"}function Dn(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 Fr(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")&&Fr(n,s,i)===2)return 2}}}function ft(t){let r=[];for(let i of D(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 Re(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let r=Object.getPrototypeOf(t);return r===null||Object.getPrototypeOf(r)===null}function Ie(t,r,i,e=[]){for(let n of r)if(n!=null)for(let s of Reflect.ownKeys(n)){e.push(s);let a=i(t[s],n[s],e);a!==void 0?t[s]=a:!Re(t[s])||!Re(n[s])?t[s]=n[s]:t[s]=Ie({},[t[s],n[s]],i,e),e.pop()}return t}function pt(t,r,i){return function(n,s){let a=n.lastIndexOf("/"),f=null;a!==-1&&(f=n.slice(a+1).trim(),n=n.slice(0,a).trim());let u=(()=>{let c=ft(n),[d,m]=Kn(t.theme,c),g=i(Mr(r()??{},c)??null);if(typeof g=="string"&&(g=g.replace("","1")),typeof d!="object")return typeof m!="object"&&m&4?g??d:d;if(g!==null&&typeof g=="object"&&!Array.isArray(g)){let w=Ie({},[g],(v,x)=>x);if(d===null&&Object.hasOwn(g,"__CSS_VALUES__")){let v={};for(let x in g.__CSS_VALUES__)v[x]=g[x],delete w[x];d=v}for(let v in d)v!=="__CSS_VALUES__"&&(g?.__CSS_VALUES__?.[v]&4&&Mr(w,v.split("-"))!==void 0||(w[we(v)]=d[v]));return w}if(Array.isArray(d)&&Array.isArray(m)&&Array.isArray(g)){let w=d[0],v=d[1];m[0]&4&&(w=g[0]??w);for(let x of Object.keys(v))m[1][x]&4&&(v[x]=g[1][x]??v[x]);return[w,v]}return d??g})();return f&&typeof u=="string"&&(u=Q(u,f)),u??s}}function Kn(t,r){if(r.length===1&&r[0].startsWith("--"))return[t.get([r[0]]),t.getOptions(r[0])];let i=ct(r),e=new Map,n=new B(()=>new Map),s=t.namespace(`--${i}`);if(s.size===0)return[null,0];let a=new Map;for(let[d,m]of s){if(!d||!d.includes("--")){e.set(d,m),a.set(d,t.getOptions(d?`--${i}-${d}`:`--${i}`));continue}let g=d.indexOf("--"),w=d.slice(0,g),v=d.slice(g+2);v=v.replace(/-([a-z])/g,(x,y)=>y.toUpperCase()),n.get(w===""?null:w).set(v,[m,t.getOptions(`--${i}${d}`)])}let f=t.getOptions(`--${i}`);for(let[d,m]of n){let g=e.get(d);if(typeof g!="string")continue;let w={},v={};for(let[x,[y,V]]of m)w[x]=y,v[x]=V;e.set(d,[g,w]),a.set(d,[f,v])}let u={},c={};for(let[d,m]of e)Wr(u,[d??"DEFAULT"],m);for(let[d,m]of a)Wr(c,[d??"DEFAULT"],m);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 Mr(t,r){for(let i=0;i0){let g=ze(n);e?e.nodes.push(g):r.push(g),n=""}let u=a,c=a+1;for(;c0){let c=ze(n);u.nodes.push(c),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Wn:case Fn:case Bn:{if(n.length>0){let u=ze(n);e?e.nodes.push(u):r.push(u)}n=String.fromCharCode(f);break}case Zr:{if(n.length>0){let d=ze(n);e?e.nodes.push(d):r.push(d)}n="";let u=a,c=0;for(let d=a+1;d0&&r.push(ze(n)),r}var ri=/^[a-z@][a-zA-Z0-9/%._-]*$/;function It({designSystem:t,ast:r,resolvedConfig:i,featuresRef:e,referenceMode:n}){let s={addBase(a){if(n)return;let f=ue(a);e.current|=Ve(f,t),r.push(F("@layer","base",f))},addVariant(a,f){if(!ut.test(a))throw new Error(`\`addVariant('${a}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(typeof f=="string"){if(f.includes(":merge("))return}else if(Array.isArray(f)){if(f.some(c=>c.includes(":merge(")))return}else if(typeof f=="object"){let c=function(d,m){return Object.entries(d).some(([g,w])=>g.includes(m)||typeof w=="object"&&c(w,m))};var u=c;if(c(f,":merge("))return}typeof f=="string"||Array.isArray(f)?t.variants.static(a,c=>{c.nodes=ii(f,c.nodes)},{compounds:Ae(typeof f=="string"?[f]:f)}):typeof f=="object"&&t.variants.fromAst(a,ue(f))},matchVariant(a,f,u){function c(m,g,w){let v=f(m,{modifier:g?.value??null});return ii(v,w)}try{let m=f("a",{modifier:null});if(typeof m=="string"&&m.includes(":merge("))return;if(Array.isArray(m)&&m.some(g=>g.includes(":merge(")))return}catch{}let d=Object.keys(u?.values??{});t.variants.group(()=>{t.variants.functional(a,(m,g)=>{if(!g.value){if(u?.values&&"DEFAULT"in u.values){m.nodes=c(u.values.DEFAULT,g.modifier,m.nodes);return}return null}if(g.value.kind==="arbitrary")m.nodes=c(g.value.value,g.modifier,m.nodes);else if(g.value.kind==="named"&&u?.values){let w=u.values[g.value.value];if(typeof w!="string")return;m.nodes=c(w,g.modifier,m.nodes)}})},(m,g)=>{if(m.kind!=="functional"||g.kind!=="functional")return 0;let w=m.value?m.value.value:"DEFAULT",v=g.value?g.value.value:"DEFAULT",x=u?.values?.[w]??w,y=u?.values?.[v]??v;if(u&&typeof u.sort=="function")return u.sort({value:x,modifier:m.modifier?.value??null},{value:y,modifier:g.modifier?.value??null});let V=d.indexOf(w),b=d.indexOf(v);return V=V===-1?d.length:V,b=b===-1?d.length:b,V!==b?V-b:xObject.entries(c));f=f.flatMap(([c,d])=>D(c,",").map(m=>[m.trim(),d]));let u=new B(()=>[]);for(let[c,d]of f){if(c.startsWith("@keyframes ")){n||r.push(G(c,ue(d)));continue}let m=dt(c),g=!1;if(Fe(m,w=>{if(w.kind==="selector"&&w.value[0]==="."&&ri.test(w.value.slice(1))){let v=w.value;w.value="&";let x=Me(m),y=v.slice(1),V=x==="&"?ue(d):[G(x,ue(d))];u.get(y).push(...V),g=!0,w.value=v;return}if(w.kind==="function"&&w.value===":not")return 1}),!g)throw new Error(`\`addUtilities({ '${c}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[c,d]of u)t.theme.prefix&&I(d,m=>{if(m.kind==="rule"){let g=dt(m.selector);Fe(g,w=>{w.kind==="selector"&&w.value[0]==="."&&(w.value=`.${t.theme.prefix}\\:${w.value.slice(1)}`)}),m.selector=Me(g)}}),t.utilities.static(c,m=>{let g=structuredClone(d);return ni(g,c,m.raw),e.current|=je(g,t),g})},matchUtilities(a,f){let u=f?.type?Array.isArray(f?.type)?f.type:[f.type]:["any"];for(let[d,m]of Object.entries(a)){let g=function({negative:w}){return v=>{if(v.value?.kind==="arbitrary"&&u.length>0&&!u.includes("any")&&(v.value.dataType&&!u.includes(v.value.dataType)||!v.value.dataType&&!Y(v.value.value,u)))return;let x=u.includes("color"),y=null,V=!1;{let R=f?.values??{};x&&(R=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},R)),v.value?v.value.kind==="arbitrary"?y=v.value.value:v.value.fraction&&R[v.value.fraction]?(y=R[v.value.fraction],V=!0):R[v.value.value]?y=R[v.value.value]:R.__BARE_VALUE__&&(y=R.__BARE_VALUE__(v.value)??null,V=(v.value.fraction!==null&&y?.includes("/"))??!1):y=R.DEFAULT??null}if(y===null)return;let b;{let R=f?.modifiers??null;v.modifier?R==="any"||v.modifier.kind==="arbitrary"?b=v.modifier.value:R?.[v.modifier.value]?b=R[v.modifier.value]:x&&!Number.isNaN(Number(v.modifier.value))?b=`${v.modifier.value}%`:b=null:b=null}if(v.modifier&&b===null&&!V)return v.value?.kind==="arbitrary"?null:void 0;x&&b!==null&&(y=Q(y,b)),w&&(y=`calc(${y} * -1)`);let S=ue(m(y,{modifier:b}));return ni(S,d,v.raw),e.current|=je(S,t),S}};var c=g;if(!ri.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\`.`);f?.supportsNegativeValues&&t.utilities.functional(`-${d}`,g({negative:!0}),{types:u}),t.utilities.functional(d,g({negative:!1}),{types:u}),t.utilities.suggest(d,()=>{let w=f?.values??{},v=new Set(Object.keys(w));v.delete("__BARE_VALUE__"),v.has("DEFAULT")&&(v.delete("DEFAULT"),v.add(null));let x=f?.modifiers??{},y=x==="any"?[]:Object.keys(x);return[{supportsNegative:f?.supportsNegativeValues??!1,values:Array.from(v),modifiers:y}]})}},addComponents(a,f){this.addUtilities(a,f)},matchComponents(a,f){this.matchUtilities(a,f)},theme:pt(t,()=>i.theme??{},a=>a),prefix(a){return a},config(a,f){let u=i;if(!a)return u;let c=ft(a);for(let d=0;dObject.entries(e));for(let[e,n]of i)if(typeof n!="object"){if(!e.startsWith("--")){if(n==="@slot"){r.push(G(e,[F("@slot")]));continue}e=e.replace(/([A-Z])/g,"-$1").toLowerCase()}r.push(l(e,String(n)))}else if(Array.isArray(n))for(let s of n)typeof s=="string"?r.push(l(e,s)):r.push(G(e,ue(s)));else n!==null&&r.push(G(e,ue(n)));return r}function ii(t,r){return(typeof t=="string"?[t]:t).flatMap(e=>{if(e.trim().endsWith("}")){let n=e.replace("}","{@slot}}"),s=ve(n);return Ut(s,r),s}else return G(e,r)})}function ni(t,r,i){I(t,e=>{if(e.kind==="rule"){let n=dt(e.selector);Fe(n,s=>{s.kind==="selector"&&s.value===`.${r}`&&(s.value=`.${de(i)}`)}),e.selector=Me(n)}})}function oi(t,r,i){for(let e of Gn(r))t.theme.addKeyframes(e)}function Gn(t){let r=[];if("keyframes"in t.theme)for(let[i,e]of Object.entries(t.theme.keyframes))r.push(F("@keyframes",i,ue(e)));return r}var mt={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 Ce(t){return{__BARE_VALUE__:t}}var le=Ce(t=>{if(T(t.value))return t.value}),re=Ce(t=>{if(T(t.value))return`${t.value}%`}),he=Ce(t=>{if(T(t.value))return`${t.value}px`}),li=Ce(t=>{if(T(t.value))return`${t.value}ms`}),gt=Ce(t=>{if(T(t.value))return`${t.value}deg`}),Yn=Ce(t=>{if(t.fraction===null)return;let[r,i]=D(t.fraction,"/");if(!(!T(r)||!T(i)))return t.fraction}),ai=Ce(t=>{if(T(Number(t.value)))return`repeat(${t.value}, minmax(0, 1fr))`}),si={accentColor:({theme:t})=>t("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",...Yn},backdropBlur:({theme:t})=>t("blur"),backdropBrightness:({theme:t})=>({...t("brightness"),...re}),backdropContrast:({theme:t})=>({...t("contrast"),...re}),backdropGrayscale:({theme:t})=>({...t("grayscale"),...re}),backdropHueRotate:({theme:t})=>({...t("hueRotate"),...gt}),backdropInvert:({theme:t})=>({...t("invert"),...re}),backdropOpacity:({theme:t})=>({...t("opacity"),...re}),backdropSaturate:({theme:t})=>({...t("saturate"),...re}),backdropSepia:({theme:t})=>({...t("sepia"),...re}),backgroundColor:({theme:t})=>t("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:t})=>t("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:t})=>({DEFAULT:"currentcolor",...t("colors")}),borderOpacity:({theme:t})=>t("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:t})=>t("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...he},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:t})=>t("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:t})=>t("colors"),colors:()=>({...mt}),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",...le},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:t})=>t("borderColor"),divideOpacity:({theme:t})=>t("borderOpacity"),divideWidth:({theme:t})=>({...t("borderWidth"),...he}),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:t})=>t("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({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%",...t("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...le},flexShrink:{0:"0",DEFAULT:"1",...le},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:t})=>t("spacing"),gradientColorStops:({theme:t})=>t("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",...le},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",...le},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",...le},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",...le},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))",...ai},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))",...ai},height:({theme:t})=>({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",...t("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...gt},inset:({theme:t})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...t("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:t})=>({auto:"auto",...t("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...le},maxHeight:({theme:t})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...t("spacing")}),maxWidth:({theme:t})=>({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",...t("spacing")}),minHeight:({theme:t})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...t("spacing")}),minWidth:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...t("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",...le},outlineColor:({theme:t})=>t("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},padding:({theme:t})=>t("spacing"),placeholderColor:({theme:t})=>t("colors"),placeholderOpacity:({theme:t})=>t("opacity"),ringColor:({theme:t})=>({DEFAULT:"currentcolor",...t("colors")}),ringOffsetColor:({theme:t})=>t("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},ringOpacity:({theme:t})=>({DEFAULT:"0.5",...t("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...gt},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:t})=>t("spacing"),scrollPadding:({theme:t})=>t("spacing"),sepia:{0:"0",DEFAULT:"100%",...re},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...gt},space:({theme:t})=>t("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:t})=>({none:"none",...t("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...le},supports:{},data:{},textColor:({theme:t})=>t("colors"),textDecorationColor:({theme:t})=>t("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},textIndent:({theme:t})=>t("spacing"),textOpacity:({theme:t})=>t("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},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",...li},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...li},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:t})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...t("spacing")}),size:({theme:t})=>({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",...t("spacing")}),width:({theme:t})=>({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",...t("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",...le}};function ui(t){return{theme:{...si,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 Zn={blocklist:[],future:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function Ft(t,r){let i={design:t,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(Zn)};for(let n of r)zt(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=Qn(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:e}}function Jn(t,r){if(Array.isArray(t)&&Re(t[0]))return t.concat(r);if(Array.isArray(r)&&Re(r[0])&&Re(t))return[t,...r];if(Array.isArray(r))return r}function zt(t,{config:r,base:i,path:e,reference:n}){let s=[];for(let u of r.plugins??[])"__isOptionsFunction"in u?s.push({...u(),reference:n}):"handler"in u?s.push({...u,reference:n}):s.push({handler:u,reference:n});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 u of r.presets??[])zt(t,{path:e,base:i,config:u,reference:n});for(let u of s)t.plugins.push(u),u.config&&zt(t,{path:e,base:i,config:u.config,reference:!!u.reference});let a=r.content??[],f=Array.isArray(a)?a:a.files;for(let u of f)t.content.files.push(typeof u=="object"?u:{base:i,pattern:u});t.configs.push(r)}function Qn(t){let r=new Set,i=pt(t.design,()=>t.theme,n),e=Object.assign(i,{theme:i,colors:mt});function n(s){return typeof s=="function"?s(e)??null:s??null}for(let s of t.configs){let a=s.theme??{},f=a.extend??{};for(let u in a)u!=="extend"&&r.add(u);Object.assign(t.theme,a);for(let u in f)t.extend[u]??=[],t.extend[u].push(f[u])}delete t.theme.extend;for(let s in t.extend){let a=[t.theme[s],...t.extend[s]];t.theme[s]=()=>{let f=a.map(n);return Ie({},f,Jn)}}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 ci(t,r){let i=t.theme.container||{};if(typeof i!="object"||i===null)return;let e=Xn(i,r);e.length!==0&&r.utilities.static("container",()=>structuredClone(e))}function Xn({center:t,padding:r,screens:i},e){let n=[],s=null;if(t&&n.push(l("margin-inline","auto")),(typeof r=="string"||typeof r=="object"&&r!==null&&"DEFAULT"in r)&&n.push(l("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((f,u)=>ye(f[1],u[1],"asc")),a.length>0){let[f]=a[0];n.push(F("@media",`(width >= --theme(--breakpoint-${f}))`,[l("max-width","none")]))}for(let[f,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;s.set(f,F("@media",`(width >= ${u})`,[l("max-width",u)]))}}if(typeof r=="object"&&r!==null){let a=Object.entries(r).filter(([f])=>f!=="DEFAULT").map(([f,u])=>[f,e.theme.resolveValue(f,["--breakpoint"]),u]).filter(Boolean);a.sort((f,u)=>ye(f[1],u[1],"asc"));for(let[f,,u]of a)if(s&&s.has(f))s.get(f).nodes.push(l("padding-inline",u));else{if(s)continue;n.push(F("@media",`(width >= theme(--breakpoint-${f}))`,[l("padding-inline",u)]))}}if(s)for(let[,a]of s)n.push(a);return n}function fi({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 pi(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.static(`bg-gradient-to-${r}`,()=>[l("--tw-gradient-position",`to ${i} in oklab`),l("background-image","linear-gradient(var(--tw-gradient-stops))")]);t.utilities.static("bg-left-top",()=>[l("background-position","left top")]),t.utilities.static("bg-right-top",()=>[l("background-position","right top")]),t.utilities.static("bg-left-bottom",()=>[l("background-position","left bottom")]),t.utilities.static("bg-right-bottom",()=>[l("background-position","right bottom")]),t.utilities.static("object-left-top",()=>[l("object-position","left top")]),t.utilities.static("object-right-top",()=>[l("object-position","right top")]),t.utilities.static("object-left-bottom",()=>[l("object-position","left bottom")]),t.utilities.static("object-right-bottom",()=>[l("object-position","right bottom")]),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[l("max-width",i)]}),t.utilities.static("overflow-ellipsis",()=>[l("text-overflow","ellipsis")]),t.utilities.static("decoration-slice",()=>[l("-webkit-box-decoration-break","slice"),l("box-decoration-break","slice")]),t.utilities.static("decoration-clone",()=>[l("-webkit-box-decoration-break","clone"),l("box-decoration-break","clone")]),t.utilities.functional("flex-shrink",r=>{if(!r.modifier){if(!r.value)return[l("flex-shrink","1")];if(r.value.kind==="arbitrary")return[l("flex-shrink",r.value.value)];if(T(r.value.value))return[l("flex-shrink",r.value.value)]}}),t.utilities.functional("flex-grow",r=>{if(!r.modifier){if(!r.value)return[l("flex-grow","1")];if(r.value.kind==="arbitrary")return[l("flex-grow",r.value.value)];if(T(r.value.value))return[l("flex-grow",r.value.value)]}}),t.utilities.static("order-none",()=>[l("order","0")])}function di(t,r){let i=t.theme.screens||{},e=r.variants.get("min")?.order??0,n=[];for(let[a,f]of Object.entries(i)){let g=function(w){r.variants.static(a,v=>{v.nodes=[F("@media",m,v.nodes)]},{order:w})};var s=g;let u=r.variants.get(a),c=r.theme.resolveValue(a,["--breakpoint"]);if(u&&c&&!r.theme.hasDefault(`--breakpoint-${a}`))continue;let d=!0;typeof f=="string"&&(d=!1);let m=eo(f);d?n.push(g):g(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,f])=>(a>e&&(a+=n.length),[a,f])));for(let[a,f]of n.entries())f(e+a+1)}}function eo(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 mi(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,f=s?.compounds;r.variants.functional("aria",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in i?a?.(u,{...c,value:{kind:"arbitrary",value:i[d.value]}}):a?.(u,c)},{compounds:f})}if(Object.keys(e).length>0){let s=r.variants.get("supports"),a=s?.applyFn,f=s?.compounds;r.variants.functional("supports",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in e?a?.(u,{...c,value:{kind:"arbitrary",value:e[d.value]}}):a?.(u,c)},{compounds:f})}if(Object.keys(n).length>0){let s=r.variants.get("data"),a=s?.applyFn,f=s?.compounds;r.variants.functional("data",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in n?a?.(u,{...c,value:{kind:"arbitrary",value:n[d.value]}}):a?.(u,c)},{compounds:f})}}var to=/^[a-z]+$/;async function hi({designSystem:t,base:r,ast:i,loadModule:e,sources:n}){let s=0,a=[],f=[];I(i,(m,{parent:g,replaceWith:w,context:v})=>{if(m.kind==="at-rule"){if(m.name==="@plugin"){if(g!==null)throw new Error("`@plugin` cannot be nested.");let x=m.params.slice(1,-1);if(x.length===0)throw new Error("`@plugin` must have a path.");let y={};for(let V of m.nodes??[]){if(V.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${oe([V])} + +\`@plugin\` options must be a flat list of declarations.`);if(V.value===void 0)continue;let b=V.value,S=D(b,",").map(R=>{if(R=R.trim(),R==="null")return null;if(R==="true")return!0;if(R==="false")return!1;if(Number.isNaN(Number(R))){if(R[0]==='"'&&R[R.length-1]==='"'||R[0]==="'"&&R[R.length-1]==="'")return R.slice(1,-1);if(R[0]==="{"&&R[R.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${oe([V]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(R);return R});y[V.property]=S.length===1?S[0]:S}a.push([{id:x,base:v.base,reference:!!v.reference},Object.keys(y).length>0?y:null]),w([]),s|=4;return}if(m.name==="@config"){if(m.nodes.length>0)throw new Error("`@config` cannot have a body.");if(g!==null)throw new Error("`@config` cannot be nested.");f.push({id:m.params.slice(1,-1),base:v.base,reference:!!v.reference}),w([]),s|=4;return}}}),pi(t);let u=t.resolveThemeValue;if(t.resolveThemeValue=function(g,w){return g.startsWith("--")?u(g,w):(s|=gi({designSystem:t,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),t.resolveThemeValue(g,w))},!a.length&&!f.length)return 0;let[c,d]=await Promise.all([Promise.all(f.map(async({id:m,base:g,reference:w})=>{let v=await e(m,g,"config");return{path:m,base:v.base,config:v.module,reference:w}})),Promise.all(a.map(async([{id:m,base:g,reference:w},v])=>{let x=await e(m,g,"plugin");return{path:m,base:x.base,plugin:x.module,options:v,reference:w}}))]);return s|=gi({designSystem:t,base:r,ast:i,sources:n,configs:c,pluginDetails:d}),s}function gi({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};if("__isOptionsFunction"in y.plugin)return{config:{plugins:[y.plugin(y.options)]},base:y.base,reference:y.reference};throw new Error(`The plugin "${y.path}" does not accept options`)}),...n],{resolvedConfig:c}=Ft(t,[{config:ui(t.theme),base:r,reference:!0},...u,{config:{plugins:[fi]},base:r,reference:!0}]),{resolvedConfig:d,replacedThemeKeys:m}=Ft(t,u),g=t.resolveThemeValue;t.resolveThemeValue=function(V,b){if(V[0]==="-"&&V[1]==="-")return g(V,b);let S=v.theme(V,void 0);if(Array.isArray(S)&&S.length===2)return S[0];if(Array.isArray(S))return S.join(", ");if(typeof S=="string")return S};let w={designSystem:t,ast:i,resolvedConfig:c,featuresRef:{set current(y){a|=y}}},v=It({...w,referenceMode:!1}),x;for(let{handler:y,reference:V}of c.plugins)V?(x||=It({...w,referenceMode:!0}),y(x)):y(v);if(zr(t,d,m),oi(t,d,m),mi(d,t),di(d,t),ci(d,t),!t.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.`)),!to.test(c.prefix))throw new Error(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);t.theme.prefix=c.prefix}if(!t.important&&c.important===!0&&(t.important=!0),typeof c.important=="string"){let y=c.important;I(i,(V,{replaceWith:b,parent:S})=>{if(V.kind==="at-rule"&&!(V.name!=="@tailwind"||V.params!=="utilities"))return S?.kind==="rule"&&S.selector===y?2:(b(M(y,[V])),2)})}for(let y of c.blocklist)t.invalidCandidates.add(y);for(let y of c.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 V=!1;y.pattern[0]=="!"&&(V=!0,y.pattern=y.pattern.slice(1)),e.push({...y,negated:V})}return a}function vi(t){let r=[0];for(let n=0;n0;){let u=(a|0)>>1,c=s+u;r[c]<=n?(s=c+1,a=a-u-1):a=u}s-=1;let f=n-r[s];return{line:s+1,column:f}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let a=r[n],f=r[n+1]??a;return Math.min(Math.max(a+s,0),f)}return{find:i,findOffset:e}}function wi({ast:t}){let r=new B(n=>vi(n.code)),i=new B(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]),f=r.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),c=0;for(let g of u.split(` +`)){if(g.trim()!==""){let w=a.find(n.src[1]+c),v=f.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:v})}c+=g.length,c+=1}let d=a.find(n.src[2]),m=f.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...d},generatedPosition:m})});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 ki=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function ht(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 m=0;mht(m));let d=ht(u);for(let m of d)for(let g of c)i.push(e+g+m);return i}function ro(t){return ki.test(t)}function io(t){let r=t.match(ki);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 f=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=f<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let c=f0&&(s=-s);for(let d=f;c?d<=u:d>=u;d+=s)a.push(d.toString())}return a}var no=/^[a-z]+$/,tt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(tt||{});function oo(){throw new Error("No `loadModule` function provided to `compile`")}function lo(){throw new Error("No `loadStylesheet` function provided to `compile`")}function ao(t){let r=0,i=null;for(let e of D(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 Se=(f=>(f[f.None=0]="None",f[f.AtApply=1]="AtApply",f[f.AtImport=2]="AtImport",f[f.JsPluginCompat=4]="JsPluginCompat",f[f.ThemeFunction=8]="ThemeFunction",f[f.Utilities=16]="Utilities",f[f.Variants=32]="Variants",f))(Se||{});async function bi(t,{base:r="",from:i,loadModule:e=oo,loadStylesheet:n=lo}={}){let s=0;t=[se({base:r},t)],s|=await jt(t,r,n,0,i!==void 0);let a=null,f=new Je,u=[],c=[],d=null,m=null,g=[],w=[],v=[],x=[],y=null;I(t,(b,{parent:S,replaceWith:R,context:L})=>{if(b.kind==="at-rule"){if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(m!==null){R([]);return}if(L.reference){R([]);return}let P=D(b.params," ");for(let K of P)if(K.startsWith("source(")){let _=K.slice(7,-1);if(_==="none"){y=_;continue}if(_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");y={base:L.sourceBase??L.base,pattern:_.slice(1,-1)}}m=b,s|=16}if(b.name==="@utility"){if(S!==null)throw new Error("`@utility` cannot be nested.");if(b.nodes.length===0)throw new Error(`\`@utility ${b.params}\` is empty. Utilities should include at least one property.`);let P=Sr(b);if(P===null)throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);c.push(P)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.");if(S!==null)throw new Error("`@source` cannot be nested.");let P=!1,K=!1,_=b.params;if(_[0]==="n"&&_.startsWith("not ")&&(P=!0,_=_.slice(4)),_[0]==="i"&&_.startsWith("inline(")&&(K=!0,_=_.slice(7,-1)),_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`@source` paths must be quoted.");let H=_.slice(1,-1);if(K){let j=P?x:v,W=D(H," ");for(let J of W)for(let ie of ht(J))j.push(ie)}else w.push({base:L.base,pattern:H,negated:P});R([]);return}if(b.name==="@variant"&&(S===null?b.nodes.length===0?b.name="@custom-variant":(I(b.nodes,P=>{if(P.kind==="at-rule"&&P.name==="@slot")return b.name="@custom-variant",2}),b.name==="@variant"&&g.push(b)):g.push(b)),b.name==="@custom-variant"){if(S!==null)throw new Error("`@custom-variant` cannot be nested.");R([]);let[P,K]=D(b.params," ");if(!ut.test(P))throw new Error(`\`@custom-variant ${P}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(b.nodes.length>0&&K)throw new Error(`\`@custom-variant ${P}\` cannot have both a selector and a body.`);if(b.nodes.length===0){if(!K)throw new Error(`\`@custom-variant ${P}\` has no selector or body.`);let _=D(K.slice(1,-1),",");if(_.length===0||_.some(W=>W.trim()===""))throw new Error(`\`@custom-variant ${P} (${_.join(",")})\` selector is invalid.`);let H=[],j=[];for(let W of _)W=W.trim(),W[0]==="@"?H.push(W):j.push(W);u.push(W=>{W.variants.static(P,J=>{let ie=[];j.length>0&&ie.push(M(j.join(", "),J.nodes));for(let o of H)ie.push(G(o,J.nodes));J.nodes=ie},{compounds:Ae([...j,...H])})});return}else{u.push(_=>{_.variants.fromAst(P,b.nodes)});return}}if(b.name==="@media"){let P=D(b.params," "),K=[];for(let _ of P)if(_.startsWith("source(")){let H=_.slice(7,-1);I(b.nodes,(j,{replaceWith:W})=>{if(j.kind==="at-rule"&&j.name==="@tailwind"&&j.params==="utilities")return j.params+=` source(${H})`,W([se({sourceBase:L.base},[j])]),2})}else if(_.startsWith("theme(")){let H=_.slice(6,-1),j=H.includes("reference");I(b.nodes,W=>{if(W.kind!=="at-rule"){if(j)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return 0}if(W.name==="@theme")return W.params+=" "+H,1})}else if(_.startsWith("prefix(")){let H=_.slice(7,-1);I(b.nodes,j=>{if(j.kind==="at-rule"&&j.name==="@theme")return j.params+=` prefix(${H})`,1})}else _==="important"?a=!0:_==="reference"?b.nodes=[se({reference:!0},b.nodes)]:K.push(_);K.length>0?b.params=K.join(" "):P.length>0&&R(b.nodes)}if(b.name==="@theme"){let[P,K]=ao(b.params);if(L.reference&&(P|=2),K){if(!no.test(K))throw new Error(`The prefix "${K}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);f.prefix=K}return I(b.nodes,_=>{if(_.kind==="at-rule"&&_.name==="@keyframes")return f.addKeyframes(_),1;if(_.kind==="comment")return;if(_.kind==="declaration"&&_.property.startsWith("--")){f.add(we(_.property),_.value??"",P,_.src);return}let H=oe([F(b.name,b.params,[_])]).split(` +`).map((j,W,J)=>`${W===0||W>=J.length-2?" ":">"} ${j}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${H}`)}),d?R([]):(d=M(":root, :host",[]),d.src=b.src,R([d])),1}}});let V=Kr(f);if(a&&(V.important=a),x.length>0)for(let b of x)V.invalidCandidates.add(b);s|=await hi({designSystem:V,base:r,ast:t,loadModule:e,sources:w});for(let b of u)b(V);for(let b of c)b(V);if(d){let b=[];for(let[R,L]of V.theme.entries()){if(L.options&2)continue;let P=l(de(R),L.value);P.src=L.src,b.push(P)}let S=V.theme.getKeyframes();for(let R of S)t.push(se({theme:!0},[z([R])]));d.nodes=[se({theme:!0},b)]}if(g.length>0){for(let b of g){let S=M("&",b.nodes),R=b.params,L=V.parseVariant(R);if(L===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${R}`);if(Ee(S,L,V.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${R}`);Object.assign(b,S)}s|=32}if(s|=Ve(t,V),s|=je(t,V),m){let b=m;b.kind="context",b.context={}}return I(t,(b,{replaceWith:S})=>{if(b.kind==="at-rule")return b.name==="@utility"&&S([]),1}),{designSystem:V,ast:t,sources:w,root:y,utilitiesNode:m,features:s,inlineCandidates:v}}async function yi(t,r={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:a,features:f,inlineCandidates:u}=await bi(t,r);e.unshift(Ze(`! tailwindcss v${Mt} | MIT License | https://tailwindcss.com `));function c(v){i.invalidCandidates.add(v)}let d=new Set,m=null,g=0,w=!1;for(let v of u)i.invalidCandidates.has(v)||(d.add(v),w=!0);return{sources:n,root:s,features:f,build(v){if(f===0)return t;if(!a)return m??=be(e,i,r.polyfills),m;let x=w,y=!1;w=!1;let V=d.size;for(let S of v)if(!i.invalidCandidates.has(S))if(S[0]==="-"&&S[1]==="-"){let R=i.theme.markUsedVariable(S);x||=R,y||=R}else d.add(S),x||=d.size!==V;if(!x)return m??=be(e,i,r.polyfills),m;let b=ge(d,i,{onInvalidCandidate:c}).astNodes;return r.from&&I(b,S=>{S.src??=a.src}),!y&&g===b.length?(m??=be(e,i,r.polyfills),m):(g=b.length,a.nodes=b,m=be(e,i,r.polyfills),m)}}}async function so(t,r={}){let i=ve(t,{from:r.from}),e=await yi(i,r),n=i,s=t;return{...e,build(a){let f=e.build(a);return f===n||(s=oe(f,!!r.from),n=f),s},buildSourceMap(){return wi({ast:n})}}}async function uo(t,r={}){return(await bi(ve(t),r)).designSystem}function We(){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 t in vt)t!=="default"&&(We[t]=vt[t]);module.exports=We; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3ab36ba484fe32b200cd53a0768e4d60354e4bd2 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/lib.mjs @@ -0,0 +1 @@ +import{a,b,c,d,e,f}from"./chunk-4WXWQT6Y.mjs";import"./chunk-G32FJCSR.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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6c11f7d9c7104c8ea65974778e6a97c1b5379e34 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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-B254mqw1.mjs'; +export { d as PluginAPI, P as PluginsConfig, T as ThemeConfig } from './types-B254mqw1.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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..305e84e2ec64ed4a7efada93ce8d0eca800674d7 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.d.ts @@ -0,0 +1,104 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-BIFUA2FY.js'; +import './colors-b_6i0Oi7.js'; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; +}; +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; +} + +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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.js b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..eca100caf8aa839dbccbcfaf890ab644a3742674 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.mjs b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/plugin.mjs new file mode 100644 index 0000000000000000000000000000000000000000..430fa2522dee47352031d52a9e969eb131a03be9 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d9dbe2f707a40ecff28699792fe21f997927e7b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e1cde16e3eced663175d9efb049bf42a799a589c --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/types-B254mqw1.d.mts b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/types-B254mqw1.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b3ac7a95a6ee083529ee6b9092ac64fe9ea84c32 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/dist/types-B254mqw1.d.mts @@ -0,0 +1,98 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs'; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; +}; +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; +} + +export type { Config as C, Plugin as P, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d }; diff --git a/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/index.css b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/index.css new file mode 100644 index 0000000000000000000000000000000000000000..0792ea331489d66c5a97d176182c310634df1348 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/index.css @@ -0,0 +1,888 @@ +@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; + } + + /* + 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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/package.json b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0278a74369a22615de1e68a0be99050deb82d937 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/package.json @@ -0,0 +1,89 @@ +{ + "name": "tailwindcss", + "version": "4.1.11", + "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": { + "@ampproject/remapping": "^2.3.0", + "@types/node": "^20.19.0", + "dedent": "1.6.0", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "@tailwindcss/oxide": "^4.1.11" + }, + "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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/preflight.css b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/preflight.css new file mode 100644 index 0000000000000000000000000000000000000000..0976a40d4924e0876195f2edef5f7e7b5d911b0d --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/preflight.css @@ -0,0 +1,385 @@ +/* + 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; +} + +/* + 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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/theme.css b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/theme.css new file mode 100644 index 0000000000000000000000000000000000000000..52d447f7ffa0bbd5412bc76689b32ef77970e9e7 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/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/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/utilities.css b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/utilities.css new file mode 100644 index 0000000000000000000000000000000000000000..65dd5f63a7dff212950f378bf32188d9d6291439 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/node_modules/tailwindcss/utilities.css @@ -0,0 +1 @@ +@tailwind utilities; diff --git a/tools/ui/node_modules/@tailwindcss/node/package.json b/tools/ui/node_modules/@tailwindcss/node/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4b45ce6a21b6d48af6f23086b700976a29bade2f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/node/package.json @@ -0,0 +1,48 @@ +{ + "name": "@tailwindcss/node", + "version": "4.1.11", + "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": { + "@ampproject/remapping": "^2.3.0", + "enhanced-resolve": "^5.18.1", + "jiti": "^2.4.2", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.11" + }, + "scripts": { + "build": "tsup-node", + "dev": "pnpm run build -- --watch" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/LICENSE b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/README.md b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f129c115fbb35c947e062d36147923620b92c395 --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2e2c258f842c28b039737665b9f65bfd6afa832f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tailwindcss/oxide-linux-x64-gnu", + "version": "4.1.11", + "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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node new file mode 100644 index 0000000000000000000000000000000000000000..69d3266ebb15e978685fdd30070b870ebb5bd253 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcae7be5b1660c3decb00f3e978cf50c36c53968eddb396cf8f2ea46429e8af2 +size 3007392 diff --git a/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/LICENSE b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/README.md b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5661d1c91bb45b1266d9908a72f9329f2fdd87e3 --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5a7a039096baab6ae3df496c899c48ccc5f4bf57 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tailwindcss/oxide-linux-x64-musl", + "version": "4.1.11", + "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/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node new file mode 100644 index 0000000000000000000000000000000000000000..6651b0858aac83efe554b5a767046ba3836dac02 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc9f04aa9cf7d01119f75e0d5fc3585dab81fa9429cacc756926d9787ae014d4 +size 3011272 diff --git a/tools/ui/node_modules/@tailwindcss/oxide/LICENSE b/tools/ui/node_modules/@tailwindcss/oxide/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide/index.d.ts b/tools/ui/node_modules/@tailwindcss/oxide/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..184e08958de3c7514159d8a8b1909e90e2de4376 --- /dev/null +++ b/tools/ui/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/tools/ui/node_modules/@tailwindcss/oxide/index.js b/tools/ui/node_modules/@tailwindcss/oxide/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6fcf962a3f8ffec09983638737ce12081d5adb3f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide/index.js @@ -0,0 +1,377 @@ +// prettier-ignore +/* eslint-disable */ +// @ts-nocheck +/* auto-generated by NAPI-RS */ + +const { createRequire } = require('node:module') +require = createRequire(__filename) + +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 { + nativeBinding = 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 { + return require('@tailwindcss/oxide-android-arm64') + } 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 { + return require('@tailwindcss/oxide-android-arm-eabi') + } 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') { + try { + return require('./tailwindcss-oxide.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-win32-x64-msvc') + } 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 { + return require('@tailwindcss/oxide-win32-ia32-msvc') + } 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 { + return require('@tailwindcss/oxide-win32-arm64-msvc') + } 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 { + return require('@tailwindcss/oxide-darwin-universal') + } catch (e) { + loadErrors.push(e) + } + + if (process.arch === 'x64') { + try { + return require('./tailwindcss-oxide.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-darwin-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-darwin-arm64') + } 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 { + return require('@tailwindcss/oxide-freebsd-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./tailwindcss-oxide.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-freebsd-arm64') + } 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 { + return require('@tailwindcss/oxide-linux-x64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./tailwindcss-oxide.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-linux-x64-gnu') + } 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 { + return require('@tailwindcss/oxide-linux-arm64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./tailwindcss-oxide.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-linux-arm64-gnu') + } 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 { + return require('@tailwindcss/oxide-linux-arm-musleabihf') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./tailwindcss-oxide.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-linux-arm-gnueabihf') + } 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 { + return require('@tailwindcss/oxide-linux-riscv64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./tailwindcss-oxide.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@tailwindcss/oxide-linux-riscv64-gnu') + } 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 { + return require('@tailwindcss/oxide-linux-ppc64-gnu') + } 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 { + return require('@tailwindcss/oxide-linux-s390x-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) + } + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + nativeBinding = require('./tailwindcss-oxide.wasi.cjs') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + loadErrors.push(err) + } + } + if (!nativeBinding) { + try { + nativeBinding = require('@tailwindcss/oxide-wasm32-wasi') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + loadErrors.push(err) + } + } + } +} + +if (!nativeBinding) { + if (loadErrors.length > 0) { + // TODO Link to documentation with potential fixes + // - The package owner could build/publish bindings for this arch + // - The user may need to bundle the correct files + // - The user may need to re-install node_modules to get new packages + throw new Error('Failed to load native binding', { cause: loadErrors }) + } + throw new Error(`Failed to load native binding`) +} + +module.exports.Scanner = nativeBinding.Scanner diff --git a/tools/ui/node_modules/@tailwindcss/oxide/package.json b/tools/ui/node_modules/@tailwindcss/oxide/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c9b7bf0b5ef5e81ff076bc623f0581b573ab77fe --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide/package.json @@ -0,0 +1,82 @@ +{ + "name": "@tailwindcss/oxide", + "version": "4.1.11", + "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", + "dependencies": { + "tar": "^7.4.3", + "detect-libc": "^2.0.4" + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.78", + "@napi-rs/wasm-runtime": "^0.2.11", + "emnapi": "1.4.3" + }, + "engines": { + "node": ">= 10" + }, + "files": [ + "index.js", + "index.d.ts", + "scripts/install.js" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.11", + "@tailwindcss/oxide-freebsd-x64": "4.1.11", + "@tailwindcss/oxide-darwin-x64": "4.1.11", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-x64-musl": "4.1.11", + "@tailwindcss/oxide-wasm32-wasi": "4.1.11", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.11", + "@tailwindcss/oxide-darwin-arm64": "4.1.11" + }, + "scripts": { + "artifacts": "napi artifacts", + "build": "pnpm run build:platform && pnpm run build:wasm", + "build:platform": "napi build --platform --release --no-const-enum", + "postbuild:platform": "node ./scripts/move-artifacts.mjs", + "build:wasm": "napi build --release --target wasm32-wasip1-threads --no-const-enum", + "postbuild:wasm": "node ./scripts/move-artifacts.mjs", + "dev": "cargo watch --quiet --shell 'npm run build'", + "build:debug": "napi build --platform --no-const-enum", + "version": "napi version", + "postinstall": "node ./scripts/install.js" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@tailwindcss/oxide/scripts/install.js b/tools/ui/node_modules/@tailwindcss/oxide/scripts/install.js new file mode 100644 index 0000000000000000000000000000000000000000..f9cefe01c7c92996d7e0dc771287b020af8c19fb --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/oxide/scripts/install.js @@ -0,0 +1,143 @@ +#!/usr/bin/env node + +/** + * @tailwindcss/oxide postinstall script + * + * This script ensures that the correct binary for the current platform and + * architecture is downloaded and available. + */ + +const fs = require('fs') +const path = require('path') +const https = require('https') +const { extract } = require('tar') +const packageJson = require('../package.json') +const detectLibc = require('detect-libc') + +const version = packageJson.version + +function getPlatformPackageName() { + let platform = process.platform + let arch = process.arch + + let libc = '' + if (platform === 'linux') { + libc = detectLibc.isNonGlibcLinuxSync() ? 'musl' : 'gnu' + } + + // Map to our package naming conventions + switch (platform) { + case 'darwin': + return arch === 'arm64' ? '@tailwindcss/oxide-darwin-arm64' : '@tailwindcss/oxide-darwin-x64' + case 'win32': + if (arch === 'arm64') return '@tailwindcss/oxide-win32-arm64-msvc' + if (arch === 'ia32') return '@tailwindcss/oxide-win32-ia32-msvc' + return '@tailwindcss/oxide-win32-x64-msvc' + case 'linux': + if (arch === 'x64') { + return libc === 'musl' + ? '@tailwindcss/oxide-linux-x64-musl' + : '@tailwindcss/oxide-linux-x64-gnu' + } else if (arch === 'arm64') { + return libc === 'musl' + ? '@tailwindcss/oxide-linux-arm64-musl' + : '@tailwindcss/oxide-linux-arm64-gnu' + } else if (arch === 'arm') { + return '@tailwindcss/oxide-linux-arm-gnueabihf' + } + break + case 'freebsd': + return '@tailwindcss/oxide-freebsd-x64' + case 'android': + return '@tailwindcss/oxide-android-arm64' + default: + return '@tailwindcss/oxide-wasm32-wasi' + } +} + +function isPackageAvailable(packageName) { + try { + require.resolve(packageName) + return true + } catch (e) { + return false + } +} + +// Extract all files from a tarball to a destination directory +async function extractTarball(tarballStream, destDir) { + if (!fs.existsSync(destDir)) { + fs.mkdirSync(destDir, { recursive: true }) + } + + return new Promise((resolve, reject) => { + tarballStream + .pipe(extract({ cwd: destDir, strip: 1 })) + .on('error', (err) => reject(err)) + .on('end', () => resolve()) + }) +} + +async function downloadAndExtractBinary(packageName) { + let tarballUrl = `https://registry.npmjs.org/${packageName}/-/${packageName.replace('@tailwindcss/', '')}-${version}.tgz` + console.log(`Downloading ${tarballUrl}...`) + + return new Promise((resolve) => { + https + .get(tarballUrl, (response) => { + if (response.statusCode === 302 || response.statusCode === 301) { + // Handle redirects + https.get(response.headers.location, handleResponse).on('error', (err) => { + console.error('Download error:', err) + resolve() + }) + return + } + + handleResponse(response) + + async function handleResponse(response) { + try { + if (response.statusCode !== 200) { + throw new Error(`Download failed with status code: ${response.statusCode}`) + } + + await extractTarball( + response, + path.join(__dirname, '..', 'node_modules', ...packageName.split('/')), + ) + console.log(`Successfully downloaded and installed ${packageName}`) + } catch (error) { + console.error('Error during extraction:', error) + resolve() + } finally { + resolve() + } + } + }) + .on('error', (err) => { + console.error('Download error:', err) + resolve() + }) + }) +} + +async function main() { + // Don't run this script in the package source + try { + if (fs.existsSync(path.join(__dirname, '..', 'build.rs'))) { + return + } + + let packageName = getPlatformPackageName() + if (!packageName) return + if (isPackageAvailable(packageName)) return + + await downloadAndExtractBinary(packageName) + } catch (error) { + console.error(error) + return + } +} + +main() diff --git a/tools/ui/node_modules/@tailwindcss/typography/LICENSE b/tools/ui/node_modules/@tailwindcss/typography/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/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/tools/ui/node_modules/@tailwindcss/typography/README.md b/tools/ui/node_modules/@tailwindcss/typography/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4d73c53ffe636ba906d4a79a9ba35cf8e540a48 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/README.md @@ -0,0 +1,398 @@ +

+ + + + + Tailwind CSS Typography + + +

+ +The official Tailwind CSS Typography plugin provides a set of `prose` classes you can use to add beautiful typographic defaults to any vanilla HTML you don’t control, like HTML rendered from Markdown, or pulled from a CMS. + +```html +
{{ markdown }}
+``` + +To see what it looks like in action, check out our [live demo](https://play.tailwindcss.com/uj1vGACRJA?layout=preview) on Tailwind Play. + +--- + +## Installation + +Install the plugin from npm: + +```shell +npm install -D @tailwindcss/typography +``` + +Then add the plugin to your `tailwind.config.js` file: + +```js +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + // ... + }, + plugins: [ + require('@tailwindcss/typography'), + // ... + ], +} +``` + +--- + +## Basic usage + +Now you can use the `prose` classes to add sensible typography styles to any vanilla HTML: + +```html +
+

Garlic bread with cheese: What the science tells us

+

+ For years parents have espoused the health benefits of eating garlic bread with cheese to their + children, with the food earning such an iconic status in our culture that kids will often dress + up as warm, cheesy loaf for Halloween. +

+

+ But a recent study shows that the celebrated appetizer may be linked to a series of rabies cases + springing up around the country. +

+ +
+``` + +### Choosing a gray scale + +This plugin includes a modifier class for each of the five gray scales Tailwind includes by default so you can easily style your content to match the grays you're using in your project. + +```html +
{{ markdown }}
+``` + +Here are the classes that are generated using a totally default Tailwind CSS v2.0 build: + +| Class | Gray scale | +| ------------------------ | ---------- | +| `prose-gray` _(default)_ | Gray | +| `prose-slate` | Slate | +| `prose-zinc` | Zinc | +| `prose-neutral` | Neutral | +| `prose-stone` | Stone | + +Modifier classes are designed to be used with the [multi-class modifier pattern](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/#component-modifiers) and must be used in conjunction with the base `prose` class. + +> [!NOTE] +> Always include the `prose` class when adding a gray scale modifier + +```html +
{{ markdown }}
+``` + +To learn about creating your own color themes, read the [adding custom color themes](#adding-custom-color-themes) documentation. + +### Applying a type scale + +Size modifiers allow you to adjust the overall size of your typography for different contexts. + +```html +
{{ markdown }}
+``` + +Five different typography sizes are included out of the box: + +| Class | Body font size | +| ------------------------ | ----------------- | +| `prose-sm` | 0.875rem _(14px)_ | +| `prose-base` _(default)_ | 1rem _(16px)_ | +| `prose-lg` | 1.125rem _(18px)_ | +| `prose-xl` | 1.25rem _(20px)_ | +| `prose-2xl` | 1.5rem _(24px)_ | + +These can be used in combination with Tailwind's [breakpoint modifiers](https://tailwindcss.com/docs/responsive-design) to change the overall font size of a piece of content at different viewport sizes: + +```html +
{{ markdown }}
+``` + +Everything about the provided size modifiers has been hand-tuned by professional designers to look as beautiful as possible, including the relationships between font sizes, heading spacing, code block padding, and more. + +Size modifiers are designed to be used with the [multi-class modifier pattern](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/#component-modifiers) and must be used in conjunction with the base `prose` class. + +> [!NOTE] +> Always include the `prose` class when adding a size modifier + +```html +
{{ markdown }}
+``` + +To learn about customizing the included type scales, read the documentation on [customizing the CSS](#customizing-the-css). + +### Adapting to dark mode + +Each default color theme includes a hand-designed dark mode version that you can trigger by adding the `prose-invert` class: + +```html +
{{ markdown }}
+``` + +To learn about creating your own color themes, read the [adding custom color themes](#adding-custom-color-themes) documentation. + +### Element modifiers + +Use element modifiers to customize the style of individual elements in your content directly in your HTML: + +```html +
+ {{ markdown }} +
+``` + +This makes it easy to do things like style links to match your brand, add a border radius to images, and tons more. + +Here's a complete list of available element modifiers: + +| Modifier | Target | +| ---------------------------- | ---------------------------- | +| `prose-headings:{utility}` | `h1`, `h2`, `h3`, `h4`, `th` | +| `prose-lead:{utility}` | `[class~="lead"]` | +| `prose-h1:{utility}` | `h1` | +| `prose-h2:{utility}` | `h2` | +| `prose-h3:{utility}` | `h3` | +| `prose-h4:{utility}` | `h4` | +| `prose-p:{utility}` | `p` | +| `prose-a:{utility}` | `a` | +| `prose-blockquote:{utility}` | `blockquote` | +| `prose-figure:{utility}` | `figure` | +| `prose-figcaption:{utility}` | `figcaption` | +| `prose-strong:{utility}` | `strong` | +| `prose-em:{utility}` | `em` | +| `prose-kbd:{utility}` | `kbd` | +| `prose-code:{utility}` | `code` | +| `prose-pre:{utility}` | `pre` | +| `prose-ol:{utility}` | `ol` | +| `prose-ul:{utility}` | `ul` | +| `prose-li:{utility}` | `li` | +| `prose-table:{utility}` | `table` | +| `prose-thead:{utility}` | `thead` | +| `prose-tr:{utility}` | `tr` | +| `prose-th:{utility}` | `th` | +| `prose-td:{utility}` | `td` | +| `prose-img:{utility}` | `img` | +| `prose-video:{utility}` | `video` | +| `prose-hr:{utility}` | `hr` | + +When stacking these modifiers with other modifiers like `hover`, you most likely want the other modifier to come first: + +```html +
{{ markdown }}
+``` + +Read the Tailwind CSS documentation on [ordering stacked modifiers](https://tailwindcss.com/docs/hover-focus-and-other-states#ordering-stacked-modifiers) to learn more. + +### Overriding max-width + +Each size modifier comes with a baked in `max-width` designed to keep the content as readable as possible. This isn't always what you want though, and sometimes you'll want the content to just fill the width of its container. + +In those cases, all you need to do is add `max-w-none` to your content to override the embedded max-width: + +```html +
+
+ +
+
+
{{ markdown }}
+
+
+``` + +--- + +## Advanced topics + +### Undoing typography styles + +If you have a block of markup embedded in some content that shouldn't inherit the `prose` styles, use the `not-prose` class to sandbox it: + +```html +
+

My Heading

+

...

+ +
+ +
+ +

...

+ +
+``` + +Note that you can't nest new `prose` instances within a `not-prose` block at this time. + +### Adding custom color themes + +You can create your own color theme by adding a new key in the `typography` section of your `tailwind.config.js` file and providing your colors under the `css` key: + +```js {{ filename: 'tailwind.config.js' }} +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + extend: { + typography: ({ theme }) => ({ + pink: { + css: { + '--tw-prose-body': theme('colors.pink[800]'), + '--tw-prose-headings': theme('colors.pink[900]'), + '--tw-prose-lead': theme('colors.pink[700]'), + '--tw-prose-links': theme('colors.pink[900]'), + '--tw-prose-bold': theme('colors.pink[900]'), + '--tw-prose-counters': theme('colors.pink[600]'), + '--tw-prose-bullets': theme('colors.pink[400]'), + '--tw-prose-hr': theme('colors.pink[300]'), + '--tw-prose-quotes': theme('colors.pink[900]'), + '--tw-prose-quote-borders': theme('colors.pink[300]'), + '--tw-prose-captions': theme('colors.pink[700]'), + '--tw-prose-code': theme('colors.pink[900]'), + '--tw-prose-pre-code': theme('colors.pink[100]'), + '--tw-prose-pre-bg': theme('colors.pink[900]'), + '--tw-prose-th-borders': theme('colors.pink[300]'), + '--tw-prose-td-borders': theme('colors.pink[200]'), + '--tw-prose-invert-body': theme('colors.pink[200]'), + '--tw-prose-invert-headings': theme('colors.white'), + '--tw-prose-invert-lead': theme('colors.pink[300]'), + '--tw-prose-invert-links': theme('colors.white'), + '--tw-prose-invert-bold': theme('colors.white'), + '--tw-prose-invert-counters': theme('colors.pink[400]'), + '--tw-prose-invert-bullets': theme('colors.pink[600]'), + '--tw-prose-invert-hr': theme('colors.pink[700]'), + '--tw-prose-invert-quotes': theme('colors.pink[100]'), + '--tw-prose-invert-quote-borders': theme('colors.pink[700]'), + '--tw-prose-invert-captions': theme('colors.pink[400]'), + '--tw-prose-invert-code': theme('colors.white'), + '--tw-prose-invert-pre-code': theme('colors.pink[300]'), + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': theme('colors.pink[600]'), + '--tw-prose-invert-td-borders': theme('colors.pink[700]'), + }, + }, + }), + }, + }, + plugins: [ + require('@tailwindcss/typography'), + // ... + ], +} +``` + +See our internal [style definitions](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/src/styles.js) for some more examples. + +### Changing the default class name + +If you need to use a class name other than `prose` for any reason, you can do so using the `className` option when registering the plugin: + +```js {{ filename: 'tailwind.config.js' }} +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + // ... + }, + plugins: [ + require('@tailwindcss/typography')({ + className: 'wysiwyg', + }), + ] + ... +} +``` + +Now every instance of `prose` in the default class names will be replaced by your custom class name: + +```html +
+

My Heading

+

...

+ +
+ +
+ +

...

+ +
+``` + +### Customizing the CSS + +If you want to customize the raw CSS generated by this plugin, add your overrides under the `typography` key in the `theme` section of your `tailwind.config.js` file: + +```js {{ filename: 'tailwind.config.js' }} +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + extend: { + typography: { + DEFAULT: { + css: { + color: '#333', + a: { + color: '#3182ce', + '&:hover': { + color: '#2c5282', + }, + }, + }, + }, + }, + }, + }, + plugins: [ + require('@tailwindcss/typography'), + // ... + ], +} +``` + +Like with all theme customizations in Tailwind, you can also define the `typography` key as a function if you need access to the `theme` helper: + +```js {{ filename: 'tailwind.config.js' }} +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + extend: { + typography: (theme) => ({ + DEFAULT: { + css: { + color: theme('colors.gray.800'), + + // ... + }, + }, + }), + }, + }, + plugins: [ + require('@tailwindcss/typography'), + // ... + ], +} +``` + +Customizations should be applied to a specific modifier like `DEFAULT` or `xl`, and must be added under the `css` property. Customizations are authored in the same [CSS-in-JS syntax](https://tailwindcss.com/docs/plugins#css-in-js-syntax) used to write Tailwind plugins. + +See [the default styles](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/src/styles.js) for this plugin for more in-depth examples of configuring each modifier. + +--- + +## Community + +For help, discussion about best practices, or any other conversation that would benefit from being searchable: + +[Discuss the Tailwind CSS Typography plugin on GitHub](https://github.com/tailwindlabs/tailwindcss/discussions) + +For casual chit-chat with others using the framework: + +[Join the Tailwind CSS Discord Server](https://tailwindcss.com/discord) diff --git a/tools/ui/node_modules/@tailwindcss/typography/package.json b/tools/ui/node_modules/@tailwindcss/typography/package.json new file mode 100644 index 0000000000000000000000000000000000000000..70ff5f3745dce1273cd50ea875fd55887e53f31b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/package.json @@ -0,0 +1,61 @@ +{ + "name": "@tailwindcss/typography", + "version": "0.5.16", + "description": "A Tailwind CSS plugin for automatically styling plain HTML content with beautiful typographic defaults.", + "main": "src/index.js", + "types": "src/index.d.ts", + "files": [ + "src/*.js", + "src/*.d.ts", + "dist/" + ], + "repository": "https://github.com/tailwindlabs/tailwindcss-typography", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "prettier": { + "printWidth": 100, + "semi": false, + "singleQuote": true, + "trailingComma": "es5" + }, + "scripts": { + "test": "jest", + "dev": "next dev demo", + "build": "next build demo", + "export": "next export demo", + "start": "next start demo", + "release-channel": "node ./scripts/release-channel.js", + "release-notes": "node ./scripts/release-notes.js" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" + }, + "devDependencies": { + "@mdx-js/loader": "^1.0.19", + "@mdx-js/mdx": "^1.6.6", + "@next/mdx": "^8.1.0", + "autoprefixer": "^10.2.1", + "highlight.js": "^10.4.1", + "jest": "^29.7.0", + "jest-diff": "^27.3.1", + "next": "^12.0.1", + "postcss": "^8.2.3", + "prettier": "^2.1.2", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "tailwindcss": "^3.2.2" + }, + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "jest": { + "setupFilesAfterEnv": [ + "/jest/customMatchers.js" + ] + } +} diff --git a/tools/ui/node_modules/@tailwindcss/typography/src/index.d.ts b/tools/ui/node_modules/@tailwindcss/typography/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5c38097ca0fedab6c02acd41630ef6f4a077179c --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/src/index.d.ts @@ -0,0 +1,9 @@ +declare function plugin(options?: Partial<{ className: string; target: 'modern' | 'legacy' }>): { + handler: () => void +} + +declare namespace plugin { + const __isOptionsFunction: true +} + +export = plugin diff --git a/tools/ui/node_modules/@tailwindcss/typography/src/index.js b/tools/ui/node_modules/@tailwindcss/typography/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..04830b9bf1373ded0a6358afc380e4ec208dcedf --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/src/index.js @@ -0,0 +1,140 @@ +const plugin = require('tailwindcss/plugin') +const merge = require('lodash.merge') +const castArray = require('lodash.castarray') +const styles = require('./styles') +const { commonTrailingPseudos } = require('./utils') + +const computed = { + // Reserved for future "magic properties", for example: + // bulletColor: (color) => ({ 'ul > li::before': { backgroundColor: color } }), +} + +function inWhere(selector, { className, modifier, prefix }) { + let prefixedNot = prefix(`.not-${className}`).slice(1) + let selectorPrefix = selector.startsWith('>') + ? `${modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`} ` + : '' + + // Parse the selector, if every component ends in the same pseudo element(s) then move it to the end + let [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector) + + if (trailingPseudo) { + return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}` + } + + return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))` +} + +function isObject(value) { + return typeof value === 'object' && value !== null +} + +function configToCss(config = {}, { target, className, modifier, prefix }) { + function updateSelector(k, v) { + if (target === 'legacy') { + return [k, v] + } + + if (Array.isArray(v)) { + return [k, v] + } + + if (isObject(v)) { + let nested = Object.values(v).some(isObject) + if (nested) { + return [ + inWhere(k, { className, modifier, prefix }), + v, + Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v))), + ] + } + + return [inWhere(k, { className, modifier, prefix }), v] + } + + return [k, v] + } + + return Object.fromEntries( + Object.entries( + merge( + {}, + ...Object.keys(config) + .filter((key) => computed[key]) + .map((key) => computed[key](config[key])), + ...castArray(config.css || {}) + ) + ).map(([k, v]) => updateSelector(k, v)) + ) +} + +module.exports = plugin.withOptions( + ({ className = 'prose', target = 'modern' } = {}) => { + return function ({ addVariant, addComponents, theme, prefix }) { + let modifiers = theme('typography') + + let options = { className, prefix } + + for (let [name, ...selectors] of [ + ['headings', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'th'], + ['h1'], + ['h2'], + ['h3'], + ['h4'], + ['h5'], + ['h6'], + ['p'], + ['a'], + ['blockquote'], + ['figure'], + ['figcaption'], + ['strong'], + ['em'], + ['kbd'], + ['code'], + ['pre'], + ['ol'], + ['ul'], + ['li'], + ['table'], + ['thead'], + ['tr'], + ['th'], + ['td'], + ['img'], + ['video'], + ['hr'], + ['lead', '[class~="lead"]'], + ]) { + selectors = selectors.length === 0 ? [name] : selectors + + let selector = + target === 'legacy' ? selectors.map((selector) => `& ${selector}`) : selectors.join(', ') + + addVariant( + `${className}-${name}`, + target === 'legacy' ? selector : `& :is(${inWhere(selector, options)})` + ) + } + + addComponents( + Object.keys(modifiers).map((modifier) => ({ + [modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`]: configToCss( + modifiers[modifier], + { + target, + className, + modifier, + prefix, + } + ), + })) + ) + } + }, + () => { + return { + theme: { typography: styles }, + } + } +) diff --git a/tools/ui/node_modules/@tailwindcss/typography/src/index.test.js b/tools/ui/node_modules/@tailwindcss/typography/src/index.test.js new file mode 100644 index 0000000000000000000000000000000000000000..8db6c6cb9e230ab7b20e295a47e5eaafbfbc5e91 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/src/index.test.js @@ -0,0 +1,1423 @@ +const path = require('path') +const tailwind = require('tailwindcss') +const postcss = require('postcss') +const typographyPlugin = require('.') + +let html = String.raw +let css = String.raw + +let vars = ` + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --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: ; +` +let defaults = css` + *, + ::before, + ::after { + ${vars} + } + ::backdrop { + ${vars} + } +` + +function run(config, plugin = tailwind) { + let { currentTestName } = expect.getState() + config = { + ...{ plugins: [typographyPlugin], corePlugins: { preflight: false } }, + ...config, + } + + return postcss(plugin(config)).process( + ['@tailwind base;', '@tailwind components;', '@tailwind utilities'].join('\n'), + { + from: `${path.resolve(__filename)}?test=${currentTestName}`, + } + ) +} + +test('specificity is reduced with :where', async () => { + let config = { + content: [{ raw: html`
` }], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + maxWidth: '65ch', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'ol[type="A"]': { + listStyleType: 'upper-alpha', + }, + 'blockquote p:first-of-type::before': { + content: 'open-quote', + }, + 'blockquote p:last-of-type::after': { + content: 'close-quote', + }, + 'h4 strong': { + fontWeight: '700', + }, + 'figure > *': { + margin: 0, + }, + 'ol > li::marker': { + fontWeight: '400', + color: 'var(--tw-prose-counters)', + }, + '> ul > li p': { + marginTop: '16px', + marginBottom: '16px', + }, + 'code::before': { + content: '"`"', + }, + 'code::after': { + content: '"`"', + }, + }, + ], + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .prose { + color: var(--tw-prose-body); + max-width: 65ch; + } + .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-lead); + } + .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-bold); + font-weight: 600; + } + .prose :where(ol[type='A']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + list-style-type: upper-alpha; + } + .prose + :where(blockquote p:first-of-type):not(:where([class~='not-prose'], [class~='not-prose'] + *))::before { + content: open-quote; + } + .prose + :where(blockquote p:last-of-type):not(:where([class~='not-prose'], [class~='not-prose'] + *))::after { + content: close-quote; + } + .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-weight: 700; + } + .prose :where(figure > *):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin: 0; + } + .prose :where(ol > li):not(:where([class~='not-prose'], [class~='not-prose'] *))::marker { + font-weight: 400; + color: var(--tw-prose-counters); + } + .prose + :where(.prose > ul > li p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin-top: 16px; + margin-bottom: 16px; + } + .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { + content: '`'; + } + .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::after { + content: '`'; + } + ` + ) + }) +}) + +test('variants', async () => { + let config = { + content: [{ raw: html`
` }], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'red', + p: { + color: 'lime', + }, + '> ul > li': { + color: 'purple', + }, + }, + ], + }, + lg: { + css: { + color: 'green', + p: { + color: 'tomato', + }, + '> ul > li': { + color: 'blue', + }, + }, + }, + xl: { + css: { + color: 'yellow', + '> ul > li': { + color: 'hotpink', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .hover\:prose-lg:hover { + color: green; + } + .hover\:prose-lg:hover :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: tomato; + } + .hover\:prose-lg:hover + :where(.hover\:prose-lg:hover + > ul + > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: blue; + } + @media (min-width: 640px) { + .sm\:prose { + color: red; + } + .sm\:prose :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: lime; + } + .sm\:prose + :where(.sm\:prose > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: purple; + } + } + @media (min-width: 1024px) { + .lg\:prose-lg { + color: green; + } + .lg\:prose-lg :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: tomato; + } + .lg\:prose-lg + :where(.lg\:prose-lg > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] + *)) { + color: blue; + } + } + ` + ) + }) +}) + +test('modifiers', async () => { + let config = { + content: [{ raw: html`
` }], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + maxWidth: '65ch', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'ol[type="A"]': { + listStyleType: 'upper-alpha', + }, + 'blockquote p:first-of-type::before': { + content: 'open-quote', + }, + 'blockquote p:last-of-type::after': { + content: 'close-quote', + }, + 'h4 strong': { + fontWeight: '700', + }, + 'figure > *': { + margin: 0, + }, + 'ol > li::marker': { + fontWeight: '400', + color: 'var(--tw-prose-counters)', + }, + 'code::before': { + content: '"`"', + }, + 'code::after': { + content: '"`"', + }, + }, + ], + }, + lg: { + css: [ + { + fontSize: '18px', + lineHeight: '1.75', + p: { + marginTop: '24px', + marginBottom: '24px', + }, + '[class~="lead"]': { + fontSize: '22px', + }, + blockquote: { + marginTop: '40px', + marginBottom: '40px', + }, + '> ul > li': { + paddingLeft: '12px', + }, + h1: { + fontSize: '48px', + marginTop: '0', + marginBottom: '40px', + }, + h2: { + fontSize: '30px', + marginTop: '56px', + marginBottom: '32px', + }, + h3: { + fontSize: '24px', + marginTop: '40px', + marginBottom: '16px', + }, + }, + ], + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .prose { + color: var(--tw-prose-body); + max-width: 65ch; + } + .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-lead); + } + .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-bold); + font-weight: 600; + } + .prose :where(ol[type='A']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + list-style-type: upper-alpha; + } + .prose + :where(blockquote p:first-of-type):not(:where([class~='not-prose'], [class~='not-prose'] + *))::before { + content: open-quote; + } + .prose + :where(blockquote p:last-of-type):not(:where([class~='not-prose'], [class~='not-prose'] + *))::after { + content: close-quote; + } + .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-weight: 700; + } + .prose :where(figure > *):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin: 0; + } + .prose :where(ol > li):not(:where([class~='not-prose'], [class~='not-prose'] *))::marker { + font-weight: 400; + color: var(--tw-prose-counters); + } + .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { + content: '`'; + } + .prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))::after { + content: '`'; + } + .prose-lg { + font-size: 18px; + line-height: 1.75; + } + .prose-lg :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin-top: 24px; + margin-bottom: 24px; + } + .prose-lg + :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-size: 22px; + } + .prose-lg :where(blockquote):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin-top: 40px; + margin-bottom: 40px; + } + .prose-lg + :where(.prose-lg > ul > li):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + padding-left: 12px; + } + .prose-lg :where(h1):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-size: 48px; + margin-top: 0; + margin-bottom: 40px; + } + .prose-lg :where(h2):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-size: 30px; + margin-top: 56px; + margin-bottom: 32px; + } + .prose-lg :where(h3):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-size: 24px; + margin-top: 40px; + margin-bottom: 16px; + } + ` + ) + }) +}) + +test('legacy target', async () => { + let config = { + plugins: [typographyPlugin({ target: 'legacy' })], + content: [ + { raw: html`
` }, + ], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + maxWidth: '65ch', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'ol[type="A"]': { + listStyleType: 'upper-alpha', + }, + 'blockquote p:first-of-type::before': { + content: 'open-quote', + }, + 'blockquote p:last-of-type::after': { + content: 'close-quote', + }, + 'h4 strong': { + fontWeight: '700', + }, + 'figure > *': { + margin: 0, + }, + 'ol > li::marker': { + fontWeight: '400', + color: 'var(--tw-prose-counters)', + }, + 'code::before': { + content: '"`"', + }, + 'code::after': { + content: '"`"', + }, + }, + ], + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .prose { + color: var(--tw-prose-body); + max-width: 65ch; + } + .prose [class~='lead'] { + color: var(--tw-prose-lead); + } + .prose strong { + color: var(--tw-prose-bold); + font-weight: 600; + } + .prose ol[type='A'] { + list-style-type: upper-alpha; + } + .prose blockquote p:first-of-type::before { + content: open-quote; + } + .prose blockquote p:last-of-type::after { + content: close-quote; + } + .prose h4 strong { + font-weight: 700; + } + .prose figure > * { + margin: 0; + } + .prose ol > li::marker { + font-weight: 400; + color: var(--tw-prose-counters); + } + .prose code::before { + content: '`'; + } + .prose code::after { + content: '`'; + } + .prose-headings\:text-ellipsis h1 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis h2 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis h3 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis h4 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis h5 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis h6 { + text-overflow: ellipsis; + } + .prose-headings\:text-ellipsis th { + text-overflow: ellipsis; + } + .prose-h1\:text-center h1 { + text-align: center; + } + ` + ) + }) +}) + +test('custom class name', async () => { + let config = { + plugins: [typographyPlugin({ className: 'markdown' })], + content: [{ raw: html`
` }], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + maxWidth: '65ch', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'ol[type="A"]': { + listStyleType: 'upper-alpha', + }, + 'blockquote p:first-of-type::before': { + content: 'open-quote', + }, + 'blockquote p:last-of-type::after': { + content: 'close-quote', + }, + 'h4 strong': { + fontWeight: '700', + }, + 'figure > *': { + margin: 0, + }, + 'ol > li::marker': { + fontWeight: '400', + color: 'var(--tw-prose-counters)', + }, + 'code::before': { + content: '"`"', + }, + 'code::after': { + content: '"`"', + }, + }, + ], + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .markdown { + color: var(--tw-prose-body); + max-width: 65ch; + } + .markdown + :where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + color: var(--tw-prose-lead); + } + .markdown :where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + color: var(--tw-prose-bold); + font-weight: 600; + } + .markdown + :where(ol[type='A']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + list-style-type: upper-alpha; + } + .markdown + :where(blockquote + p:first-of-type):not(:where([class~='not-markdown'], [class~='not-markdown'] + *))::before { + content: open-quote; + } + .markdown + :where(blockquote + p:last-of-type):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::after { + content: close-quote; + } + .markdown + :where(h4 strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + font-weight: 700; + } + .markdown + :where(figure > *):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + margin: 0; + } + .markdown + :where(ol > li):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::marker { + font-weight: 400; + color: var(--tw-prose-counters); + } + .markdown + :where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::before { + content: '`'; + } + .markdown + :where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))::after { + content: '`'; + } + ` + ) + }) +}) + +test('element variants', async () => { + let config = { + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'h4 strong': { + fontWeight: '700', + }, + }, + ], + }, + }, + }, + } + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .prose { + color: var(--tw-prose-body); + } + .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-lead); + } + .prose :where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-bold); + font-weight: 600; + } + .prose :where(h4 strong):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + font-weight: 700; + } + .prose-headings\:underline + :is(:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~='not-prose'], [class~='not-prose'] + *))) { + text-decoration-line: underline; + } + .prose-h1\:text-3xl + :is(:where(h1):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 1.875rem; + line-height: 2.25rem; + } + .prose-h2\:text-2xl + :is(:where(h2):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 1.5rem; + line-height: 2rem; + } + .prose-h3\:text-xl + :is(:where(h3):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 1.25rem; + line-height: 1.75rem; + } + .prose-h4\:text-lg + :is(:where(h4):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 1.125rem; + line-height: 1.75rem; + } + .prose-p\:text-gray-700 + :is(:where(p):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); + } + .prose-a\:font-bold + :is(:where(a):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-weight: 700; + } + .prose-blockquote\:italic + :is(:where(blockquote):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-style: italic; + } + .prose-figure\:mx-auto + :is(:where(figure):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + margin-left: auto; + margin-right: auto; + } + .prose-figcaption\:opacity-75 + :is(:where(figcaption):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + opacity: 0.75; + } + .prose-strong\:font-medium + :is(:where(strong):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-weight: 500; + } + .prose-em\:italic + :is(:where(em):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-style: italic; + } + .prose-kbd\:border-b-2 + :is(:where(kbd):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + border-bottom-width: 2px; + } + .prose-code\:font-mono + :is(:where(code):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + } + .prose-pre\:font-mono + :is(:where(pre):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + } + .prose-ol\:pl-6 :is(:where(ol):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + padding-left: 1.5rem; + } + .prose-ul\:pl-8 :is(:where(ul):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + padding-left: 2rem; + } + .prose-li\:my-4 :is(:where(li):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + margin-top: 1rem; + margin-bottom: 1rem; + } + .prose-table\:my-8 + :is(:where(table):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + margin-top: 2rem; + margin-bottom: 2rem; + } + .prose-thead\:border-red-300 + :is(:where(thead):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + --tw-border-opacity: 1; + border-color: rgb(252 165 165 / var(--tw-border-opacity)); + } + .prose-tr\:border-red-200 + :is(:where(tr):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + --tw-border-opacity: 1; + border-color: rgb(254 202 202 / var(--tw-border-opacity)); + } + .prose-th\:text-left + :is(:where(th):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + text-align: left; + } + .prose-img\:rounded-lg + :is(:where(img):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + border-radius: 0.5rem; + } + .prose-video\:my-12 + :is(:where(video):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + margin-top: 3rem; + margin-bottom: 3rem; + } + .prose-hr\:border-t-2 + :is(:where(hr):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + border-top-width: 2px; + } + .prose-lead\:italic + :is(:where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-style: italic; + } + ` + ) + }) +}) + +test('element variants with custom class name', async () => { + let config = { + plugins: [typographyPlugin({ className: 'markdown' })], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'h4 strong': { + fontWeight: '700', + }, + }, + ], + }, + }, + }, + } + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .markdown { + color: var(--tw-prose-body); + } + .markdown + :where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + color: var(--tw-prose-lead); + } + .markdown :where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + color: var(--tw-prose-bold); + font-weight: 600; + } + .markdown + :where(h4 strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *)) { + font-weight: 700; + } + .markdown-headings\:underline + :is(:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~='not-markdown'], [class~='not-markdown'] + *))) { + text-decoration-line: underline; + } + .markdown-h1\:text-3xl + :is(:where(h1):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-size: 1.875rem; + line-height: 2.25rem; + } + .markdown-h2\:text-2xl + :is(:where(h2):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-size: 1.5rem; + line-height: 2rem; + } + .markdown-h3\:text-xl + :is(:where(h3):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-size: 1.25rem; + line-height: 1.75rem; + } + .markdown-h4\:text-lg + :is(:where(h4):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-size: 1.125rem; + line-height: 1.75rem; + } + .markdown-p\:text-gray-700 + :is(:where(p):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); + } + .markdown-a\:font-bold + :is(:where(a):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-weight: 700; + } + .markdown-blockquote\:italic + :is(:where(blockquote):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-style: italic; + } + .markdown-figure\:mx-auto + :is(:where(figure):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + margin-left: auto; + margin-right: auto; + } + .markdown-figcaption\:opacity-75 + :is(:where(figcaption):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + opacity: 0.75; + } + .markdown-strong\:font-medium + :is(:where(strong):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-weight: 500; + } + .markdown-em\:italic + :is(:where(em):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-style: italic; + } + .markdown-kbd\:border-b-2 + :is(:where(kbd):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + border-bottom-width: 2px; + } + .markdown-code\:font-mono + :is(:where(code):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + } + .markdown-pre\:font-mono + :is(:where(pre):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + } + .markdown-ol\:pl-6 + :is(:where(ol):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + padding-left: 1.5rem; + } + .markdown-ul\:pl-8 + :is(:where(ul):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + padding-left: 2rem; + } + .markdown-li\:my-4 + :is(:where(li):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + margin-top: 1rem; + margin-bottom: 1rem; + } + .markdown-table\:my-8 + :is(:where(table):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + margin-top: 2rem; + margin-bottom: 2rem; + } + .markdown-thead\:border-red-300 + :is(:where(thead):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + --tw-border-opacity: 1; + border-color: rgb(252 165 165 / var(--tw-border-opacity)); + } + .markdown-tr\:border-red-200 + :is(:where(tr):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + --tw-border-opacity: 1; + border-color: rgb(254 202 202 / var(--tw-border-opacity)); + } + .markdown-th\:text-left + :is(:where(th):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + text-align: left; + } + .markdown-img\:rounded-lg + :is(:where(img):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + border-radius: 0.5rem; + } + .markdown-video\:my-12 + :is(:where(video):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + margin-top: 3rem; + margin-bottom: 3rem; + } + .markdown-hr\:border-t-2 + :is(:where(hr):not(:where([class~='not-markdown'], [class~='not-markdown'] *))) { + border-top-width: 2px; + } + .markdown-lead\:italic + :is(:where([class~='lead']):not(:where([class~='not-markdown'], [class~='not-markdown'] + *))) { + font-style: italic; + } + ` + ) + }) +}) + +test('customizing defaults with multiple values does not result in invalid css', async () => { + let config = { + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + textAlign: ['-webkit-match-parent', 'match-parent'], + }, + }, + }, + }, + } + return run(config).then((result) => { + expect(result.css).toMatchFormattedCss( + css` + ${defaults} + + .prose { + text-align: -webkit-match-parent; + text-align: match-parent; + } + ` + ) + }) +}) + +it('should be possible to use nested syntax (&) when extending the config', () => { + let config = { + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + extend: { + typography: { + DEFAULT: { + css: { + color: '#000', + a: { + color: '#888', + '&:hover': { + color: '#ff0000', + }, + }, + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose { + color: #000; + max-width: 65ch; + } + `) + + expect(result.css).toIncludeCss(css` + .prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: #888; + text-decoration: underline; + font-weight: 500; + } + `) + + expect(result.css).toIncludeCss(css` + .prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)):hover { + color: #ff0000; + } + `) + }) +}) + +it('should be possible to specify custom h5 and h6 styles', () => { + let config = { + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose-h5\:text-sm :is(:where(h5):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 0.875rem; + line-height: 1.25rem; + } + .prose-h6\:text-xl :is(:where(h6):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + font-size: 1.25rem; + line-height: 1.75rem; + } + `) + }) +}) + +it('should not break with multiple selectors with pseudo elements using variants', () => { + let config = { + darkMode: 'class', + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + 'ol li::before, ul li::before': { + color: 'red', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .dark + .dark\:prose + :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { + color: red; + } + `) + }) +}) + +it('lifts all common, trailing pseudo elements when the same across all selectors', () => { + let config = { + darkMode: 'class', + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + 'ol li::marker::before, ul li::marker::before': { + color: 'red', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose + :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] + *))::marker::before { + color: red; + } + `) + + // TODO: The output here is a bug in tailwindcss variant selector rewriting + // IT should be ::marker::before + expect(result.css).toIncludeCss(css` + .dark + .dark\:prose + :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] + *))::before::marker { + color: red; + } + `) + }) +}) + +it('does not modify selectors with differing pseudo elements', () => { + let config = { + darkMode: 'class', + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + 'ol li::before, ul li::after': { + color: 'red', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose + :where(ol li::before, ul li::after):not(:where([class~='not-prose'], [class~='not-prose'] + *)) { + color: red; + } + `) + + // TODO: The output here is a bug in tailwindcss variant selector rewriting + expect(result.css).toIncludeCss(css` + .dark + .dark\:prose + :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] *))::before, + ::after { + color: red; + } + `) + }) +}) + +it('lifts only the common, trailing pseudo elements from selectors', () => { + let config = { + darkMode: 'class', + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + 'ol li::scroll-thumb::before, ul li::scroll-track::before': { + color: 'red', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose + :where(ol li::scroll-thumb, ul + li::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *))::before { + color: red; + } + `) + + // TODO: The output here is a bug in tailwindcss variant selector rewriting + expect(result.css).toIncludeCss(css` + .dark + .dark\:prose + :where(ol li, ul li):not(:where([class~='not-prose'], [class~='not-prose'] + *))::scroll-thumb, + ::scroll-track, + ::before { + color: red; + } + `) + }) +}) + +it('ignores common non-trailing pseudo-elements in selectors', () => { + let config = { + darkMode: 'class', + plugins: [typographyPlugin()], + content: [ + { + raw: html`
`, + }, + ], + theme: { + typography: { + DEFAULT: { + css: { + 'ol li::before::scroll-thumb, ul li::before::scroll-track': { + color: 'red', + }, + }, + }, + }, + }, + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss(css` + .prose + :where(ol li::before::scroll-thumb, ul + li::before::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: red; + } + `) + + // TODO: The output here is a bug in tailwindcss variant selector rewriting + expect(result.css).toIncludeCss(css` + .dark + .dark\:prose + :where(ol li::scroll-thumb, ul + li::scroll-track):not(:where([class~='not-prose'], [class~='not-prose'] *))::before, + ::before { + color: red; + } + `) + }) +}) + +test('lead styles are inserted after paragraph styles', async () => { + let config = { + content: [{ raw: html`
` }], + } + + return run(config).then((result) => { + expect(result.css).toIncludeCss( + css` + .prose { + color: var(--tw-prose-body); + max-width: 65ch; + } + .prose :where(p):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + .prose :where([class~='lead']):not(:where([class~='not-prose'], [class~='not-prose'] *)) { + color: var(--tw-prose-lead); + font-size: 1.25em; + line-height: 1.6; + margin-top: 1.2em; + margin-bottom: 1.2em; + } + ` + ) + }) +}) diff --git a/tools/ui/node_modules/@tailwindcss/typography/src/styles.js b/tools/ui/node_modules/@tailwindcss/typography/src/styles.js new file mode 100644 index 0000000000000000000000000000000000000000..a4d6967391ee1b747a173193cab7bfe31c3014f3 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/src/styles.js @@ -0,0 +1,1632 @@ +const colors = require('tailwindcss/colors') + +const round = (num) => + num + .toFixed(7) + .replace(/(\.[0-9]+?)0+$/, '$1') + .replace(/\.0$/, '') +const rem = (px) => `${round(px / 16)}rem` +const em = (px, base) => `${round(px / base)}em` +const hexToRgb = (hex) => { + hex = hex.replace('#', '') + hex = hex.length === 3 ? hex.replace(/./g, '$&$&') : hex + const r = parseInt(hex.substring(0, 2), 16) + const g = parseInt(hex.substring(2, 4), 16) + const b = parseInt(hex.substring(4, 6), 16) + return `${r} ${g} ${b}` +} + +let defaultModifiers = { + sm: { + css: [ + { + fontSize: rem(14), + lineHeight: round(24 / 14), + p: { + marginTop: em(16, 14), + marginBottom: em(16, 14), + }, + '[class~="lead"]': { + fontSize: em(18, 14), + lineHeight: round(28 / 18), + marginTop: em(16, 18), + marginBottom: em(16, 18), + }, + blockquote: { + marginTop: em(24, 18), + marginBottom: em(24, 18), + paddingInlineStart: em(20, 18), + }, + h1: { + fontSize: em(30, 14), + marginTop: '0', + marginBottom: em(24, 30), + lineHeight: round(36 / 30), + }, + h2: { + fontSize: em(20, 14), + marginTop: em(32, 20), + marginBottom: em(16, 20), + lineHeight: round(28 / 20), + }, + h3: { + fontSize: em(18, 14), + marginTop: em(28, 18), + marginBottom: em(8, 18), + lineHeight: round(28 / 18), + }, + h4: { + marginTop: em(20, 14), + marginBottom: em(8, 14), + lineHeight: round(20 / 14), + }, + img: { + marginTop: em(24, 14), + marginBottom: em(24, 14), + }, + picture: { + marginTop: em(24, 14), + marginBottom: em(24, 14), + }, + 'picture > img': { + marginTop: '0', + marginBottom: '0', + }, + video: { + marginTop: em(24, 14), + marginBottom: em(24, 14), + }, + kbd: { + fontSize: em(12, 14), + borderRadius: rem(5), + paddingTop: em(2, 14), + paddingInlineEnd: em(5, 14), + paddingBottom: em(2, 14), + paddingInlineStart: em(5, 14), + }, + code: { + fontSize: em(12, 14), + }, + 'h2 code': { + fontSize: em(18, 20), + }, + 'h3 code': { + fontSize: em(16, 18), + }, + pre: { + fontSize: em(12, 14), + lineHeight: round(20 / 12), + marginTop: em(20, 12), + marginBottom: em(20, 12), + borderRadius: rem(4), + paddingTop: em(8, 12), + paddingInlineEnd: em(12, 12), + paddingBottom: em(8, 12), + paddingInlineStart: em(12, 12), + }, + ol: { + marginTop: em(16, 14), + marginBottom: em(16, 14), + paddingInlineStart: em(22, 14), + }, + ul: { + marginTop: em(16, 14), + marginBottom: em(16, 14), + paddingInlineStart: em(22, 14), + }, + li: { + marginTop: em(4, 14), + marginBottom: em(4, 14), + }, + 'ol > li': { + paddingInlineStart: em(6, 14), + }, + 'ul > li': { + paddingInlineStart: em(6, 14), + }, + '> ul > li p': { + marginTop: em(8, 14), + marginBottom: em(8, 14), + }, + '> ul > li > p:first-child': { + marginTop: em(16, 14), + }, + '> ul > li > p:last-child': { + marginBottom: em(16, 14), + }, + '> ol > li > p:first-child': { + marginTop: em(16, 14), + }, + '> ol > li > p:last-child': { + marginBottom: em(16, 14), + }, + 'ul ul, ul ol, ol ul, ol ol': { + marginTop: em(8, 14), + marginBottom: em(8, 14), + }, + dl: { + marginTop: em(16, 14), + marginBottom: em(16, 14), + }, + dt: { + marginTop: em(16, 14), + }, + dd: { + marginTop: em(4, 14), + paddingInlineStart: em(22, 14), + }, + hr: { + marginTop: em(40, 14), + marginBottom: em(40, 14), + }, + 'hr + *': { + marginTop: '0', + }, + 'h2 + *': { + marginTop: '0', + }, + 'h3 + *': { + marginTop: '0', + }, + 'h4 + *': { + marginTop: '0', + }, + table: { + fontSize: em(12, 14), + lineHeight: round(18 / 12), + }, + 'thead th': { + paddingInlineEnd: em(12, 12), + paddingBottom: em(8, 12), + paddingInlineStart: em(12, 12), + }, + 'thead th:first-child': { + paddingInlineStart: '0', + }, + 'thead th:last-child': { + paddingInlineEnd: '0', + }, + 'tbody td, tfoot td': { + paddingTop: em(8, 12), + paddingInlineEnd: em(12, 12), + paddingBottom: em(8, 12), + paddingInlineStart: em(12, 12), + }, + 'tbody td:first-child, tfoot td:first-child': { + paddingInlineStart: '0', + }, + 'tbody td:last-child, tfoot td:last-child': { + paddingInlineEnd: '0', + }, + figure: { + marginTop: em(24, 14), + marginBottom: em(24, 14), + }, + 'figure > *': { + marginTop: '0', + marginBottom: '0', + }, + figcaption: { + fontSize: em(12, 14), + lineHeight: round(16 / 12), + marginTop: em(8, 12), + }, + }, + { + '> :first-child': { + marginTop: '0', + }, + '> :last-child': { + marginBottom: '0', + }, + }, + ], + }, + base: { + css: [ + { + fontSize: rem(16), + lineHeight: round(28 / 16), + p: { + marginTop: em(20, 16), + marginBottom: em(20, 16), + }, + '[class~="lead"]': { + fontSize: em(20, 16), + lineHeight: round(32 / 20), + marginTop: em(24, 20), + marginBottom: em(24, 20), + }, + blockquote: { + marginTop: em(32, 20), + marginBottom: em(32, 20), + paddingInlineStart: em(20, 20), + }, + h1: { + fontSize: em(36, 16), + marginTop: '0', + marginBottom: em(32, 36), + lineHeight: round(40 / 36), + }, + h2: { + fontSize: em(24, 16), + marginTop: em(48, 24), + marginBottom: em(24, 24), + lineHeight: round(32 / 24), + }, + h3: { + fontSize: em(20, 16), + marginTop: em(32, 20), + marginBottom: em(12, 20), + lineHeight: round(32 / 20), + }, + h4: { + marginTop: em(24, 16), + marginBottom: em(8, 16), + lineHeight: round(24 / 16), + }, + img: { + marginTop: em(32, 16), + marginBottom: em(32, 16), + }, + picture: { + marginTop: em(32, 16), + marginBottom: em(32, 16), + }, + 'picture > img': { + marginTop: '0', + marginBottom: '0', + }, + video: { + marginTop: em(32, 16), + marginBottom: em(32, 16), + }, + kbd: { + fontSize: em(14, 16), + borderRadius: rem(5), + paddingTop: em(3, 16), + paddingInlineEnd: em(6, 16), + paddingBottom: em(3, 16), + paddingInlineStart: em(6, 16), + }, + code: { + fontSize: em(14, 16), + }, + 'h2 code': { + fontSize: em(21, 24), + }, + 'h3 code': { + fontSize: em(18, 20), + }, + pre: { + fontSize: em(14, 16), + lineHeight: round(24 / 14), + marginTop: em(24, 14), + marginBottom: em(24, 14), + borderRadius: rem(6), + paddingTop: em(12, 14), + paddingInlineEnd: em(16, 14), + paddingBottom: em(12, 14), + paddingInlineStart: em(16, 14), + }, + ol: { + marginTop: em(20, 16), + marginBottom: em(20, 16), + paddingInlineStart: em(26, 16), + }, + ul: { + marginTop: em(20, 16), + marginBottom: em(20, 16), + paddingInlineStart: em(26, 16), + }, + li: { + marginTop: em(8, 16), + marginBottom: em(8, 16), + }, + 'ol > li': { + paddingInlineStart: em(6, 16), + }, + 'ul > li': { + paddingInlineStart: em(6, 16), + }, + '> ul > li p': { + marginTop: em(12, 16), + marginBottom: em(12, 16), + }, + '> ul > li > p:first-child': { + marginTop: em(20, 16), + }, + '> ul > li > p:last-child': { + marginBottom: em(20, 16), + }, + '> ol > li > p:first-child': { + marginTop: em(20, 16), + }, + '> ol > li > p:last-child': { + marginBottom: em(20, 16), + }, + 'ul ul, ul ol, ol ul, ol ol': { + marginTop: em(12, 16), + marginBottom: em(12, 16), + }, + dl: { + marginTop: em(20, 16), + marginBottom: em(20, 16), + }, + dt: { + marginTop: em(20, 16), + }, + dd: { + marginTop: em(8, 16), + paddingInlineStart: em(26, 16), + }, + hr: { + marginTop: em(48, 16), + marginBottom: em(48, 16), + }, + 'hr + *': { + marginTop: '0', + }, + 'h2 + *': { + marginTop: '0', + }, + 'h3 + *': { + marginTop: '0', + }, + 'h4 + *': { + marginTop: '0', + }, + table: { + fontSize: em(14, 16), + lineHeight: round(24 / 14), + }, + 'thead th': { + paddingInlineEnd: em(8, 14), + paddingBottom: em(8, 14), + paddingInlineStart: em(8, 14), + }, + 'thead th:first-child': { + paddingInlineStart: '0', + }, + 'thead th:last-child': { + paddingInlineEnd: '0', + }, + 'tbody td, tfoot td': { + paddingTop: em(8, 14), + paddingInlineEnd: em(8, 14), + paddingBottom: em(8, 14), + paddingInlineStart: em(8, 14), + }, + 'tbody td:first-child, tfoot td:first-child': { + paddingInlineStart: '0', + }, + 'tbody td:last-child, tfoot td:last-child': { + paddingInlineEnd: '0', + }, + figure: { + marginTop: em(32, 16), + marginBottom: em(32, 16), + }, + 'figure > *': { + marginTop: '0', + marginBottom: '0', + }, + figcaption: { + fontSize: em(14, 16), + lineHeight: round(20 / 14), + marginTop: em(12, 14), + }, + }, + { + '> :first-child': { + marginTop: '0', + }, + '> :last-child': { + marginBottom: '0', + }, + }, + ], + }, + lg: { + css: [ + { + fontSize: rem(18), + lineHeight: round(32 / 18), + p: { + marginTop: em(24, 18), + marginBottom: em(24, 18), + }, + '[class~="lead"]': { + fontSize: em(22, 18), + lineHeight: round(32 / 22), + marginTop: em(24, 22), + marginBottom: em(24, 22), + }, + blockquote: { + marginTop: em(40, 24), + marginBottom: em(40, 24), + paddingInlineStart: em(24, 24), + }, + h1: { + fontSize: em(48, 18), + marginTop: '0', + marginBottom: em(40, 48), + lineHeight: round(48 / 48), + }, + h2: { + fontSize: em(30, 18), + marginTop: em(56, 30), + marginBottom: em(32, 30), + lineHeight: round(40 / 30), + }, + h3: { + fontSize: em(24, 18), + marginTop: em(40, 24), + marginBottom: em(16, 24), + lineHeight: round(36 / 24), + }, + h4: { + marginTop: em(32, 18), + marginBottom: em(8, 18), + lineHeight: round(28 / 18), + }, + img: { + marginTop: em(32, 18), + marginBottom: em(32, 18), + }, + picture: { + marginTop: em(32, 18), + marginBottom: em(32, 18), + }, + 'picture > img': { + marginTop: '0', + marginBottom: '0', + }, + video: { + marginTop: em(32, 18), + marginBottom: em(32, 18), + }, + kbd: { + fontSize: em(16, 18), + borderRadius: rem(5), + paddingTop: em(4, 18), + paddingInlineEnd: em(8, 18), + paddingBottom: em(4, 18), + paddingInlineStart: em(8, 18), + }, + code: { + fontSize: em(16, 18), + }, + 'h2 code': { + fontSize: em(26, 30), + }, + 'h3 code': { + fontSize: em(21, 24), + }, + pre: { + fontSize: em(16, 18), + lineHeight: round(28 / 16), + marginTop: em(32, 16), + marginBottom: em(32, 16), + borderRadius: rem(6), + paddingTop: em(16, 16), + paddingInlineEnd: em(24, 16), + paddingBottom: em(16, 16), + paddingInlineStart: em(24, 16), + }, + ol: { + marginTop: em(24, 18), + marginBottom: em(24, 18), + paddingInlineStart: em(28, 18), + }, + ul: { + marginTop: em(24, 18), + marginBottom: em(24, 18), + paddingInlineStart: em(28, 18), + }, + li: { + marginTop: em(12, 18), + marginBottom: em(12, 18), + }, + 'ol > li': { + paddingInlineStart: em(8, 18), + }, + 'ul > li': { + paddingInlineStart: em(8, 18), + }, + '> ul > li p': { + marginTop: em(16, 18), + marginBottom: em(16, 18), + }, + '> ul > li > p:first-child': { + marginTop: em(24, 18), + }, + '> ul > li > p:last-child': { + marginBottom: em(24, 18), + }, + '> ol > li > p:first-child': { + marginTop: em(24, 18), + }, + '> ol > li > p:last-child': { + marginBottom: em(24, 18), + }, + 'ul ul, ul ol, ol ul, ol ol': { + marginTop: em(16, 18), + marginBottom: em(16, 18), + }, + dl: { + marginTop: em(24, 18), + marginBottom: em(24, 18), + }, + dt: { + marginTop: em(24, 18), + }, + dd: { + marginTop: em(12, 18), + paddingInlineStart: em(28, 18), + }, + hr: { + marginTop: em(56, 18), + marginBottom: em(56, 18), + }, + 'hr + *': { + marginTop: '0', + }, + 'h2 + *': { + marginTop: '0', + }, + 'h3 + *': { + marginTop: '0', + }, + 'h4 + *': { + marginTop: '0', + }, + table: { + fontSize: em(16, 18), + lineHeight: round(24 / 16), + }, + 'thead th': { + paddingInlineEnd: em(12, 16), + paddingBottom: em(12, 16), + paddingInlineStart: em(12, 16), + }, + 'thead th:first-child': { + paddingInlineStart: '0', + }, + 'thead th:last-child': { + paddingInlineEnd: '0', + }, + 'tbody td, tfoot td': { + paddingTop: em(12, 16), + paddingInlineEnd: em(12, 16), + paddingBottom: em(12, 16), + paddingInlineStart: em(12, 16), + }, + 'tbody td:first-child, tfoot td:first-child': { + paddingInlineStart: '0', + }, + 'tbody td:last-child, tfoot td:last-child': { + paddingInlineEnd: '0', + }, + figure: { + marginTop: em(32, 18), + marginBottom: em(32, 18), + }, + 'figure > *': { + marginTop: '0', + marginBottom: '0', + }, + figcaption: { + fontSize: em(16, 18), + lineHeight: round(24 / 16), + marginTop: em(16, 16), + }, + }, + { + '> :first-child': { + marginTop: '0', + }, + '> :last-child': { + marginBottom: '0', + }, + }, + ], + }, + xl: { + css: [ + { + fontSize: rem(20), + lineHeight: round(36 / 20), + p: { + marginTop: em(24, 20), + marginBottom: em(24, 20), + }, + '[class~="lead"]': { + fontSize: em(24, 20), + lineHeight: round(36 / 24), + marginTop: em(24, 24), + marginBottom: em(24, 24), + }, + blockquote: { + marginTop: em(48, 30), + marginBottom: em(48, 30), + paddingInlineStart: em(32, 30), + }, + h1: { + fontSize: em(56, 20), + marginTop: '0', + marginBottom: em(48, 56), + lineHeight: round(56 / 56), + }, + h2: { + fontSize: em(36, 20), + marginTop: em(56, 36), + marginBottom: em(32, 36), + lineHeight: round(40 / 36), + }, + h3: { + fontSize: em(30, 20), + marginTop: em(48, 30), + marginBottom: em(20, 30), + lineHeight: round(40 / 30), + }, + h4: { + marginTop: em(36, 20), + marginBottom: em(12, 20), + lineHeight: round(32 / 20), + }, + img: { + marginTop: em(40, 20), + marginBottom: em(40, 20), + }, + picture: { + marginTop: em(40, 20), + marginBottom: em(40, 20), + }, + 'picture > img': { + marginTop: '0', + marginBottom: '0', + }, + video: { + marginTop: em(40, 20), + marginBottom: em(40, 20), + }, + kbd: { + fontSize: em(18, 20), + borderRadius: rem(5), + paddingTop: em(5, 20), + paddingInlineEnd: em(8, 20), + paddingBottom: em(5, 20), + paddingInlineStart: em(8, 20), + }, + code: { + fontSize: em(18, 20), + }, + 'h2 code': { + fontSize: em(31, 36), + }, + 'h3 code': { + fontSize: em(27, 30), + }, + pre: { + fontSize: em(18, 20), + lineHeight: round(32 / 18), + marginTop: em(36, 18), + marginBottom: em(36, 18), + borderRadius: rem(8), + paddingTop: em(20, 18), + paddingInlineEnd: em(24, 18), + paddingBottom: em(20, 18), + paddingInlineStart: em(24, 18), + }, + ol: { + marginTop: em(24, 20), + marginBottom: em(24, 20), + paddingInlineStart: em(32, 20), + }, + ul: { + marginTop: em(24, 20), + marginBottom: em(24, 20), + paddingInlineStart: em(32, 20), + }, + li: { + marginTop: em(12, 20), + marginBottom: em(12, 20), + }, + 'ol > li': { + paddingInlineStart: em(8, 20), + }, + 'ul > li': { + paddingInlineStart: em(8, 20), + }, + '> ul > li p': { + marginTop: em(16, 20), + marginBottom: em(16, 20), + }, + '> ul > li > p:first-child': { + marginTop: em(24, 20), + }, + '> ul > li > p:last-child': { + marginBottom: em(24, 20), + }, + '> ol > li > p:first-child': { + marginTop: em(24, 20), + }, + '> ol > li > p:last-child': { + marginBottom: em(24, 20), + }, + 'ul ul, ul ol, ol ul, ol ol': { + marginTop: em(16, 20), + marginBottom: em(16, 20), + }, + dl: { + marginTop: em(24, 20), + marginBottom: em(24, 20), + }, + dt: { + marginTop: em(24, 20), + }, + dd: { + marginTop: em(12, 20), + paddingInlineStart: em(32, 20), + }, + hr: { + marginTop: em(56, 20), + marginBottom: em(56, 20), + }, + 'hr + *': { + marginTop: '0', + }, + 'h2 + *': { + marginTop: '0', + }, + 'h3 + *': { + marginTop: '0', + }, + 'h4 + *': { + marginTop: '0', + }, + table: { + fontSize: em(18, 20), + lineHeight: round(28 / 18), + }, + 'thead th': { + paddingInlineEnd: em(12, 18), + paddingBottom: em(16, 18), + paddingInlineStart: em(12, 18), + }, + 'thead th:first-child': { + paddingInlineStart: '0', + }, + 'thead th:last-child': { + paddingInlineEnd: '0', + }, + 'tbody td, tfoot td': { + paddingTop: em(16, 18), + paddingInlineEnd: em(12, 18), + paddingBottom: em(16, 18), + paddingInlineStart: em(12, 18), + }, + 'tbody td:first-child, tfoot td:first-child': { + paddingInlineStart: '0', + }, + 'tbody td:last-child, tfoot td:last-child': { + paddingInlineEnd: '0', + }, + figure: { + marginTop: em(40, 20), + marginBottom: em(40, 20), + }, + 'figure > *': { + marginTop: '0', + marginBottom: '0', + }, + figcaption: { + fontSize: em(18, 20), + lineHeight: round(28 / 18), + marginTop: em(18, 18), + }, + }, + { + '> :first-child': { + marginTop: '0', + }, + '> :last-child': { + marginBottom: '0', + }, + }, + ], + }, + '2xl': { + css: [ + { + fontSize: rem(24), + lineHeight: round(40 / 24), + p: { + marginTop: em(32, 24), + marginBottom: em(32, 24), + }, + '[class~="lead"]': { + fontSize: em(30, 24), + lineHeight: round(44 / 30), + marginTop: em(32, 30), + marginBottom: em(32, 30), + }, + blockquote: { + marginTop: em(64, 36), + marginBottom: em(64, 36), + paddingInlineStart: em(40, 36), + }, + h1: { + fontSize: em(64, 24), + marginTop: '0', + marginBottom: em(56, 64), + lineHeight: round(64 / 64), + }, + h2: { + fontSize: em(48, 24), + marginTop: em(72, 48), + marginBottom: em(40, 48), + lineHeight: round(52 / 48), + }, + h3: { + fontSize: em(36, 24), + marginTop: em(56, 36), + marginBottom: em(24, 36), + lineHeight: round(44 / 36), + }, + h4: { + marginTop: em(40, 24), + marginBottom: em(16, 24), + lineHeight: round(36 / 24), + }, + img: { + marginTop: em(48, 24), + marginBottom: em(48, 24), + }, + picture: { + marginTop: em(48, 24), + marginBottom: em(48, 24), + }, + 'picture > img': { + marginTop: '0', + marginBottom: '0', + }, + video: { + marginTop: em(48, 24), + marginBottom: em(48, 24), + }, + kbd: { + fontSize: em(20, 24), + borderRadius: rem(6), + paddingTop: em(6, 24), + paddingInlineEnd: em(8, 24), + paddingBottom: em(6, 24), + paddingInlineStart: em(8, 24), + }, + code: { + fontSize: em(20, 24), + }, + 'h2 code': { + fontSize: em(42, 48), + }, + 'h3 code': { + fontSize: em(32, 36), + }, + pre: { + fontSize: em(20, 24), + lineHeight: round(36 / 20), + marginTop: em(40, 20), + marginBottom: em(40, 20), + borderRadius: rem(8), + paddingTop: em(24, 20), + paddingInlineEnd: em(32, 20), + paddingBottom: em(24, 20), + paddingInlineStart: em(32, 20), + }, + ol: { + marginTop: em(32, 24), + marginBottom: em(32, 24), + paddingInlineStart: em(38, 24), + }, + ul: { + marginTop: em(32, 24), + marginBottom: em(32, 24), + paddingInlineStart: em(38, 24), + }, + li: { + marginTop: em(12, 24), + marginBottom: em(12, 24), + }, + 'ol > li': { + paddingInlineStart: em(10, 24), + }, + 'ul > li': { + paddingInlineStart: em(10, 24), + }, + '> ul > li p': { + marginTop: em(20, 24), + marginBottom: em(20, 24), + }, + '> ul > li > p:first-child': { + marginTop: em(32, 24), + }, + '> ul > li > p:last-child': { + marginBottom: em(32, 24), + }, + '> ol > li > p:first-child': { + marginTop: em(32, 24), + }, + '> ol > li > p:last-child': { + marginBottom: em(32, 24), + }, + 'ul ul, ul ol, ol ul, ol ol': { + marginTop: em(16, 24), + marginBottom: em(16, 24), + }, + dl: { + marginTop: em(32, 24), + marginBottom: em(32, 24), + }, + dt: { + marginTop: em(32, 24), + }, + dd: { + marginTop: em(12, 24), + paddingInlineStart: em(38, 24), + }, + hr: { + marginTop: em(72, 24), + marginBottom: em(72, 24), + }, + 'hr + *': { + marginTop: '0', + }, + 'h2 + *': { + marginTop: '0', + }, + 'h3 + *': { + marginTop: '0', + }, + 'h4 + *': { + marginTop: '0', + }, + table: { + fontSize: em(20, 24), + lineHeight: round(28 / 20), + }, + 'thead th': { + paddingInlineEnd: em(12, 20), + paddingBottom: em(16, 20), + paddingInlineStart: em(12, 20), + }, + 'thead th:first-child': { + paddingInlineStart: '0', + }, + 'thead th:last-child': { + paddingInlineEnd: '0', + }, + 'tbody td, tfoot td': { + paddingTop: em(16, 20), + paddingInlineEnd: em(12, 20), + paddingBottom: em(16, 20), + paddingInlineStart: em(12, 20), + }, + 'tbody td:first-child, tfoot td:first-child': { + paddingInlineStart: '0', + }, + 'tbody td:last-child, tfoot td:last-child': { + paddingInlineEnd: '0', + }, + figure: { + marginTop: em(48, 24), + marginBottom: em(48, 24), + }, + 'figure > *': { + marginTop: '0', + marginBottom: '0', + }, + figcaption: { + fontSize: em(20, 24), + lineHeight: round(32 / 20), + marginTop: em(20, 20), + }, + }, + { + '> :first-child': { + marginTop: '0', + }, + '> :last-child': { + marginBottom: '0', + }, + }, + ], + }, + + // Gray color themes + + slate: { + css: { + '--tw-prose-body': colors.slate[700], + '--tw-prose-headings': colors.slate[900], + '--tw-prose-lead': colors.slate[600], + '--tw-prose-links': colors.slate[900], + '--tw-prose-bold': colors.slate[900], + '--tw-prose-counters': colors.slate[500], + '--tw-prose-bullets': colors.slate[300], + '--tw-prose-hr': colors.slate[200], + '--tw-prose-quotes': colors.slate[900], + '--tw-prose-quote-borders': colors.slate[200], + '--tw-prose-captions': colors.slate[500], + '--tw-prose-kbd': colors.slate[900], + '--tw-prose-kbd-shadows': hexToRgb(colors.slate[900]), + '--tw-prose-code': colors.slate[900], + '--tw-prose-pre-code': colors.slate[200], + '--tw-prose-pre-bg': colors.slate[800], + '--tw-prose-th-borders': colors.slate[300], + '--tw-prose-td-borders': colors.slate[200], + '--tw-prose-invert-body': colors.slate[300], + '--tw-prose-invert-headings': colors.white, + '--tw-prose-invert-lead': colors.slate[400], + '--tw-prose-invert-links': colors.white, + '--tw-prose-invert-bold': colors.white, + '--tw-prose-invert-counters': colors.slate[400], + '--tw-prose-invert-bullets': colors.slate[600], + '--tw-prose-invert-hr': colors.slate[700], + '--tw-prose-invert-quotes': colors.slate[100], + '--tw-prose-invert-quote-borders': colors.slate[700], + '--tw-prose-invert-captions': colors.slate[400], + '--tw-prose-invert-kbd': colors.white, + '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), + '--tw-prose-invert-code': colors.white, + '--tw-prose-invert-pre-code': colors.slate[300], + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': colors.slate[600], + '--tw-prose-invert-td-borders': colors.slate[700], + }, + }, + + gray: { + css: { + '--tw-prose-body': colors.gray[700], + '--tw-prose-headings': colors.gray[900], + '--tw-prose-lead': colors.gray[600], + '--tw-prose-links': colors.gray[900], + '--tw-prose-bold': colors.gray[900], + '--tw-prose-counters': colors.gray[500], + '--tw-prose-bullets': colors.gray[300], + '--tw-prose-hr': colors.gray[200], + '--tw-prose-quotes': colors.gray[900], + '--tw-prose-quote-borders': colors.gray[200], + '--tw-prose-captions': colors.gray[500], + '--tw-prose-kbd': colors.gray[900], + '--tw-prose-kbd-shadows': hexToRgb(colors.gray[900]), + '--tw-prose-code': colors.gray[900], + '--tw-prose-pre-code': colors.gray[200], + '--tw-prose-pre-bg': colors.gray[800], + '--tw-prose-th-borders': colors.gray[300], + '--tw-prose-td-borders': colors.gray[200], + '--tw-prose-invert-body': colors.gray[300], + '--tw-prose-invert-headings': colors.white, + '--tw-prose-invert-lead': colors.gray[400], + '--tw-prose-invert-links': colors.white, + '--tw-prose-invert-bold': colors.white, + '--tw-prose-invert-counters': colors.gray[400], + '--tw-prose-invert-bullets': colors.gray[600], + '--tw-prose-invert-hr': colors.gray[700], + '--tw-prose-invert-quotes': colors.gray[100], + '--tw-prose-invert-quote-borders': colors.gray[700], + '--tw-prose-invert-captions': colors.gray[400], + '--tw-prose-invert-kbd': colors.white, + '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), + '--tw-prose-invert-code': colors.white, + '--tw-prose-invert-pre-code': colors.gray[300], + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': colors.gray[600], + '--tw-prose-invert-td-borders': colors.gray[700], + }, + }, + + zinc: { + css: { + '--tw-prose-body': colors.zinc[700], + '--tw-prose-headings': colors.zinc[900], + '--tw-prose-lead': colors.zinc[600], + '--tw-prose-links': colors.zinc[900], + '--tw-prose-bold': colors.zinc[900], + '--tw-prose-counters': colors.zinc[500], + '--tw-prose-bullets': colors.zinc[300], + '--tw-prose-hr': colors.zinc[200], + '--tw-prose-quotes': colors.zinc[900], + '--tw-prose-quote-borders': colors.zinc[200], + '--tw-prose-captions': colors.zinc[500], + '--tw-prose-kbd': colors.zinc[900], + '--tw-prose-kbd-shadows': hexToRgb(colors.zinc[900]), + '--tw-prose-code': colors.zinc[900], + '--tw-prose-pre-code': colors.zinc[200], + '--tw-prose-pre-bg': colors.zinc[800], + '--tw-prose-th-borders': colors.zinc[300], + '--tw-prose-td-borders': colors.zinc[200], + '--tw-prose-invert-body': colors.zinc[300], + '--tw-prose-invert-headings': colors.white, + '--tw-prose-invert-lead': colors.zinc[400], + '--tw-prose-invert-links': colors.white, + '--tw-prose-invert-bold': colors.white, + '--tw-prose-invert-counters': colors.zinc[400], + '--tw-prose-invert-bullets': colors.zinc[600], + '--tw-prose-invert-hr': colors.zinc[700], + '--tw-prose-invert-quotes': colors.zinc[100], + '--tw-prose-invert-quote-borders': colors.zinc[700], + '--tw-prose-invert-captions': colors.zinc[400], + '--tw-prose-invert-kbd': colors.white, + '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), + '--tw-prose-invert-code': colors.white, + '--tw-prose-invert-pre-code': colors.zinc[300], + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': colors.zinc[600], + '--tw-prose-invert-td-borders': colors.zinc[700], + }, + }, + + neutral: { + css: { + '--tw-prose-body': colors.neutral[700], + '--tw-prose-headings': colors.neutral[900], + '--tw-prose-lead': colors.neutral[600], + '--tw-prose-links': colors.neutral[900], + '--tw-prose-bold': colors.neutral[900], + '--tw-prose-counters': colors.neutral[500], + '--tw-prose-bullets': colors.neutral[300], + '--tw-prose-hr': colors.neutral[200], + '--tw-prose-quotes': colors.neutral[900], + '--tw-prose-quote-borders': colors.neutral[200], + '--tw-prose-captions': colors.neutral[500], + '--tw-prose-kbd': colors.neutral[900], + '--tw-prose-kbd-shadows': hexToRgb(colors.neutral[900]), + '--tw-prose-code': colors.neutral[900], + '--tw-prose-pre-code': colors.neutral[200], + '--tw-prose-pre-bg': colors.neutral[800], + '--tw-prose-th-borders': colors.neutral[300], + '--tw-prose-td-borders': colors.neutral[200], + '--tw-prose-invert-body': colors.neutral[300], + '--tw-prose-invert-headings': colors.white, + '--tw-prose-invert-lead': colors.neutral[400], + '--tw-prose-invert-links': colors.white, + '--tw-prose-invert-bold': colors.white, + '--tw-prose-invert-counters': colors.neutral[400], + '--tw-prose-invert-bullets': colors.neutral[600], + '--tw-prose-invert-hr': colors.neutral[700], + '--tw-prose-invert-quotes': colors.neutral[100], + '--tw-prose-invert-quote-borders': colors.neutral[700], + '--tw-prose-invert-captions': colors.neutral[400], + '--tw-prose-invert-kbd': colors.white, + '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), + '--tw-prose-invert-code': colors.white, + '--tw-prose-invert-pre-code': colors.neutral[300], + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': colors.neutral[600], + '--tw-prose-invert-td-borders': colors.neutral[700], + }, + }, + + stone: { + css: { + '--tw-prose-body': colors.stone[700], + '--tw-prose-headings': colors.stone[900], + '--tw-prose-lead': colors.stone[600], + '--tw-prose-links': colors.stone[900], + '--tw-prose-bold': colors.stone[900], + '--tw-prose-counters': colors.stone[500], + '--tw-prose-bullets': colors.stone[300], + '--tw-prose-hr': colors.stone[200], + '--tw-prose-quotes': colors.stone[900], + '--tw-prose-quote-borders': colors.stone[200], + '--tw-prose-captions': colors.stone[500], + '--tw-prose-kbd': colors.stone[900], + '--tw-prose-kbd-shadows': hexToRgb(colors.stone[900]), + '--tw-prose-code': colors.stone[900], + '--tw-prose-pre-code': colors.stone[200], + '--tw-prose-pre-bg': colors.stone[800], + '--tw-prose-th-borders': colors.stone[300], + '--tw-prose-td-borders': colors.stone[200], + '--tw-prose-invert-body': colors.stone[300], + '--tw-prose-invert-headings': colors.white, + '--tw-prose-invert-lead': colors.stone[400], + '--tw-prose-invert-links': colors.white, + '--tw-prose-invert-bold': colors.white, + '--tw-prose-invert-counters': colors.stone[400], + '--tw-prose-invert-bullets': colors.stone[600], + '--tw-prose-invert-hr': colors.stone[700], + '--tw-prose-invert-quotes': colors.stone[100], + '--tw-prose-invert-quote-borders': colors.stone[700], + '--tw-prose-invert-captions': colors.stone[400], + '--tw-prose-invert-kbd': colors.white, + '--tw-prose-invert-kbd-shadows': hexToRgb(colors.white), + '--tw-prose-invert-code': colors.white, + '--tw-prose-invert-pre-code': colors.stone[300], + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': colors.stone[600], + '--tw-prose-invert-td-borders': colors.stone[700], + }, + }, + + // Link-only themes (for backward compatibility) + + red: { + css: { + '--tw-prose-links': colors.red[600], + '--tw-prose-invert-links': colors.red[500], + }, + }, + + orange: { + css: { + '--tw-prose-links': colors.orange[600], + '--tw-prose-invert-links': colors.orange[500], + }, + }, + + amber: { + css: { + '--tw-prose-links': colors.amber[600], + '--tw-prose-invert-links': colors.amber[500], + }, + }, + + yellow: { + css: { + '--tw-prose-links': colors.yellow[600], + '--tw-prose-invert-links': colors.yellow[500], + }, + }, + + lime: { + css: { + '--tw-prose-links': colors.lime[600], + '--tw-prose-invert-links': colors.lime[500], + }, + }, + + green: { + css: { + '--tw-prose-links': colors.green[600], + '--tw-prose-invert-links': colors.green[500], + }, + }, + + emerald: { + css: { + '--tw-prose-links': colors.emerald[600], + '--tw-prose-invert-links': colors.emerald[500], + }, + }, + + teal: { + css: { + '--tw-prose-links': colors.teal[600], + '--tw-prose-invert-links': colors.teal[500], + }, + }, + + cyan: { + css: { + '--tw-prose-links': colors.cyan[600], + '--tw-prose-invert-links': colors.cyan[500], + }, + }, + + sky: { + css: { + '--tw-prose-links': colors.sky[600], + '--tw-prose-invert-links': colors.sky[500], + }, + }, + + blue: { + css: { + '--tw-prose-links': colors.blue[600], + '--tw-prose-invert-links': colors.blue[500], + }, + }, + + indigo: { + css: { + '--tw-prose-links': colors.indigo[600], + '--tw-prose-invert-links': colors.indigo[500], + }, + }, + + violet: { + css: { + '--tw-prose-links': colors.violet[600], + '--tw-prose-invert-links': colors.violet[500], + }, + }, + + purple: { + css: { + '--tw-prose-links': colors.purple[600], + '--tw-prose-invert-links': colors.purple[500], + }, + }, + + fuchsia: { + css: { + '--tw-prose-links': colors.fuchsia[600], + '--tw-prose-invert-links': colors.fuchsia[500], + }, + }, + + pink: { + css: { + '--tw-prose-links': colors.pink[600], + '--tw-prose-invert-links': colors.pink[500], + }, + }, + + rose: { + css: { + '--tw-prose-links': colors.rose[600], + '--tw-prose-invert-links': colors.rose[500], + }, + }, + + // Invert (for dark mode) + invert: { + css: { + '--tw-prose-body': 'var(--tw-prose-invert-body)', + '--tw-prose-headings': 'var(--tw-prose-invert-headings)', + '--tw-prose-lead': 'var(--tw-prose-invert-lead)', + '--tw-prose-links': 'var(--tw-prose-invert-links)', + '--tw-prose-bold': 'var(--tw-prose-invert-bold)', + '--tw-prose-counters': 'var(--tw-prose-invert-counters)', + '--tw-prose-bullets': 'var(--tw-prose-invert-bullets)', + '--tw-prose-hr': 'var(--tw-prose-invert-hr)', + '--tw-prose-quotes': 'var(--tw-prose-invert-quotes)', + '--tw-prose-quote-borders': 'var(--tw-prose-invert-quote-borders)', + '--tw-prose-captions': 'var(--tw-prose-invert-captions)', + '--tw-prose-kbd': 'var(--tw-prose-invert-kbd)', + '--tw-prose-kbd-shadows': 'var(--tw-prose-invert-kbd-shadows)', + '--tw-prose-code': 'var(--tw-prose-invert-code)', + '--tw-prose-pre-code': 'var(--tw-prose-invert-pre-code)', + '--tw-prose-pre-bg': 'var(--tw-prose-invert-pre-bg)', + '--tw-prose-th-borders': 'var(--tw-prose-invert-th-borders)', + '--tw-prose-td-borders': 'var(--tw-prose-invert-td-borders)', + }, + }, +} + +module.exports = { + DEFAULT: { + css: [ + { + color: 'var(--tw-prose-body)', + maxWidth: '65ch', + p: {}, // Required to maintain correct order when merging + '[class~="lead"]': { + color: 'var(--tw-prose-lead)', + }, + a: { + color: 'var(--tw-prose-links)', + textDecoration: 'underline', + fontWeight: '500', + }, + strong: { + color: 'var(--tw-prose-bold)', + fontWeight: '600', + }, + 'a strong': { + color: 'inherit', + }, + 'blockquote strong': { + color: 'inherit', + }, + 'thead th strong': { + color: 'inherit', + }, + ol: { + listStyleType: 'decimal', + }, + 'ol[type="A"]': { + listStyleType: 'upper-alpha', + }, + 'ol[type="a"]': { + listStyleType: 'lower-alpha', + }, + 'ol[type="A" s]': { + listStyleType: 'upper-alpha', + }, + 'ol[type="a" s]': { + listStyleType: 'lower-alpha', + }, + 'ol[type="I"]': { + listStyleType: 'upper-roman', + }, + 'ol[type="i"]': { + listStyleType: 'lower-roman', + }, + 'ol[type="I" s]': { + listStyleType: 'upper-roman', + }, + 'ol[type="i" s]': { + listStyleType: 'lower-roman', + }, + 'ol[type="1"]': { + listStyleType: 'decimal', + }, + ul: { + listStyleType: 'disc', + }, + 'ol > li::marker': { + fontWeight: '400', + color: 'var(--tw-prose-counters)', + }, + 'ul > li::marker': { + color: 'var(--tw-prose-bullets)', + }, + dt: { + color: 'var(--tw-prose-headings)', + fontWeight: '600', + }, + hr: { + borderColor: 'var(--tw-prose-hr)', + borderTopWidth: 1, + }, + blockquote: { + fontWeight: '500', + fontStyle: 'italic', + color: 'var(--tw-prose-quotes)', + borderInlineStartWidth: '0.25rem', + borderInlineStartColor: 'var(--tw-prose-quote-borders)', + quotes: '"\\201C""\\201D""\\2018""\\2019"', + }, + 'blockquote p:first-of-type::before': { + content: 'open-quote', + }, + 'blockquote p:last-of-type::after': { + content: 'close-quote', + }, + h1: { + color: 'var(--tw-prose-headings)', + fontWeight: '800', + }, + 'h1 strong': { + fontWeight: '900', + color: 'inherit', + }, + h2: { + color: 'var(--tw-prose-headings)', + fontWeight: '700', + }, + 'h2 strong': { + fontWeight: '800', + color: 'inherit', + }, + h3: { + color: 'var(--tw-prose-headings)', + fontWeight: '600', + }, + 'h3 strong': { + fontWeight: '700', + color: 'inherit', + }, + h4: { + color: 'var(--tw-prose-headings)', + fontWeight: '600', + }, + 'h4 strong': { + fontWeight: '700', + color: 'inherit', + }, + img: {}, // Required to maintain correct order when merging + picture: { + display: 'block', + }, + video: {}, // Required to maintain correct order when merging + kbd: { + fontWeight: '500', + fontFamily: 'inherit', + color: 'var(--tw-prose-kbd)', + boxShadow: + '0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%)', + }, + code: { + color: 'var(--tw-prose-code)', + fontWeight: '600', + }, + 'code::before': { + content: '"`"', + }, + 'code::after': { + content: '"`"', + }, + 'a code': { + color: 'inherit', + }, + 'h1 code': { + color: 'inherit', + }, + 'h2 code': { + color: 'inherit', + }, + 'h3 code': { + color: 'inherit', + }, + 'h4 code': { + color: 'inherit', + }, + 'blockquote code': { + color: 'inherit', + }, + 'thead th code': { + color: 'inherit', + }, + pre: { + color: 'var(--tw-prose-pre-code)', + backgroundColor: 'var(--tw-prose-pre-bg)', + overflowX: 'auto', + fontWeight: '400', + }, + 'pre code': { + backgroundColor: 'transparent', + borderWidth: '0', + borderRadius: '0', + padding: '0', + fontWeight: 'inherit', + color: 'inherit', + fontSize: 'inherit', + fontFamily: 'inherit', + lineHeight: 'inherit', + }, + 'pre code::before': { + content: 'none', + }, + 'pre code::after': { + content: 'none', + }, + table: { + width: '100%', + tableLayout: 'auto', + marginTop: em(32, 16), + marginBottom: em(32, 16), + }, + thead: { + borderBottomWidth: '1px', + borderBottomColor: 'var(--tw-prose-th-borders)', + }, + 'thead th': { + color: 'var(--tw-prose-headings)', + fontWeight: '600', + verticalAlign: 'bottom', + }, + 'tbody tr': { + borderBottomWidth: '1px', + borderBottomColor: 'var(--tw-prose-td-borders)', + }, + 'tbody tr:last-child': { + borderBottomWidth: '0', + }, + 'tbody td': { + verticalAlign: 'baseline', + }, + tfoot: { + borderTopWidth: '1px', + borderTopColor: 'var(--tw-prose-th-borders)', + }, + 'tfoot td': { + verticalAlign: 'top', + }, + 'th, td': { + textAlign: 'start', + }, + 'figure > *': {}, // Required to maintain correct order when merging + figcaption: { + color: 'var(--tw-prose-captions)', + }, + }, + defaultModifiers.gray.css, + ...defaultModifiers.base.css, + ], + }, + ...defaultModifiers, +} diff --git a/tools/ui/node_modules/@tailwindcss/typography/src/utils.js b/tools/ui/node_modules/@tailwindcss/typography/src/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..53508901c52ea242280831e4f3a7576b53e62eed --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/typography/src/utils.js @@ -0,0 +1,62 @@ +const isPlainObject = require('lodash.isplainobject') + +const parser = require('postcss-selector-parser') +const parseSelector = parser() + +module.exports = { + isUsableColor(color, values) { + return isPlainObject(values) && color !== 'gray' && values[600] + }, + + /** + * @param {string} selector + */ + commonTrailingPseudos(selector) { + let ast = parseSelector.astSync(selector) + + /** @type {import('postcss-selector-parser').Pseudo[][]} */ + let matrix = [] + + // Put the pseudo elements in reverse order in a sparse, column-major 2D array + for (let [i, sel] of ast.nodes.entries()) { + for (const [j, child] of [...sel.nodes].reverse().entries()) { + // We only care about pseudo elements + if (child.type !== 'pseudo' || !child.value.startsWith('::')) { + break + } + + matrix[j] = matrix[j] || [] + matrix[j][i] = child + } + } + + let trailingPseudos = parser.selector() + + // At this point the pseudo elements are in a column-major 2D array + // This means each row contains one "column" of pseudo elements from each selector + // We can compare all the pseudo elements in a row to see if they are the same + for (const pseudos of matrix) { + // It's a sparse 2D array so there are going to be holes in the rows + // We skip those + if (!pseudos) { + continue + } + + let values = new Set(pseudos.map((p) => p.value)) + + // The pseudo elements are not the same + if (values.size > 1) { + break + } + + pseudos.forEach((pseudo) => pseudo.remove()) + trailingPseudos.prepend(pseudos[0]) + } + + if (trailingPseudos.nodes.length) { + return [trailingPseudos.toString(), ast.toString()] + } + + return [null, selector] + }, +} diff --git a/tools/ui/node_modules/@tailwindcss/vite/LICENSE b/tools/ui/node_modules/@tailwindcss/vite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/README.md b/tools/ui/node_modules/@tailwindcss/vite/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95ec9d87ddcc59defeaed61b39cbb49869220c9f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/README.md @@ -0,0 +1,40 @@ +

+ + + + + 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 any other conversation that would benefit from being searchable: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +For chatting with others using the framework: + +[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## 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/tools/ui/node_modules/@tailwindcss/vite/dist/index.d.mts b/tools/ui/node_modules/@tailwindcss/vite/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4ad5773a387be9cfd2ee6170a7681a0cdc2c9a23 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/dist/index.d.mts @@ -0,0 +1,5 @@ +import { Plugin } from 'vite'; + +declare function tailwindcss(): Plugin[]; + +export { tailwindcss as default }; diff --git a/tools/ui/node_modules/@tailwindcss/vite/dist/index.mjs b/tools/ui/node_modules/@tailwindcss/vite/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..042b557401fefb14957d481dd6e7bf6bf9ed4372 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/dist/index.mjs @@ -0,0 +1 @@ +var D=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),P=r=>{throw TypeError(r)};var b=(r,e,s)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&P("Object expected");var t,u;s&&(t=e[D("asyncDispose")]),t===void 0&&(t=e[D("dispose")],s&&(u=t)),typeof t!="function"&&P("Object not disposable"),u&&(t=function(){try{u.call(this)}catch(n){return Promise.reject(n)}}),r.push([s,t,e])}else s&&r.push([s]);return e},w=(r,e,s)=>{var t=typeof SuppressedError=="function"?SuppressedError:function(a,p,d,l){return l=Error(d),l.name="SuppressedError",l.error=a,l.suppressed=p,l},u=a=>e=s?new t(a,e,"An error was suppressed during disposal"):(s=!0,a),n=a=>{for(;a=r.pop();)try{var p=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(p).then(n,d=>(u(d),n()))}catch(d){u(d)}if(s)throw e};return n()};import{compile as F,env as _,Features as h,Instrumentation as M,normalizePath as B,optimize as U,toSourceMap as V}from"@tailwindcss/node";import{clearRequireCache as G}from"@tailwindcss/node/require-cache";import{Scanner as J}from"@tailwindcss/oxide";import y from"fs/promises";import m from"path";var c=_.DEBUG,A=/[?&](?:worker|sharedworker|raw|url)\b/,K=/\?commonjs-proxy/,O=/[?&]index\=\d+\.css$/;function T(){let r=[],e=null,s=!1,t=!1,u=new R(n=>{let a=e.createResolver({...e.resolve,extensions:[".css"],mainFields:["style"],conditions:["style","development|production"],tryIndex:!1,preferRelative:!0});function p(i,o){return a(i,o,!0,s)}let d=e.createResolver(e.resolve);function l(i,o){return d(i,o,!0,s)}return new C(n,e.root,e?.css.devSourcemap??!1,p,l)});return[{name:"@tailwindcss/vite:scan",enforce:"pre",configureServer(n){r.push(n)},async configResolved(n){e=n,t=e.build.cssMinify!==!1,s=e.build.ssr!==!1&&e.build.ssr!==void 0}},{name:"@tailwindcss/vite:generate:serve",apply:"serve",enforce:"pre",async transform(n,a,p){var o=[];try{if(!x(a))return;let d=b(o,new M);c&&d.start("[@tailwindcss/vite] Generate CSS (serve)");let l=u.get(a);let i=await l.generate(n,S=>this.addWatchFile(S),d);if(!i)return u.delete(a),n;c&&d.end("[@tailwindcss/vite] Generate CSS (serve)");return i}catch(f){var v=f,g=!0}finally{w(o,v,g)}}},{name:"@tailwindcss/vite:generate:build",apply:"build",enforce:"pre",async transform(n,a){var i=[];try{if(!x(a))return;let p=b(i,new M);c&&p.start("[@tailwindcss/vite] Generate CSS (build)");let d=u.get(a);let l=await d.generate(n,g=>this.addWatchFile(g),p);if(!l)return u.delete(a),n;c&&p.end("[@tailwindcss/vite] Generate CSS (build)");c&&p.start("[@tailwindcss/vite] Optimize CSS");l=U(l.code,{minify:t,map:l.map});c&&p.end("[@tailwindcss/vite] Optimize CSS");return l}catch(o){var f=o,v=!0}finally{w(i,f,v)}}}]}function q(r){let[e]=r.split("?",2);return m.extname(e).slice(1)}function x(r){return r.includes("/.vite/")?void 0:(q(r)==="css"||r.includes("&lang.css")||r.match(O))&&!A.test(r)&&!K.test(r)}function E(r){return m.resolve(r.replace(/\?.*$/,""))}var R=class extends Map{constructor(s){super();this.factory=s}get(s){let t=super.get(s);return t===void 0&&(t=this.factory(s,this),this.set(s,t)),t}},C=class{constructor(e,s,t,u,n){this.id=e;this.base=s;this.enableSourceMaps=t;this.customCssResolver=u;this.customJsResolver=n}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(e,s,t){let u=E(this.id);function n(i){i!==u&&(/[\#\?].*\.svg$/.test(i)||s(i))}let a=this.requiresBuild(),p=m.dirname(m.resolve(u));if(!this.compiler||!this.scanner||await a){G(Array.from(this.buildDependencies.keys())),this.buildDependencies.clear(),this.addBuildDependency(E(u)),c&&t.start("Setup compiler");let i=[];this.compiler=await F(e,{from:this.enableSourceMaps?this.id:void 0,base:p,shouldRewriteUrls:!0,onDependency:f=>{n(f),i.push(this.addBuildDependency(f))},customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver}),await Promise.all(i),c&&t.end("Setup compiler"),c&&t.start("Setup scanner");let o=(this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,pattern:"**/*",negated:!1}]:[{...this.compiler.root,negated:!1}]).concat(this.compiler.sources);this.scanner=new J({sources:o}),c&&t.end("Setup scanner")}else for(let i of this.buildDependencies.keys())n(i);if(!(this.compiler.features&(h.AtApply|h.JsPluginCompat|h.ThemeFunction|h.Utilities)))return!1;if(this.compiler.features&h.Utilities){c&&t.start("Scan for candidates");for(let i of this.scanner.scan())this.candidates.add(i);c&&t.end("Scan for candidates")}if(this.compiler.features&h.Utilities){for(let i of this.scanner.files)n(i);for(let i of this.scanner.globs){if(i.pattern[0]==="!")continue;let o=m.relative(this.base,i.base);o[0]!=="."&&(o="./"+o),o=B(o),n(m.posix.join(o,i.pattern));let f=this.compiler.root;if(f!=="none"&&f!==null){let v=B(m.resolve(f.base,f.pattern));if(!await y.stat(v).then(S=>S.isDirectory(),()=>!1))throw new Error(`The path given to \`source(\u2026)\` must be a directory but got \`source(${v})\` instead.`)}}}c&&t.start("Build CSS");let d=this.compiler.build([...this.candidates]);c&&t.end("Build CSS"),c&&t.start("Build Source Map");let l=this.enableSourceMaps?V(this.compiler.buildSourceMap()).raw:void 0;return c&&t.end("Build Source Map"),{code:d,map:l}}async addBuildDependency(e){let s=null;try{s=(await y.stat(e)).mtimeMs}catch{}this.buildDependencies.set(e,s)}async requiresBuild(){for(let[e,s]of this.buildDependencies){if(s===null)return!0;try{if((await y.stat(e)).mtimeMs>s)return!0}catch{return!0}}return!1}};export{T as default}; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/LICENSE b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d6a82290738a9f78946cbcb4594535d6984086dd --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/README.md b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95ec9d87ddcc59defeaed61b39cbb49869220c9f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/README.md @@ -0,0 +1,40 @@ +

+ + + + + 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 any other conversation that would benefit from being searchable: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +For chatting with others using the framework: + +[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## 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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bf291d6dcbcba58fb36a7f6c3339af4f67c97705 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-4WXWQT6Y.mjs @@ -0,0 +1,35 @@ +import{a as Tt,b as D,c as J,d as E,e as lt,f as de,g as Ue,h as Pt}from"./chunk-G32FJCSR.mjs";import{a as Et}from"./chunk-HTB5LLOP.mjs";var Rt="4.1.11";var Ve=92,Ie=47,Fe=42,Ot=34,Kt=39,ii=58,ze=59,ie=10,Me=13,Ne=32,Le=9,_t=123,at=125,ft=40,jt=41,ni=91,oi=93,Dt=45,st=64,li=33;function me(r,t){let i=t?.from?{file:t.from,code:r}:null;r[0]==="\uFEFF"&&(r=" "+r.slice(1));let e=[],n=[],s=[],a=null,c=null,u="",f="",g=0,d;for(let m=0;m0&&r[b]===v[v.length-1]&&(v=v.slice(0,-1));let N=ut(u,k);if(!N)throw new Error("Invalid custom property, expected a value");i&&(N.src=[i,x,m],N.dst=[i,x,m]),a?a.nodes.push(N):e.push(N),u=""}else if(w===ze&&u.charCodeAt(0)===st)c=Se(u),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a?a.nodes.push(c):e.push(c),u="",c=null;else if(w===ze&&f[f.length-1]!==")"){let v=ut(u);if(!v)throw u.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${u.trim()}\``);i&&(v.src=[i,g,m],v.dst=[i,g,m]),a?a.nodes.push(v):e.push(v),u=""}else if(w===_t&&f[f.length-1]!==")")f+="}",c=H(u.trim()),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a&&a.nodes.push(c),s.push(a),a=c,u="",c=null;else if(w===at&&f[f.length-1]!==")"){if(f==="")throw new Error("Missing opening {");if(f=f.slice(0,-1),u.length>0)if(u.charCodeAt(0)===st)c=Se(u),i&&(c.src=[i,g,m],c.dst=[i,g,m]),a?a.nodes.push(c):e.push(c),u="",c=null;else{let x=u.indexOf(":");if(a){let k=ut(u,x);if(!k)throw new Error(`Invalid declaration: \`${u.trim()}\``);i&&(k.src=[i,g,m],k.dst=[i,g,m]),a.nodes.push(k)}}let v=s.pop()??null;v===null&&a&&e.push(a),a=v,u="",c=null}else if(w===ft)f+=")",u+="(";else if(w===jt){if(f[f.length-1]!==")")throw new Error("Missing opening (");f=f.slice(0,-1),u+=")"}else{if(u.length===0&&(w===Ne||w===ie||w===Le))continue;u===""&&(g=m),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===st){let m=Se(u);i&&(m.src=[i,g,r.length],m.dst=[i,g,r.length]),e.push(m)}if(f.length>0&&a){if(a.kind==="rule")throw new Error(`Missing closing } at ${a.selector}`);if(a.kind==="at-rule")throw new Error(`Missing closing } at ${a.name} ${a.params}`)}return n.length>0?n.concat(e):e}function Se(r,t=[]){let i=r,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+=t.charAt(e);continue}s+="\\"+t.charAt(e)}return s}function ge(r){return r.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,t=>t.length>2?String.fromCodePoint(Number.parseInt(t.slice(1).trim(),16)):t[1])}var Ft=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"]]]);function It(r,t){return(Ft.get(t)??[]).some(i=>r===i||r.startsWith(`${i}-`))}var Be=class{constructor(t=new Map,i=new Set([])){this.values=t;this.keyframes=i}prefix=null;get size(){return this.values.size}add(t,i,e=0,n){if(t.endsWith("-*")){if(i!=="initial")throw new Error(`Invalid theme value \`${i}\` for namespace \`${t}\``);t==="--*"?this.values.clear():this.clearNamespace(t.slice(0,-2),0)}if(e&4){let s=this.values.get(t);if(s&&!(s.options&4))return}i==="initial"?this.values.delete(t):this.values.set(t,{value:i,options:e,src:n})}keysInNamespaces(t){let i=[];for(let e of t){let n=`${e}-`;for(let s of this.values.keys())s.startsWith(n)&&s.indexOf("--",2)===-1&&(It(s,e)||i.push(s.slice(n.length)))}return i}get(t){for(let i of t){let e=this.values.get(i);if(e)return e.value}return null}hasDefault(t){return(this.getOptions(t)&4)===4}getOptions(t){return t=ge(this.#r(t)),this.values.get(t)?.options??0}entries(){return this.prefix?Array.from(this.values,t=>(t[0]=this.prefixKey(t[0]),t)):this.values.entries()}prefixKey(t){return this.prefix?`--${this.prefix}-${t.slice(2)}`:t}#r(t){return this.prefix?`--${t.slice(3+this.prefix.length)}`:t}clearNamespace(t,i){let e=Ft.get(t)??[];e:for(let n of this.values.keys())if(n.startsWith(t)){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(t,i){for(let e of i){let n=t!==null?`${e}-${t}`:e;if(!this.values.has(n))if(t!==null&&t.includes(".")){if(n=`${e}-${t.replaceAll(".","_")}`,!this.values.has(n))continue}else continue;if(!It(n,e))return n}return null}#t(t){let i=this.values.get(t);if(!i)return null;let e=null;return i.options&2&&(e=i.value),`var(${fe(this.prefixKey(t))}${e?`, ${e}`:""})`}markUsedVariable(t){let i=ge(this.#r(t)),e=this.values.get(i);if(!e)return!1;let n=e.options&16;return e.options|=16,!n}resolve(t,i,e=0){let n=this.#e(t,i);if(!n)return null;let s=this.values.get(n);return(e|s.options)&1?s.value:this.#t(n)}resolveValue(t,i){let e=this.#e(t,i);return e?this.values.get(e).value:null}resolveWith(t,i,e=[]){let n=this.#e(t,i);if(!n)return null;let s={};for(let c of e){let u=`${n}${c}`,f=this.values.get(u);f&&(f.options&1?s[c]=f.value:s[c]=this.#t(u))}let a=this.values.get(n);return a.options&1?[a.value,s]:[this.#t(n),s]}namespace(t){let i=new Map,e=`${t}-`;for(let[n,s]of this.values)n===t?i.set(null,s.value):n.startsWith(`${e}-`)?i.set(n.slice(t.length),s.value):n.startsWith(e)&&i.set(n.slice(e.length),s.value);return i}addKeyframes(t){this.keyframes.add(t)}getKeyframes(){return Array.from(this.keyframes)}};var B=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 pt(r){return{kind:"word",value:r}}function ai(r,t){return{kind:"function",value:r,nodes:t}}function si(r){return{kind:"separator",value:r}}function ee(r,t,i=null){for(let e=0;e0){let d=pt(n);e?e.nodes.push(d):t.push(d),n=""}let u=a,f=a+1;for(;f0){let f=pt(n);u?.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(c)}}return n.length>0&&t.push(pt(n)),t}function qe(r){let t=[];return ee(q(r),i=>{if(!(i.kind!=="function"||i.value!=="var"))return ee(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||t.push(e.value)}),1}),t}var mi=64;function M(r,t=[]){return{kind:"rule",selector:r,nodes:t}}function z(r,t="",i=[]){return{kind:"at-rule",name:r,params:t,nodes:i}}function H(r,t=[]){return r.charCodeAt(0)===mi?Se(r,t):M(r,t)}function l(r,t,i=!1){return{kind:"declaration",property:r,value:t,important:i}}function We(r){return{kind:"comment",value:r}}function le(r,t){return{kind:"context",context:r,nodes:t}}function L(r){return{kind:"at-root",nodes:r}}function F(r,t,i=[],e={}){for(let n=0;nnew Set),a=new B(()=>new Set),c=new Set,u=new Set,f=[],g=[],d=new B(()=>new Set);function m(v,x,k={},N=0){if(v.kind==="declaration"){if(v.property==="--tw-sort"||v.value===void 0||v.value===null)return;if(k.theme&&v.property[0]==="-"&&v.property[1]==="-"){if(v.value==="initial"){v.value=void 0;return}k.keyframes||s.get(x).add(v)}if(v.value.includes("var("))if(k.theme&&v.property[0]==="-"&&v.property[1]==="-")for(let b of qe(v.value))d.get(b).add(v.property);else t.trackUsedVariables(v.value);if(v.property==="animation")for(let b of Zt(v.value))u.add(b);i&2&&v.value.includes("color-mix(")&&a.get(x).add(v),x.push(v)}else if(v.kind==="rule")if(v.selector==="&")for(let b of v.nodes){let S=[];m(b,S,k,N+1),S.length>0&&x.push(...S)}else{let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);b.nodes.length>0&&x.push(b)}else if(v.kind==="at-rule"&&v.name==="@property"&&N===0){if(n.has(v.params))return;if(i&1){let S=v.params,P=null,U=!1;for(let _ of v.nodes)_.kind==="declaration"&&(_.property==="initial-value"?P=_.value:_.property==="inherits"&&(U=_.value==="true"));let R=l(S,P??"initial");R.src=v.src,U?f.push(R):g.push(R)}n.add(v.params);let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);x.push(b)}else if(v.kind==="at-rule"){v.name==="@keyframes"&&(k={...k,keyframes:!0});let b={...v,nodes:[]};for(let S of v.nodes)m(S,b.nodes,k,N+1);v.name==="@keyframes"&&k.theme&&c.add(b),(b.nodes.length>0||b.name==="@layer"||b.name==="@charset"||b.name==="@custom-media"||b.name==="@namespace"||b.name==="@import")&&x.push(b)}else if(v.kind==="at-root")for(let b of v.nodes){let S=[];m(b,S,k,0);for(let P of S)e.push(P)}else if(v.kind==="context"){if(v.context.reference)return;for(let b of v.nodes)m(b,x,{...k,...v.context},N)}else v.kind==="comment"&&x.push(v)}let w=[];for(let v of r)m(v,w,{},0);e:for(let[v,x]of s)for(let k of x){if(Qt(k.property,t.theme,d)){if(k.property.startsWith(t.theme.prefixKey("--animate-")))for(let S of Zt(k.value))u.add(S);continue}let b=v.indexOf(k);if(v.splice(b,1),v.length===0){let S=gi(w,P=>P.kind==="rule"&&P.nodes===v);if(!S||S.length===0)continue e;S.unshift({kind:"at-root",nodes:w});do{let P=S.pop();if(!P)break;let U=S[S.length-1];if(!U||U.kind!=="at-root"&&U.kind!=="at-rule")break;let R=U.nodes.indexOf(P);if(R===-1)break;U.nodes.splice(R,1)}while(!0);continue e}}for(let v of c)if(!u.has(v.params)){let x=e.indexOf(v);e.splice(x,1)}if(w=w.concat(e),i&2)for(let[v,x]of a)for(let k of x){let N=v.indexOf(k);if(N===-1||k.value==null)continue;let b=q(k.value),S=!1;if(ee(b,(R,{replaceWith:_})=>{if(R.kind!=="function"||R.value!=="color-mix")return;let K=!1,G=!1;if(ee(R.nodes,(I,{replaceWith:W})=>{if(I.kind=="word"&&I.value.toLowerCase()==="currentcolor"){G=!0,S=!0;return}let Z=I,re=null,o=new Set;do{if(Z.kind!=="function"||Z.value!=="var")return;let p=Z.nodes[0];if(!p||p.kind!=="word")return;let h=p.value;if(o.has(h)){K=!0;return}if(o.add(h),S=!0,re=t.theme.resolveValue(null,[p.value]),!re){K=!0;return}if(re.toLowerCase()==="currentcolor"){G=!0;return}re.startsWith("var(")?Z=q(re)[0]:Z=null}while(Z);W({kind:"word",value:re})}),K||G){let I=R.nodes.findIndex(Z=>Z.kind==="separator"&&Z.value.trim().includes(","));if(I===-1)return;let W=R.nodes.length>I?R.nodes[I+1]:null;if(!W)return;_(W)}else if(S){let I=R.nodes[2];I.kind==="word"&&(I.value==="oklab"||I.value==="oklch"||I.value==="lab"||I.value==="lch")&&(I.value="srgb")}}),!S)continue;let P={...k,value:Y(b)},U=H("@supports (color: color-mix(in lab, red, red))",[k]);U.src=k.src,v.splice(N,1,P,U)}if(i&1){let v=[];if(f.length>0){let x=H(":root, :host",f);x.src=f[0].src,v.push(x)}if(g.length>0){let x=H("*, ::before, ::after, ::backdrop",g);x.src=g[0].src,v.push(x)}if(v.length>0){let x=w.findIndex(b=>!(b.kind==="comment"||b.kind==="at-rule"&&(b.name==="@charset"||b.name==="@import"))),k=z("@layer","properties",[]);k.src=v[0].src,w.splice(x<0?w.length:x,0,k);let N=H("@layer properties",[z("@supports","((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))",v)]);N.src=v[0].src,N.nodes[0].src=v[0].src,w.push(N)}}return w}function ne(r,t){let i=0,e={file:null,code:""};function n(a,c=0){let u="",f=" ".repeat(c);if(a.kind==="declaration"){if(u+=`${f}${a.property}: ${a.value}${a.important?" !important":""}; +`,t){i+=f.length;let g=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let d=i;i+=2,a.dst=[e,g,d]}}else if(a.kind==="rule"){if(u+=`${f}${a.selector} { +`,t){i+=f.length;let g=i;i+=a.selector.length,i+=1;let d=i;a.dst=[e,g,d],i+=2}for(let g of a.nodes)u+=n(g,c+1);u+=`${f}} +`,t&&(i+=f.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let g=`${f}${a.name} ${a.params}; +`;if(t){i+=f.length;let d=i;i+=a.name.length,i+=1,i+=a.params.length;let m=i;i+=2,a.dst=[e,d,m]}return g}if(u+=`${f}${a.name}${a.params?` ${a.params} `:" "}{ +`,t){i+=f.length;let g=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let d=i;a.dst=[e,g,d],i+=2}for(let g of a.nodes)u+=n(g,c+1);u+=`${f}} +`,t&&(i+=f.length,i+=2)}else if(a.kind==="comment"){if(u+=`${f}/*${a.value}*/ +`,t){i+=f.length;let g=i;i+=2+a.value.length+2;let d=i;a.dst=[e,g,d],i+=1}}else if(a.kind==="context"||a.kind==="at-root")return"";return u}let s="";for(let a of r)s+=n(a,0);return e.code=s,s}function gi(r,t){let i=[];return F(r,(e,{path:n})=>{if(t(e))return i=[...n],2}),i}function Qt(r,t,i,e=new Set){if(e.has(r)||(e.add(r),t.getOptions(r)&24))return!0;{let s=i.get(r)??[];for(let a of s)if(Qt(a,t,i,e))return!0}return!1}function Zt(r){return r.split(/[\s,]+/)}function ce(r){if(r.indexOf("(")===-1)return be(r);let t=q(r);return mt(t),r=Y(t),r=Tt(r),r}function be(r,t=!1){let i="";for(let e=0;e0&&n===gt[t-1]&&t--;break;case 59:if(t===0)return!1;break}}return!0}var vi=58,Xt=45,er=97,tr=122;function*rr(r,t){let i=D(r,":");if(t.theme.prefix){if(i.length===1||i[0]!==t.theme.prefix)return null;i.shift()}let e=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let m=t.parseVariant(i[d]);if(m===null)return;n.push(m)}let s=!1;e[e.length-1]==="!"?(s=!0,e=e.slice(0,-1)):e[0]==="!"&&(s=!0,e=e.slice(1)),t.utilities.has(e,"static")&&!e.includes("[")&&(yield{kind:"static",root:e,variants:n,important:s,raw:r});let[a,c=null,u]=D(e,"/");if(u)return;let f=c===null?null:ht(c);if(c!==null&&f===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let d=a.charCodeAt(1);if(d!==Xt&&!(d>=er&&d<=tr))return;a=a.slice(1,-1);let m=a.indexOf(":");if(m===-1||m===0||m===a.length-1)return;let w=a.slice(0,m),v=ce(a.slice(m+1));if(!se(v))return;yield{kind:"arbitrary",property:w,value:v,modifier:f,variants:n,important:s,raw:r};return}let g;if(a[a.length-1]==="]"){let d=a.indexOf("-[");if(d===-1)return;let m=a.slice(0,d);if(!t.utilities.has(m,"functional"))return;let w=a.slice(d+1);g=[[m,w]]}else if(a[a.length-1]===")"){let d=a.indexOf("-(");if(d===-1)return;let m=a.slice(0,d);if(!t.utilities.has(m,"functional"))return;let w=a.slice(d+2,-1),v=D(w,":"),x=null;if(v.length===2&&(x=v[0],w=v[1]),w[0]!=="-"||w[1]!=="-"||!se(w))return;g=[[m,x===null?`[var(${w})]`:`[${x}:var(${w})]`]]}else g=nr(a,d=>t.utilities.has(d,"functional"));for(let[d,m]of g){let w={kind:"functional",root:d,modifier:f,value:null,variants:n,important:s,raw:r};if(m===null){yield w;continue}{let v=m.indexOf("[");if(v!==-1){if(m[m.length-1]!=="]")return;let k=ce(m.slice(v+1,-1));if(!se(k))continue;let N="";for(let b=0;b=er&&S<=tr))break}if(k.length===0||k.trim().length===0)continue;w.value={kind:"arbitrary",dataType:N||null,value:k}}else{let k=c===null||w.modifier?.kind==="arbitrary"?null:`${m}/${c}`;w.value={kind:"named",value:m,fraction:k}}}yield w}}function ht(r){if(r[0]==="["&&r[r.length-1]==="]"){let t=ce(r.slice(1,-1));return!se(t)||t.length===0||t.trim().length===0?null:{kind:"arbitrary",value:t}}return r[0]==="("&&r[r.length-1]===")"?(r=r.slice(1,-1),r[0]!=="-"||r[1]!=="-"||!se(r)?null:(r=`var(${r})`,{kind:"arbitrary",value:ce(r)})):{kind:"named",value:r}}function ir(r,t){if(r[0]==="["&&r[r.length-1]==="]"){if(r[1]==="@"&&r.includes("&"))return null;let i=ce(r.slice(1,-1));if(!se(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]=D(r,"/");if(n)return null;let s=nr(i,a=>t.variants.has(a));for(let[a,c]of s)switch(t.variants.kind(a)){case"static":return c!==null||e!==null?null:{kind:"static",root:a};case"functional":{let u=e===null?null:ht(e);if(e!==null&&u===null)return null;if(c===null)return{kind:"functional",root:a,modifier:u,value:null};if(c[c.length-1]==="]"){if(c[0]!=="[")continue;let f=ce(c.slice(1,-1));return!se(f)||f.length===0||f.trim().length===0?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:f}}}if(c[c.length-1]===")"){if(c[0]!=="(")continue;let f=ce(c.slice(1,-1));return!se(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})`}}}return{kind:"functional",root:a,modifier:u,value:{kind:"named",value:c}}}case"compound":{if(c===null)return null;let u=t.parseVariant(c);if(u===null||!t.variants.compoundsWith(a,u))return null;let f=e===null?null:ht(e);return e!==null&&f===null?null:{kind:"compound",root:a,modifier:f,variant:u}}}}return null}function*nr(r,t){t(r)&&(yield[r,null]);let i=r.lastIndexOf("-");for(;i>0;){let e=r.slice(0,i);if(t(e)){let n=[e,r.slice(i+1)];if(n[1]==="")break;yield n}i=r.lastIndexOf("-",i-1)}r[0]==="@"&&t("@")&&(yield["@",r.slice(1)])}function or(r,t){let i=[];for(let n of t.variants)i.unshift(He(n));r.theme.prefix&&i.unshift(r.theme.prefix);let e="";if(t.kind==="static"&&(e+=t.root),t.kind==="functional"&&(e+=t.root,t.value))if(t.value.kind==="arbitrary"){if(t.value!==null){let n=wt(t.value.value),s=n?t.value.value.slice(4,-1):t.value.value,[a,c]=n?["(",")"]:["[","]"];t.value.dataType?e+=`-${a}${t.value.dataType}:${ke(s)}${c}`:e+=`-${a}${ke(s)}${c}`}}else t.value.kind==="named"&&(e+=`-${t.value.value}`);return t.kind==="arbitrary"&&(e+=`[${t.property}:${ke(t.value)}]`),(t.kind==="arbitrary"||t.kind==="functional")&&(e+=lr(t.modifier)),t.important&&(e+="!"),i.push(e),i.join(":")}function lr(r){if(r===null)return"";let t=wt(r.value),i=t?r.value.slice(4,-1):r.value,[e,n]=t?["(",")"]:["[","]"];return r.kind==="arbitrary"?`/${e}${ke(i)}${n}`:r.kind==="named"?`/${r.value}`:""}function He(r){if(r.kind==="static")return r.root;if(r.kind==="arbitrary")return`[${ke(bi(r.selector))}]`;let t="";if(r.kind==="functional"){t+=r.root;let i=r.root!=="@";if(r.value)if(r.value.kind==="arbitrary"){let e=wt(r.value.value),n=e?r.value.value.slice(4,-1):r.value.value,[s,a]=e?["(",")"]:["[","]"];t+=`${i?"-":""}${s}${ke(n)}${a}`}else r.value.kind==="named"&&(t+=`${i?"-":""}${r.value.value}`)}return r.kind==="compound"&&(t+=r.root,t+="-",t+=He(r.variant)),(r.kind==="functional"||r.kind==="compound")&&(t+=lr(r.modifier)),t}var wi=new B(r=>{let t=q(r),i=new Set;return ee(t,(e,{parent:n})=>{let s=n===null?t:n.nodes??[];if(e.kind==="word"&&(e.value==="+"||e.value==="-"||e.value==="*"||e.value==="/")){let a=s.indexOf(e)??-1;if(a===-1)return;let c=s[a-1];if(c?.kind!=="separator"||c.value!==" ")return;let u=s[a+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(c),i.add(u)}else e.kind==="separator"&&e.value.trim()==="/"?e.value="/":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&&ee(t,(e,{replaceWith:n})=>{i.has(e)&&(i.delete(e),n([]))}),vt(t),Y(t)});function ke(r){return wi.get(r)}var yi=new B(r=>{let t=q(r);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"?Y(t[2].nodes):r});function bi(r){return yi.get(r)}function vt(r){for(let t of r)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=Te(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=Te(t.value);for(let i=0;i{let t=q(r);return t.length===1&&t[0].kind==="function"&&t[0].value==="var"});function wt(r){return ki.get(r)}function xi(r){throw new Error(`Unexpected value: ${r}`)}function Te(r){return r.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function we(r,t,i){if(r===t)return 0;let e=r.indexOf("("),n=t.indexOf("("),s=e===-1?r.replace(/[\d.]+/g,""):r.slice(0,e),a=n===-1?t.replace(/[\d.]+/g,""):t.slice(0,n),c=(s===a?0:s{e=e.trim();let n=D(e," ").filter(f=>f.trim()!==""),s=null,a=null,c=null;for(let f of n)Ai.has(f)||(ar.test(f)?(a===null?a=f:c===null&&(c=f),ar.lastIndex=0):s===null&&(s=f));if(a===null||c===null)return e;let u=t(s??"currentcolor");return s!==null?e.replace(s,u):`${e} ${u}`}).join(", ")}var Ci=/^-?[a-z][a-zA-Z0-9/%._-]*$/,$i=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,Ze=["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"],yt=class{utilities=new B(()=>[]);completions=new Map;static(t,i){this.utilities.get(t).push({kind:"static",compileFn:i})}functional(t,i,e){this.utilities.get(t).push({kind:"functional",compileFn:i,options:e})}has(t,i){return this.utilities.has(t)&&this.utilities.get(t).some(e=>e.kind===i)}get(t){return this.utilities.has(t)?this.utilities.get(t):[]}getCompletions(t){return this.completions.get(t)?.()??[]}suggest(t,i){this.completions.set(t,i)}keys(t){let i=[];for(let[e,n]of this.utilities.entries())for(let s of n)if(s.kind===t){i.push(e);break}return i}};function $(r,t,i){return z("@property",r,[l("syntax",i?`"${i}"`:'"*"'),l("inherits","false"),...t?[l("initial-value",t)]:[]])}function Q(r,t){if(t===null)return r;let i=Number(t);return Number.isNaN(i)||(t=`${i*100}%`),t==="100%"?r:`color-mix(in oklab, ${r} ${t}, transparent)`}function ur(r,t){let i=Number(t);return Number.isNaN(i)||(t=`${i*100}%`),`oklab(from ${r} l a b / ${t})`}function X(r,t,i){if(!t)return r;if(t.kind==="arbitrary")return Q(r,t.value);let e=i.resolve(t.value,["--opacity"]);return e?Q(r,e):Ue(t.value)?Q(r,`${t.value}%`):null}function te(r,t,i){let e=null;switch(r.value.value){case"inherit":{e="inherit";break}case"transparent":{e="transparent";break}case"current":{e="currentcolor";break}default:{e=t.resolve(r.value.value,i);break}}return e?X(e,r.modifier,t):null}var fr=/(\d+)_(\d+)/g;function cr(r){let t=new yt;function i(o,p){function*h(y){for(let C of r.keysInNamespaces(y))yield C.replace(fr,(O,V,T)=>`${V}.${T}`)}let A=["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"];t.suggest(o,()=>{let y=[];for(let C of p()){if(typeof C=="string"){y.push({values:[C],modifiers:[]});continue}let O=[...C.values??[],...h(C.valueThemeKeys??[])],V=[...C.modifiers??[],...h(C.modifierThemeKeys??[])];C.supportsFractions&&O.push(...A),C.hasDefaultValue&&O.unshift(null),y.push({supportsNegative:C.supportsNegative,values:O,modifiers:V})}return y})}function e(o,p){t.static(o,()=>p.map(h=>typeof h=="function"?h():l(h[0],h[1])))}function n(o,p){function h({negative:A}){return y=>{let C=null,O=null;if(y.value)if(y.value.kind==="arbitrary"){if(y.modifier)return;C=y.value.value,O=y.value.dataType}else{if(C=r.resolve(y.value.fraction??y.value.value,p.themeKeys??[]),C===null&&p.supportsFractions&&y.value.fraction){let[V,T]=D(y.value.fraction,"/");if(!E(V)||!E(T))return;C=`calc(${y.value.fraction} * 100%)`}if(C===null&&A&&p.handleNegativeBareValue){if(C=p.handleNegativeBareValue(y.value),!C?.includes("/")&&y.modifier)return;if(C!==null)return p.handle(C,null)}if(C===null&&p.handleBareValue&&(C=p.handleBareValue(y.value),!C?.includes("/")&&y.modifier))return}else{if(y.modifier)return;C=p.defaultValue!==void 0?p.defaultValue:r.resolve(null,p.themeKeys??[])}if(C!==null)return p.handle(A?`calc(${C} * -1)`:C,O)}}p.supportsNegative&&t.functional(`-${o}`,h({negative:!0})),t.functional(o,h({negative:!1})),i(o,()=>[{supportsNegative:p.supportsNegative,valueThemeKeys:p.themeKeys??[],hasDefaultValue:p.defaultValue!==void 0&&p.defaultValue!==null,supportsFractions:p.supportsFractions}])}function s(o,p){t.functional(o,h=>{if(!h.value)return;let A=null;if(h.value.kind==="arbitrary"?(A=h.value.value,A=X(A,h.modifier,r)):A=te(h,r,p.themeKeys),A!==null)return p.handle(A)}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:p.themeKeys,modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}function a(o,p,h,{supportsNegative:A=!1,supportsFractions:y=!1}={}){A&&t.static(`-${o}-px`,()=>h("-1px")),t.static(`${o}-px`,()=>h("1px")),n(o,{themeKeys:p,supportsFractions:y,supportsNegative:A,defaultValue:null,handleBareValue:({value:C})=>{let O=r.resolve(null,["--spacing"]);return!O||!de(C)?null:`calc(${O} * ${C})`},handleNegativeBareValue:({value:C})=>{let O=r.resolve(null,["--spacing"]);return!O||!de(C)?null:`calc(${O} * -${C})`},handle:h}),i(o,()=>[{values:r.get(["--spacing"])?Ze:[],supportsNegative:A,supportsFractions:y,valueThemeKeys:p}])}e("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip","rect(0, 0, 0, 0)"],["white-space","nowrap"],["border-width","0"]]),e("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip","auto"],["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[o,p]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(`${o}-auto`,[[p,"auto"]]),e(`${o}-full`,[[p,"100%"]]),e(`-${o}-full`,[[p,"-100%"]]),a(o,["--inset","--spacing"],h=>[l(p,h)],{supportsNegative:!0,supportsFractions:!0});e("isolate",[["isolation","isolate"]]),e("isolation-auto",[["isolation","auto"]]),e("z-auto",[["z-index","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--z-index"],handle:o=>[l("z-index",o)]}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),e("order-first",[["order","-9999"]]),e("order-last",[["order","9999"]]),n("order",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--order"],handle:o=>[l("order",o)]}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--order"]}]),e("col-auto",[["grid-column","auto"]]),n("col",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column"],handle:o=>[l("grid-column",o)]}),e("col-span-full",[["grid-column","1 / -1"]]),n("col-span",{handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("grid-column",`span ${o} / span ${o}`)]}),e("col-start-auto",[["grid-column-start","auto"]]),n("col-start",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column-start"],handle:o=>[l("grid-column-start",o)]}),e("col-end-auto",[["grid-column-end","auto"]]),n("col-end",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-column-end"],handle:o=>[l("grid-column-end",o)]}),i("col-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-end"]}]),e("row-auto",[["grid-row","auto"]]),n("row",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row"],handle:o=>[l("grid-row",o)]}),e("row-span-full",[["grid-row","1 / -1"]]),n("row-span",{themeKeys:[],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("grid-row",`span ${o} / span ${o}`)]}),e("row-start-auto",[["grid-row-start","auto"]]),n("row-start",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row-start"],handle:o=>[l("grid-row-start",o)]}),e("row-end-auto",[["grid-row-end","auto"]]),n("row-end",{supportsNegative:!0,handleBareValue:({value:o})=>E(o)?o:null,themeKeys:["--grid-row-end"],handle:o=>[l("grid-row-end",o)]}),i("row-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+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[o,p]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(`${o}-auto`,[[p,"auto"]]),a(o,["--margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});e("box-border",[["box-sizing","border-box"]]),e("box-content",[["box-sizing","content-box"]]),e("line-clamp-none",[["overflow","visible"],["display","block"],["-webkit-box-orient","horizontal"],["-webkit-line-clamp","unset"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("overflow","hidden"),l("display","-webkit-box"),l("-webkit-box-orient","vertical"),l("-webkit-line-clamp",o)]}),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"]]),e("aspect-auto",[["aspect-ratio","auto"]]),e("aspect-square",[["aspect-ratio","1 / 1"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:o})=>{if(o===null)return null;let[p,h]=D(o,"/");return!E(p)||!E(h)?null:o},handle:o=>[l("aspect-ratio",o)]});for(let[o,p]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-${o}`,[["--tw-sort","size"],["width",p],["height",p]]),e(`w-${o}`,[["width",p]]),e(`h-${o}`,[["height",p]]),e(`min-w-${o}`,[["min-width",p]]),e(`min-h-${o}`,[["min-height",p]]),e(`max-w-${o}`,[["max-width",p]]),e(`max-h-${o}`,[["max-height",p]]);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"],o=>[l("--tw-sort","size"),l("width",o),l("height",o)],{supportsFractions:!0});for(let[o,p,h]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(o,p,A=>[l(h,A)],{supportsFractions:!0});t.static("container",()=>{let o=[...r.namespace("--breakpoint").values()];o.sort((h,A)=>we(h,A,"asc"));let p=[l("--tw-sort","--tw-container-component"),l("width","100%")];for(let h of o)p.push(z("@media",`(width >= ${h})`,[l("max-width",h)]));return p}),e("flex-auto",[["flex","auto"]]),e("flex-initial",[["flex","0 auto"]]),e("flex-none",[["flex","none"]]),t.functional("flex",o=>{if(o.value){if(o.value.kind==="arbitrary")return o.modifier?void 0:[l("flex",o.value.value)];if(o.value.fraction){let[p,h]=D(o.value.fraction,"/");return!E(p)||!E(h)?void 0:[l("flex",`calc(${o.value.fraction} * 100%)`)]}if(E(o.value.value))return o.modifier?void 0:[l("flex",o.value.value)]}}),i("flex",()=>[{supportsFractions:!0}]),n("shrink",{defaultValue:"1",handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("flex-shrink",o)]}),n("grow",{defaultValue:"1",handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("flex-grow",o)]}),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"],o=>[l("flex-basis",o)],{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 c=()=>L([$("--tw-border-spacing-x","0",""),$("--tw-border-spacing-y","0","")]);a("border-spacing",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-x",o),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-x",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-x",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-y",["--border-spacing","--spacing"],o=>[c(),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),e("origin-center",[["transform-origin","center"]]),e("origin-top",[["transform-origin","top"]]),e("origin-top-right",[["transform-origin","top right"]]),e("origin-right",[["transform-origin","right"]]),e("origin-bottom-right",[["transform-origin","bottom right"]]),e("origin-bottom",[["transform-origin","bottom"]]),e("origin-bottom-left",[["transform-origin","bottom left"]]),e("origin-left",[["transform-origin","left"]]),e("origin-top-left",[["transform-origin","top left"]]),n("origin",{themeKeys:["--transform-origin"],handle:o=>[l("transform-origin",o)]}),e("perspective-origin-center",[["perspective-origin","center"]]),e("perspective-origin-top",[["perspective-origin","top"]]),e("perspective-origin-top-right",[["perspective-origin","top right"]]),e("perspective-origin-right",[["perspective-origin","right"]]),e("perspective-origin-bottom-right",[["perspective-origin","bottom right"]]),e("perspective-origin-bottom",[["perspective-origin","bottom"]]),e("perspective-origin-bottom-left",[["perspective-origin","bottom left"]]),e("perspective-origin-left",[["perspective-origin","left"]]),e("perspective-origin-top-left",[["perspective-origin","top left"]]),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:o=>[l("perspective-origin",o)]}),e("perspective-none",[["perspective","none"]]),n("perspective",{themeKeys:["--perspective"],handle:o=>[l("perspective",o)]});let u=()=>L([$("--tw-translate-x","0"),$("--tw-translate-y","0"),$("--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"],o=>[u(),l("--tw-translate-x",o),l("--tw-translate-y",o),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let o of["x","y"])e(`-translate-${o}-full`,[u,[`--tw-translate-${o}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e(`translate-${o}-full`,[u,[`--tw-translate-${o}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a(`translate-${o}`,["--translate","--spacing"],p=>[u(),l(`--tw-translate-${o}`,p),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});a("translate-z",["--translate","--spacing"],o=>[u(),l("--tw-translate-z",o),l("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=()=>L([$("--tw-scale-x","1"),$("--tw-scale-y","1"),$("--tw-scale-z","1")]);e("scale-none",[["scale","none"]]);function g({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;return p.value.kind==="arbitrary"?(h=p.value.value,h=o?`calc(${h} * -1)`:h,[l("scale",h)]):(h=r.resolve(p.value.value,["--scale"]),!h&&E(p.value.value)&&(h=`${p.value.value}%`),h?(h=o?`calc(${h} * -1)`:h,[f(),l("--tw-scale-x",h),l("--tw-scale-y",h),l("--tw-scale-z",h),l("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}t.functional("-scale",g({negative:!0})),t.functional("scale",g({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let o of["x","y","z"])n(`scale-${o}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:p})=>E(p)?`${p}%`:null,handle:p=>[f(),l(`--tw-scale-${o}`,p),l("scale",`var(--tw-scale-x) var(--tw-scale-y)${o==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${o}`,()=>[{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:o}){return p=>{if(!p.value||p.modifier)return;let h;if(p.value.kind==="arbitrary"){h=p.value.value;let A=p.value.dataType??J(h,["angle","vector"]);if(A==="vector")return[l("rotate",`${h} var(--tw-rotate)`)];if(A!=="angle")return[l("rotate",o?`calc(${h} * -1)`:h)]}else if(h=r.resolve(p.value.value,["--rotate"]),!h&&E(p.value.value)&&(h=`${p.value.value}deg`),!h)return;return[l("rotate",o?`calc(${h} * -1)`:h)]}}t.functional("-rotate",d({negative:!0})),t.functional("rotate",d({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let o=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),p=()=>L([$("--tw-rotate-x"),$("--tw-rotate-y"),$("--tw-rotate-z"),$("--tw-skew-x"),$("--tw-skew-y")]);for(let h of["x","y","z"])n(`rotate-${h}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:A})=>E(A)?`${A}deg`:null,handle:A=>[p(),l(`--tw-rotate-${h}`,`rotate${h.toUpperCase()}(${A})`),l("transform",o)]}),i(`rotate-${h}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("transform",o)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>E(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),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"]}]),t.functional("transform",h=>{if(h.modifier)return;let A=null;if(h.value?h.value.kind==="arbitrary"&&(A=h.value.value):A=o,A!==null)return[p(),l("transform",A)]}),i("transform",()=>[{hasDefaultValue:!0}]),e("transform-cpu",[["transform",o]]),e("transform-gpu",[["transform",`translateZ(0) ${o}`]]),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 o 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-${o}`,[["cursor",o]]);n("cursor",{themeKeys:["--cursor"],handle:o=>[l("cursor",o)]});for(let o of["auto","none","manipulation"])e(`touch-${o}`,[["touch-action",o]]);let m=()=>L([$("--tw-pan-x"),$("--tw-pan-y"),$("--tw-pinch-zoom")]);for(let o of["x","left","right"])e(`touch-pan-${o}`,[m,["--tw-pan-x",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["y","up","down"])e(`touch-pan-${o}`,[m,["--tw-pan-y",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);e("touch-pinch-zoom",[m,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["none","text","all","auto"])e(`select-${o}`,[["-webkit-user-select",o],["user-select",o]]);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=()=>L([$("--tw-scroll-snap-strictness","proximity","*")]);for(let o of["x","y","both"])e(`snap-${o}`,[w,["scroll-snap-type",`${o} 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[o,p]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(o,["--scroll-margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});for(let[o,p]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(o,["--scroll-padding","--spacing"],h=>[l(p,h)]);e("list-inside",[["list-style-position","inside"]]),e("list-outside",[["list-style-position","outside"]]),e("list-none",[["list-style-type","none"]]),e("list-disc",[["list-style-type","disc"]]),e("list-decimal",[["list-style-type","decimal"]]),n("list",{themeKeys:["--list-style-type"],handle:o=>[l("list-style-type",o)]}),e("list-image-none",[["list-style-image","none"]]),n("list-image",{themeKeys:["--list-style-image"],handle:o=>[l("list-style-image",o)]}),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"]]),e("columns-auto",[["columns","auto"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:o})=>E(o)?o:null,handle:o=>[l("columns",o)]}),i("columns",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--columns","--container"]}]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-before-${o}`,[["break-before",o]]);for(let o of["auto","avoid","avoid-page","avoid-column"])e(`break-inside-${o}`,[["break-inside",o]]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-after-${o}`,[["break-after",o]]);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"]]),e("auto-cols-auto",[["grid-auto-columns","auto"]]),e("auto-cols-min",[["grid-auto-columns","min-content"]]),e("auto-cols-max",[["grid-auto-columns","max-content"]]),e("auto-cols-fr",[["grid-auto-columns","minmax(0, 1fr)"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:o=>[l("grid-auto-columns",o)]}),e("auto-rows-auto",[["grid-auto-rows","auto"]]),e("auto-rows-min",[["grid-auto-rows","min-content"]]),e("auto-rows-max",[["grid-auto-rows","max-content"]]),e("auto-rows-fr",[["grid-auto-rows","minmax(0, 1fr)"]]),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:o=>[l("grid-auto-rows",o)]}),e("grid-cols-none",[["grid-template-columns","none"]]),e("grid-cols-subgrid",[["grid-template-columns","subgrid"]]),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:o})=>lt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-columns",o)]}),e("grid-rows-none",[["grid-template-rows","none"]]),e("grid-rows-subgrid",[["grid-template-rows","subgrid"]]),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:o})=>lt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-rows",o)]}),i("grid-cols",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(o,p)=>`${p+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"],o=>[l("gap",o)]),a("gap-x",["--gap","--spacing"],o=>[l("column-gap",o)]),a("gap-y",["--gap","--spacing"],o=>[l("row-gap",o)]),a("space-x",["--space","--spacing"],o=>[L([$("--tw-space-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","0"),l("margin-inline-start",`calc(${o} * var(--tw-space-x-reverse))`),l("margin-inline-end",`calc(${o} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),a("space-y",["--space","--spacing"],o=>[L([$("--tw-space-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","0"),l("margin-block-start",`calc(${o} * var(--tw-space-y-reverse))`),l("margin-block-end",`calc(${o} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),e("space-x-reverse",[()=>L([$("--tw-space-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","1")])]),e("space-y-reverse",[()=>L([$("--tw-space-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","1")])]),e("accent-auto",[["accent-color","auto"]]),s("accent",{themeKeys:["--accent-color","--color"],handle:o=>[l("accent-color",o)]}),s("caret",{themeKeys:["--caret-color","--color"],handle:o=>[l("caret-color",o)]}),s("divide",{themeKeys:["--divide-color","--color"],handle:o=>[M(":where(& > :not(:last-child))",[l("--tw-sort","divide-color"),l("border-color",o)])]}),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 o of["auto","hidden","clip","visible","scroll"])e(`overflow-${o}`,[["overflow",o]]),e(`overflow-x-${o}`,[["overflow-x",o]]),e(`overflow-y-${o}`,[["overflow-y",o]]);for(let o of["auto","contain","none"])e(`overscroll-${o}`,[["overscroll-behavior",o]]),e(`overscroll-x-${o}`,[["overscroll-behavior-x",o]]),e(`overscroll-y-${o}`,[["overscroll-behavior-y",o]]);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-words",[["overflow-wrap","break-word"]]),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[o,p]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"]]])e(`${o}-none`,p.map(h=>[h,"0"])),e(`${o}-full`,p.map(h=>[h,"calc(infinity * 1px)"])),n(o,{themeKeys:["--radius"],handle:h=>p.map(A=>l(A,h))});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 p=function(h,A){t.functional(h,y=>{if(!y.value){if(y.modifier)return;let C=r.get(["--default-border-width"])??"1px",O=A.width(C);return O?[o(),...O]:void 0}if(y.value.kind==="arbitrary"){let C=y.value.value;switch(y.value.dataType??J(C,["color","line-width","length"])){case"line-width":case"length":{if(y.modifier)return;let V=A.width(C);return V?[o(),...V]:void 0}default:return C=X(C,y.modifier,r),C===null?void 0:A.color(C)}}{let C=te(y,r,["--border-color","--color"]);if(C)return A.color(C)}{if(y.modifier)return;let C=r.resolve(y.value.value,["--border-width"]);if(C){let O=A.width(C);return O?[o(),...O]:void 0}if(E(y.value.value)){let O=A.width(`${y.value.value}px`);return O?[o(),...O]:void 0}}}),i(h,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(y,C)=>`${C*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var K=p;let o=()=>L([$("--tw-border-style","solid")]);p("border",{width:h=>[l("border-style","var(--tw-border-style)"),l("border-width",h)],color:h=>[l("border-color",h)]}),p("border-x",{width:h=>[l("border-inline-style","var(--tw-border-style)"),l("border-inline-width",h)],color:h=>[l("border-inline-color",h)]}),p("border-y",{width:h=>[l("border-block-style","var(--tw-border-style)"),l("border-block-width",h)],color:h=>[l("border-block-color",h)]}),p("border-s",{width:h=>[l("border-inline-start-style","var(--tw-border-style)"),l("border-inline-start-width",h)],color:h=>[l("border-inline-start-color",h)]}),p("border-e",{width:h=>[l("border-inline-end-style","var(--tw-border-style)"),l("border-inline-end-width",h)],color:h=>[l("border-inline-end-color",h)]}),p("border-t",{width:h=>[l("border-top-style","var(--tw-border-style)"),l("border-top-width",h)],color:h=>[l("border-top-color",h)]}),p("border-r",{width:h=>[l("border-right-style","var(--tw-border-style)"),l("border-right-width",h)],color:h=>[l("border-right-color",h)]}),p("border-b",{width:h=>[l("border-bottom-style","var(--tw-border-style)"),l("border-bottom-width",h)],color:h=>[l("border-bottom-color",h)]}),p("border-l",{width:h=>[l("border-left-style","var(--tw-border-style)"),l("border-left-width",h)],color:h=>[l("border-left-color",h)]}),n("divide-x",{defaultValue:r.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>E(h)?`${h}px`:null,handle:h=>[L([$("--tw-divide-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-x-width"),o(),l("--tw-divide-x-reverse","0"),l("border-inline-style","var(--tw-border-style)"),l("border-inline-start-width",`calc(${h} * var(--tw-divide-x-reverse))`),l("border-inline-end-width",`calc(${h} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:r.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>E(h)?`${h}px`:null,handle:h=>[L([$("--tw-divide-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-y-width"),o(),l("--tw-divide-y-reverse","0"),l("border-bottom-style","var(--tw-border-style)"),l("border-top-style","var(--tw-border-style)"),l("border-top-width",`calc(${h} * var(--tw-divide-y-reverse))`),l("border-bottom-width",`calc(${h} * 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",[()=>L([$("--tw-divide-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-x-reverse","1")])]),e("divide-y-reverse",[()=>L([$("--tw-divide-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-y-reverse","1")])]);for(let h of["solid","dashed","dotted","double","none"])e(`divide-${h}`,[()=>M(":where(& > :not(:last-child))",[l("--tw-sort","divide-style"),l("--tw-border-style",h),l("border-style",h)])])}e("bg-auto",[["background-size","auto"]]),e("bg-cover",[["background-size","cover"]]),e("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(o){if(o)return[l("background-size",o)]}}),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(o){if(o)return[l("background-position",o)]}}),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 h=function(C){let O="in oklab";if(C?.kind==="named")switch(C.value){case"longer":case"shorter":case"increasing":case"decreasing":O=`in oklch ${C.value} hue`;break;default:O=`in ${C.value}`}else C?.kind==="arbitrary"&&(O=C.value);return O},A=function({negative:C}){return O=>{if(!O.value)return;if(O.value.kind==="arbitrary"){if(O.modifier)return;let j=O.value.value;switch(O.value.dataType??J(j,["angle"])){case"angle":return j=C?`calc(${j} * -1)`:`${j}`,[l("--tw-gradient-position",j),l("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)];default:return C?void 0:[l("--tw-gradient-position",j),l("background-image",`linear-gradient(var(--tw-gradient-stops,${j}))`)]}}let V=O.value.value;if(!C&&p.has(V))V=p.get(V);else if(E(V))V=C?`calc(${V}deg * -1)`:`${V}deg`;else return;let T=h(O.modifier);return[l("--tw-gradient-position",`${V}`),H("@supports (background-image: linear-gradient(in lab, red, red))",[l("--tw-gradient-position",`${V} ${T}`)]),l("background-image","linear-gradient(var(--tw-gradient-stops))")]}},y=function({negative:C}){return O=>{if(O.value?.kind==="arbitrary"){if(O.modifier)return;let j=O.value.value;return[l("--tw-gradient-position",j),l("background-image",`conic-gradient(var(--tw-gradient-stops,${j}))`)]}let V=h(O.modifier);if(!O.value)return[l("--tw-gradient-position",V),l("background-image","conic-gradient(var(--tw-gradient-stops))")];let T=O.value.value;if(E(T))return T=C?`calc(${T}deg * -1)`:`${T}deg`,[l("--tw-gradient-position",`from ${T} ${V}`),l("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var G=h,I=A,W=y;let o=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],p=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"]]);t.functional("-bg-linear",A({negative:!0})),t.functional("bg-linear",A({negative:!1})),i("bg-linear",()=>[{values:[...p.keys()],modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),t.functional("-bg-conic",y({negative:!0})),t.functional("bg-conic",y({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),t.functional("bg-radial",C=>{if(!C.value){let O=h(C.modifier);return[l("--tw-gradient-position",O),l("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(C.value.kind==="arbitrary"){if(C.modifier)return;let O=C.value.value;return[l("--tw-gradient-position",O),l("background-image",`radial-gradient(var(--tw-gradient-stops,${O}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:o}])}t.functional("bg",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("background-position",p)];case"bg-size":case"length":case"size":return o.modifier?void 0:[l("background-size",p)];case"image":case"url":return o.modifier?void 0:[l("background-image",p)];default:return p=X(p,o.modifier,r),p===null?void 0:[l("background-color",p)]}}{let p=te(o,r,["--background-color","--color"]);if(p)return[l("background-color",p)]}{if(o.modifier)return;let p=r.resolve(o.value.value,["--background-image"]);if(p)return[l("background-image",p)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let v=()=>L([$("--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 x(o,p){t.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??J(A,["color","length","percentage"])){case"length":case"percentage":return h.modifier?void 0:p.position(A);default:return A=X(A,h.modifier,r),A===null?void 0:p.color(A)}}{let A=te(h,r,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=r.resolve(h.value.value,["--gradient-color-stop-positions"]);if(A)return p.position(A);if(h.value.value[h.value.value.length-1]==="%"&&E(h.value.value.slice(0,-1)))return p.position(h.value.value)}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}x("from",{color:o=>[v(),l("--tw-sort","--tw-gradient-from"),l("--tw-gradient-from",o),l("--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:o=>[v(),l("--tw-gradient-from-position",o)]}),e("via-none",[["--tw-gradient-via-stops","initial"]]),x("via",{color:o=>[v(),l("--tw-sort","--tw-gradient-via"),l("--tw-gradient-via",o),l("--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)"),l("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:o=>[v(),l("--tw-gradient-via-position",o)]}),x("to",{color:o=>[v(),l("--tw-sort","--tw-gradient-to"),l("--tw-gradient-to",o),l("--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:o=>[v(),l("--tw-gradient-to-position",o)]}),e("mask-none",[["mask-image","none"]]),t.functional("mask",o=>{if(!o.value||o.modifier||o.value.kind!=="arbitrary")return;let p=o.value.value;switch(o.value.dataType??J(p,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("mask-position",p)];case"bg-size":case"length":case"size":return[l("mask-size",p)];case"image":case"url":default:return[l("mask-image",p)]}}),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(o){if(o)return[l("mask-size",o)]}}),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(o){if(o)return[l("mask-position",o)]}}),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 k=()=>L([$("--tw-mask-linear","linear-gradient(#fff, #fff)"),$("--tw-mask-radial","linear-gradient(#fff, #fff)"),$("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function N(o,p){t.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??J(A,["length","percentage","color"])){case"color":return A=X(A,h.modifier,r),A===null?void 0:p.color(A);case"percentage":return h.modifier||!E(A.slice(0,-1))?void 0:p.position(A);default:return h.modifier?void 0:p.position(A)}}{let A=te(h,r,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=J(h.value.value,["number","percentage"]);if(!A)return;switch(A){case"number":{let y=r.resolve(null,["--spacing"]);return!y||!de(h.value.value)?void 0:p.position(`calc(${y} * ${h.value.value})`)}case"percentage":return E(h.value.value.slice(0,-1))?p.position(h.value.value):void 0;default:return}}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(o,()=>[{values:Array.from({length:21},(h,A)=>`${A*5}%`)},{values:r.get(["--spacing"])?Ze:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}let b=()=>L([$("--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 S(o,p,h){N(o,{color(A){let y=[k(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(y.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),y.push(L([$(`--tw-mask-${C}-from-position`,"0%"),$(`--tw-mask-${C}-to-position`,"100%"),$(`--tw-mask-${C}-from-color`,"black"),$(`--tw-mask-${C}-to-color`,"transparent")])),y.push(l(`--tw-mask-${C}-${p}-color`,A)));return y},position(A){let y=[k(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(y.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),y.push(L([$(`--tw-mask-${C}-from-position`,"0%"),$(`--tw-mask-${C}-to-position`,"100%"),$(`--tw-mask-${C}-from-color`,"black"),$(`--tw-mask-${C}-to-color`,"transparent")])),y.push(l(`--tw-mask-${C}-${p}-position`,A)));return y}})}S("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),S("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let P=()=>L([$("--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(o){return E(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return E(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),l("--tw-mask-linear-position",o)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),N("mask-linear-from",{color:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-color",o)],position:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-position",o)]}),N("mask-linear-to",{color:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-color",o)],position:o=>[k(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-position",o)]});let U=()=>L([$("--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")]);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:o=>[l("--tw-mask-radial-position",o)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),l("--tw-mask-radial-size",o)]}),N("mask-radial-from",{color:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-color",o)],position:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-position",o)]}),N("mask-radial-to",{color:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-color",o)],position:o=>[k(),U(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-position",o)]});let R=()=>L([$("--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(o){return E(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return E(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),l("--tw-mask-conic-position",o)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),N("mask-conic-from",{color:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-color",o)],position:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-position",o)]}),N("mask-conic-to",{color:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-color",o)],position:o=>[k(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-position",o)]}),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 o of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])e(`bg-blend-${o}`,[["background-blend-mode",o]]),e(`mix-blend-${o}`,[["mix-blend-mode",o]]);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"]]),t.functional("fill",o=>{if(!o.value)return;if(o.value.kind==="arbitrary"){let h=X(o.value.value,o.modifier,r);return h===null?void 0:[l("fill",h)]}let p=te(o,r,["--fill","--color"]);if(p)return[l("fill",p)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)}]),e("stroke-none",[["stroke","none"]]),t.functional("stroke",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","number","length","percentage"])){case"number":case"length":case"percentage":return o.modifier?void 0:[l("stroke-width",p)];default:return p=X(o.value.value,o.modifier,r),p===null?void 0:[l("stroke",p)]}}{let p=te(o,r,["--stroke","--color"]);if(p)return[l("stroke",p)]}{let p=r.resolve(o.value.value,["--stroke-width"]);if(p)return[l("stroke-width",p)];if(E(o.value.value))return[l("stroke-width",o.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*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"]]),e("object-top",[["object-position","top"]]),e("object-top-left",[["object-position","left top"]]),e("object-top-right",[["object-position","right top"]]),e("object-bottom",[["object-position","bottom"]]),e("object-bottom-left",[["object-position","left bottom"]]),e("object-bottom-right",[["object-position","right bottom"]]),e("object-left",[["object-position","left"]]),e("object-right",[["object-position","right"]]),e("object-center",[["object-position","center"]]),n("object",{themeKeys:["--object-position"],handle:o=>[l("object-position",o)]});for(let[o,p]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(o,["--padding","--spacing"],h=>[l(p,h)]);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"],o=>[l("text-indent",o)],{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:o=>[l("vertical-align",o)]}),t.functional("font",o=>{if(!(!o.value||o.modifier)){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[l("font-family",p)];default:return[L([$("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}{let p=r.resolveWith(o.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(p){let[h,A={}]=p;return[l("font-family",h),l("font-feature-settings",A["--font-feature-settings"]),l("font-variation-settings",A["--font-variation-settings"])]}}{let p=r.resolve(o.value.value,["--font-weight"]);if(p)return[L([$("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}}),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:o})=>{if(!o.endsWith("%"))return null;let p=Number(o.slice(0,-1));return!E(p)||Number.isNaN(p)||p<50||p>200?null:o},handle:o=>[l("font-stretch",o)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),s("placeholder",{themeKeys:["--background-color","--color"],handle:o=>[M("&::placeholder",[l("--tw-sort","placeholder-color"),l("color",o)])]}),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"]]),t.functional("decoration",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","length","percentage"])){case"length":case"percentage":return o.modifier?void 0:[l("text-decoration-thickness",p)];default:return p=X(p,o.modifier,r),p===null?void 0:[l("text-decoration-color",p)]}}{let p=r.resolve(o.value.value,["--text-decoration-thickness"]);if(p)return o.modifier?void 0:[l("text-decoration-thickness",p)];if(E(o.value.value))return o.modifier?void 0:[l("text-decoration-thickness",`${o.value.value}px`)]}{let p=te(o,r,["--text-decoration-color","--color"]);if(p)return[l("text-decoration-color",p)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),e("animate-none",[["animation","none"]]),n("animate",{themeKeys:["--animate"],handle:o=>[l("animation",o)]});{let o=["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(" "),p=["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(" "),h=()=>L([$("--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")]),A=()=>L([$("--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")]);t.functional("filter",y=>{if(!y.modifier){if(y.value===null)return[h(),l("filter",o)];if(y.value.kind==="arbitrary")return[l("filter",y.value.value)];switch(y.value.value){case"none":return[l("filter","none")]}}}),t.functional("backdrop-filter",y=>{if(!y.modifier){if(y.value===null)return[A(),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)];if(y.value.kind==="arbitrary")return[l("-webkit-backdrop-filter",y.value.value),l("backdrop-filter",y.value.value)];switch(y.value.value){case"none":return[l("-webkit-backdrop-filter","none"),l("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:y=>[h(),l("--tw-blur",`blur(${y})`),l("filter",o)]}),e("blur-none",[h,["--tw-blur"," "],["filter",o]]),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:y=>[A(),l("--tw-backdrop-blur",`blur(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),e("backdrop-blur-none",[A,["--tw-backdrop-blur"," "],["-webkit-backdrop-filter",p],["backdrop-filter",p]]),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-brightness",`brightness(${y})`),l("filter",o)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-brightness",`brightness(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-contrast",`contrast(${y})`),l("filter",o)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-contrast",`contrast(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-grayscale",`grayscale(${y})`),l("filter",o)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-grayscale",`grayscale(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}deg`:null,handle:y=>[h(),l("--tw-hue-rotate",`hue-rotate(${y})`),l("filter",o)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:y})=>E(y)?`${y}deg`:null,handle:y=>[A(),l("--tw-backdrop-hue-rotate",`hue-rotate(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-invert",`invert(${y})`),l("filter",o)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-invert",`invert(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,handle:y=>[h(),l("--tw-saturate",`saturate(${y})`),l("filter",o)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-saturate",`saturate(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[h(),l("--tw-sepia",`sepia(${y})`),l("filter",o)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:y})=>E(y)?`${y}%`:null,defaultValue:"100%",handle:y=>[A(),l("--tw-backdrop-sepia",`sepia(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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",[h,["--tw-drop-shadow"," "],["filter",o]]),t.functional("drop-shadow",y=>{let C;if(y.modifier&&(y.modifier.kind==="arbitrary"?C=y.modifier.value:E(y.modifier.value)&&(C=`${y.modifier.value}%`)),!y.value){let O=r.get(["--drop-shadow"]),V=r.resolve(null,["--drop-shadow"]);return O===null||V===null?void 0:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow",D(V,",").map(T=>`drop-shadow(${T})`).join(" ")),l("filter",o)]}if(y.value.kind==="arbitrary"){let O=y.value.value;switch(y.value.dataType??J(O,["color"])){case"color":return O=X(O,y.modifier,r),O===null?void 0:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return y.modifier&&!C?void 0:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]}}{let O=r.get([`--drop-shadow-${y.value.value}`]),V=r.resolve(y.value.value,["--drop-shadow"]);if(O&&V)return y.modifier&&!C?void 0:C?[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]:[h(),l("--tw-drop-shadow-alpha",C),...Ye("--tw-drop-shadow-size",O,C,T=>`var(--tw-drop-shadow-color, ${T})`),l("--tw-drop-shadow",D(V,",").map(T=>`drop-shadow(${T})`).join(" ")),l("filter",o)]}{let O=te(y,r,["--drop-shadow-color","--color"]);if(O)return O==="inherit"?[h(),l("--tw-drop-shadow-color","inherit"),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--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},(y,C)=>`${C*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:y})=>Ue(y)?`${y}%`:null,handle:y=>[A(),l("--tw-backdrop-opacity",`opacity(${y})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(y,C)=>`${C*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let o=`var(--tw-ease, ${r.resolve(null,["--default-transition-timing-function"])??"ease"})`,p=`var(--tw-duration, ${r.resolve(null,["--default-transition-duration"])??"0s"})`;e("transition-none",[["transition-property","none"]]),e("transition-all",[["transition-property","all"],["transition-timing-function",o],["transition-duration",p]]),e("transition-colors",[["transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"],["transition-timing-function",o],["transition-duration",p]]),e("transition-opacity",[["transition-property","opacity"],["transition-timing-function",o],["transition-duration",p]]),e("transition-shadow",[["transition-property","box-shadow"],["transition-timing-function",o],["transition-duration",p]]),e("transition-transform",[["transition-property","transform, translate, scale, rotate"],["transition-timing-function",o],["transition-duration",p]]),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, visibility, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:h=>[l("transition-property",h),l("transition-timing-function",o),l("transition-duration",p)]}),e("transition-discrete",[["transition-behavior","allow-discrete"]]),e("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:h})=>E(h)?`${h}ms`:null,themeKeys:["--transition-delay"],handle:h=>[l("transition-delay",h)]});{let h=()=>L([$("--tw-duration")]);e("duration-initial",[h,["--tw-duration","initial"]]),t.functional("duration",A=>{if(A.modifier||!A.value)return;let y=null;if(A.value.kind==="arbitrary"?y=A.value.value:(y=r.resolve(A.value.fraction??A.value.value,["--transition-duration"]),y===null&&E(A.value.value)&&(y=`${A.value.value}ms`)),y!==null)return[h(),l("--tw-duration",y),l("transition-duration",y)]})}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 o=()=>L([$("--tw-ease")]);e("ease-initial",[o,["--tw-ease","initial"]]),e("ease-linear",[o,["--tw-ease","linear"],["transition-timing-function","linear"]]),n("ease",{themeKeys:["--ease"],handle:p=>[o(),l("--tw-ease",p),l("transition-timing-function",p)]})}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:o=>[l("will-change",o)]}),e("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:[],handle:o=>[L([$("--tw-content",'""')]),l("--tw-content",o),l("content","var(--tw-content)")]});{let o="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",p=()=>L([$("--tw-contain-size"),$("--tw-contain-layout"),$("--tw-contain-paint"),$("--tw-contain-style")]);e("contain-none",[["contain","none"]]),e("contain-content",[["contain","content"]]),e("contain-strict",[["contain","strict"]]),e("contain-size",[p,["--tw-contain-size","size"],["contain",o]]),e("contain-inline-size",[p,["--tw-contain-size","inline-size"],["contain",o]]),e("contain-layout",[p,["--tw-contain-layout","layout"],["contain",o]]),e("contain-paint",[p,["--tw-contain-paint","paint"],["contain",o]]),e("contain-style",[p,["--tw-contain-style","style"],["contain",o]]),n("contain",{themeKeys:[],handle:h=>[l("contain",h)]})}e("forced-color-adjust-none",[["forced-color-adjust","none"]]),e("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),e("leading-none",[()=>L([$("--tw-leading")]),["--tw-leading","1"],["line-height","1"]]),a("leading",["--leading","--spacing"],o=>[L([$("--tw-leading")]),l("--tw-leading",o),l("line-height",o)]),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:o=>[L([$("--tw-tracking")]),l("--tw-tracking",o),l("letter-spacing",o)]}),e("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),e("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let o="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",p=()=>L([$("--tw-ordinal"),$("--tw-slashed-zero"),$("--tw-numeric-figure"),$("--tw-numeric-spacing"),$("--tw-numeric-fraction")]);e("normal-nums",[["font-variant-numeric","normal"]]),e("ordinal",[p,["--tw-ordinal","ordinal"],["font-variant-numeric",o]]),e("slashed-zero",[p,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",o]]),e("lining-nums",[p,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",o]]),e("oldstyle-nums",[p,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",o]]),e("proportional-nums",[p,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",o]]),e("tabular-nums",[p,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",o]]),e("diagonal-fractions",[p,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",o]]),e("stacked-fractions",[p,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",o]])}{let o=()=>L([$("--tw-outline-style","solid")]);t.static("outline-hidden",()=>[l("--tw-outline-style","none"),l("outline-style","none"),z("@media","(forced-colors: active)",[l("outline","2px solid transparent"),l("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"]]),t.functional("outline",p=>{if(p.value===null){if(p.modifier)return;let h=r.get(["--default-outline-width"])??"1px";return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)]}if(p.value.kind==="arbitrary"){let h=p.value.value;switch(p.value.dataType??J(h,["color","length","number","percentage"])){case"length":case"number":case"percentage":return p.modifier?void 0:[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];default:return h=X(h,p.modifier,r),h===null?void 0:[l("outline-color",h)]}}{let h=te(p,r,["--outline-color","--color"]);if(h)return[l("outline-color",h)]}{if(p.modifier)return;let h=r.resolve(p.value.value,["--outline-width"]);if(h)return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];if(E(p.value.value))return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",`${p.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(p,h)=>`${h*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:p})=>E(p)?`${p}px`:null,handle:p=>[l("outline-offset",p)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:o})=>Ue(o)?`${o}%`:null,handle:o=>[l("opacity",o)]}),i("opacity",()=>[{values:Array.from({length:21},(o,p)=>`${p*5}`),valueThemeKeys:["--opacity"]}]),e("underline-offset-auto",[["text-underline-offset","auto"]]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:o})=>E(o)?`${o}px`:null,handle:o=>[l("text-underline-offset",o)]}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),t.functional("text",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??J(p,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(o.modifier){let A=o.modifier.kind==="arbitrary"?o.modifier.value:r.resolve(o.modifier.value,["--leading"]);if(!A&&de(o.modifier.value)){let y=r.resolve(null,["--spacing"]);if(!y)return null;A=`calc(${y} * ${o.modifier.value})`}return!A&&o.modifier.value==="none"&&(A="1"),A?[l("font-size",p),l("line-height",A)]:null}return[l("font-size",p)]}default:return p=X(p,o.modifier,r),p===null?void 0:[l("color",p)]}}{let p=te(o,r,["--text-color","--color"]);if(p)return[l("color",p)]}{let p=r.resolveWith(o.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(p){let[h,A={}]=Array.isArray(p)?p:[p];if(o.modifier){let y=o.modifier.kind==="arbitrary"?o.modifier.value:r.resolve(o.modifier.value,["--leading"]);if(!y&&de(o.modifier.value)){let O=r.resolve(null,["--spacing"]);if(!O)return null;y=`calc(${O} * ${o.modifier.value})`}if(!y&&o.modifier.value==="none"&&(y="1"),!y)return null;let C=[l("font-size",h)];return y&&C.push(l("line-height",y)),C}return typeof A=="string"?[l("font-size",h),l("line-height",A)]:[l("font-size",h),l("line-height",A["--line-height"]?`var(--tw-leading, ${A["--line-height"]})`:void 0),l("letter-spacing",A["--letter-spacing"]?`var(--tw-tracking, ${A["--letter-spacing"]})`:void 0),l("font-weight",A["--font-weight"]?`var(--tw-font-weight, ${A["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let _=()=>L([$("--tw-text-shadow-color"),$("--tw-text-shadow-alpha","100%","")]);e("text-shadow-initial",[_,["--tw-text-shadow-color","initial"]]),t.functional("text-shadow",o=>{let p;if(o.modifier&&(o.modifier.kind==="arbitrary"?p=o.modifier.value:E(o.modifier.value)&&(p=`${o.modifier.value}%`)),!o.value){let h=r.get(["--text-shadow"]);return h===null?void 0:[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}if(o.value.kind==="arbitrary"){let h=o.value.value;switch(o.value.dataType??J(h,["color"])){case"color":return h=X(h,o.modifier,r),h===null?void 0:[_(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))];default:return[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,y=>`var(--tw-text-shadow-color, ${y})`)]}}switch(o.value.value){case"none":return o.modifier?void 0:[_(),l("text-shadow","none")];case"inherit":return o.modifier?void 0:[_(),l("--tw-text-shadow-color","inherit")]}{let h=r.get([`--text-shadow-${o.value.value}`]);if(h)return[_(),l("--tw-text-shadow-alpha",p),...ue("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}{let h=te(o,r,["--text-shadow-color","--color"]);if(h)return[_(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`),hasDefaultValue:r.get(["--text-shadow"])!==null}]);{let y=function(V){return`var(--tw-ring-inset,) 0 0 0 calc(${V} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${A})`},C=function(V){return`inset 0 0 0 ${V} var(--tw-inset-ring-color, currentcolor)`};var Z=y,re=C;let o=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),p="0 0 #0000",h=()=>L([$("--tw-shadow",p),$("--tw-shadow-color"),$("--tw-shadow-alpha","100%",""),$("--tw-inset-shadow",p),$("--tw-inset-shadow-color"),$("--tw-inset-shadow-alpha","100%",""),$("--tw-ring-color"),$("--tw-ring-shadow",p),$("--tw-inset-ring-color"),$("--tw-inset-ring-shadow",p),$("--tw-ring-inset"),$("--tw-ring-offset-width","0px",""),$("--tw-ring-offset-color","#fff"),$("--tw-ring-offset-shadow",p)]);e("shadow-initial",[h,["--tw-shadow-color","initial"]]),t.functional("shadow",V=>{let T;if(V.modifier&&(V.modifier.kind==="arbitrary"?T=V.modifier.value:E(V.modifier.value)&&(T=`${V.modifier.value}%`)),!V.value){let j=r.get(["--shadow"]);return j===null?void 0:[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,oe=>`var(--tw-shadow-color, ${oe})`),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let j=V.value.value;switch(V.value.dataType??J(j,["color"])){case"color":return j=X(j,V.modifier,r),j===null?void 0:[h(),l("--tw-shadow-color",Q(j,"var(--tw-shadow-alpha)"))];default:return[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,ot=>`var(--tw-shadow-color, ${ot})`),l("box-shadow",o)]}}switch(V.value.value){case"none":return V.modifier?void 0:[h(),l("--tw-shadow",p),l("box-shadow",o)];case"inherit":return V.modifier?void 0:[h(),l("--tw-shadow-color","inherit")]}{let j=r.get([`--shadow-${V.value.value}`]);if(j)return[h(),l("--tw-shadow-alpha",T),...ue("--tw-shadow",j,T,oe=>`var(--tw-shadow-color, ${oe})`),l("box-shadow",o)]}{let j=te(V,r,["--box-shadow-color","--color"]);if(j)return[h(),l("--tw-shadow-color",Q(j,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`),hasDefaultValue:r.get(["--shadow"])!==null}]),e("inset-shadow-initial",[h,["--tw-inset-shadow-color","initial"]]),t.functional("inset-shadow",V=>{let T;if(V.modifier&&(V.modifier.kind==="arbitrary"?T=V.modifier.value:E(V.modifier.value)&&(T=`${V.modifier.value}%`)),!V.value){let j=r.get(["--inset-shadow"]);return j===null?void 0:[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,oe=>`var(--tw-inset-shadow-color, ${oe})`),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let j=V.value.value;switch(V.value.dataType??J(j,["color"])){case"color":return j=X(j,V.modifier,r),j===null?void 0:[h(),l("--tw-inset-shadow-color",Q(j,"var(--tw-inset-shadow-alpha)"))];default:return[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,ot=>`var(--tw-inset-shadow-color, ${ot})`,"inset "),l("box-shadow",o)]}}switch(V.value.value){case"none":return V.modifier?void 0:[h(),l("--tw-inset-shadow",p),l("box-shadow",o)];case"inherit":return V.modifier?void 0:[h(),l("--tw-inset-shadow-color","inherit")]}{let j=r.get([`--inset-shadow-${V.value.value}`]);if(j)return[h(),l("--tw-inset-shadow-alpha",T),...ue("--tw-inset-shadow",j,T,oe=>`var(--tw-inset-shadow-color, ${oe})`),l("box-shadow",o)]}{let j=te(V,r,["--box-shadow-color","--color"]);if(j)return[h(),l("--tw-inset-shadow-color",Q(j,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`),hasDefaultValue:r.get(["--inset-shadow"])!==null}]),e("ring-inset",[h,["--tw-ring-inset","inset"]]);let A=r.get(["--default-ring-color"])??"currentcolor";t.functional("ring",V=>{if(!V.value){if(V.modifier)return;let T=r.get(["--default-ring-width"])??"1px";return[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)]}if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-ring-color",T)]}}{let T=te(V,r,["--ring-color","--color"]);if(T)return[l("--tw-ring-color",T)]}{if(V.modifier)return;let T=r.resolve(V.value.value,["--ring-width"]);if(T===null&&E(V.value.value)&&(T=`${V.value.value}px`),T)return[h(),l("--tw-ring-shadow",y(T)),l("box-shadow",o)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),t.functional("inset-ring",V=>{if(!V.value)return V.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C("1px")),l("box-shadow",o)];if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C(T)),l("box-shadow",o)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-inset-ring-color",T)]}}{let T=te(V,r,["--ring-color","--color"]);if(T)return[l("--tw-inset-ring-color",T)]}{if(V.modifier)return;let T=r.resolve(V.value.value,["--ring-width"]);if(T===null&&E(V.value.value)&&(T=`${V.value.value}px`),T)return[h(),l("--tw-inset-ring-shadow",C(T)),l("box-shadow",o)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},(V,T)=>`${T*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let O="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";t.functional("ring-offset",V=>{if(V.value){if(V.value.kind==="arbitrary"){let T=V.value.value;switch(V.value.dataType??J(T,["color","length"])){case"length":return V.modifier?void 0:[l("--tw-ring-offset-width",T),l("--tw-ring-offset-shadow",O)];default:return T=X(T,V.modifier,r),T===null?void 0:[l("--tw-ring-offset-color",T)]}}{let T=r.resolve(V.value.value,["--ring-offset-width"]);if(T)return V.modifier?void 0:[l("--tw-ring-offset-width",T),l("--tw-ring-offset-shadow",O)];if(E(V.value.value))return V.modifier?void 0:[l("--tw-ring-offset-width",`${V.value.value}px`),l("--tw-ring-offset-shadow",O)]}{let T=te(V,r,["--ring-offset-color","--color"]);if(T)return[l("--tw-ring-offset-color",T)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),t.functional("@container",o=>{let p=null;if(o.value===null?p="inline-size":o.value.kind==="arbitrary"?p=o.value.value:o.value.kind==="named"&&o.value.value==="normal"&&(p="normal"),p!==null)return o.modifier?[l("container-type",p),l("container-name",o.modifier.value)]:[l("container-type",p)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),t}var bt=["number","integer","ratio","percentage"];function pr(r){let t=r.params;return $i.test(t)?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}};F(r.nodes,n=>{if(n.kind!=="declaration"||!n.value||!n.value.includes("--value(")&&!n.value.includes("--modifier("))return;let s=q(n.value);ee(s,a=>{if(a.kind!=="function")return;if(a.value==="--spacing"&&!(e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return ee(a.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let f=u.value;for(let g of u.nodes)if(g.kind==="word"){if(g.value==="integer")e[f].usedSpacingInteger||=!0;else if(g.value==="number"&&(e[f].usedSpacingNumber||=!0,e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return 2}}),0;if(a.value!=="--value"&&a.value!=="--modifier")return;let c=D(Y(a.nodes),",");for(let[u,f]of c.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+="-*"),c[u]=f;a.nodes=q(c.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]==="]")&&!bt.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${bt.map(x=>`"${x}"`).join(", ")}. +`);let f=u.value,g=structuredClone(a),d="\xB6";ee(g.nodes,(x,{replaceWith:k})=>{x.kind==="word"&&x.value===f&&k({kind:"word",value:d})});let m="^".repeat(Y([u]).length),w=Y([g]).indexOf(d),v=["```css",Y([a])," ".repeat(w)+m,"```"].join(` +`);console.warn(v)}}),n.value=Y(s)}),i.utilities.functional(t.slice(0,-2),n=>{let s=structuredClone(r),a=n.value,c=n.modifier;if(a===null)return;let u=!1,f=!1,g=!1,d=!1,m=new Map,w=!1;if(F([s],(v,{parent:x,replaceWith:k})=>{if(x?.kind!=="rule"&&x?.kind!=="at-rule"||v.kind!=="declaration"||!v.value)return;let N=q(v.value);(ee(N,(S,{replaceWith:P})=>{if(S.kind==="function"){if(S.value==="--value"){u=!0;let U=sr(a,S,i);return U?(f=!0,U.ratio?w=!0:m.set(v,x),P(U.nodes),1):(u||=!1,k([]),2)}else if(S.value==="--modifier"){if(c===null)return k([]),2;g=!0;let U=sr(c,S,i);return U?(d=!0,P(U.nodes),1):(g||=!1,k([]),2)}}})??0)===0&&(v.value=Y(N))}),u&&!f||g&&!d||w&&d||c&&!w&&!d)return null;if(w)for(let[v,x]of m){let k=x.nodes.indexOf(v);k!==-1&&x.nodes.splice(k,1)}return s.nodes}),i.utilities.suggest(t.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:c,usedSpacingNumber:u,usedSpacingInteger:f,themeKeys:g}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let d of c)a.push(d);if(u)a.push(...Ze);else if(f)for(let d of Ze)E(d)&&a.push(d);for(let d of i.theme.keysInNamespaces(g))a.push(d.replace(fr,(m,w,v)=>`${w}.${v}`))}return[{values:n,modifiers:s}]})}:Ci.test(t)?i=>{i.utilities.static(t,()=>structuredClone(r.nodes))}:null}function sr(r,t,i){for(let e of t.nodes){if(r.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)===r.value)return{nodes:q(r.value)};if(r.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(r.value,[n]);if(s)return{nodes:q(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],c=i.theme.resolveWith(r.value,a,s);if(c){let[,u={}]=c;{let f=u[s.pop()];if(f)return{nodes:q(f)}}}}}else if(r.kind==="named"&&e.kind==="word"){if(!bt.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in r?r.fraction:r.value;if(!n)continue;let s=J(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[a,c]=D(n,"/");if(!E(a)||!E(c))continue}else{if(s==="number"&&!de(n))continue;if(s==="percentage"&&!E(n.slice(0,-1)))continue}return{nodes:q(n),ratio:s==="ratio"}}else if(r.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:q(r.value)};if("dataType"in r&&r.dataType&&r.dataType!==n)continue;if("dataType"in r&&r.dataType)return{nodes:q(r.value)};if(J(r.value,[n])!==null)return{nodes:q(r.value)}}}}function ue(r,t,i,e,n=""){let s=!1,a=Ee(t,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(ur(u,i))));function c(u){return n?D(u,",").map(f=>n+f).join(","):u}return s?[l(r,c(Ee(t,e))),H("@supports (color: lab(from red l a b))",[l(r,c(a))])]:[l(r,c(a))]}function Ye(r,t,i,e,n=""){let s=!1,a=D(t,",").map(c=>Ee(c,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(ur(u,i))))).map(c=>`drop-shadow(${c})`).join(" ");return s?[l(r,n+D(t,",").map(c=>`drop-shadow(${Ee(c,e)})`).join(" ")),H("@supports (color: lab(from red l a b))",[l(r,n+a)])]:[l(r,n+a)]}var kt={"--alpha":Vi,"--spacing":Ni,"--theme":Si,theme:Ti};function Vi(r,t,i,...e){let[n,s]=D(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 Ni(r,t,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=r.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 Si(r,t,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)),t.kind==="at-rule"&&(n=!0);let s=r.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 c=q(s);return Pi(c,a),Y(c)}return s}function Ti(r,t,i,...e){i=Ei(i);let n=r.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 dr=new RegExp(Object.keys(kt).map(r=>`${r}\\(`).join("|"));function xe(r,t){let i=0;return F(r,e=>{if(e.kind==="declaration"&&e.value&&dr.test(e.value)){i|=8,e.value=mr(e.value,e,t);return}e.kind==="at-rule"&&(e.name==="@media"||e.name==="@custom-media"||e.name==="@container"||e.name==="@supports")&&dr.test(e.params)&&(i|=8,e.params=mr(e.params,e,t))}),i}function mr(r,t,i){let e=q(r);return ee(e,(n,{replaceWith:s})=>{if(n.kind==="function"&&n.value in kt){let a=D(Y(n.nodes).trim(),",").map(u=>u.trim()),c=kt[n.value](i,t,...a);return s(q(c))}}),Y(e)}function Ei(r){if(r[0]!=="'"&&r[0]!=='"')return r;let t="",i=r[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:`, ${t}`});else{let e=i.nodes[i.nodes.length-1];e.kind==="word"&&e.value==="initial"&&(e.value=t)}})}function Qe(r,t){let i=r.length,e=t.length,n=i=48&&a<=57&&c>=48&&c<=57){let u=s,f=s+1,g=s,d=s+1;for(a=r.charCodeAt(f);a>=48&&a<=57;)a=r.charCodeAt(++f);for(c=t.charCodeAt(d);c>=48&&c<=57;)c=t.charCodeAt(++d);let m=r.slice(u,f),w=t.slice(g,d),v=Number(m)-Number(w);if(v)return v;if(mw)return 1;continue}if(a!==c)return a-c}return r.length-t.length}var Ri=/^\d+\/\d+$/;function gr(r){let t=new B(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of r.utilities.keys("static")){let s=t.get(n);s.fraction=!1,s.modifiers=[]}for(let n of r.utilities.keys("functional")){let s=r.utilities.getCompletions(n);for(let a of s)for(let c of a.values){let u=c!==null&&Ri.test(c),f=c===null?n:`${n}-${c}`,g=t.get(f);if(g.utility=n,g.fraction||=u,g.modifiers.push(...a.modifiers),a.supportsNegative){let d=t.get(`-${f}`);d.utility=`-${n}`,d.fraction||=u,d.modifiers.push(...a.modifiers)}}}if(t.size===0)return[];let i=Array.from(t.values());return i.sort((n,s)=>Qe(n.name,s.name)),Oi(i)}function Oi(r){let t=[],i=null,e=new Map,n=new B(()=>[]);for(let a of r){let{utility:c,fraction:u}=a;i||(i={utility:c,items:[]},e.set(c,i)),c!==i.utility&&(t.push(i),i={utility:c,items:[]},e.set(c,i)),u?n.get(c).push(a):i.items.push(a)}i&&t[t.length-1]!==i&&t.push(i);for(let[a,c]of n){let u=e.get(a);u&&u.items.push(...c)}let s=[];for(let a of t)for(let c of a.items)s.push([c.name,{modifiers:c.modifiers}]);return s}function hr(r){let t=[];for(let[e,n]of r.variants.entries()){let c=function({value:u,modifier:f}={}){let g=e;u&&(g+=s?`-${u}`:u),f&&(g+=`/${f}`);let d=r.parseVariant(g);if(!d)return[];let m=M(".__placeholder__",[]);if(Ae(m,d,r.variants)===null)return[];let w=[];return Ge(m.nodes,(v,{path:x})=>{if(v.kind!=="rule"&&v.kind!=="at-rule"||v.nodes.length>0)return;x.sort((b,S)=>{let P=b.kind==="at-rule",U=S.kind==="at-rule";return P&&!U?-1:!P&&U?1:0});let k=x.flatMap(b=>b.kind==="rule"?b.selector==="&"?[]:[b.selector]:b.kind==="at-rule"?[`${b.name} ${b.params}`]:[]),N="";for(let b=k.length-1;b>=0;b--)N=N===""?k[b]:`${k[b]} { ${N} }`;w.push(N)}),w};var i=c;if(n.kind==="arbitrary")continue;let s=e!=="@",a=r.variants.getCompletions(e);switch(n.kind){case"static":{t.push({name:e,values:a,isArbitrary:!1,hasDash:s,selectors:c});break}case"functional":{t.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:c});break}case"compound":{t.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:c});break}}}return t}function vr(r,t){let{astNodes:i,nodeSorting:e}=pe(Array.from(t),r),n=new Map(t.map(a=>[a,null])),s=0n;for(let a of i){let c=e.get(a)?.candidate;c&&n.set(c,n.get(c)??s++)}return t.map(a=>[a,n.get(a)??null])}var Xe=/^@?[a-zA-Z0-9_-]*$/;var xt=class{compareFns=new Map;variants=new Map;completions=new Map;groupOrder=null;lastOrder=0;static(t,i,{compounds:e,order:n}={}){this.set(t,{kind:"static",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}fromAst(t,i){let e=[];F(i,n=>{n.kind==="rule"?e.push(n.selector):n.kind==="at-rule"&&n.name!=="@slot"&&e.push(`${n.name} ${n.params}`)}),this.static(t,n=>{let s=structuredClone(i);At(s,n.nodes),n.nodes=s},{compounds:ye(e)})}functional(t,i,{compounds:e,order:n}={}){this.set(t,{kind:"functional",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}compound(t,i,e,{compounds:n,order:s}={}){this.set(t,{kind:"compound",applyFn:e,compoundsWith:i,compounds:n??2,order:s})}group(t,i){this.groupOrder=this.nextOrder(),i&&this.compareFns.set(this.groupOrder,i),t(),this.groupOrder=null}has(t){return this.variants.has(t)}get(t){return this.variants.get(t)}kind(t){return this.variants.get(t)?.kind}compoundsWith(t,i){let e=this.variants.get(t),n=typeof i=="string"?this.variants.get(i):i.kind==="arbitrary"?{compounds:ye([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(t,i){this.completions.set(t,i)}getCompletions(t){return this.completions.get(t)?.()??[]}compare(t,i){if(t===i)return 0;if(t===null)return-1;if(i===null)return 1;if(t.kind==="arbitrary"&&i.kind==="arbitrary")return t.selector{m.nodes=g.map(w=>H(w,m.nodes))},{compounds:d})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function e(f,g){return g.map(d=>{d=d.trim();let m=D(d," ");return m[0]==="not"?m.slice(1).join(" "):f==="@container"?m[0][0]==="("?`not ${d}`:m[1]==="not"?`${m[0]} ${m.slice(2).join(" ")}`:`${m[0]} not ${m.slice(1).join(" ")}`:`not ${d}`})}let n=["@media","@supports","@container"];function s(f){for(let g of n){if(g!==f.name)continue;let d=D(f.params,",");return d.length>1?null:(d=e(f.name,d),z(f.name,d.join(", ")))}return null}function a(f){return f.includes("::")?null:`&:not(${D(f,",").map(d=>(d=d.replaceAll("&","*"),d)).join(", ")})`}t.compound("not",3,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative||g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule"&&m.kind!=="at-rule")return 0;if(m.nodes.length>0)return 0;let v=[],x=[];for(let N of w)N.kind==="at-rule"?v.push(N):N.kind==="rule"&&x.push(N);if(v.length>1)return 2;if(x.length>1)return 2;let k=[];for(let N of x){let b=a(N.selector);if(!b)return d=!1,2;k.push(M(b,[]))}for(let N of v){let b=s(N);if(!b)return d=!1,2;k.push(b)}return Object.assign(f,M("&",k)),d=!0,1}),f.kind==="rule"&&f.selector==="&"&&f.nodes.length===1&&Object.assign(f,f.nodes[0]),!d)return null}),t.suggest("not",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("not",f))),t.compound("group",2,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative)return null;let d=g.modifier?`:where(.${r.prefix?`${r.prefix}\\:`:""}group\\/${g.modifier.value})`:`:where(.${r.prefix?`${r.prefix}\\:`:""}group)`,m=!1;if(F([f],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let k of v.slice(0,-1))if(k.kind==="rule")return m=!1,2;let x=w.selector.replaceAll("&",d);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} *)`,m=!0}),!m)return null}),t.suggest("group",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("group",f))),t.compound("peer",2,(f,g)=>{if(g.variant.kind==="arbitrary"&&g.variant.relative)return null;let d=g.modifier?`:where(.${r.prefix?`${r.prefix}\\:`:""}peer\\/${g.modifier.value})`:`:where(.${r.prefix?`${r.prefix}\\:`:""}peer)`,m=!1;if(F([f],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let k of v.slice(0,-1))if(k.kind==="rule")return m=!1,2;let x=w.selector.replaceAll("&",d);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} ~ *)`,m=!0}),!m)return null}),t.suggest("peer",()=>Array.from(t.keys()).filter(f=>t.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 L([z("@property","--tw-content",[l("syntax",'"*"'),l("initial-value",'""'),l("inherits","false")])])};var c=f;t.static("before",g=>{g.nodes=[M("&::before",[f(),l("content","var(--tw-content)"),...g.nodes])]},{compounds:0}),t.static("after",g=>{g.nodes=[M("&::after",[f(),l("content","var(--tw-content)"),...g.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"]),t.static("hover",f=>{f.nodes=[M("&:hover",[z("@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] *)"]),t.compound("in",2,(f,g)=>{if(g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return d=!1,2;m.selector=`:where(${m.selector.replaceAll("&","*")}) &`,d=!0}),!d)return null}),t.suggest("in",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("in",f))),t.compound("has",2,(f,g)=>{if(g.modifier)return null;let d=!1;if(F([f],(m,{path:w})=>{if(m.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return d=!1,2;m.selector=`&:has(${m.selector.replaceAll("&","*")})`,d=!0}),!d)return null}),t.suggest("has",()=>Array.from(t.keys()).filter(f=>t.compoundsWith("has",f))),t.functional("aria",(f,g)=>{if(!g.value||g.modifier)return null;g.value.kind==="arbitrary"?f.nodes=[M(`&[aria-${wr(g.value.value)}]`,f.nodes)]:f.nodes=[M(`&[aria-${g.value.value}="true"]`,f.nodes)]}),t.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),t.functional("data",(f,g)=>{if(!g.value||g.modifier)return null;f.nodes=[M(`&[data-${wr(g.value.value)}]`,f.nodes)]}),t.functional("nth",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-child(${g.value.value})`,f.nodes)]}),t.functional("nth-last",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-last-child(${g.value.value})`,f.nodes)]}),t.functional("nth-of-type",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-of-type(${g.value.value})`,f.nodes)]}),t.functional("nth-last-of-type",(f,g)=>{if(!g.value||g.modifier||g.value.kind==="named"&&!E(g.value.value))return null;f.nodes=[M(`&:nth-last-of-type(${g.value.value})`,f.nodes)]}),t.functional("supports",(f,g)=>{if(!g.value||g.modifier)return null;let d=g.value.value;if(d===null)return null;if(/^[\w-]*\s*\(/.test(d)){let m=d.replace(/\b(and|or|not)\b/g," $1 ");f.nodes=[z("@supports",m,f.nodes)];return}d.includes(":")||(d=`${d}: var(--tw)`),(d[0]!=="("||d[d.length-1]!==")")&&(d=`(${d})`),f.nodes=[z("@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(g,d,m,w){if(g===d)return 0;let v=w.get(g);if(v===null)return m==="asc"?-1:1;let x=w.get(d);return x===null?m==="asc"?1:-1:we(v,x,m)};var u=f;{let g=r.namespace("--breakpoint"),d=new B(m=>{switch(m.kind){case"static":return r.resolveValue(m.root,["--breakpoint"])??null;case"functional":{if(!m.value||m.modifier)return null;let w=null;return m.value.kind==="arbitrary"?w=m.value.value:m.value.kind==="named"&&(w=r.resolveValue(m.value.value,["--breakpoint"])),!w||w.includes("var(")?null:w}case"arbitrary":case"compound":return null}});t.group(()=>{t.functional("max",(m,w)=>{if(w.modifier)return null;let v=d.get(w);if(v===null)return null;m.nodes=[z("@media",`(width < ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"desc",d)),t.suggest("max",()=>Array.from(g.keys()).filter(m=>m!==null)),t.group(()=>{for(let[m,w]of r.namespace("--breakpoint"))m!==null&&t.static(m,v=>{v.nodes=[z("@media",`(width >= ${w})`,v.nodes)]},{compounds:1});t.functional("min",(m,w)=>{if(w.modifier)return null;let v=d.get(w);if(v===null)return null;m.nodes=[z("@media",`(width >= ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"asc",d)),t.suggest("min",()=>Array.from(g.keys()).filter(m=>m!==null))}{let g=r.namespace("--container"),d=new B(m=>{switch(m.kind){case"functional":{if(m.value===null)return null;let w=null;return m.value.kind==="arbitrary"?w=m.value.value:m.value.kind==="named"&&(w=r.resolveValue(m.value.value,["--container"])),!w||w.includes("var(")?null:w}case"static":case"arbitrary":case"compound":return null}});t.group(()=>{t.functional("@max",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width < ${v})`:`(width < ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"desc",d)),t.suggest("@max",()=>Array.from(g.keys()).filter(m=>m!==null)),t.group(()=>{t.functional("@",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,m.nodes)]},{compounds:1}),t.functional("@min",(m,w)=>{let v=d.get(w);if(v===null)return null;m.nodes=[z("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,m.nodes)]},{compounds:1})},(m,w)=>f(m,w,"asc",d)),t.suggest("@min",()=>Array.from(g.keys()).filter(m=>m!==null)),t.suggest("@",()=>Array.from(g.keys()).filter(m=>m!==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)"]),t}function wr(r){if(r.includes("=")){let[t,...i]=D(r,"="),e=i.join("=").trim();if(e[0]==="'"||e[0]==='"')return r;if(e.length>1){let n=e[e.length-1];if(e[e.length-2]===" "&&(n==="i"||n==="I"||n==="s"||n==="S"))return`${t}="${e.slice(0,-2)}" ${n}`}return`${t}="${e}"`}return r}function At(r,t){F(r,(i,{replaceWith:e})=>{if(i.kind==="at-rule"&&i.name==="@slot")e(t);else if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,L([z(i.name,i.params,i.nodes)])),1})}function br(r){let t=cr(r),i=yr(r),e=new B(u=>ir(u,c)),n=new B(u=>Array.from(rr(u,c))),s=new B(u=>{let f=kr(u,c);try{xe(f.map(({node:g})=>g),c)}catch{return[]}return f}),a=new B(u=>{for(let f of qe(u))r.markUsedVariable(f)}),c={theme:r,utilities:t,variants:i,invalidCandidates:new Set,important:!1,candidatesToCss(u){let f=[];for(let g of u){let d=!1,{astNodes:m}=pe([g],this,{onInvalidCandidate(){d=!0}});m=ve(m,c,0),m.length===0||d?f.push(null):f.push(ne(m))}return f},getClassOrder(u){return vr(this,u)},getClassList(){return gr(this)},getVariants(){return hr(this)},parseCandidate(u){return n.get(u)},parseVariant(u){return e.get(u)},compileAstNodes(u){return s.get(u)},printCandidate(u){return or(c,u)},printVariant(u){return He(u)},getVariantOrder(){let u=Array.from(e.values());u.sort((m,w)=>this.variants.compare(m,w));let f=new Map,g,d=0;for(let m of u)m!==null&&(g!==void 0&&this.variants.compare(g,m)!==0&&d++,f.set(m,d),g=m);return f},resolveThemeValue(u,f=!0){let g=u.lastIndexOf("/"),d=null;g!==-1&&(d=u.slice(g+1).trim(),u=u.slice(0,g).trim());let m=r.resolve(null,[u],f?1:0)??void 0;return d&&m?Q(m,d):m},trackUsedVariables(u){a.get(u)}};return c}var Ct=["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 pe(r,t,{onInvalidCandidate:i}={}){let e=new Map,n=[],s=new Map;for(let c of r){if(t.invalidCandidates.has(c)){i?.(c);continue}let u=t.parseCandidate(c);if(u.length===0){i?.(c);continue}s.set(c,u)}let a=t.getVariantOrder();for(let[c,u]of s){let f=!1;for(let g of u){let d=t.compileAstNodes(g);if(d.length!==0){f=!0;for(let{node:m,propertySort:w}of d){let v=0n;for(let x of g.variants)v|=1n<{let f=e.get(c),g=e.get(u);if(f.variants-g.variants!==0n)return Number(f.variants-g.variants);let d=0;for(;d1)return null;for(let u of a.nodes)if(u.kind!=="rule"&&u.kind!=="at-rule"||n(u,t)===null)return null;F(a.nodes,u=>{if((u.kind==="rule"||u.kind==="at-rule")&&u.nodes.length<=0)return u.nodes=r.nodes,1}),r.nodes=a.nodes;return}if(n(r,t)===null)return null}function xr(r){let t=r.options?.types??[];return t.length>1&&t.includes("any")}function Ki(r,t){if(r.kind==="arbitrary"){let a=r.value;return r.modifier&&(a=X(a,r.modifier,t.theme)),a===null?[]:[[l(r.property,a)]]}let i=t.utilities.get(r.root)??[],e=[],n=i.filter(a=>!xr(a));for(let a of n){if(a.kind!==r.kind)continue;let c=a.compileFn(r);if(c!==void 0){if(c===null)return e;e.push(c)}}if(e.length>0)return e;let s=i.filter(a=>xr(a));for(let a of s){if(a.kind!==r.kind)continue;let c=a.compileFn(r);if(c!==void 0){if(c===null)return e;e.push(c)}}return e}function Ar(r){for(let t of r)t.kind!=="at-root"&&(t.kind==="declaration"?t.important=!0:(t.kind==="rule"||t.kind==="at-rule")&&Ar(t.nodes))}function _i(r){let t=new Set,i=0,e=r.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 c=Ct.indexOf(s.value??"");if(c!==-1){t.add(c),n=!0;continue}}let a=Ct.indexOf(s.property);a!==-1&&t.add(a)}else if(s.kind==="rule"||s.kind==="at-rule")for(let a of s.nodes)e.push(a)}return{order:Array.from(t).sort((s,a)=>s-a),count:i}}function Oe(r,t){let i=0,e=H("&",r),n=new Set,s=new B(()=>new Set),a=new B(()=>new Set);F([e],(d,{parent:m,path:w})=>{if(d.kind==="at-rule"){if(d.name==="@keyframes")return F(d.nodes,v=>{if(v.kind==="at-rule"&&v.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),1;if(d.name==="@utility"){let v=d.params.replace(/-\*$/,"");a.get(v).add(d),F(d.nodes,x=>{if(!(x.kind!=="at-rule"||x.name!=="@apply")){n.add(d);for(let k of Cr(x,t))s.get(d).add(k)}});return}if(d.name==="@apply"){if(m===null)return;i|=1,n.add(m);for(let v of Cr(d,t))for(let x of w)x!==d&&n.has(x)&&s.get(x).add(v)}}});let c=new Set,u=[],f=new Set;function g(d,m=[]){if(!c.has(d)){if(f.has(d)){let w=m[(m.indexOf(d)+1)%m.length];throw d.kind==="at-rule"&&d.name==="@utility"&&w.kind==="at-rule"&&w.name==="@utility"&&F(d.nodes,v=>{if(v.kind!=="at-rule"||v.name!=="@apply")return;let x=v.params.split(/\s+/g);for(let k of x)for(let N of t.parseCandidate(k))switch(N.kind){case"arbitrary":break;case"static":case"functional":if(w.params.replace(/-\*$/,"")===N.root)throw new Error(`You cannot \`@apply\` the \`${k}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${ne([d])} +Relies on: + +${ne([w])}`)}f.add(d);for(let w of s.get(d))for(let v of a.get(w))m.push(d),g(v,m),m.pop();c.add(d),f.delete(d),u.push(d)}}for(let d of n)g(d);for(let d of u)"nodes"in d&&F(d.nodes,(m,{replaceWith:w})=>{if(m.kind!=="at-rule"||m.name!=="@apply")return;let v=m.params.split(/(\s+)/g),x={},k=0;for(let[N,b]of v.entries())N%2===0&&(x[b]=k),k+=b.length;{let N=Object.keys(x),b=pe(N,t,{onInvalidCandidate:R=>{if(t.theme.prefix&&!R.startsWith(t.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${R}\`. Did you mean \`${t.theme.prefix}:${R}\`?`);if(t.invalidCandidates.has(R))throw new Error(`Cannot apply utility class \`${R}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let _=D(R,":");if(_.length>1){let K=_.pop();if(t.candidatesToCss([K])[0]){let G=t.candidatesToCss(_.map(W=>`${W}:[--tw-variant-check:1]`)),I=_.filter((W,Z)=>G[Z]===null);if(I.length>0){if(I.length===1)throw new Error(`Cannot apply utility class \`${R}\` because the ${I.map(W=>`\`${W}\``)} variant does not exist.`);{let W=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${R}\` because the ${W.format(I.map(Z=>`\`${Z}\``))} variants do not exist.`)}}}}throw t.theme.size===0?new Error(`Cannot apply unknown utility class \`${R}\`. 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 \`${R}\``)}}),S=m.src,P=b.astNodes.map(R=>{let _=b.nodeSorting.get(R)?.candidate,K=_?x[_]:void 0;if(R=structuredClone(R),!S||!_||K===void 0)return F([R],I=>{I.src=S}),R;let G=[S[0],S[1],S[2]];return G[1]+=7+K,G[2]=G[1]+_.length,F([R],I=>{I.src=G}),R}),U=[];for(let R of P)if(R.kind==="rule")for(let _ of R.nodes)U.push(_);else U.push(R);w(U)}});return i}function*Cr(r,t){for(let i of r.params.split(/\s+/g))for(let e of t.parseCandidate(i))switch(e.kind){case"arbitrary":break;case"static":case"functional":yield e.root;break;default:}}async function $t(r,t,i,e=0,n=!1){let s=0,a=[];return F(r,(c,{replaceWith:u})=>{if(c.kind==="at-rule"&&(c.name==="@import"||c.name==="@reference")){let f=ji(q(c.params));if(f===null)return;c.name==="@reference"&&(f.media="reference"),s|=2;let{uri:g,layer:d,media:m,supports:w}=f;if(g.startsWith("data:")||g.startsWith("http://")||g.startsWith("https://"))return;let v=le({},[]);return a.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${g}\` in \`${t}\`)`);let x=await i(g,t),k=me(x.content,{from:n?x.path:void 0});await $t(k,x.base,i,e+1,n),v.nodes=Di(c,[le({base:x.base},k)],d,m,w)})()),u(v),1}}),a.length>0&&await Promise.all(a),s}function ji(r){let t,i=null,e=null,n=null;for(let s=0;s/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=et(e);s&&r.theme.add(`--${s}`,""+n,7)}if(Object.hasOwn(t,"fontFamily")){let e=5;{let n=Ce(t.fontFamily.sans);n&&r.theme.hasDefault("--font-sans")&&(r.theme.add("--default-font-family",n,e),r.theme.add("--default-font-feature-settings",Ce(t.fontFamily.sans,"fontFeatureSettings")??"normal",e),r.theme.add("--default-font-variation-settings",Ce(t.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let n=Ce(t.fontFamily.mono);n&&r.theme.hasDefault("--font-mono")&&(r.theme.add("--default-mono-font-family",n,e),r.theme.add("--default-mono-font-feature-settings",Ce(t.fontFamily.mono,"fontFeatureSettings")??"normal",e),r.theme.add("--default-mono-font-variation-settings",Ce(t.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return t}function Ui(r){let t=[];return Vr(r,[],(i,e)=>{if(Fi(i))return t.push([e,i]),1;if(Li(i)){t.push([e,i[0]]);for(let n of Reflect.ownKeys(i[1]))t.push([[...e,`-${n}`],i[1][n]]);return 1}if(Array.isArray(i)&&i.every(n=>typeof n=="string"))return e[0]==="fontSize"?(t.push([e,i[0]]),i.length>=2&&t.push([[...e,"-line-height"],i[1]])):t.push([e,i.join(", ")]),1}),t}var Ii=/^[a-zA-Z0-9-_%/\.]+$/;function et(r){if(r[0]==="container")return null;r=structuredClone(r),r[0]==="animation"&&(r[0]="animate"),r[0]==="aspectRatio"&&(r[0]="aspect"),r[0]==="borderRadius"&&(r[0]="radius"),r[0]==="boxShadow"&&(r[0]="shadow"),r[0]==="colors"&&(r[0]="color"),r[0]==="containers"&&(r[0]="container"),r[0]==="fontFamily"&&(r[0]="font"),r[0]==="fontSize"&&(r[0]="text"),r[0]==="letterSpacing"&&(r[0]="tracking"),r[0]==="lineHeight"&&(r[0]="leading"),r[0]==="maxWidth"&&(r[0]="container"),r[0]==="screens"&&(r[0]="breakpoint"),r[0]==="transitionTimingFunction"&&(r[0]="ease");for(let t of r)if(!Ii.test(t))return null;return r.map((t,i,e)=>t==="1"&&i!==e.length-1?"":t).map(t=>t.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(i,e,n)=>`${e}-${n.toLowerCase()}`)).filter((t,i)=>t!=="DEFAULT"||i!==r.length-1).join("-")}function Fi(r){return typeof r=="number"||typeof r=="string"}function Li(r){if(!Array.isArray(r)||r.length!==2||typeof r[0]!="string"&&typeof r[0]!="number"||r[1]===void 0||r[1]===null||typeof r[1]!="object")return!1;for(let t of Reflect.ownKeys(r[1]))if(typeof t!="string"||typeof r[1][t]!="string"&&typeof r[1][t]!="number")return!1;return!0}function Vr(r,t=[],i){for(let e of Reflect.ownKeys(r)){let n=r[e];if(n==null)continue;let s=[...t,e],a=i(n,s)??0;if(a!==1){if(a===2)return 2;if(!(!Array.isArray(n)&&typeof n!="object")&&Vr(n,s,i)===2)return 2}}}function tt(r){let t=[];for(let i of D(r,".")){if(!i.includes("[")){t.push(i);continue}let e=0;for(;;){let n=i.indexOf("[",e),s=i.indexOf("]",n);if(n===-1||s===-1)break;n>e&&t.push(i.slice(e,n)),t.push(i.slice(n+1,s)),e=s+1}e<=i.length-1&&t.push(i.slice(e))}return t}function $e(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let t=Object.getPrototypeOf(r);return t===null||Object.getPrototypeOf(t)===null}function Ke(r,t,i,e=[]){for(let n of t)if(n!=null)for(let s of Reflect.ownKeys(n)){e.push(s);let a=i(r[s],n[s],e);a!==void 0?r[s]=a:!$e(r[s])||!$e(n[s])?r[s]=n[s]:r[s]=Ke({},[r[s],n[s]],i,e),e.pop()}return r}function rt(r,t,i){return function(n,s){let a=n.lastIndexOf("/"),c=null;a!==-1&&(c=n.slice(a+1).trim(),n=n.slice(0,a).trim());let u=(()=>{let f=tt(n),[g,d]=zi(r.theme,f),m=i(Nr(t()??{},f)??null);if(typeof m=="string"&&(m=m.replace("","1")),typeof g!="object")return typeof d!="object"&&d&4?m??g:g;if(m!==null&&typeof m=="object"&&!Array.isArray(m)){let w=Ke({},[m],(v,x)=>x);if(g===null&&Object.hasOwn(m,"__CSS_VALUES__")){let v={};for(let x in m.__CSS_VALUES__)v[x]=m[x],delete w[x];g=v}for(let v in g)v!=="__CSS_VALUES__"&&(m?.__CSS_VALUES__?.[v]&4&&Nr(w,v.split("-"))!==void 0||(w[ge(v)]=g[v]));return w}if(Array.isArray(g)&&Array.isArray(d)&&Array.isArray(m)){let w=g[0],v=g[1];d[0]&4&&(w=m[0]??w);for(let x of Object.keys(v))d[1][x]&4&&(v[x]=m[1][x]??v[x]);return[w,v]}return g??m})();return c&&typeof u=="string"&&(u=Q(u,c)),u??s}}function zi(r,t){if(t.length===1&&t[0].startsWith("--"))return[r.get([t[0]]),r.getOptions(t[0])];let i=et(t),e=new Map,n=new B(()=>new Map),s=r.namespace(`--${i}`);if(s.size===0)return[null,0];let a=new Map;for(let[g,d]of s){if(!g||!g.includes("--")){e.set(g,d),a.set(g,r.getOptions(g?`--${i}-${g}`:`--${i}`));continue}let m=g.indexOf("--"),w=g.slice(0,m),v=g.slice(m+2);v=v.replace(/-([a-z])/g,(x,k)=>k.toUpperCase()),n.get(w===""?null:w).set(v,[d,r.getOptions(`--${i}${g}`)])}let c=r.getOptions(`--${i}`);for(let[g,d]of n){let m=e.get(g);if(typeof m!="string")continue;let w={},v={};for(let[x,[k,N]]of d)w[x]=k,v[x]=N;e.set(g,[m,w]),a.set(g,[c,v])}let u={},f={};for(let[g,d]of e)Sr(u,[g??"DEFAULT"],d);for(let[g,d]of a)Sr(f,[g??"DEFAULT"],d);return t[t.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 Nr(r,t){for(let i=0;i0){let m=_e(n);e?e.nodes.push(m):t.push(m),n=""}let u=a,f=a+1;for(;f0){let f=_e(n);u.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Yi:case Ji:case Zi:{if(n.length>0){let u=_e(n);e?e.nodes.push(u):t.push(u)}n=String.fromCharCode(c);break}case Kr:{if(n.length>0){let g=_e(n);e?e.nodes.push(g):t.push(g)}n="";let u=a,f=0;for(let g=a+1;g0&&t.push(_e(n)),t}var Fr=/^[a-z@][a-zA-Z0-9/%._-]*$/;function Vt({designSystem:r,ast:t,resolvedConfig:i,featuresRef:e,referenceMode:n}){let s={addBase(a){if(n)return;let c=ae(a);e.current|=xe(c,r),t.push(z("@layer","base",c))},addVariant(a,c){if(!Xe.test(a))throw new Error(`\`addVariant('${a}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(typeof c=="string"){if(c.includes(":merge("))return}else if(Array.isArray(c)){if(c.some(f=>f.includes(":merge(")))return}else if(typeof c=="object"){let f=function(g,d){return Object.entries(g).some(([m,w])=>m.includes(d)||typeof w=="object"&&f(w,d))};var u=f;if(f(c,":merge("))return}typeof c=="string"||Array.isArray(c)?r.variants.static(a,f=>{f.nodes=Lr(c,f.nodes)},{compounds:ye(typeof c=="string"?[c]:c)}):typeof c=="object"&&r.variants.fromAst(a,ae(c))},matchVariant(a,c,u){function f(d,m,w){let v=c(d,{modifier:m?.value??null});return Lr(v,w)}try{let d=c("a",{modifier:null});if(typeof d=="string"&&d.includes(":merge("))return;if(Array.isArray(d)&&d.some(m=>m.includes(":merge(")))return}catch{}let g=Object.keys(u?.values??{});r.variants.group(()=>{r.variants.functional(a,(d,m)=>{if(!m.value){if(u?.values&&"DEFAULT"in u.values){d.nodes=f(u.values.DEFAULT,m.modifier,d.nodes);return}return null}if(m.value.kind==="arbitrary")d.nodes=f(m.value.value,m.modifier,d.nodes);else if(m.value.kind==="named"&&u?.values){let w=u.values[m.value.value];if(typeof w!="string")return;d.nodes=f(w,m.modifier,d.nodes)}})},(d,m)=>{if(d.kind!=="functional"||m.kind!=="functional")return 0;let w=d.value?d.value.value:"DEFAULT",v=m.value?m.value.value:"DEFAULT",x=u?.values?.[w]??w,k=u?.values?.[v]??v;if(u&&typeof u.sort=="function")return u.sort({value:x,modifier:d.modifier?.value??null},{value:k,modifier:m.modifier?.value??null});let N=g.indexOf(w),b=g.indexOf(v);return N=N===-1?g.length:N,b=b===-1?g.length:b,N!==b?N-b:xObject.entries(f));c=c.flatMap(([f,g])=>D(f,",").map(d=>[d.trim(),g]));let u=new B(()=>[]);for(let[f,g]of c){if(f.startsWith("@keyframes ")){n||t.push(H(f,ae(g)));continue}let d=it(f),m=!1;if(je(d,w=>{if(w.kind==="selector"&&w.value[0]==="."&&Fr.test(w.value.slice(1))){let v=w.value;w.value="&";let x=De(d),k=v.slice(1),N=x==="&"?ae(g):[H(x,ae(g))];u.get(k).push(...N),m=!0,w.value=v;return}if(w.kind==="function"&&w.value===":not")return 1}),!m)throw new Error(`\`addUtilities({ '${f}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[f,g]of u)r.theme.prefix&&F(g,d=>{if(d.kind==="rule"){let m=it(d.selector);je(m,w=>{w.kind==="selector"&&w.value[0]==="."&&(w.value=`.${r.theme.prefix}\\:${w.value.slice(1)}`)}),d.selector=De(m)}}),r.utilities.static(f,d=>{let m=structuredClone(g);return zr(m,f,d.raw),e.current|=Oe(m,r),m})},matchUtilities(a,c){let u=c?.type?Array.isArray(c?.type)?c.type:[c.type]:["any"];for(let[g,d]of Object.entries(a)){let m=function({negative:w}){return v=>{if(v.value?.kind==="arbitrary"&&u.length>0&&!u.includes("any")&&(v.value.dataType&&!u.includes(v.value.dataType)||!v.value.dataType&&!J(v.value.value,u)))return;let x=u.includes("color"),k=null,N=!1;{let P=c?.values??{};x&&(P=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},P)),v.value?v.value.kind==="arbitrary"?k=v.value.value:v.value.fraction&&P[v.value.fraction]?(k=P[v.value.fraction],N=!0):P[v.value.value]?k=P[v.value.value]:P.__BARE_VALUE__&&(k=P.__BARE_VALUE__(v.value)??null,N=(v.value.fraction!==null&&k?.includes("/"))??!1):k=P.DEFAULT??null}if(k===null)return;let b;{let P=c?.modifiers??null;v.modifier?P==="any"||v.modifier.kind==="arbitrary"?b=v.modifier.value:P?.[v.modifier.value]?b=P[v.modifier.value]:x&&!Number.isNaN(Number(v.modifier.value))?b=`${v.modifier.value}%`:b=null:b=null}if(v.modifier&&b===null&&!N)return v.value?.kind==="arbitrary"?null:void 0;x&&b!==null&&(k=Q(k,b)),w&&(k=`calc(${k} * -1)`);let S=ae(d(k,{modifier:b}));return zr(S,g,v.raw),e.current|=Oe(S,r),S}};var f=m;if(!Fr.test(g))throw new Error(`\`matchUtilities({ '${g}' : \u2026 })\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter, eg. \`scrollbar\`.`);c?.supportsNegativeValues&&r.utilities.functional(`-${g}`,m({negative:!0}),{types:u}),r.utilities.functional(g,m({negative:!1}),{types:u}),r.utilities.suggest(g,()=>{let w=c?.values??{},v=new Set(Object.keys(w));v.delete("__BARE_VALUE__"),v.has("DEFAULT")&&(v.delete("DEFAULT"),v.add(null));let x=c?.modifiers??{},k=x==="any"?[]:Object.keys(x);return[{supportsNegative:c?.supportsNegativeValues??!1,values:Array.from(v),modifiers:k}]})}},addComponents(a,c){this.addUtilities(a,c)},matchComponents(a,c){this.matchUtilities(a,c)},theme:rt(r,()=>i.theme??{},a=>a),prefix(a){return a},config(a,c){let u=i;if(!a)return u;let f=tt(a);for(let g=0;gObject.entries(e));for(let[e,n]of i)if(typeof n!="object"){if(!e.startsWith("--")){if(n==="@slot"){t.push(H(e,[z("@slot")]));continue}e=e.replace(/([A-Z])/g,"-$1").toLowerCase()}t.push(l(e,String(n)))}else if(Array.isArray(n))for(let s of n)typeof s=="string"?t.push(l(e,s)):t.push(H(e,ae(s)));else n!==null&&t.push(H(e,ae(n)));return t}function Lr(r,t){return(typeof r=="string"?[r]:r).flatMap(e=>{if(e.trim().endsWith("}")){let n=e.replace("}","{@slot}}"),s=me(n);return At(s,t),s}else return H(e,t)})}function zr(r,t,i){F(r,e=>{if(e.kind==="rule"){let n=it(e.selector);je(n,s=>{s.kind==="selector"&&s.value===`.${t}`&&(s.value=`.${fe(i)}`)}),e.selector=De(n)}})}function Mr(r,t,i){for(let e of en(t))r.theme.addKeyframes(e)}function en(r){let t=[];if("keyframes"in r.theme)for(let[i,e]of Object.entries(r.theme.keyframes))t.push(z("@keyframes",i,ae(e)));return t}function Wr(r){return{theme:{...Pt,colors:({theme:t})=>t("color",{}),extend:{fontSize:({theme:t})=>({...t("text",{})}),boxShadow:({theme:t})=>({...t("shadow",{})}),animation:({theme:t})=>({...t("animate",{})}),aspectRatio:({theme:t})=>({...t("aspect",{})}),borderRadius:({theme:t})=>({...t("radius",{})}),screens:({theme:t})=>({...t("breakpoint",{})}),letterSpacing:({theme:t})=>({...t("tracking",{})}),lineHeight:({theme:t})=>({...t("leading",{})}),transitionDuration:{DEFAULT:r.get(["--default-transition-duration"])??null},transitionTimingFunction:{DEFAULT:r.get(["--default-transition-timing-function"])??null},maxWidth:({theme:t})=>({...t("container",{})})}}}}var tn={blocklist:[],future:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function St(r,t){let i={design:r,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(tn)};for(let n of t)Nt(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=nn(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:e}}function rn(r,t){if(Array.isArray(r)&&$e(r[0]))return r.concat(t);if(Array.isArray(t)&&$e(t[0])&&$e(r))return[r,...t];if(Array.isArray(t))return t}function Nt(r,{config:t,base:i,path:e,reference:n}){let s=[];for(let u of t.plugins??[])"__isOptionsFunction"in u?s.push({...u(),reference:n}):"handler"in u?s.push({...u,reference:n}):s.push({handler:u,reference:n});if(Array.isArray(t.presets)&&t.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let u of t.presets??[])Nt(r,{path:e,base:i,config:u,reference:n});for(let u of s)r.plugins.push(u),u.config&&Nt(r,{path:e,base:i,config:u.config,reference:!!u.reference});let a=t.content??[],c=Array.isArray(a)?a:a.files;for(let u of c)r.content.files.push(typeof u=="object"?u:{base:i,pattern:u});r.configs.push(t)}function nn(r){let t=new Set,i=rt(r.design,()=>r.theme,n),e=Object.assign(i,{theme:i,colors:Et});function n(s){return typeof s=="function"?s(e)??null:s??null}for(let s of r.configs){let a=s.theme??{},c=a.extend??{};for(let u in a)u!=="extend"&&t.add(u);Object.assign(r.theme,a);for(let u in c)r.extend[u]??=[],r.extend[u].push(c[u])}delete r.theme.extend;for(let s in r.extend){let a=[r.theme[s],...r.extend[s]];r.theme[s]=()=>{let c=a.map(n);return Ke({},c,rn)}}for(let s in r.theme)r.theme[s]=n(r.theme[s]);if(r.theme.screens&&typeof r.theme.screens=="object")for(let s of Object.keys(r.theme.screens)){let a=r.theme.screens[s];a&&typeof a=="object"&&("raw"in a||"max"in a||"min"in a&&(r.theme.screens[s]=a.min))}return t}function Br(r,t){let i=r.theme.container||{};if(typeof i!="object"||i===null)return;let e=on(i,t);e.length!==0&&t.utilities.static("container",()=>structuredClone(e))}function on({center:r,padding:t,screens:i},e){let n=[],s=null;if(r&&n.push(l("margin-inline","auto")),(typeof t=="string"||typeof t=="object"&&t!==null&&"DEFAULT"in t)&&n.push(l("padding-inline",typeof t=="string"?t:t.DEFAULT)),typeof i=="object"&&i!==null){s=new Map;let a=Array.from(e.theme.namespace("--breakpoint").entries());if(a.sort((c,u)=>we(c[1],u[1],"asc")),a.length>0){let[c]=a[0];n.push(z("@media",`(width >= --theme(--breakpoint-${c}))`,[l("max-width","none")]))}for(let[c,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;s.set(c,z("@media",`(width >= ${u})`,[l("max-width",u)]))}}if(typeof t=="object"&&t!==null){let a=Object.entries(t).filter(([c])=>c!=="DEFAULT").map(([c,u])=>[c,e.theme.resolveValue(c,["--breakpoint"]),u]).filter(Boolean);a.sort((c,u)=>we(c[1],u[1],"asc"));for(let[c,,u]of a)if(s&&s.has(c))s.get(c).nodes.push(l("padding-inline",u));else{if(s)continue;n.push(z("@media",`(width >= theme(--breakpoint-${c}))`,[l("padding-inline",u)]))}}if(s)for(let[,a]of s)n.push(a);return n}function qr({addVariant:r,config:t}){let i=t("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"?r("dark",`&:where(${n}, ${n} *)`):e==="media"?r("dark","@media (prefers-color-scheme: dark)"):e==="variant"?r("dark",n):e==="class"&&r("dark",`&:is(${n} *)`))}function Gr(r){for(let[t,i]of[["t","top"],["tr","top right"],["r","right"],["br","bottom right"],["b","bottom"],["bl","bottom left"],["l","left"],["tl","top left"]])r.utilities.static(`bg-gradient-to-${t}`,()=>[l("--tw-gradient-position",`to ${i} in oklab`),l("background-image","linear-gradient(var(--tw-gradient-stops))")]);r.utilities.static("bg-left-top",()=>[l("background-position","left top")]),r.utilities.static("bg-right-top",()=>[l("background-position","right top")]),r.utilities.static("bg-left-bottom",()=>[l("background-position","left bottom")]),r.utilities.static("bg-right-bottom",()=>[l("background-position","right bottom")]),r.utilities.static("object-left-top",()=>[l("object-position","left top")]),r.utilities.static("object-right-top",()=>[l("object-position","right top")]),r.utilities.static("object-left-bottom",()=>[l("object-position","left bottom")]),r.utilities.static("object-right-bottom",()=>[l("object-position","right bottom")]),r.utilities.functional("max-w-screen",t=>{if(!t.value||t.value.kind==="arbitrary")return;let i=r.theme.resolve(t.value.value,["--breakpoint"]);if(i)return[l("max-width",i)]}),r.utilities.static("overflow-ellipsis",()=>[l("text-overflow","ellipsis")]),r.utilities.static("decoration-slice",()=>[l("-webkit-box-decoration-break","slice"),l("box-decoration-break","slice")]),r.utilities.static("decoration-clone",()=>[l("-webkit-box-decoration-break","clone"),l("box-decoration-break","clone")]),r.utilities.functional("flex-shrink",t=>{if(!t.modifier){if(!t.value)return[l("flex-shrink","1")];if(t.value.kind==="arbitrary")return[l("flex-shrink",t.value.value)];if(E(t.value.value))return[l("flex-shrink",t.value.value)]}}),r.utilities.functional("flex-grow",t=>{if(!t.modifier){if(!t.value)return[l("flex-grow","1")];if(t.value.kind==="arbitrary")return[l("flex-grow",t.value.value)];if(E(t.value.value))return[l("flex-grow",t.value.value)]}}),r.utilities.static("order-none",()=>[l("order","0")])}function Jr(r,t){let i=r.theme.screens||{},e=t.variants.get("min")?.order??0,n=[];for(let[a,c]of Object.entries(i)){let m=function(w){t.variants.static(a,v=>{v.nodes=[z("@media",d,v.nodes)]},{order:w})};var s=m;let u=t.variants.get(a),f=t.theme.resolveValue(a,["--breakpoint"]);if(u&&f&&!t.theme.hasDefault(`--breakpoint-${a}`))continue;let g=!0;typeof c=="string"&&(g=!1);let d=ln(c);g?n.push(m):m(e)}if(n.length!==0){for(let[,a]of t.variants.variants)a.order>e&&(a.order+=n.length);t.variants.compareFns=new Map(Array.from(t.variants.compareFns).map(([a,c])=>(a>e&&(a+=n.length),[a,c])));for(let[a,c]of n.entries())c(e+a+1)}}function ln(r){return(Array.isArray(r)?r:[r]).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 Hr(r,t){let i=r.theme.aria||{},e=r.theme.supports||{},n=r.theme.data||{};if(Object.keys(i).length>0){let s=t.variants.get("aria"),a=s?.applyFn,c=s?.compounds;t.variants.functional("aria",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in i?a?.(u,{...f,value:{kind:"arbitrary",value:i[g.value]}}):a?.(u,f)},{compounds:c})}if(Object.keys(e).length>0){let s=t.variants.get("supports"),a=s?.applyFn,c=s?.compounds;t.variants.functional("supports",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in e?a?.(u,{...f,value:{kind:"arbitrary",value:e[g.value]}}):a?.(u,f)},{compounds:c})}if(Object.keys(n).length>0){let s=t.variants.get("data"),a=s?.applyFn,c=s?.compounds;t.variants.functional("data",(u,f)=>{let g=f.value;return g&&g.kind==="named"&&g.value in n?a?.(u,{...f,value:{kind:"arbitrary",value:n[g.value]}}):a?.(u,f)},{compounds:c})}}var an=/^[a-z]+$/;async function Zr({designSystem:r,base:t,ast:i,loadModule:e,sources:n}){let s=0,a=[],c=[];F(i,(d,{parent:m,replaceWith:w,context:v})=>{if(d.kind==="at-rule"){if(d.name==="@plugin"){if(m!==null)throw new Error("`@plugin` cannot be nested.");let x=d.params.slice(1,-1);if(x.length===0)throw new Error("`@plugin` must have a path.");let k={};for(let N of d.nodes??[]){if(N.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${ne([N])} + +\`@plugin\` options must be a flat list of declarations.`);if(N.value===void 0)continue;let b=N.value,S=D(b,",").map(P=>{if(P=P.trim(),P==="null")return null;if(P==="true")return!0;if(P==="false")return!1;if(Number.isNaN(Number(P))){if(P[0]==='"'&&P[P.length-1]==='"'||P[0]==="'"&&P[P.length-1]==="'")return P.slice(1,-1);if(P[0]==="{"&&P[P.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${ne([N]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(P);return P});k[N.property]=S.length===1?S[0]:S}a.push([{id:x,base:v.base,reference:!!v.reference},Object.keys(k).length>0?k:null]),w([]),s|=4;return}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(m!==null)throw new Error("`@config` cannot be nested.");c.push({id:d.params.slice(1,-1),base:v.base,reference:!!v.reference}),w([]),s|=4;return}}}),Gr(r);let u=r.resolveThemeValue;if(r.resolveThemeValue=function(m,w){return m.startsWith("--")?u(m,w):(s|=Yr({designSystem:r,base:t,ast:i,sources:n,configs:[],pluginDetails:[]}),r.resolveThemeValue(m,w))},!a.length&&!c.length)return 0;let[f,g]=await Promise.all([Promise.all(c.map(async({id:d,base:m,reference:w})=>{let v=await e(d,m,"config");return{path:d,base:v.base,config:v.module,reference:w}})),Promise.all(a.map(async([{id:d,base:m,reference:w},v])=>{let x=await e(d,m,"plugin");return{path:d,base:x.base,plugin:x.module,options:v,reference:w}}))]);return s|=Yr({designSystem:r,base:t,ast:i,sources:n,configs:f,pluginDetails:g}),s}function Yr({designSystem:r,base:t,ast:i,sources:e,configs:n,pluginDetails:s}){let a=0,u=[...s.map(k=>{if(!k.options)return{config:{plugins:[k.plugin]},base:k.base,reference:k.reference};if("__isOptionsFunction"in k.plugin)return{config:{plugins:[k.plugin(k.options)]},base:k.base,reference:k.reference};throw new Error(`The plugin "${k.path}" does not accept options`)}),...n],{resolvedConfig:f}=St(r,[{config:Wr(r.theme),base:t,reference:!0},...u,{config:{plugins:[qr]},base:t,reference:!0}]),{resolvedConfig:g,replacedThemeKeys:d}=St(r,u),m=r.resolveThemeValue;r.resolveThemeValue=function(N,b){if(N[0]==="-"&&N[1]==="-")return m(N,b);let S=v.theme(N,void 0);if(Array.isArray(S)&&S.length===2)return S[0];if(Array.isArray(S))return S.join(", ");if(typeof S=="string")return S};let w={designSystem:r,ast:i,resolvedConfig:f,featuresRef:{set current(k){a|=k}}},v=Vt({...w,referenceMode:!1}),x;for(let{handler:k,reference:N}of f.plugins)N?(x||=Vt({...w,referenceMode:!0}),k(x)):k(v);if($r(r,g,d),Mr(r,g,d),Hr(g,r),Jr(g,r),Br(g,r),!r.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.`)),!an.test(f.prefix))throw new Error(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);r.theme.prefix=f.prefix}if(!r.important&&f.important===!0&&(r.important=!0),typeof f.important=="string"){let k=f.important;F(i,(N,{replaceWith:b,parent:S})=>{if(N.kind==="at-rule"&&!(N.name!=="@tailwind"||N.params!=="utilities"))return S?.kind==="rule"&&S.selector===k?2:(b(M(k,[N])),2)})}for(let k of f.blocklist)r.invalidCandidates.add(k);for(let k of f.content.files){if("raw"in k)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry: + +${JSON.stringify(k,null,2)} + +This feature is not currently supported.`);let N=!1;k.pattern[0]=="!"&&(N=!0,k.pattern=k.pattern.slice(1)),e.push({...k,negated:N})}return a}function Qr(r){let t=[0];for(let n=0;n0;){let u=(a|0)>>1,f=s+u;t[f]<=n?(s=f+1,a=a-u-1):a=u}s-=1;let c=n-t[s];return{line:s+1,column:c}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),t.length-1);let a=t[n],c=t[n+1]??a;return Math.min(Math.max(a+s,0),c)}return{find:i,findOffset:e}}function Xr({ast:r}){let t=new B(n=>Qr(n.code)),i=new B(n=>({url:n.file,content:n.code,ignore:!1})),e={file:null,sources:[],mappings:[]};F(r,n=>{if(!n.src||!n.dst)return;let s=i.get(n.src[0]);if(!s.content)return;let a=t.get(n.src[0]),c=t.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),f=0;for(let m of u.split(` +`)){if(m.trim()!==""){let w=a.find(n.src[1]+f),v=c.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:v})}f+=m.length,f+=1}let g=a.find(n.src[2]),d=c.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...g},generatedPosition:d})});for(let n of t.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 ei=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function nt(r){let t=r.indexOf("{");if(t===-1)return[r];let i=[],e=r.slice(0,t),n=r.slice(t),s=0,a=n.lastIndexOf("}");for(let d=0;dnt(d));let g=nt(u);for(let d of g)for(let m of f)i.push(e+m+d);return i}function sn(r){return ei.test(r)}function un(r){let t=r.match(ei);if(!t)return[r];let[,i,e,n]=t,s=n?parseInt(n,10):void 0,a=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(e)){let c=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=c<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let f=c0&&(s=-s);for(let g=c;f?g<=u:g>=u;g+=s)a.push(g.toString())}return a}var fn=/^[a-z]+$/,dt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(dt||{});function cn(){throw new Error("No `loadModule` function provided to `compile`")}function pn(){throw new Error("No `loadStylesheet` function provided to `compile`")}function dn(r){let t=0,i=null;for(let e of D(r," "))e==="reference"?t|=2:e==="inline"?t|=1:e==="default"?t|=4:e==="static"?t|=8:e.startsWith("prefix(")&&e.endsWith(")")&&(i=e.slice(7,-1));return[t,i]}var Pe=(c=>(c[c.None=0]="None",c[c.AtApply=1]="AtApply",c[c.AtImport=2]="AtImport",c[c.JsPluginCompat=4]="JsPluginCompat",c[c.ThemeFunction=8]="ThemeFunction",c[c.Utilities=16]="Utilities",c[c.Variants=32]="Variants",c))(Pe||{});async function ti(r,{base:t="",from:i,loadModule:e=cn,loadStylesheet:n=pn}={}){let s=0;r=[le({base:t},r)],s|=await $t(r,t,n,0,i!==void 0);let a=null,c=new Be,u=[],f=[],g=null,d=null,m=[],w=[],v=[],x=[],k=null;F(r,(b,{parent:S,replaceWith:P,context:U})=>{if(b.kind==="at-rule"){if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(d!==null){P([]);return}if(U.reference){P([]);return}let R=D(b.params," ");for(let _ of R)if(_.startsWith("source(")){let K=_.slice(7,-1);if(K==="none"){k=K;continue}if(K[0]==='"'&&K[K.length-1]!=='"'||K[0]==="'"&&K[K.length-1]!=="'"||K[0]!=="'"&&K[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");k={base:U.sourceBase??U.base,pattern:K.slice(1,-1)}}d=b,s|=16}if(b.name==="@utility"){if(S!==null)throw new Error("`@utility` cannot be nested.");if(b.nodes.length===0)throw new Error(`\`@utility ${b.params}\` is empty. Utilities should include at least one property.`);let R=pr(b);if(R===null)throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);f.push(R)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.");if(S!==null)throw new Error("`@source` cannot be nested.");let R=!1,_=!1,K=b.params;if(K[0]==="n"&&K.startsWith("not ")&&(R=!0,K=K.slice(4)),K[0]==="i"&&K.startsWith("inline(")&&(_=!0,K=K.slice(7,-1)),K[0]==='"'&&K[K.length-1]!=='"'||K[0]==="'"&&K[K.length-1]!=="'"||K[0]!=="'"&&K[0]!=='"')throw new Error("`@source` paths must be quoted.");let G=K.slice(1,-1);if(_){let I=R?x:v,W=D(G," ");for(let Z of W)for(let re of nt(Z))I.push(re)}else w.push({base:U.base,pattern:G,negated:R});P([]);return}if(b.name==="@variant"&&(S===null?b.nodes.length===0?b.name="@custom-variant":(F(b.nodes,R=>{if(R.kind==="at-rule"&&R.name==="@slot")return b.name="@custom-variant",2}),b.name==="@variant"&&m.push(b)):m.push(b)),b.name==="@custom-variant"){if(S!==null)throw new Error("`@custom-variant` cannot be nested.");P([]);let[R,_]=D(b.params," ");if(!Xe.test(R))throw new Error(`\`@custom-variant ${R}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(b.nodes.length>0&&_)throw new Error(`\`@custom-variant ${R}\` cannot have both a selector and a body.`);if(b.nodes.length===0){if(!_)throw new Error(`\`@custom-variant ${R}\` has no selector or body.`);let K=D(_.slice(1,-1),",");if(K.length===0||K.some(W=>W.trim()===""))throw new Error(`\`@custom-variant ${R} (${K.join(",")})\` selector is invalid.`);let G=[],I=[];for(let W of K)W=W.trim(),W[0]==="@"?G.push(W):I.push(W);u.push(W=>{W.variants.static(R,Z=>{let re=[];I.length>0&&re.push(M(I.join(", "),Z.nodes));for(let o of G)re.push(H(o,Z.nodes));Z.nodes=re},{compounds:ye([...I,...G])})});return}else{u.push(K=>{K.variants.fromAst(R,b.nodes)});return}}if(b.name==="@media"){let R=D(b.params," "),_=[];for(let K of R)if(K.startsWith("source(")){let G=K.slice(7,-1);F(b.nodes,(I,{replaceWith:W})=>{if(I.kind==="at-rule"&&I.name==="@tailwind"&&I.params==="utilities")return I.params+=` source(${G})`,W([le({sourceBase:U.base},[I])]),2})}else if(K.startsWith("theme(")){let G=K.slice(6,-1),I=G.includes("reference");F(b.nodes,W=>{if(W.kind!=="at-rule"){if(I)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return 0}if(W.name==="@theme")return W.params+=" "+G,1})}else if(K.startsWith("prefix(")){let G=K.slice(7,-1);F(b.nodes,I=>{if(I.kind==="at-rule"&&I.name==="@theme")return I.params+=` prefix(${G})`,1})}else K==="important"?a=!0:K==="reference"?b.nodes=[le({reference:!0},b.nodes)]:_.push(K);_.length>0?b.params=_.join(" "):R.length>0&&P(b.nodes)}if(b.name==="@theme"){let[R,_]=dn(b.params);if(U.reference&&(R|=2),_){if(!fn.test(_))throw new Error(`The prefix "${_}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);c.prefix=_}return F(b.nodes,K=>{if(K.kind==="at-rule"&&K.name==="@keyframes")return c.addKeyframes(K),1;if(K.kind==="comment")return;if(K.kind==="declaration"&&K.property.startsWith("--")){c.add(ge(K.property),K.value??"",R,K.src);return}let G=ne([z(b.name,b.params,[K])]).split(` +`).map((I,W,Z)=>`${W===0||W>=Z.length-2?" ":">"} ${I}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${G}`)}),g?P([]):(g=M(":root, :host",[]),g.src=b.src,P([g])),1}}});let N=br(c);if(a&&(N.important=a),x.length>0)for(let b of x)N.invalidCandidates.add(b);s|=await Zr({designSystem:N,base:t,ast:r,loadModule:e,sources:w});for(let b of u)b(N);for(let b of f)b(N);if(g){let b=[];for(let[P,U]of N.theme.entries()){if(U.options&2)continue;let R=l(fe(P),U.value);R.src=U.src,b.push(R)}let S=N.theme.getKeyframes();for(let P of S)r.push(le({theme:!0},[L([P])]));g.nodes=[le({theme:!0},b)]}if(m.length>0){for(let b of m){let S=M("&",b.nodes),P=b.params,U=N.parseVariant(P);if(U===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${P}`);if(Ae(S,U,N.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${P}`);Object.assign(b,S)}s|=32}if(s|=xe(r,N),s|=Oe(r,N),d){let b=d;b.kind="context",b.context={}}return F(r,(b,{replaceWith:S})=>{if(b.kind==="at-rule")return b.name==="@utility"&&S([]),1}),{designSystem:N,ast:r,sources:w,root:k,utilitiesNode:d,features:s,inlineCandidates:v}}async function mn(r,t={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:a,features:c,inlineCandidates:u}=await ti(r,t);e.unshift(We(`! tailwindcss v${Rt} | MIT License | https://tailwindcss.com `));function f(v){i.invalidCandidates.add(v)}let g=new Set,d=null,m=0,w=!1;for(let v of u)i.invalidCandidates.has(v)||(g.add(v),w=!0);return{sources:n,root:s,features:c,build(v){if(c===0)return r;if(!a)return d??=ve(e,i,t.polyfills),d;let x=w,k=!1;w=!1;let N=g.size;for(let S of v)if(!i.invalidCandidates.has(S))if(S[0]==="-"&&S[1]==="-"){let P=i.theme.markUsedVariable(S);x||=P,k||=P}else g.add(S),x||=g.size!==N;if(!x)return d??=ve(e,i,t.polyfills),d;let b=pe(g,i,{onInvalidCandidate:f}).astNodes;return t.from&&F(b,S=>{S.src??=a.src}),!k&&m===b.length?(d??=ve(e,i,t.polyfills),d):(m=b.length,a.nodes=b,d=ve(e,i,t.polyfills),d)}}}async function Ca(r,t={}){let i=me(r,{from:t.from}),e=await mn(i,t),n=i,s=r;return{...e,build(a){let c=e.build(a);return c===n||(s=ne(c,!!t.from),n=c),s},buildSourceMap(){return Xr({ast:n})}}}async function $a(r,t={}){return(await ti(me(r),t)).designSystem}function gn(){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{dt as a,Pe as b,mn as c,Ca as d,$a as e,gn as f}; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-G32FJCSR.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-G32FJCSR.mjs new file mode 100644 index 0000000000000000000000000000000000000000..86a6941776b8da27765976361615eb80a5e11c9b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-G32FJCSR.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,u as d,pe as e,ge as f,ue as g,be as h}; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/chunk-HTB5LLOP.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8a95483a290362f50a01eec98ac3ab7aa77b5f1b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors-b_6i0Oi7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f187dc6ae350a405031960170ca84d4ae9bc982 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5ea47011a52263416f81387cdddea6f829234b55 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9d15d3de324a3fe932fc98067270ebe8fa27b21 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.js b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.js new file mode 100644 index 0000000000000000000000000000000000000000..409c0d5185a807d593a91f58521a55d10491d086 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9d20fbc2ba033db5c180b5eaaef1f95190be63af --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/colors.mjs @@ -0,0 +1 @@ +import{a}from"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1b80d8aefd36f985bb401ff78163dd6136010b49 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d36e26e34069bb65bf83118153bdbcc6839d74f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.js b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.js new file mode 100644 index 0000000000000000000000000000000000000000..48982db90f68fe43d7ee1bebb002aa39e7261d8f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2fca4a65a7996f5acbd5d661371437d977d8974a --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/default-theme.mjs @@ -0,0 +1 @@ +import{h as a}from"./chunk-G32FJCSR.mjs";import"./chunk-HTB5LLOP.mjs";export{a as default}; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1151604860f5cedb146a45057c69f388a43b4553 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1151604860f5cedb146a45057c69f388a43b4553 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.js b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.js new file mode 100644 index 0000000000000000000000000000000000000000..b9e6c33c1669735d03d9cb90e02d54a08c6915c4 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.js @@ -0,0 +1,3 @@ +"use strict";function _(e){return{kind:"word",value:e}}function se(e,t){return{kind:"function",value:e,nodes:t}}function ue(e){return{kind:"separator",value:e}}function v(e,t,i=null){for(let r=0;r0){let M=_(n);r?r.nodes.push(M):t.push(M),n=""}let a=l,u=l+1;for(;u0){let u=_(n);a?.nodes.push(u),n=""}i.length>0?r=i[i.length-1]:r=null;break}default:n+=String.fromCharCode(s)}}return n.length>0&&t.push(_(n)),t}var c=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 He=new Uint8Array(256);var T=new Uint8Array(256);function p(e,t){let i=0,r=[],n=0,o=e.length,l=t.charCodeAt(0);for(let s=0;s0&&a===T[i-1]&&i--;break}}return r.push(e.slice(n)),r}var tt=new c(e=>{let t=m(e),i=new Set;return v(t,(r,{parent:n})=>{let o=n===null?t:n.nodes??[];if(r.kind==="word"&&(r.value==="+"||r.value==="-"||r.value==="*"||r.value==="/")){let l=o.indexOf(r)??-1;if(l===-1)return;let s=o[l-1];if(s?.kind!=="separator"||s.value!==" ")return;let a=o[l+1];if(a?.kind!=="separator"||a.value!==" ")return;i.add(s),i.add(a)}else r.kind==="separator"&&r.value.trim()==="/"?r.value="/":r.kind==="separator"&&r.value.length>0&&r.value.trim()===""?(o[0]===r||o[o.length-1]===r)&&i.add(r):r.kind==="separator"&&r.value.trim()===","&&(r.value=",")}),i.size>0&&v(t,(r,{replaceWith:n})=>{i.has(r)&&(i.delete(r),n([]))}),D(t),h(t)});var rt=new c(e=>{let t=m(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"?h(t[2].nodes):e});function D(e){for(let t of e)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=N(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=N(t.value);for(let i=0;i{let t=m(e);return t.length===1&&t[0].kind==="function"&&t[0].value==="var"});function me(e){throw new Error(`Unexpected value: ${e}`)}function N(e){return e.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}var w=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,pt=new RegExp(`^${w.source}$`);var dt=new RegExp(`^${w.source}%$`);var mt=new RegExp(`^${w.source}s*/s*${w.source}$`);var ge=["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"],gt=new RegExp(`^${w.source}(${ge.join("|")})$`);var he=["deg","rad","grad","turn"],ht=new RegExp(`^${w.source}(${he.join("|")})$`);var vt=new RegExp(`^${w.source} +${w.source} +${w.source}$`);function d(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===String(e)}function S(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 ke={"--alpha":be,"--spacing":ye,"--theme":xe,theme:Ae};function be(e,t,i,...r){let[n,o]=p(i,"/").map(l=>l.trim());if(!n||!o)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${o||"50%"})\``);if(r.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${o||"50%"})\``);return S(n,o)}function ye(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 xe(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 o=e.resolveThemeValue(i,n);if(!o){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 o;let l=r.join(", ");if(l==="initial")return o;if(o==="initial")return l;if(o.startsWith("var(")||o.startsWith("theme(")||o.startsWith("--theme(")){let s=m(o);return $e(s,l),h(s)}return o}function Ae(e,t,i,...r){i=Ce(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 Ut=new RegExp(Object.keys(ke).map(e=>`${e}\\(`).join("|"));function Ce(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 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 C(e){return{__BARE_VALUE__:e}}var g=C(e=>{if(d(e.value))return e.value}),f=C(e=>{if(d(e.value))return`${e.value}%`}),y=C(e=>{if(d(e.value))return`${e.value}px`}),le=C(e=>{if(d(e.value))return`${e.value}ms`}),P=C(e=>{if(d(e.value))return`${e.value}deg`}),Ie=C(e=>{if(e.fraction===null)return;let[t,i]=p(e.fraction,"/");if(!(!d(t)||!d(i)))return e.fraction}),ae=C(e=>{if(d(Number(e.value)))return`repeat(${e.value}, minmax(0, 1fr))`}),ze={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",...Ie},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>({...e("brightness"),...f}),backdropContrast:({theme:e})=>({...e("contrast"),...f}),backdropGrayscale:({theme:e})=>({...e("grayscale"),...f}),backdropHueRotate:({theme:e})=>({...e("hueRotate"),...P}),backdropInvert:({theme:e})=>({...e("invert"),...f}),backdropOpacity:({theme:e})=>({...e("opacity"),...f}),backdropSaturate:({theme:e})=>({...e("saturate"),...f}),backdropSepia:({theme:e})=>({...e("sepia"),...f}),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",...y},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",...f},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",...g},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2",...f},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"),...y}),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%",...f},grayscale:{0:"0",DEFAULT:"100%",...f},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))",...ae},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))",...ae},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%",...f},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",...f},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",...y},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...y},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...f},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",...f},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%",...f},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",...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",...y},textIndent:({theme:e})=>e("spacing"),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...y},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",...le},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...le},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}};function O(e){let t={};for(let[i,r]of Object.entries(e??{}))if(i!=="__CSS_VALUES__")if(typeof r=="object"&&r!==null)for(let[n,o]of Object.entries(O(r)))t[`${i}${n==="DEFAULT"?"":`-${n}`}`]=o;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=O; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d047645d27aaecbeb2b9f4f11177786610ce7ae3 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/flatten-color-palette.mjs @@ -0,0 +1 @@ +import"./chunk-4WXWQT6Y.mjs";import"./chunk-G32FJCSR.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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..df2c5634e2410af8def3583a699feeb160a97323 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.mts @@ -0,0 +1,373 @@ +import { U as UserConfig, P as Plugin } from './types-B254mqw1.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[]): 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): "static" | "arbitrary" | "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): { + node: AstNode; + propertySort: { + order: number[]; + count: number; + }; +}[]; + +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[]; +} + +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): ReturnType; + printCandidate(candidate: Candidate): string; + printVariant(variant: Variant): string; + getVariantOrder(): Map; + resolveThemeValue(path: string, forceInline?: boolean): string | undefined; + trackUsedVariables(raw: string): void; + candidatesToCss(classes: string[]): (string | null)[]; +}; + +/** + * 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 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 +} +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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..411ce0604b0e875ee7073327db0d8d9ad895896f --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.d.ts @@ -0,0 +1,3 @@ +declare function postcssPluginWarning(): void; + +export { postcssPluginWarning as default }; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.js b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.js new file mode 100644 index 0000000000000000000000000000000000000000..c62b83b6a177876fadcc58e6f53b06210f462409 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.js @@ -0,0 +1,35 @@ +"use strict";var xi=Object.defineProperty;var Ai=(t,r)=>{for(var i in r)xi(t,i,{get:r[i],enumerable:!0})};var vt={};Ai(vt,{Features:()=>Se,Polyfills:()=>tt,__unstable__loadDesignSystem:()=>uo,compile:()=>so,compileAst:()=>yi,default:()=>We});var Mt="4.1.11";var Pe=92,Be=47,qe=42,Wt=34,Bt=39,Ni=58,Ge=59,ne=10,Ye=13,Oe=32,He=9,qt=123,kt=125,xt=40,Ht=41,$i=91,Vi=93,Gt=45,bt=64,Si=33;function ve(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,f=null,u="",c="",d=0,m;for(let g=0;g0&&t[b]===v[v.length-1]&&(v=v.slice(0,-1));let V=yt(u,y);if(!V)throw new Error("Invalid custom property, expected a value");i&&(V.src=[i,x,g],V.dst=[i,x,g]),a?a.nodes.push(V):e.push(V),u=""}else if(w===Ge&&u.charCodeAt(0)===bt)f=_e(u),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a?a.nodes.push(f):e.push(f),u="",f=null;else if(w===Ge&&c[c.length-1]!==")"){let v=yt(u);if(!v)throw u.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${u.trim()}\``);i&&(v.src=[i,d,g],v.dst=[i,d,g]),a?a.nodes.push(v):e.push(v),u=""}else if(w===qt&&c[c.length-1]!==")")c+="}",f=G(u.trim()),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a&&a.nodes.push(f),s.push(a),a=f,u="",f=null;else if(w===kt&&c[c.length-1]!==")"){if(c==="")throw new Error("Missing opening {");if(c=c.slice(0,-1),u.length>0)if(u.charCodeAt(0)===bt)f=_e(u),i&&(f.src=[i,d,g],f.dst=[i,d,g]),a?a.nodes.push(f):e.push(f),u="",f=null;else{let x=u.indexOf(":");if(a){let y=yt(u,x);if(!y)throw new Error(`Invalid declaration: \`${u.trim()}\``);i&&(y.src=[i,d,g],y.dst=[i,d,g]),a.nodes.push(y)}}let v=s.pop()??null;v===null&&a&&e.push(a),a=v,u="",f=null}else if(w===xt)c+=")",u+="(";else if(w===Ht){if(c[c.length-1]!==")")throw new Error("Missing opening (");c=c.slice(0,-1),u+=")"}else{if(u.length===0&&(w===Oe||w===ne||w===He))continue;u===""&&(d=g),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===bt){let g=_e(u);i&&(g.src=[i,d,t.length],g.dst=[i,d,t.length]),e.push(g)}if(c.length>0&&a){if(a.kind==="rule")throw new Error(`Missing closing } at ${a.selector}`);if(a.kind==="at-rule")throw new Error(`Missing closing } at ${a.name} ${a.params}`)}return n.length>0?n.concat(e):e}function _e(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 we(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 Jt=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"]]]);function Zt(t,r){return(Jt.get(r)??[]).some(i=>t===i||t.startsWith(`${i}-`))}var Je=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&&(Zt(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=we(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=Jt.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(!Zt(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(${de(this.prefixKey(r))}${e?`, ${e}`:""})`}markUsedVariable(r){let i=we(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 f of e){let u=`${n}${f}`,c=this.values.get(u);c&&(c.options&1?s[f]=c.value:s[f]=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 B=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 Ct(t){return{kind:"word",value:t}}function Ei(t,r){return{kind:"function",value:t,nodes:r}}function Ti(t){return{kind:"separator",value:t}}function ee(t,r,i=null){for(let e=0;e0){let m=Ct(n);e?e.nodes.push(m):r.push(m),n=""}let u=a,c=a+1;for(;c0){let c=Ct(n);u?.nodes.push(c),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(f)}}return n.length>0&&r.push(Ct(n)),r}function Qe(t){let r=[];return ee(q(t),i=>{if(!(i.kind!=="function"||i.value!=="var"))return ee(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||r.push(e.value)}),1}),r}var Ki=64;function M(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 G(t,r=[]){return t.charCodeAt(0)===Ki?_e(t,r):M(t,r)}function l(t,r,i=!1){return{kind:"declaration",property:t,value:r,important:i}}function Ze(t){return{kind:"comment",value:t}}function se(t,r){return{kind:"context",context:t,nodes:r}}function z(t){return{kind:"at-root",nodes:t}}function I(t,r,i=[],e={}){for(let n=0;nnew Set),a=new B(()=>new Set),f=new Set,u=new Set,c=[],d=[],m=new B(()=>new Set);function g(v,x,y={},V=0){if(v.kind==="declaration"){if(v.property==="--tw-sort"||v.value===void 0||v.value===null)return;if(y.theme&&v.property[0]==="-"&&v.property[1]==="-"){if(v.value==="initial"){v.value=void 0;return}y.keyframes||s.get(x).add(v)}if(v.value.includes("var("))if(y.theme&&v.property[0]==="-"&&v.property[1]==="-")for(let b of Qe(v.value))m.get(b).add(v.property);else r.trackUsedVariables(v.value);if(v.property==="animation")for(let b of sr(v.value))u.add(b);i&2&&v.value.includes("color-mix(")&&a.get(x).add(v),x.push(v)}else if(v.kind==="rule")if(v.selector==="&")for(let b of v.nodes){let S=[];g(b,S,y,V+1),S.length>0&&x.push(...S)}else{let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);b.nodes.length>0&&x.push(b)}else if(v.kind==="at-rule"&&v.name==="@property"&&V===0){if(n.has(v.params))return;if(i&1){let S=v.params,R=null,L=!1;for(let K of v.nodes)K.kind==="declaration"&&(K.property==="initial-value"?R=K.value:K.property==="inherits"&&(L=K.value==="true"));let P=l(S,R??"initial");P.src=v.src,L?c.push(P):d.push(P)}n.add(v.params);let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);x.push(b)}else if(v.kind==="at-rule"){v.name==="@keyframes"&&(y={...y,keyframes:!0});let b={...v,nodes:[]};for(let S of v.nodes)g(S,b.nodes,y,V+1);v.name==="@keyframes"&&y.theme&&f.add(b),(b.nodes.length>0||b.name==="@layer"||b.name==="@charset"||b.name==="@custom-media"||b.name==="@namespace"||b.name==="@import")&&x.push(b)}else if(v.kind==="at-root")for(let b of v.nodes){let S=[];g(b,S,y,0);for(let R of S)e.push(R)}else if(v.kind==="context"){if(v.context.reference)return;for(let b of v.nodes)g(b,x,{...y,...v.context},V)}else v.kind==="comment"&&x.push(v)}let w=[];for(let v of t)g(v,w,{},0);e:for(let[v,x]of s)for(let y of x){if(ur(y.property,r.theme,m)){if(y.property.startsWith(r.theme.prefixKey("--animate-")))for(let S of sr(y.value))u.add(S);continue}let b=v.indexOf(y);if(v.splice(b,1),v.length===0){let S=Ui(w,R=>R.kind==="rule"&&R.nodes===v);if(!S||S.length===0)continue e;S.unshift({kind:"at-root",nodes:w});do{let R=S.pop();if(!R)break;let L=S[S.length-1];if(!L||L.kind!=="at-root"&&L.kind!=="at-rule")break;let P=L.nodes.indexOf(R);if(P===-1)break;L.nodes.splice(P,1)}while(!0);continue e}}for(let v of f)if(!u.has(v.params)){let x=e.indexOf(v);e.splice(x,1)}if(w=w.concat(e),i&2)for(let[v,x]of a)for(let y of x){let V=v.indexOf(y);if(V===-1||y.value==null)continue;let b=q(y.value),S=!1;if(ee(b,(P,{replaceWith:K})=>{if(P.kind!=="function"||P.value!=="color-mix")return;let _=!1,H=!1;if(ee(P.nodes,(j,{replaceWith:W})=>{if(j.kind=="word"&&j.value.toLowerCase()==="currentcolor"){H=!0,S=!0;return}let J=j,ie=null,o=new Set;do{if(J.kind!=="function"||J.value!=="var")return;let p=J.nodes[0];if(!p||p.kind!=="word")return;let h=p.value;if(o.has(h)){_=!0;return}if(o.add(h),S=!0,ie=r.theme.resolveValue(null,[p.value]),!ie){_=!0;return}if(ie.toLowerCase()==="currentcolor"){H=!0;return}ie.startsWith("var(")?J=q(ie)[0]:J=null}while(J);W({kind:"word",value:ie})}),_||H){let j=P.nodes.findIndex(J=>J.kind==="separator"&&J.value.trim().includes(","));if(j===-1)return;let W=P.nodes.length>j?P.nodes[j+1]:null;if(!W)return;K(W)}else if(S){let j=P.nodes[2];j.kind==="word"&&(j.value==="oklab"||j.value==="oklch"||j.value==="lab"||j.value==="lch")&&(j.value="srgb")}}),!S)continue;let R={...y,value:Z(b)},L=G("@supports (color: color-mix(in lab, red, red))",[y]);L.src=y.src,v.splice(V,1,R,L)}if(i&1){let v=[];if(c.length>0){let x=G(":root, :host",c);x.src=c[0].src,v.push(x)}if(d.length>0){let x=G("*, ::before, ::after, ::backdrop",d);x.src=d[0].src,v.push(x)}if(v.length>0){let x=w.findIndex(b=>!(b.kind==="comment"||b.kind==="at-rule"&&(b.name==="@charset"||b.name==="@import"))),y=F("@layer","properties",[]);y.src=v[0].src,w.splice(x<0?w.length:x,0,y);let V=G("@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))))",v)]);V.src=v[0].src,V.nodes[0].src=v[0].src,w.push(V)}}return w}function oe(t,r){let i=0,e={file:null,code:""};function n(a,f=0){let u="",c=" ".repeat(f);if(a.kind==="declaration"){if(u+=`${c}${a.property}: ${a.value}${a.important?" !important":""}; +`,r){i+=c.length;let d=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let m=i;i+=2,a.dst=[e,d,m]}}else if(a.kind==="rule"){if(u+=`${c}${a.selector} { +`,r){i+=c.length;let d=i;i+=a.selector.length,i+=1;let m=i;a.dst=[e,d,m],i+=2}for(let d of a.nodes)u+=n(d,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let d=`${c}${a.name} ${a.params}; +`;if(r){i+=c.length;let m=i;i+=a.name.length,i+=1,i+=a.params.length;let g=i;i+=2,a.dst=[e,m,g]}return d}if(u+=`${c}${a.name}${a.params?` ${a.params} `:" "}{ +`,r){i+=c.length;let d=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let m=i;a.dst=[e,d,m],i+=2}for(let d of a.nodes)u+=n(d,f+1);u+=`${c}} +`,r&&(i+=c.length,i+=2)}else if(a.kind==="comment"){if(u+=`${c}/*${a.value}*/ +`,r){i+=c.length;let d=i;i+=2+a.value.length+2;let m=i;a.dst=[e,d,m],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 Ui(t,r){let i=[];return I(t,(e,{path:n})=>{if(r(e))return i=[...n],2}),i}function ur(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(ur(a,r,i,e))return!0}return!1}function sr(t){return t.split(/[\s,]+/)}var Nt=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"];function De(t){return t.indexOf("(")!==-1&&Nt.some(r=>t.includes(`${r}(`))}function cr(t){if(!Nt.some(s=>t.includes(s)))return t;let r="",i=[],e=null,n=null;for(let s=0;s=48&&a<=57||e!==null&&(a===37||a>=97&&a<=122||a>=65&&a<=90)?e=s:(n=e,e=null),a===40){r+=t[s];let f=s;for(let c=s-1;c>=0;c--){let d=t.charCodeAt(c);if(d>=48&&d<=57)f=c;else if(d>=97&&d<=122)f=c;else break}let u=t.slice(f,s);if(Nt.includes(u)){i.unshift(!0);continue}else if(i[0]&&u===""){i.unshift(!0);continue}i.unshift(!1);continue}else if(a===41)r+=t[s],i.shift();else if(a===44&&i[0]){r+=", ";continue}else{if(a===32&&i[0]&&r.charCodeAt(r.length-1)===32)continue;if((a===43||a===42||a===47||a===45)&&i[0]){let f=r.trimEnd(),u=f.charCodeAt(f.length-1),c=f.charCodeAt(f.length-2),d=t.charCodeAt(s+1);if((u===101||u===69)&&c>=48&&c<=57){r+=t[s];continue}else if(u===43||u===42||u===47||u===45){r+=t[s];continue}else if(u===40||u===44){r+=t[s];continue}else t.charCodeAt(s-1)===32?r+=`${t[s]} `:u>=48&&u<=57||d>=48&&d<=57||u===41||d===40||d===43||d===42||d===47||d===45||n!==null&&n===s-1?r+=` ${t[s]} `:r+=t[s]}else r+=t[s]}}return r}function me(t){if(t.indexOf("(")===-1)return Ne(t);let r=q(t);return $t(r),t=Z(r),t=cr(t),t}function Ne(t,r=!1){let i="";for(let e=0;e0&&n===Vt[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var rt=new Uint8Array(256);function D(t,r){let i=0,e=[],n=0,s=t.length,a=r.charCodeAt(0);for(let f=0;f0&&u===rt[i-1]&&i--;break}}return e.push(t.slice(n)),e}var ji=58,fr=45,pr=97,dr=122;function*mr(t,r){let i=D(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 m=i.length-1;m>=0;--m){let g=r.parseVariant(i[m]);if(g===null)return;n.push(g)}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,f=null,u]=D(e,"/");if(u)return;let c=f===null?null:St(f);if(f!==null&&c===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let m=a.charCodeAt(1);if(m!==fr&&!(m>=pr&&m<=dr))return;a=a.slice(1,-1);let g=a.indexOf(":");if(g===-1||g===0||g===a.length-1)return;let w=a.slice(0,g),v=me(a.slice(g+1));if(!ce(v))return;yield{kind:"arbitrary",property:w,value:v,modifier:c,variants:n,important:s,raw:t};return}let d;if(a[a.length-1]==="]"){let m=a.indexOf("-[");if(m===-1)return;let g=a.slice(0,m);if(!r.utilities.has(g,"functional"))return;let w=a.slice(m+1);d=[[g,w]]}else if(a[a.length-1]===")"){let m=a.indexOf("-(");if(m===-1)return;let g=a.slice(0,m);if(!r.utilities.has(g,"functional"))return;let w=a.slice(m+2,-1),v=D(w,":"),x=null;if(v.length===2&&(x=v[0],w=v[1]),w[0]!=="-"||w[1]!=="-"||!ce(w))return;d=[[g,x===null?`[var(${w})]`:`[${x}:var(${w})]`]]}else d=hr(a,m=>r.utilities.has(m,"functional"));for(let[m,g]of d){let w={kind:"functional",root:m,modifier:c,value:null,variants:n,important:s,raw:t};if(g===null){yield w;continue}{let v=g.indexOf("[");if(v!==-1){if(g[g.length-1]!=="]")return;let y=me(g.slice(v+1,-1));if(!ce(y))continue;let V="";for(let b=0;b=pr&&S<=dr))break}if(y.length===0||y.trim().length===0)continue;w.value={kind:"arbitrary",dataType:V||null,value:y}}else{let y=f===null||w.modifier?.kind==="arbitrary"?null:`${g}/${f}`;w.value={kind:"named",value:g,fraction:y}}}yield w}}function St(t){if(t[0]==="["&&t[t.length-1]==="]"){let r=me(t.slice(1,-1));return!ce(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]!=="-"||!ce(t)?null:(t=`var(${t})`,{kind:"arbitrary",value:me(t)})):{kind:"named",value:t}}function gr(t,r){if(t[0]==="["&&t[t.length-1]==="]"){if(t[1]==="@"&&t.includes("&"))return null;let i=me(t.slice(1,-1));if(!ce(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]=D(t,"/");if(n)return null;let s=hr(i,a=>r.variants.has(a));for(let[a,f]of s)switch(r.variants.kind(a)){case"static":return f!==null||e!==null?null:{kind:"static",root:a};case"functional":{let u=e===null?null:St(e);if(e!==null&&u===null)return null;if(f===null)return{kind:"functional",root:a,modifier:u,value:null};if(f[f.length-1]==="]"){if(f[0]!=="[")continue;let c=me(f.slice(1,-1));return!ce(c)||c.length===0||c.trim().length===0?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:c}}}if(f[f.length-1]===")"){if(f[0]!=="(")continue;let c=me(f.slice(1,-1));return!ce(c)||c.length===0||c.trim().length===0||c[0]!=="-"||c[1]!=="-"?null:{kind:"functional",root:a,modifier:u,value:{kind:"arbitrary",value:`var(${c})`}}}return{kind:"functional",root:a,modifier:u,value:{kind:"named",value:f}}}case"compound":{if(f===null)return null;let u=r.parseVariant(f);if(u===null||!r.variants.compoundsWith(a,u))return null;let c=e===null?null:St(e);return e!==null&&c===null?null:{kind:"compound",root:a,modifier:c,variant:u}}}}return null}function*hr(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]==="")break;yield n}i=t.lastIndexOf("-",i-1)}t[0]==="@"&&r("@")&&(yield["@",t.slice(1)])}function vr(t,r){let i=[];for(let n of r.variants)i.unshift(it(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=Tt(r.value.value),s=n?r.value.value.slice(4,-1):r.value.value,[a,f]=n?["(",")"]:["[","]"];r.value.dataType?e+=`-${a}${r.value.dataType}:${$e(s)}${f}`:e+=`-${a}${$e(s)}${f}`}}else r.value.kind==="named"&&(e+=`-${r.value.value}`);return r.kind==="arbitrary"&&(e+=`[${r.property}:${$e(r.value)}]`),(r.kind==="arbitrary"||r.kind==="functional")&&(e+=wr(r.modifier)),r.important&&(e+="!"),i.push(e),i.join(":")}function wr(t){if(t===null)return"";let r=Tt(t.value),i=r?t.value.slice(4,-1):t.value,[e,n]=r?["(",")"]:["[","]"];return t.kind==="arbitrary"?`/${e}${$e(i)}${n}`:t.kind==="named"?`/${t.value}`:""}function it(t){if(t.kind==="static")return t.root;if(t.kind==="arbitrary")return`[${$e(Fi(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=Tt(t.value.value),n=e?t.value.value.slice(4,-1):t.value.value,[s,a]=e?["(",")"]:["[","]"];r+=`${i?"-":""}${s}${$e(n)}${a}`}else t.value.kind==="named"&&(r+=`${i?"-":""}${t.value.value}`)}return t.kind==="compound"&&(r+=t.root,r+="-",r+=it(t.variant)),(t.kind==="functional"||t.kind==="compound")&&(r+=wr(t.modifier)),r}var Ii=new B(t=>{let r=q(t),i=new Set;return ee(r,(e,{parent:n})=>{let s=n===null?r:n.nodes??[];if(e.kind==="word"&&(e.value==="+"||e.value==="-"||e.value==="*"||e.value==="/")){let a=s.indexOf(e)??-1;if(a===-1)return;let f=s[a-1];if(f?.kind!=="separator"||f.value!==" ")return;let u=s[a+1];if(u?.kind!=="separator"||u.value!==" ")return;i.add(f),i.add(u)}else e.kind==="separator"&&e.value.trim()==="/"?e.value="/":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&&ee(r,(e,{replaceWith:n})=>{i.has(e)&&(i.delete(e),n([]))}),Et(r),Z(r)});function $e(t){return Ii.get(t)}var zi=new B(t=>{let r=q(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 Fi(t){return zi.get(t)}function Et(t){for(let r of t)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=Ke(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=Ke(r.value);for(let i=0;i{let r=q(t);return r.length===1&&r[0].kind==="function"&&r[0].value==="var"});function Tt(t){return Mi.get(t)}function Wi(t){throw new Error(`Unexpected value: ${t}`)}function Ke(t){return t.replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function ye(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),f=(s===a?0:snt(r)||yr(r)||r==="thin"||r==="medium"||r==="thick")}var Zi=/^(?:element|image|cross-fade|image-set)\(/,Ji=/^(repeating-)?(conic|linear|radial)-gradient\(/;function Qi(t){let r=0;for(let i of D(t,","))if(!i.startsWith("var(")){if(br(i)){r+=1;continue}if(Ji.test(i)){r+=1;continue}if(Zi.test(i)){r+=1;continue}return!1}return r>0}function Xi(t){return t==="serif"||t==="sans-serif"||t==="monospace"||t==="cursive"||t==="fantasy"||t==="system-ui"||t==="ui-serif"||t==="ui-sans-serif"||t==="ui-monospace"||t==="ui-rounded"||t==="math"||t==="emoji"||t==="fangsong"}function en(t){let r=0;for(let i of D(t,",")){let e=i.charCodeAt(0);if(e>=48&&e<=57)return!1;i.startsWith("var(")||(r+=1)}return r>0}function tn(t){return t==="xx-small"||t==="x-small"||t==="small"||t==="medium"||t==="large"||t==="x-large"||t==="xx-large"||t==="xxx-large"}function rn(t){return t==="larger"||t==="smaller"}var fe=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,nn=new RegExp(`^${fe.source}$`);function yr(t){return nn.test(t)||De(t)}var on=new RegExp(`^${fe.source}%$`);function Rt(t){return on.test(t)||De(t)}var ln=new RegExp(`^${fe.source}s*/s*${fe.source}$`);function an(t){return ln.test(t)||De(t)}var sn=["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"],un=new RegExp(`^${fe.source}(${sn.join("|")})$`);function nt(t){return un.test(t)||De(t)}function cn(t){let r=0;for(let i of D(t," ")){if(i==="center"||i==="top"||i==="right"||i==="bottom"||i==="left"){r+=1;continue}if(!i.startsWith("var(")){if(nt(i)||Rt(i)){r+=1;continue}return!1}}return r>0}function fn(t){let r=0;for(let i of D(t,",")){if(i==="cover"||i==="contain"){r+=1;continue}let e=D(i," ");if(e.length!==1&&e.length!==2)return!1;if(e.every(n=>n==="auto"||nt(n)||Rt(n))){r+=1;continue}}return r>0}var pn=["deg","rad","grad","turn"],dn=new RegExp(`^${fe.source}(${pn.join("|")})$`);function mn(t){return dn.test(t)}var gn=new RegExp(`^${fe.source} +${fe.source} +${fe.source}$`);function hn(t){return gn.test(t)}function T(t){let r=Number(t);return Number.isInteger(r)&&r>=0&&String(r)===String(t)}function Pt(t){let r=Number(t);return Number.isInteger(r)&&r>0&&String(r)===String(t)}function xe(t){return xr(t,.25)}function ot(t){return xr(t,.25)}function xr(t,r){let i=Number(t);return i>=0&&i%r===0&&String(i)===String(t)}var vn=new Set(["inset","inherit","initial","revert","unset"]),Ar=/^-?(\d+|\.\d+)(.*?)$/g;function Ue(t,r){return D(t,",").map(e=>{e=e.trim();let n=D(e," ").filter(c=>c.trim()!==""),s=null,a=null,f=null;for(let c of n)vn.has(c)||(Ar.test(c)?(a===null?a=c:f===null&&(f=c),Ar.lastIndex=0):s===null&&(s=c));if(a===null||f===null)return e;let u=r(s??"currentcolor");return s!==null?e.replace(s,u):`${e} ${u}`}).join(", ")}var wn=/^-?[a-z][a-zA-Z0-9/%._-]*$/,kn=/^-?[a-z][a-zA-Z0-9/%._-]*-\*$/,at=["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"],Ot=class{utilities=new B(()=>[]);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.completions.get(r)?.()??[]}suggest(r,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 N(t,r,i){return F("@property",t,[l("syntax",i?`"${i}"`:'"*"'),l("inherits","false"),...r?[l("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 Nr(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):ot(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 Vr(t){let r=new Ot;function i(o,p){function*h(k){for(let C of t.keysInNamespaces(k))yield C.replace($r,(O,$,E)=>`${$}.${E}`)}let A=["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(o,()=>{let k=[];for(let C of p()){if(typeof C=="string"){k.push({values:[C],modifiers:[]});continue}let O=[...C.values??[],...h(C.valueThemeKeys??[])],$=[...C.modifiers??[],...h(C.modifierThemeKeys??[])];C.supportsFractions&&O.push(...A),C.hasDefaultValue&&O.unshift(null),k.push({supportsNegative:C.supportsNegative,values:O,modifiers:$})}return k})}function e(o,p){r.static(o,()=>p.map(h=>typeof h=="function"?h():l(h[0],h[1])))}function n(o,p){function h({negative:A}){return k=>{let C=null,O=null;if(k.value)if(k.value.kind==="arbitrary"){if(k.modifier)return;C=k.value.value,O=k.value.dataType}else{if(C=t.resolve(k.value.fraction??k.value.value,p.themeKeys??[]),C===null&&p.supportsFractions&&k.value.fraction){let[$,E]=D(k.value.fraction,"/");if(!T($)||!T(E))return;C=`calc(${k.value.fraction} * 100%)`}if(C===null&&A&&p.handleNegativeBareValue){if(C=p.handleNegativeBareValue(k.value),!C?.includes("/")&&k.modifier)return;if(C!==null)return p.handle(C,null)}if(C===null&&p.handleBareValue&&(C=p.handleBareValue(k.value),!C?.includes("/")&&k.modifier))return}else{if(k.modifier)return;C=p.defaultValue!==void 0?p.defaultValue:t.resolve(null,p.themeKeys??[])}if(C!==null)return p.handle(A?`calc(${C} * -1)`:C,O)}}p.supportsNegative&&r.functional(`-${o}`,h({negative:!0})),r.functional(o,h({negative:!1})),i(o,()=>[{supportsNegative:p.supportsNegative,valueThemeKeys:p.themeKeys??[],hasDefaultValue:p.defaultValue!==void 0&&p.defaultValue!==null,supportsFractions:p.supportsFractions}])}function s(o,p){r.functional(o,h=>{if(!h.value)return;let A=null;if(h.value.kind==="arbitrary"?(A=h.value.value,A=X(A,h.modifier,t)):A=te(h,t,p.themeKeys),A!==null)return p.handle(A)}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:p.themeKeys,modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}function a(o,p,h,{supportsNegative:A=!1,supportsFractions:k=!1}={}){A&&r.static(`-${o}-px`,()=>h("-1px")),r.static(`${o}-px`,()=>h("1px")),n(o,{themeKeys:p,supportsFractions:k,supportsNegative:A,defaultValue:null,handleBareValue:({value:C})=>{let O=t.resolve(null,["--spacing"]);return!O||!xe(C)?null:`calc(${O} * ${C})`},handleNegativeBareValue:({value:C})=>{let O=t.resolve(null,["--spacing"]);return!O||!xe(C)?null:`calc(${O} * -${C})`},handle:h}),i(o,()=>[{values:t.get(["--spacing"])?at:[],supportsNegative:A,supportsFractions:k,valueThemeKeys:p}])}e("sr-only",[["position","absolute"],["width","1px"],["height","1px"],["padding","0"],["margin","-1px"],["overflow","hidden"],["clip","rect(0, 0, 0, 0)"],["white-space","nowrap"],["border-width","0"]]),e("not-sr-only",[["position","static"],["width","auto"],["height","auto"],["padding","0"],["margin","0"],["overflow","visible"],["clip","auto"],["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[o,p]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(`${o}-auto`,[[p,"auto"]]),e(`${o}-full`,[[p,"100%"]]),e(`-${o}-full`,[[p,"-100%"]]),a(o,["--inset","--spacing"],h=>[l(p,h)],{supportsNegative:!0,supportsFractions:!0});e("isolate",[["isolation","isolate"]]),e("isolation-auto",[["isolation","auto"]]),e("z-auto",[["z-index","auto"]]),n("z",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--z-index"],handle:o=>[l("z-index",o)]}),i("z",()=>[{supportsNegative:!0,values:["0","10","20","30","40","50"],valueThemeKeys:["--z-index"]}]),e("order-first",[["order","-9999"]]),e("order-last",[["order","9999"]]),n("order",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--order"],handle:o=>[l("order",o)]}),i("order",()=>[{supportsNegative:!0,values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--order"]}]),e("col-auto",[["grid-column","auto"]]),n("col",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column"],handle:o=>[l("grid-column",o)]}),e("col-span-full",[["grid-column","1 / -1"]]),n("col-span",{handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("grid-column",`span ${o} / span ${o}`)]}),e("col-start-auto",[["grid-column-start","auto"]]),n("col-start",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column-start"],handle:o=>[l("grid-column-start",o)]}),e("col-end-auto",[["grid-column-end","auto"]]),n("col-end",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-column-end"],handle:o=>[l("grid-column-end",o)]}),i("col-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("col-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-start"]}]),i("col-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-column-end"]}]),e("row-auto",[["grid-row","auto"]]),n("row",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row"],handle:o=>[l("grid-row",o)]}),e("row-span-full",[["grid-row","1 / -1"]]),n("row-span",{themeKeys:[],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("grid-row",`span ${o} / span ${o}`)]}),e("row-start-auto",[["grid-row-start","auto"]]),n("row-start",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row-start"],handle:o=>[l("grid-row-start",o)]}),e("row-end-auto",[["grid-row-end","auto"]]),n("row-end",{supportsNegative:!0,handleBareValue:({value:o})=>T(o)?o:null,themeKeys:["--grid-row-end"],handle:o=>[l("grid-row-end",o)]}),i("row-span",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:[]}]),i("row-start",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-row-start"]}]),i("row-end",()=>[{supportsNegative:!0,values:Array.from({length:13},(o,p)=>`${p+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[o,p]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(`${o}-auto`,[[p,"auto"]]),a(o,["--margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});e("box-border",[["box-sizing","border-box"]]),e("box-content",[["box-sizing","content-box"]]),e("line-clamp-none",[["overflow","visible"],["display","block"],["-webkit-box-orient","horizontal"],["-webkit-line-clamp","unset"]]),n("line-clamp",{themeKeys:["--line-clamp"],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("overflow","hidden"),l("display","-webkit-box"),l("-webkit-box-orient","vertical"),l("-webkit-line-clamp",o)]}),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"]]),e("aspect-auto",[["aspect-ratio","auto"]]),e("aspect-square",[["aspect-ratio","1 / 1"]]),n("aspect",{themeKeys:["--aspect"],handleBareValue:({fraction:o})=>{if(o===null)return null;let[p,h]=D(o,"/");return!T(p)||!T(h)?null:o},handle:o=>[l("aspect-ratio",o)]});for(let[o,p]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-${o}`,[["--tw-sort","size"],["width",p],["height",p]]),e(`w-${o}`,[["width",p]]),e(`h-${o}`,[["height",p]]),e(`min-w-${o}`,[["min-width",p]]),e(`min-h-${o}`,[["min-height",p]]),e(`max-w-${o}`,[["max-width",p]]),e(`max-h-${o}`,[["max-height",p]]);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"],o=>[l("--tw-sort","size"),l("width",o),l("height",o)],{supportsFractions:!0});for(let[o,p,h]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(o,p,A=>[l(h,A)],{supportsFractions:!0});r.static("container",()=>{let o=[...t.namespace("--breakpoint").values()];o.sort((h,A)=>ye(h,A,"asc"));let p=[l("--tw-sort","--tw-container-component"),l("width","100%")];for(let h of o)p.push(F("@media",`(width >= ${h})`,[l("max-width",h)]));return p}),e("flex-auto",[["flex","auto"]]),e("flex-initial",[["flex","0 auto"]]),e("flex-none",[["flex","none"]]),r.functional("flex",o=>{if(o.value){if(o.value.kind==="arbitrary")return o.modifier?void 0:[l("flex",o.value.value)];if(o.value.fraction){let[p,h]=D(o.value.fraction,"/");return!T(p)||!T(h)?void 0:[l("flex",`calc(${o.value.fraction} * 100%)`)]}if(T(o.value.value))return o.modifier?void 0:[l("flex",o.value.value)]}}),i("flex",()=>[{supportsFractions:!0}]),n("shrink",{defaultValue:"1",handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("flex-shrink",o)]}),n("grow",{defaultValue:"1",handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("flex-grow",o)]}),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"],o=>[l("flex-basis",o)],{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 f=()=>z([N("--tw-border-spacing-x","0",""),N("--tw-border-spacing-y","0","")]);a("border-spacing",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-x",o),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-x",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-x",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),a("border-spacing-y",["--border-spacing","--spacing"],o=>[f(),l("--tw-border-spacing-y",o),l("border-spacing","var(--tw-border-spacing-x) var(--tw-border-spacing-y)")]),e("origin-center",[["transform-origin","center"]]),e("origin-top",[["transform-origin","top"]]),e("origin-top-right",[["transform-origin","top right"]]),e("origin-right",[["transform-origin","right"]]),e("origin-bottom-right",[["transform-origin","bottom right"]]),e("origin-bottom",[["transform-origin","bottom"]]),e("origin-bottom-left",[["transform-origin","bottom left"]]),e("origin-left",[["transform-origin","left"]]),e("origin-top-left",[["transform-origin","top left"]]),n("origin",{themeKeys:["--transform-origin"],handle:o=>[l("transform-origin",o)]}),e("perspective-origin-center",[["perspective-origin","center"]]),e("perspective-origin-top",[["perspective-origin","top"]]),e("perspective-origin-top-right",[["perspective-origin","top right"]]),e("perspective-origin-right",[["perspective-origin","right"]]),e("perspective-origin-bottom-right",[["perspective-origin","bottom right"]]),e("perspective-origin-bottom",[["perspective-origin","bottom"]]),e("perspective-origin-bottom-left",[["perspective-origin","bottom left"]]),e("perspective-origin-left",[["perspective-origin","left"]]),e("perspective-origin-top-left",[["perspective-origin","top left"]]),n("perspective-origin",{themeKeys:["--perspective-origin"],handle:o=>[l("perspective-origin",o)]}),e("perspective-none",[["perspective","none"]]),n("perspective",{themeKeys:["--perspective"],handle:o=>[l("perspective",o)]});let u=()=>z([N("--tw-translate-x","0"),N("--tw-translate-y","0"),N("--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"],o=>[u(),l("--tw-translate-x",o),l("--tw-translate-y",o),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});for(let o of["x","y"])e(`-translate-${o}-full`,[u,[`--tw-translate-${o}`,"-100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),e(`translate-${o}-full`,[u,[`--tw-translate-${o}`,"100%"],["translate","var(--tw-translate-x) var(--tw-translate-y)"]]),a(`translate-${o}`,["--translate","--spacing"],p=>[u(),l(`--tw-translate-${o}`,p),l("translate","var(--tw-translate-x) var(--tw-translate-y)")],{supportsNegative:!0,supportsFractions:!0});a("translate-z",["--translate","--spacing"],o=>[u(),l("--tw-translate-z",o),l("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 c=()=>z([N("--tw-scale-x","1"),N("--tw-scale-y","1"),N("--tw-scale-z","1")]);e("scale-none",[["scale","none"]]);function d({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;return p.value.kind==="arbitrary"?(h=p.value.value,h=o?`calc(${h} * -1)`:h,[l("scale",h)]):(h=t.resolve(p.value.value,["--scale"]),!h&&T(p.value.value)&&(h=`${p.value.value}%`),h?(h=o?`calc(${h} * -1)`:h,[c(),l("--tw-scale-x",h),l("--tw-scale-y",h),l("--tw-scale-z",h),l("scale","var(--tw-scale-x) var(--tw-scale-y)")]):void 0)}}r.functional("-scale",d({negative:!0})),r.functional("scale",d({negative:!1})),i("scale",()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);for(let o of["x","y","z"])n(`scale-${o}`,{supportsNegative:!0,themeKeys:["--scale"],handleBareValue:({value:p})=>T(p)?`${p}%`:null,handle:p=>[c(),l(`--tw-scale-${o}`,p),l("scale",`var(--tw-scale-x) var(--tw-scale-y)${o==="z"?" var(--tw-scale-z)":""}`)]}),i(`scale-${o}`,()=>[{supportsNegative:!0,values:["0","50","75","90","95","100","105","110","125","150","200"],valueThemeKeys:["--scale"]}]);e("scale-3d",[c,["scale","var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z)"]]),e("rotate-none",[["rotate","none"]]);function m({negative:o}){return p=>{if(!p.value||p.modifier)return;let h;if(p.value.kind==="arbitrary"){h=p.value.value;let A=p.value.dataType??Y(h,["angle","vector"]);if(A==="vector")return[l("rotate",`${h} var(--tw-rotate)`)];if(A!=="angle")return[l("rotate",o?`calc(${h} * -1)`:h)]}else if(h=t.resolve(p.value.value,["--rotate"]),!h&&T(p.value.value)&&(h=`${p.value.value}deg`),!h)return;return[l("rotate",o?`calc(${h} * -1)`:h)]}}r.functional("-rotate",m({negative:!0})),r.functional("rotate",m({negative:!1})),i("rotate",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);{let o=["var(--tw-rotate-x,)","var(--tw-rotate-y,)","var(--tw-rotate-z,)","var(--tw-skew-x,)","var(--tw-skew-y,)"].join(" "),p=()=>z([N("--tw-rotate-x"),N("--tw-rotate-y"),N("--tw-rotate-z"),N("--tw-skew-x"),N("--tw-skew-y")]);for(let h of["x","y","z"])n(`rotate-${h}`,{supportsNegative:!0,themeKeys:["--rotate"],handleBareValue:({value:A})=>T(A)?`${A}deg`:null,handle:A=>[p(),l(`--tw-rotate-${h}`,`rotate${h.toUpperCase()}(${A})`),l("transform",o)]}),i(`rotate-${h}`,()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"],valueThemeKeys:["--rotate"]}]);n("skew",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),n("skew-x",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-x",`skewX(${h})`),l("transform",o)]}),n("skew-y",{supportsNegative:!0,themeKeys:["--skew"],handleBareValue:({value:h})=>T(h)?`${h}deg`:null,handle:h=>[p(),l("--tw-skew-y",`skewY(${h})`),l("transform",o)]}),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",h=>{if(h.modifier)return;let A=null;if(h.value?h.value.kind==="arbitrary"&&(A=h.value.value):A=o,A!==null)return[p(),l("transform",A)]}),i("transform",()=>[{hasDefaultValue:!0}]),e("transform-cpu",[["transform",o]]),e("transform-gpu",[["transform",`translateZ(0) ${o}`]]),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 o 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-${o}`,[["cursor",o]]);n("cursor",{themeKeys:["--cursor"],handle:o=>[l("cursor",o)]});for(let o of["auto","none","manipulation"])e(`touch-${o}`,[["touch-action",o]]);let g=()=>z([N("--tw-pan-x"),N("--tw-pan-y"),N("--tw-pinch-zoom")]);for(let o of["x","left","right"])e(`touch-pan-${o}`,[g,["--tw-pan-x",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["y","up","down"])e(`touch-pan-${o}`,[g,["--tw-pan-y",`pan-${o}`],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);e("touch-pinch-zoom",[g,["--tw-pinch-zoom","pinch-zoom"],["touch-action","var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)"]]);for(let o of["none","text","all","auto"])e(`select-${o}`,[["-webkit-user-select",o],["user-select",o]]);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=()=>z([N("--tw-scroll-snap-strictness","proximity","*")]);for(let o of["x","y","both"])e(`snap-${o}`,[w,["scroll-snap-type",`${o} 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[o,p]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(o,["--scroll-margin","--spacing"],h=>[l(p,h)],{supportsNegative:!0});for(let[o,p]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(o,["--scroll-padding","--spacing"],h=>[l(p,h)]);e("list-inside",[["list-style-position","inside"]]),e("list-outside",[["list-style-position","outside"]]),e("list-none",[["list-style-type","none"]]),e("list-disc",[["list-style-type","disc"]]),e("list-decimal",[["list-style-type","decimal"]]),n("list",{themeKeys:["--list-style-type"],handle:o=>[l("list-style-type",o)]}),e("list-image-none",[["list-style-image","none"]]),n("list-image",{themeKeys:["--list-style-image"],handle:o=>[l("list-style-image",o)]}),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"]]),e("columns-auto",[["columns","auto"]]),n("columns",{themeKeys:["--columns","--container"],handleBareValue:({value:o})=>T(o)?o:null,handle:o=>[l("columns",o)]}),i("columns",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--columns","--container"]}]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-before-${o}`,[["break-before",o]]);for(let o of["auto","avoid","avoid-page","avoid-column"])e(`break-inside-${o}`,[["break-inside",o]]);for(let o of["auto","avoid","all","avoid-page","page","left","right","column"])e(`break-after-${o}`,[["break-after",o]]);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"]]),e("auto-cols-auto",[["grid-auto-columns","auto"]]),e("auto-cols-min",[["grid-auto-columns","min-content"]]),e("auto-cols-max",[["grid-auto-columns","max-content"]]),e("auto-cols-fr",[["grid-auto-columns","minmax(0, 1fr)"]]),n("auto-cols",{themeKeys:["--grid-auto-columns"],handle:o=>[l("grid-auto-columns",o)]}),e("auto-rows-auto",[["grid-auto-rows","auto"]]),e("auto-rows-min",[["grid-auto-rows","min-content"]]),e("auto-rows-max",[["grid-auto-rows","max-content"]]),e("auto-rows-fr",[["grid-auto-rows","minmax(0, 1fr)"]]),n("auto-rows",{themeKeys:["--grid-auto-rows"],handle:o=>[l("grid-auto-rows",o)]}),e("grid-cols-none",[["grid-template-columns","none"]]),e("grid-cols-subgrid",[["grid-template-columns","subgrid"]]),n("grid-cols",{themeKeys:["--grid-template-columns"],handleBareValue:({value:o})=>Pt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-columns",o)]}),e("grid-rows-none",[["grid-template-rows","none"]]),e("grid-rows-subgrid",[["grid-template-rows","subgrid"]]),n("grid-rows",{themeKeys:["--grid-template-rows"],handleBareValue:({value:o})=>Pt(o)?`repeat(${o}, minmax(0, 1fr))`:null,handle:o=>[l("grid-template-rows",o)]}),i("grid-cols",()=>[{values:Array.from({length:12},(o,p)=>`${p+1}`),valueThemeKeys:["--grid-template-columns"]}]),i("grid-rows",()=>[{values:Array.from({length:12},(o,p)=>`${p+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"],o=>[l("gap",o)]),a("gap-x",["--gap","--spacing"],o=>[l("column-gap",o)]),a("gap-y",["--gap","--spacing"],o=>[l("row-gap",o)]),a("space-x",["--space","--spacing"],o=>[z([N("--tw-space-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","0"),l("margin-inline-start",`calc(${o} * var(--tw-space-x-reverse))`),l("margin-inline-end",`calc(${o} * calc(1 - var(--tw-space-x-reverse)))`)])],{supportsNegative:!0}),a("space-y",["--space","--spacing"],o=>[z([N("--tw-space-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","0"),l("margin-block-start",`calc(${o} * var(--tw-space-y-reverse))`),l("margin-block-end",`calc(${o} * calc(1 - var(--tw-space-y-reverse)))`)])],{supportsNegative:!0}),e("space-x-reverse",[()=>z([N("--tw-space-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","row-gap"),l("--tw-space-x-reverse","1")])]),e("space-y-reverse",[()=>z([N("--tw-space-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-sort","column-gap"),l("--tw-space-y-reverse","1")])]),e("accent-auto",[["accent-color","auto"]]),s("accent",{themeKeys:["--accent-color","--color"],handle:o=>[l("accent-color",o)]}),s("caret",{themeKeys:["--caret-color","--color"],handle:o=>[l("caret-color",o)]}),s("divide",{themeKeys:["--divide-color","--color"],handle:o=>[M(":where(& > :not(:last-child))",[l("--tw-sort","divide-color"),l("border-color",o)])]}),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 o of["auto","hidden","clip","visible","scroll"])e(`overflow-${o}`,[["overflow",o]]),e(`overflow-x-${o}`,[["overflow-x",o]]),e(`overflow-y-${o}`,[["overflow-y",o]]);for(let o of["auto","contain","none"])e(`overscroll-${o}`,[["overscroll-behavior",o]]),e(`overscroll-x-${o}`,[["overscroll-behavior-x",o]]),e(`overscroll-y-${o}`,[["overscroll-behavior-y",o]]);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-words",[["overflow-wrap","break-word"]]),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[o,p]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"]]])e(`${o}-none`,p.map(h=>[h,"0"])),e(`${o}-full`,p.map(h=>[h,"calc(infinity * 1px)"])),n(o,{themeKeys:["--radius"],handle:h=>p.map(A=>l(A,h))});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 p=function(h,A){r.functional(h,k=>{if(!k.value){if(k.modifier)return;let C=t.get(["--default-border-width"])??"1px",O=A.width(C);return O?[o(),...O]:void 0}if(k.value.kind==="arbitrary"){let C=k.value.value;switch(k.value.dataType??Y(C,["color","line-width","length"])){case"line-width":case"length":{if(k.modifier)return;let $=A.width(C);return $?[o(),...$]:void 0}default:return C=X(C,k.modifier,t),C===null?void 0:A.color(C)}}{let C=te(k,t,["--border-color","--color"]);if(C)return A.color(C)}{if(k.modifier)return;let C=t.resolve(k.value.value,["--border-width"]);if(C){let O=A.width(C);return O?[o(),...O]:void 0}if(T(k.value.value)){let O=A.width(`${k.value.value}px`);return O?[o(),...O]:void 0}}}),i(h,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--border-color","--color"],modifiers:Array.from({length:21},(k,C)=>`${C*5}`),hasDefaultValue:!0},{values:["0","2","4","8"],valueThemeKeys:["--border-width"]}])};var _=p;let o=()=>z([N("--tw-border-style","solid")]);p("border",{width:h=>[l("border-style","var(--tw-border-style)"),l("border-width",h)],color:h=>[l("border-color",h)]}),p("border-x",{width:h=>[l("border-inline-style","var(--tw-border-style)"),l("border-inline-width",h)],color:h=>[l("border-inline-color",h)]}),p("border-y",{width:h=>[l("border-block-style","var(--tw-border-style)"),l("border-block-width",h)],color:h=>[l("border-block-color",h)]}),p("border-s",{width:h=>[l("border-inline-start-style","var(--tw-border-style)"),l("border-inline-start-width",h)],color:h=>[l("border-inline-start-color",h)]}),p("border-e",{width:h=>[l("border-inline-end-style","var(--tw-border-style)"),l("border-inline-end-width",h)],color:h=>[l("border-inline-end-color",h)]}),p("border-t",{width:h=>[l("border-top-style","var(--tw-border-style)"),l("border-top-width",h)],color:h=>[l("border-top-color",h)]}),p("border-r",{width:h=>[l("border-right-style","var(--tw-border-style)"),l("border-right-width",h)],color:h=>[l("border-right-color",h)]}),p("border-b",{width:h=>[l("border-bottom-style","var(--tw-border-style)"),l("border-bottom-width",h)],color:h=>[l("border-bottom-color",h)]}),p("border-l",{width:h=>[l("border-left-style","var(--tw-border-style)"),l("border-left-width",h)],color:h=>[l("border-left-color",h)]}),n("divide-x",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>T(h)?`${h}px`:null,handle:h=>[z([N("--tw-divide-x-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-x-width"),o(),l("--tw-divide-x-reverse","0"),l("border-inline-style","var(--tw-border-style)"),l("border-inline-start-width",`calc(${h} * var(--tw-divide-x-reverse))`),l("border-inline-end-width",`calc(${h} * calc(1 - var(--tw-divide-x-reverse)))`)])]}),n("divide-y",{defaultValue:t.get(["--default-border-width"])??"1px",themeKeys:["--divide-width","--border-width"],handleBareValue:({value:h})=>T(h)?`${h}px`:null,handle:h=>[z([N("--tw-divide-y-reverse","0")]),M(":where(& > :not(:last-child))",[l("--tw-sort","divide-y-width"),o(),l("--tw-divide-y-reverse","0"),l("border-bottom-style","var(--tw-border-style)"),l("border-top-style","var(--tw-border-style)"),l("border-top-width",`calc(${h} * var(--tw-divide-y-reverse))`),l("border-bottom-width",`calc(${h} * 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",[()=>z([N("--tw-divide-x-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-x-reverse","1")])]),e("divide-y-reverse",[()=>z([N("--tw-divide-y-reverse","0")]),()=>M(":where(& > :not(:last-child))",[l("--tw-divide-y-reverse","1")])]);for(let h of["solid","dashed","dotted","double","none"])e(`divide-${h}`,[()=>M(":where(& > :not(:last-child))",[l("--tw-sort","divide-style"),l("--tw-border-style",h),l("border-style",h)])])}e("bg-auto",[["background-size","auto"]]),e("bg-cover",[["background-size","cover"]]),e("bg-contain",[["background-size","contain"]]),n("bg-size",{handle(o){if(o)return[l("background-size",o)]}}),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(o){if(o)return[l("background-position",o)]}}),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 h=function(C){let O="in oklab";if(C?.kind==="named")switch(C.value){case"longer":case"shorter":case"increasing":case"decreasing":O=`in oklch ${C.value} hue`;break;default:O=`in ${C.value}`}else C?.kind==="arbitrary"&&(O=C.value);return O},A=function({negative:C}){return O=>{if(!O.value)return;if(O.value.kind==="arbitrary"){if(O.modifier)return;let U=O.value.value;switch(O.value.dataType??Y(U,["angle"])){case"angle":return U=C?`calc(${U} * -1)`:`${U}`,[l("--tw-gradient-position",U),l("background-image",`linear-gradient(var(--tw-gradient-stops,${U}))`)];default:return C?void 0:[l("--tw-gradient-position",U),l("background-image",`linear-gradient(var(--tw-gradient-stops,${U}))`)]}}let $=O.value.value;if(!C&&p.has($))$=p.get($);else if(T($))$=C?`calc(${$}deg * -1)`:`${$}deg`;else return;let E=h(O.modifier);return[l("--tw-gradient-position",`${$}`),G("@supports (background-image: linear-gradient(in lab, red, red))",[l("--tw-gradient-position",`${$} ${E}`)]),l("background-image","linear-gradient(var(--tw-gradient-stops))")]}},k=function({negative:C}){return O=>{if(O.value?.kind==="arbitrary"){if(O.modifier)return;let U=O.value.value;return[l("--tw-gradient-position",U),l("background-image",`conic-gradient(var(--tw-gradient-stops,${U}))`)]}let $=h(O.modifier);if(!O.value)return[l("--tw-gradient-position",$),l("background-image","conic-gradient(var(--tw-gradient-stops))")];let E=O.value.value;if(T(E))return E=C?`calc(${E}deg * -1)`:`${E}deg`,[l("--tw-gradient-position",`from ${E} ${$}`),l("background-image","conic-gradient(var(--tw-gradient-stops))")]}};var H=h,j=A,W=k;let o=["oklab","oklch","srgb","hsl","longer","shorter","increasing","decreasing"],p=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",A({negative:!0})),r.functional("bg-linear",A({negative:!1})),i("bg-linear",()=>[{values:[...p.keys()],modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),r.functional("-bg-conic",k({negative:!0})),r.functional("bg-conic",k({negative:!1})),i("bg-conic",()=>[{hasDefaultValue:!0,modifiers:o},{values:["0","30","60","90","120","150","180","210","240","270","300","330"],supportsNegative:!0,modifiers:o}]),r.functional("bg-radial",C=>{if(!C.value){let O=h(C.modifier);return[l("--tw-gradient-position",O),l("background-image","radial-gradient(var(--tw-gradient-stops))")]}if(C.value.kind==="arbitrary"){if(C.modifier)return;let O=C.value.value;return[l("--tw-gradient-position",O),l("background-image",`radial-gradient(var(--tw-gradient-stops,${O}))`)]}}),i("bg-radial",()=>[{hasDefaultValue:!0,modifiers:o}])}r.functional("bg",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["image","color","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("background-position",p)];case"bg-size":case"length":case"size":return o.modifier?void 0:[l("background-size",p)];case"image":case"url":return o.modifier?void 0:[l("background-image",p)];default:return p=X(p,o.modifier,t),p===null?void 0:[l("background-color",p)]}}{let p=te(o,t,["--background-color","--color"]);if(p)return[l("background-color",p)]}{if(o.modifier)return;let p=t.resolve(o.value.value,["--background-image"]);if(p)return[l("background-image",p)]}}}),i("bg",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--background-image"]}]);let v=()=>z([N("--tw-gradient-position"),N("--tw-gradient-from","#0000",""),N("--tw-gradient-via","#0000",""),N("--tw-gradient-to","#0000",""),N("--tw-gradient-stops"),N("--tw-gradient-via-stops"),N("--tw-gradient-from-position","0%",""),N("--tw-gradient-via-position","50%",""),N("--tw-gradient-to-position","100%","")]);function x(o,p){r.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??Y(A,["color","length","percentage"])){case"length":case"percentage":return h.modifier?void 0:p.position(A);default:return A=X(A,h.modifier,t),A===null?void 0:p.color(A)}}{let A=te(h,t,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=t.resolve(h.value.value,["--gradient-color-stop-positions"]);if(A)return p.position(A);if(h.value.value[h.value.value.length-1]==="%"&&T(h.value.value.slice(0,-1)))return p.position(h.value.value)}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}])}x("from",{color:o=>[v(),l("--tw-sort","--tw-gradient-from"),l("--tw-gradient-from",o),l("--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:o=>[v(),l("--tw-gradient-from-position",o)]}),e("via-none",[["--tw-gradient-via-stops","initial"]]),x("via",{color:o=>[v(),l("--tw-sort","--tw-gradient-via"),l("--tw-gradient-via",o),l("--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)"),l("--tw-gradient-stops","var(--tw-gradient-via-stops)")],position:o=>[v(),l("--tw-gradient-via-position",o)]}),x("to",{color:o=>[v(),l("--tw-sort","--tw-gradient-to"),l("--tw-gradient-to",o),l("--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:o=>[v(),l("--tw-gradient-to-position",o)]}),e("mask-none",[["mask-image","none"]]),r.functional("mask",o=>{if(!o.value||o.modifier||o.value.kind!=="arbitrary")return;let p=o.value.value;switch(o.value.dataType??Y(p,["image","percentage","position","bg-size","length","url"])){case"percentage":case"position":return o.modifier?void 0:[l("mask-position",p)];case"bg-size":case"length":case"size":return[l("mask-size",p)];case"image":case"url":default:return[l("mask-image",p)]}}),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(o){if(o)return[l("mask-size",o)]}}),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(o){if(o)return[l("mask-position",o)]}}),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 y=()=>z([N("--tw-mask-linear","linear-gradient(#fff, #fff)"),N("--tw-mask-radial","linear-gradient(#fff, #fff)"),N("--tw-mask-conic","linear-gradient(#fff, #fff)")]);function V(o,p){r.functional(o,h=>{if(h.value){if(h.value.kind==="arbitrary"){let A=h.value.value;switch(h.value.dataType??Y(A,["length","percentage","color"])){case"color":return A=X(A,h.modifier,t),A===null?void 0:p.color(A);case"percentage":return h.modifier||!T(A.slice(0,-1))?void 0:p.position(A);default:return h.modifier?void 0:p.position(A)}}{let A=te(h,t,["--background-color","--color"]);if(A)return p.color(A)}{if(h.modifier)return;let A=Y(h.value.value,["number","percentage"]);if(!A)return;switch(A){case"number":{let k=t.resolve(null,["--spacing"]);return!k||!xe(h.value.value)?void 0:p.position(`calc(${k} * ${h.value.value})`)}case"percentage":return T(h.value.value.slice(0,-1))?p.position(h.value.value):void 0;default:return}}}}),i(o,()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)},{values:Array.from({length:21},(h,A)=>`${A*5}%`),valueThemeKeys:["--gradient-color-stop-positions"]}]),i(o,()=>[{values:Array.from({length:21},(h,A)=>`${A*5}%`)},{values:t.get(["--spacing"])?at:[]},{values:["current","inherit","transparent"],valueThemeKeys:["--background-color","--color"],modifiers:Array.from({length:21},(h,A)=>`${A*5}`)}])}let b=()=>z([N("--tw-mask-left","linear-gradient(#fff, #fff)"),N("--tw-mask-right","linear-gradient(#fff, #fff)"),N("--tw-mask-bottom","linear-gradient(#fff, #fff)"),N("--tw-mask-top","linear-gradient(#fff, #fff)")]);function S(o,p,h){V(o,{color(A){let k=[y(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(k.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),k.push(z([N(`--tw-mask-${C}-from-position`,"0%"),N(`--tw-mask-${C}-to-position`,"100%"),N(`--tw-mask-${C}-from-color`,"black"),N(`--tw-mask-${C}-to-color`,"transparent")])),k.push(l(`--tw-mask-${C}-${p}-color`,A)));return k},position(A){let k=[y(),b(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)")];for(let C of["top","right","bottom","left"])h[C]&&(k.push(l(`--tw-mask-${C}`,`linear-gradient(to ${C}, var(--tw-mask-${C}-from-color) var(--tw-mask-${C}-from-position), var(--tw-mask-${C}-to-color) var(--tw-mask-${C}-to-position))`)),k.push(z([N(`--tw-mask-${C}-from-position`,"0%"),N(`--tw-mask-${C}-to-position`,"100%"),N(`--tw-mask-${C}-from-color`,"black"),N(`--tw-mask-${C}-to-color`,"transparent")])),k.push(l(`--tw-mask-${C}-${p}-position`,A)));return k}})}S("mask-x-from","from",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-x-to","to",{top:!1,right:!0,bottom:!1,left:!0}),S("mask-y-from","from",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-y-to","to",{top:!0,right:!1,bottom:!0,left:!1}),S("mask-t-from","from",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-t-to","to",{top:!0,right:!1,bottom:!1,left:!1}),S("mask-r-from","from",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-r-to","to",{top:!1,right:!0,bottom:!1,left:!1}),S("mask-b-from","from",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-b-to","to",{top:!1,right:!1,bottom:!0,left:!1}),S("mask-l-from","from",{top:!1,right:!1,bottom:!1,left:!0}),S("mask-l-to","to",{top:!1,right:!1,bottom:!1,left:!0});let R=()=>z([N("--tw-mask-linear-position","0deg"),N("--tw-mask-linear-from-position","0%"),N("--tw-mask-linear-to-position","100%"),N("--tw-mask-linear-from-color","black"),N("--tw-mask-linear-to-color","transparent")]);n("mask-linear",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(o){return T(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return T(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops, var(--tw-mask-linear-position)))"),l("--tw-mask-linear-position",o)]}),i("mask-linear",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),V("mask-linear-from",{color:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-color",o)],position:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-from-position",o)]}),V("mask-linear-to",{color:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-color",o)],position:o=>[y(),R(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-linear","linear-gradient(var(--tw-mask-linear-stops))"),l("--tw-mask-linear-to-position",o)]});let L=()=>z([N("--tw-mask-radial-from-position","0%"),N("--tw-mask-radial-to-position","100%"),N("--tw-mask-radial-from-color","black"),N("--tw-mask-radial-to-color","transparent"),N("--tw-mask-radial-shape","ellipse"),N("--tw-mask-radial-size","farthest-corner"),N("--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:o=>[l("--tw-mask-radial-position",o)]}),n("mask-radial",{defaultValue:null,supportsNegative:!1,supportsFractions:!1,handle:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops, var(--tw-mask-radial-size)))"),l("--tw-mask-radial-size",o)]}),V("mask-radial-from",{color:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-color",o)],position:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-from-position",o)]}),V("mask-radial-to",{color:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-color",o)],position:o=>[y(),L(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-radial","radial-gradient(var(--tw-mask-radial-stops))"),l("--tw-mask-radial-to-position",o)]});let P=()=>z([N("--tw-mask-conic-position","0deg"),N("--tw-mask-conic-from-position","0%"),N("--tw-mask-conic-to-position","100%"),N("--tw-mask-conic-from-color","black"),N("--tw-mask-conic-to-color","transparent")]);n("mask-conic",{defaultValue:null,supportsNegative:!0,supportsFractions:!1,handleBareValue(o){return T(o.value)?`calc(1deg * ${o.value})`:null},handleNegativeBareValue(o){return T(o.value)?`calc(1deg * -${o.value})`:null},handle:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops, var(--tw-mask-conic-position)))"),l("--tw-mask-conic-position",o)]}),i("mask-conic",()=>[{supportsNegative:!0,values:["0","1","2","3","6","12","45","90","180"]}]),V("mask-conic-from",{color:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-color",o)],position:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-from-position",o)]}),V("mask-conic-to",{color:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-color",o)],position:o=>[y(),P(),l("mask-image","var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)"),l("mask-composite","intersect"),l("--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)"),l("--tw-mask-conic","conic-gradient(var(--tw-mask-conic-stops))"),l("--tw-mask-conic-to-position",o)]}),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 o of["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"])e(`bg-blend-${o}`,[["background-blend-mode",o]]),e(`mix-blend-${o}`,[["mix-blend-mode",o]]);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",o=>{if(!o.value)return;if(o.value.kind==="arbitrary"){let h=X(o.value.value,o.modifier,t);return h===null?void 0:[l("fill",h)]}let p=te(o,t,["--fill","--color"]);if(p)return[l("fill",p)]}),i("fill",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--fill","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)}]),e("stroke-none",[["stroke","none"]]),r.functional("stroke",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","number","length","percentage"])){case"number":case"length":case"percentage":return o.modifier?void 0:[l("stroke-width",p)];default:return p=X(o.value.value,o.modifier,t),p===null?void 0:[l("stroke",p)]}}{let p=te(o,t,["--stroke","--color"]);if(p)return[l("stroke",p)]}{let p=t.resolve(o.value.value,["--stroke-width"]);if(p)return[l("stroke-width",p)];if(T(o.value.value))return[l("stroke-width",o.value.value)]}}}),i("stroke",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--stroke","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*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"]]),e("object-top",[["object-position","top"]]),e("object-top-left",[["object-position","left top"]]),e("object-top-right",[["object-position","right top"]]),e("object-bottom",[["object-position","bottom"]]),e("object-bottom-left",[["object-position","left bottom"]]),e("object-bottom-right",[["object-position","right bottom"]]),e("object-left",[["object-position","left"]]),e("object-right",[["object-position","right"]]),e("object-center",[["object-position","center"]]),n("object",{themeKeys:["--object-position"],handle:o=>[l("object-position",o)]});for(let[o,p]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(o,["--padding","--spacing"],h=>[l(p,h)]);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"],o=>[l("text-indent",o)],{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:o=>[l("vertical-align",o)]}),r.functional("font",o=>{if(!(!o.value||o.modifier)){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["number","generic-name","family-name"])){case"generic-name":case"family-name":return[l("font-family",p)];default:return[z([N("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}{let p=t.resolveWith(o.value.value,["--font"],["--font-feature-settings","--font-variation-settings"]);if(p){let[h,A={}]=p;return[l("font-family",h),l("font-feature-settings",A["--font-feature-settings"]),l("font-variation-settings",A["--font-variation-settings"])]}}{let p=t.resolve(o.value.value,["--font-weight"]);if(p)return[z([N("--tw-font-weight")]),l("--tw-font-weight",p),l("font-weight",p)]}}}),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:o})=>{if(!o.endsWith("%"))return null;let p=Number(o.slice(0,-1));return!T(p)||Number.isNaN(p)||p<50||p>200?null:o},handle:o=>[l("font-stretch",o)]}),i("font-stretch",()=>[{values:["50%","75%","90%","95%","100%","105%","110%","125%","150%","200%"]}]),s("placeholder",{themeKeys:["--background-color","--color"],handle:o=>[M("&::placeholder",[l("--tw-sort","placeholder-color"),l("color",o)])]}),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",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","length","percentage"])){case"length":case"percentage":return o.modifier?void 0:[l("text-decoration-thickness",p)];default:return p=X(p,o.modifier,t),p===null?void 0:[l("text-decoration-color",p)]}}{let p=t.resolve(o.value.value,["--text-decoration-thickness"]);if(p)return o.modifier?void 0:[l("text-decoration-thickness",p)];if(T(o.value.value))return o.modifier?void 0:[l("text-decoration-thickness",`${o.value.value}px`)]}{let p=te(o,t,["--text-decoration-color","--color"]);if(p)return[l("text-decoration-color",p)]}}}),i("decoration",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-decoration-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2"],valueThemeKeys:["--text-decoration-thickness"]}]),e("animate-none",[["animation","none"]]),n("animate",{themeKeys:["--animate"],handle:o=>[l("animation",o)]});{let o=["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(" "),p=["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(" "),h=()=>z([N("--tw-blur"),N("--tw-brightness"),N("--tw-contrast"),N("--tw-grayscale"),N("--tw-hue-rotate"),N("--tw-invert"),N("--tw-opacity"),N("--tw-saturate"),N("--tw-sepia"),N("--tw-drop-shadow"),N("--tw-drop-shadow-color"),N("--tw-drop-shadow-alpha","100%",""),N("--tw-drop-shadow-size")]),A=()=>z([N("--tw-backdrop-blur"),N("--tw-backdrop-brightness"),N("--tw-backdrop-contrast"),N("--tw-backdrop-grayscale"),N("--tw-backdrop-hue-rotate"),N("--tw-backdrop-invert"),N("--tw-backdrop-opacity"),N("--tw-backdrop-saturate"),N("--tw-backdrop-sepia")]);r.functional("filter",k=>{if(!k.modifier){if(k.value===null)return[h(),l("filter",o)];if(k.value.kind==="arbitrary")return[l("filter",k.value.value)];switch(k.value.value){case"none":return[l("filter","none")]}}}),r.functional("backdrop-filter",k=>{if(!k.modifier){if(k.value===null)return[A(),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)];if(k.value.kind==="arbitrary")return[l("-webkit-backdrop-filter",k.value.value),l("backdrop-filter",k.value.value)];switch(k.value.value){case"none":return[l("-webkit-backdrop-filter","none"),l("backdrop-filter","none")]}}}),n("blur",{themeKeys:["--blur"],handle:k=>[h(),l("--tw-blur",`blur(${k})`),l("filter",o)]}),e("blur-none",[h,["--tw-blur"," "],["filter",o]]),n("backdrop-blur",{themeKeys:["--backdrop-blur","--blur"],handle:k=>[A(),l("--tw-backdrop-blur",`blur(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),e("backdrop-blur-none",[A,["--tw-backdrop-blur"," "],["-webkit-backdrop-filter",p],["backdrop-filter",p]]),n("brightness",{themeKeys:["--brightness"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-brightness",`brightness(${k})`),l("filter",o)]}),n("backdrop-brightness",{themeKeys:["--backdrop-brightness","--brightness"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-brightness",`brightness(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-contrast",`contrast(${k})`),l("filter",o)]}),n("backdrop-contrast",{themeKeys:["--backdrop-contrast","--contrast"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-contrast",`contrast(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-grayscale",`grayscale(${k})`),l("filter",o)]}),n("backdrop-grayscale",{themeKeys:["--backdrop-grayscale","--grayscale"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-grayscale",`grayscale(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}deg`:null,handle:k=>[h(),l("--tw-hue-rotate",`hue-rotate(${k})`),l("filter",o)]}),n("backdrop-hue-rotate",{supportsNegative:!0,themeKeys:["--backdrop-hue-rotate","--hue-rotate"],handleBareValue:({value:k})=>T(k)?`${k}deg`:null,handle:k=>[A(),l("--tw-backdrop-hue-rotate",`hue-rotate(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-invert",`invert(${k})`),l("filter",o)]}),n("backdrop-invert",{themeKeys:["--backdrop-invert","--invert"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-invert",`invert(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,handle:k=>[h(),l("--tw-saturate",`saturate(${k})`),l("filter",o)]}),n("backdrop-saturate",{themeKeys:["--backdrop-saturate","--saturate"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-saturate",`saturate(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[h(),l("--tw-sepia",`sepia(${k})`),l("filter",o)]}),n("backdrop-sepia",{themeKeys:["--backdrop-sepia","--sepia"],handleBareValue:({value:k})=>T(k)?`${k}%`:null,defaultValue:"100%",handle:k=>[A(),l("--tw-backdrop-sepia",`sepia(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),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",[h,["--tw-drop-shadow"," "],["filter",o]]),r.functional("drop-shadow",k=>{let C;if(k.modifier&&(k.modifier.kind==="arbitrary"?C=k.modifier.value:T(k.modifier.value)&&(C=`${k.modifier.value}%`)),!k.value){let O=t.get(["--drop-shadow"]),$=t.resolve(null,["--drop-shadow"]);return O===null||$===null?void 0:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow",D($,",").map(E=>`drop-shadow(${E})`).join(" ")),l("filter",o)]}if(k.value.kind==="arbitrary"){let O=k.value.value;switch(k.value.dataType??Y(O,["color"])){case"color":return O=X(O,k.modifier,t),O===null?void 0:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")];default:return k.modifier&&!C?void 0:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]}}{let O=t.get([`--drop-shadow-${k.value.value}`]),$=t.resolve(k.value.value,["--drop-shadow"]);if(O&&$)return k.modifier&&!C?void 0:C?[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow","var(--tw-drop-shadow-size)"),l("filter",o)]:[h(),l("--tw-drop-shadow-alpha",C),...lt("--tw-drop-shadow-size",O,C,E=>`var(--tw-drop-shadow-color, ${E})`),l("--tw-drop-shadow",D($,",").map(E=>`drop-shadow(${E})`).join(" ")),l("filter",o)]}{let O=te(k,t,["--drop-shadow-color","--color"]);if(O)return O==="inherit"?[h(),l("--tw-drop-shadow-color","inherit"),l("--tw-drop-shadow","var(--tw-drop-shadow-size)")]:[h(),l("--tw-drop-shadow-color",Q(O,"var(--tw-drop-shadow-alpha)")),l("--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},(k,C)=>`${C*5}`)},{valueThemeKeys:["--drop-shadow"]}]),n("backdrop-opacity",{themeKeys:["--backdrop-opacity","--opacity"],handleBareValue:({value:k})=>ot(k)?`${k}%`:null,handle:k=>[A(),l("--tw-backdrop-opacity",`opacity(${k})`),l("-webkit-backdrop-filter",p),l("backdrop-filter",p)]}),i("backdrop-opacity",()=>[{values:Array.from({length:21},(k,C)=>`${C*5}`),valueThemeKeys:["--backdrop-opacity","--opacity"]}])}{let o=`var(--tw-ease, ${t.resolve(null,["--default-transition-timing-function"])??"ease"})`,p=`var(--tw-duration, ${t.resolve(null,["--default-transition-duration"])??"0s"})`;e("transition-none",[["transition-property","none"]]),e("transition-all",[["transition-property","all"],["transition-timing-function",o],["transition-duration",p]]),e("transition-colors",[["transition-property","color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to"],["transition-timing-function",o],["transition-duration",p]]),e("transition-opacity",[["transition-property","opacity"],["transition-timing-function",o],["transition-duration",p]]),e("transition-shadow",[["transition-property","box-shadow"],["transition-timing-function",o],["transition-duration",p]]),e("transition-transform",[["transition-property","transform, translate, scale, rotate"],["transition-timing-function",o],["transition-duration",p]]),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, visibility, content-visibility, overlay, pointer-events",themeKeys:["--transition-property"],handle:h=>[l("transition-property",h),l("transition-timing-function",o),l("transition-duration",p)]}),e("transition-discrete",[["transition-behavior","allow-discrete"]]),e("transition-normal",[["transition-behavior","normal"]]),n("delay",{handleBareValue:({value:h})=>T(h)?`${h}ms`:null,themeKeys:["--transition-delay"],handle:h=>[l("transition-delay",h)]});{let h=()=>z([N("--tw-duration")]);e("duration-initial",[h,["--tw-duration","initial"]]),r.functional("duration",A=>{if(A.modifier||!A.value)return;let k=null;if(A.value.kind==="arbitrary"?k=A.value.value:(k=t.resolve(A.value.fraction??A.value.value,["--transition-duration"]),k===null&&T(A.value.value)&&(k=`${A.value.value}ms`)),k!==null)return[h(),l("--tw-duration",k),l("transition-duration",k)]})}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 o=()=>z([N("--tw-ease")]);e("ease-initial",[o,["--tw-ease","initial"]]),e("ease-linear",[o,["--tw-ease","linear"],["transition-timing-function","linear"]]),n("ease",{themeKeys:["--ease"],handle:p=>[o(),l("--tw-ease",p),l("transition-timing-function",p)]})}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:o=>[l("will-change",o)]}),e("content-none",[["--tw-content","none"],["content","none"]]),n("content",{themeKeys:[],handle:o=>[z([N("--tw-content",'""')]),l("--tw-content",o),l("content","var(--tw-content)")]});{let o="var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)",p=()=>z([N("--tw-contain-size"),N("--tw-contain-layout"),N("--tw-contain-paint"),N("--tw-contain-style")]);e("contain-none",[["contain","none"]]),e("contain-content",[["contain","content"]]),e("contain-strict",[["contain","strict"]]),e("contain-size",[p,["--tw-contain-size","size"],["contain",o]]),e("contain-inline-size",[p,["--tw-contain-size","inline-size"],["contain",o]]),e("contain-layout",[p,["--tw-contain-layout","layout"],["contain",o]]),e("contain-paint",[p,["--tw-contain-paint","paint"],["contain",o]]),e("contain-style",[p,["--tw-contain-style","style"],["contain",o]]),n("contain",{themeKeys:[],handle:h=>[l("contain",h)]})}e("forced-color-adjust-none",[["forced-color-adjust","none"]]),e("forced-color-adjust-auto",[["forced-color-adjust","auto"]]),e("leading-none",[()=>z([N("--tw-leading")]),["--tw-leading","1"],["line-height","1"]]),a("leading",["--leading","--spacing"],o=>[z([N("--tw-leading")]),l("--tw-leading",o),l("line-height",o)]),n("tracking",{supportsNegative:!0,themeKeys:["--tracking"],handle:o=>[z([N("--tw-tracking")]),l("--tw-tracking",o),l("letter-spacing",o)]}),e("antialiased",[["-webkit-font-smoothing","antialiased"],["-moz-osx-font-smoothing","grayscale"]]),e("subpixel-antialiased",[["-webkit-font-smoothing","auto"],["-moz-osx-font-smoothing","auto"]]);{let o="var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)",p=()=>z([N("--tw-ordinal"),N("--tw-slashed-zero"),N("--tw-numeric-figure"),N("--tw-numeric-spacing"),N("--tw-numeric-fraction")]);e("normal-nums",[["font-variant-numeric","normal"]]),e("ordinal",[p,["--tw-ordinal","ordinal"],["font-variant-numeric",o]]),e("slashed-zero",[p,["--tw-slashed-zero","slashed-zero"],["font-variant-numeric",o]]),e("lining-nums",[p,["--tw-numeric-figure","lining-nums"],["font-variant-numeric",o]]),e("oldstyle-nums",[p,["--tw-numeric-figure","oldstyle-nums"],["font-variant-numeric",o]]),e("proportional-nums",[p,["--tw-numeric-spacing","proportional-nums"],["font-variant-numeric",o]]),e("tabular-nums",[p,["--tw-numeric-spacing","tabular-nums"],["font-variant-numeric",o]]),e("diagonal-fractions",[p,["--tw-numeric-fraction","diagonal-fractions"],["font-variant-numeric",o]]),e("stacked-fractions",[p,["--tw-numeric-fraction","stacked-fractions"],["font-variant-numeric",o]])}{let o=()=>z([N("--tw-outline-style","solid")]);r.static("outline-hidden",()=>[l("--tw-outline-style","none"),l("outline-style","none"),F("@media","(forced-colors: active)",[l("outline","2px solid transparent"),l("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",p=>{if(p.value===null){if(p.modifier)return;let h=t.get(["--default-outline-width"])??"1px";return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)]}if(p.value.kind==="arbitrary"){let h=p.value.value;switch(p.value.dataType??Y(h,["color","length","number","percentage"])){case"length":case"number":case"percentage":return p.modifier?void 0:[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];default:return h=X(h,p.modifier,t),h===null?void 0:[l("outline-color",h)]}}{let h=te(p,t,["--outline-color","--color"]);if(h)return[l("outline-color",h)]}{if(p.modifier)return;let h=t.resolve(p.value.value,["--outline-width"]);if(h)return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",h)];if(T(p.value.value))return[o(),l("outline-style","var(--tw-outline-style)"),l("outline-width",`${p.value.value}px`)]}}),i("outline",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--outline-color","--color"],modifiers:Array.from({length:21},(p,h)=>`${h*5}`),hasDefaultValue:!0},{values:["0","1","2","4","8"],valueThemeKeys:["--outline-width"]}]),n("outline-offset",{supportsNegative:!0,themeKeys:["--outline-offset"],handleBareValue:({value:p})=>T(p)?`${p}px`:null,handle:p=>[l("outline-offset",p)]}),i("outline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--outline-offset"]}])}n("opacity",{themeKeys:["--opacity"],handleBareValue:({value:o})=>ot(o)?`${o}%`:null,handle:o=>[l("opacity",o)]}),i("opacity",()=>[{values:Array.from({length:21},(o,p)=>`${p*5}`),valueThemeKeys:["--opacity"]}]),e("underline-offset-auto",[["text-underline-offset","auto"]]),n("underline-offset",{supportsNegative:!0,themeKeys:["--text-underline-offset"],handleBareValue:({value:o})=>T(o)?`${o}px`:null,handle:o=>[l("text-underline-offset",o)]}),i("underline-offset",()=>[{supportsNegative:!0,values:["0","1","2","4","8"],valueThemeKeys:["--text-underline-offset"]}]),r.functional("text",o=>{if(o.value){if(o.value.kind==="arbitrary"){let p=o.value.value;switch(o.value.dataType??Y(p,["color","length","percentage","absolute-size","relative-size"])){case"size":case"length":case"percentage":case"absolute-size":case"relative-size":{if(o.modifier){let A=o.modifier.kind==="arbitrary"?o.modifier.value:t.resolve(o.modifier.value,["--leading"]);if(!A&&xe(o.modifier.value)){let k=t.resolve(null,["--spacing"]);if(!k)return null;A=`calc(${k} * ${o.modifier.value})`}return!A&&o.modifier.value==="none"&&(A="1"),A?[l("font-size",p),l("line-height",A)]:null}return[l("font-size",p)]}default:return p=X(p,o.modifier,t),p===null?void 0:[l("color",p)]}}{let p=te(o,t,["--text-color","--color"]);if(p)return[l("color",p)]}{let p=t.resolveWith(o.value.value,["--text"],["--line-height","--letter-spacing","--font-weight"]);if(p){let[h,A={}]=Array.isArray(p)?p:[p];if(o.modifier){let k=o.modifier.kind==="arbitrary"?o.modifier.value:t.resolve(o.modifier.value,["--leading"]);if(!k&&xe(o.modifier.value)){let O=t.resolve(null,["--spacing"]);if(!O)return null;k=`calc(${O} * ${o.modifier.value})`}if(!k&&o.modifier.value==="none"&&(k="1"),!k)return null;let C=[l("font-size",h)];return k&&C.push(l("line-height",k)),C}return typeof A=="string"?[l("font-size",h),l("line-height",A)]:[l("font-size",h),l("line-height",A["--line-height"]?`var(--tw-leading, ${A["--line-height"]})`:void 0),l("letter-spacing",A["--letter-spacing"]?`var(--tw-tracking, ${A["--letter-spacing"]})`:void 0),l("font-weight",A["--font-weight"]?`var(--tw-font-weight, ${A["--font-weight"]})`:void 0)]}}}}),i("text",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:[],valueThemeKeys:["--text"],modifiers:[],modifierThemeKeys:["--leading"]}]);let K=()=>z([N("--tw-text-shadow-color"),N("--tw-text-shadow-alpha","100%","")]);e("text-shadow-initial",[K,["--tw-text-shadow-color","initial"]]),r.functional("text-shadow",o=>{let p;if(o.modifier&&(o.modifier.kind==="arbitrary"?p=o.modifier.value:T(o.modifier.value)&&(p=`${o.modifier.value}%`)),!o.value){let h=t.get(["--text-shadow"]);return h===null?void 0:[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}if(o.value.kind==="arbitrary"){let h=o.value.value;switch(o.value.dataType??Y(h,["color"])){case"color":return h=X(h,o.modifier,t),h===null?void 0:[K(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))];default:return[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,k=>`var(--tw-text-shadow-color, ${k})`)]}}switch(o.value.value){case"none":return o.modifier?void 0:[K(),l("text-shadow","none")];case"inherit":return o.modifier?void 0:[K(),l("--tw-text-shadow-color","inherit")]}{let h=t.get([`--text-shadow-${o.value.value}`]);if(h)return[K(),l("--tw-text-shadow-alpha",p),...pe("text-shadow",h,p,A=>`var(--tw-text-shadow-color, ${A})`)]}{let h=te(o,t,["--text-shadow-color","--color"]);if(h)return[K(),l("--tw-text-shadow-color",Q(h,"var(--tw-text-shadow-alpha)"))]}}),i("text-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--text-shadow-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["none"]},{valueThemeKeys:["--text-shadow"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`),hasDefaultValue:t.get(["--text-shadow"])!==null}]);{let k=function($){return`var(--tw-ring-inset,) 0 0 0 calc(${$} + var(--tw-ring-offset-width)) var(--tw-ring-color, ${A})`},C=function($){return`inset 0 0 0 ${$} var(--tw-inset-ring-color, currentcolor)`};var J=k,ie=C;let o=["var(--tw-inset-shadow)","var(--tw-inset-ring-shadow)","var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow)"].join(", "),p="0 0 #0000",h=()=>z([N("--tw-shadow",p),N("--tw-shadow-color"),N("--tw-shadow-alpha","100%",""),N("--tw-inset-shadow",p),N("--tw-inset-shadow-color"),N("--tw-inset-shadow-alpha","100%",""),N("--tw-ring-color"),N("--tw-ring-shadow",p),N("--tw-inset-ring-color"),N("--tw-inset-ring-shadow",p),N("--tw-ring-inset"),N("--tw-ring-offset-width","0px",""),N("--tw-ring-offset-color","#fff"),N("--tw-ring-offset-shadow",p)]);e("shadow-initial",[h,["--tw-shadow-color","initial"]]),r.functional("shadow",$=>{let E;if($.modifier&&($.modifier.kind==="arbitrary"?E=$.modifier.value:T($.modifier.value)&&(E=`${$.modifier.value}%`)),!$.value){let U=t.get(["--shadow"]);return U===null?void 0:[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,ae=>`var(--tw-shadow-color, ${ae})`),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let U=$.value.value;switch($.value.dataType??Y(U,["color"])){case"color":return U=X(U,$.modifier,t),U===null?void 0:[h(),l("--tw-shadow-color",Q(U,"var(--tw-shadow-alpha)"))];default:return[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,wt=>`var(--tw-shadow-color, ${wt})`),l("box-shadow",o)]}}switch($.value.value){case"none":return $.modifier?void 0:[h(),l("--tw-shadow",p),l("box-shadow",o)];case"inherit":return $.modifier?void 0:[h(),l("--tw-shadow-color","inherit")]}{let U=t.get([`--shadow-${$.value.value}`]);if(U)return[h(),l("--tw-shadow-alpha",E),...pe("--tw-shadow",U,E,ae=>`var(--tw-shadow-color, ${ae})`),l("box-shadow",o)]}{let U=te($,t,["--box-shadow-color","--color"]);if(U)return[h(),l("--tw-shadow-color",Q(U,"var(--tw-shadow-alpha)"))]}}),i("shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["none"]},{valueThemeKeys:["--shadow"],modifiers:Array.from({length:21},($,E)=>`${E*5}`),hasDefaultValue:t.get(["--shadow"])!==null}]),e("inset-shadow-initial",[h,["--tw-inset-shadow-color","initial"]]),r.functional("inset-shadow",$=>{let E;if($.modifier&&($.modifier.kind==="arbitrary"?E=$.modifier.value:T($.modifier.value)&&(E=`${$.modifier.value}%`)),!$.value){let U=t.get(["--inset-shadow"]);return U===null?void 0:[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,ae=>`var(--tw-inset-shadow-color, ${ae})`),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let U=$.value.value;switch($.value.dataType??Y(U,["color"])){case"color":return U=X(U,$.modifier,t),U===null?void 0:[h(),l("--tw-inset-shadow-color",Q(U,"var(--tw-inset-shadow-alpha)"))];default:return[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,wt=>`var(--tw-inset-shadow-color, ${wt})`,"inset "),l("box-shadow",o)]}}switch($.value.value){case"none":return $.modifier?void 0:[h(),l("--tw-inset-shadow",p),l("box-shadow",o)];case"inherit":return $.modifier?void 0:[h(),l("--tw-inset-shadow-color","inherit")]}{let U=t.get([`--inset-shadow-${$.value.value}`]);if(U)return[h(),l("--tw-inset-shadow-alpha",E),...pe("--tw-inset-shadow",U,E,ae=>`var(--tw-inset-shadow-color, ${ae})`),l("box-shadow",o)]}{let U=te($,t,["--box-shadow-color","--color"]);if(U)return[h(),l("--tw-inset-shadow-color",Q(U,"var(--tw-inset-shadow-alpha)"))]}}),i("inset-shadow",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--box-shadow-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["none"]},{valueThemeKeys:["--inset-shadow"],modifiers:Array.from({length:21},($,E)=>`${E*5}`),hasDefaultValue:t.get(["--inset-shadow"])!==null}]),e("ring-inset",[h,["--tw-ring-inset","inset"]]);let A=t.get(["--default-ring-color"])??"currentcolor";r.functional("ring",$=>{if(!$.value){if($.modifier)return;let E=t.get(["--default-ring-width"])??"1px";return[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)]}if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-ring-color",E)]}}{let E=te($,t,["--ring-color","--color"]);if(E)return[l("--tw-ring-color",E)]}{if($.modifier)return;let E=t.resolve($.value.value,["--ring-width"]);if(E===null&&T($.value.value)&&(E=`${$.value.value}px`),E)return[h(),l("--tw-ring-shadow",k(E)),l("box-shadow",o)]}}),i("ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]),r.functional("inset-ring",$=>{if(!$.value)return $.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C("1px")),l("box-shadow",o)];if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[h(),l("--tw-inset-ring-shadow",C(E)),l("box-shadow",o)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-inset-ring-color",E)]}}{let E=te($,t,["--ring-color","--color"]);if(E)return[l("--tw-inset-ring-color",E)]}{if($.modifier)return;let E=t.resolve($.value.value,["--ring-width"]);if(E===null&&T($.value.value)&&(E=`${$.value.value}px`),E)return[h(),l("--tw-inset-ring-shadow",C(E)),l("box-shadow",o)]}}),i("inset-ring",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-color","--color"],modifiers:Array.from({length:21},($,E)=>`${E*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-width"],hasDefaultValue:!0}]);let O="var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)";r.functional("ring-offset",$=>{if($.value){if($.value.kind==="arbitrary"){let E=$.value.value;switch($.value.dataType??Y(E,["color","length"])){case"length":return $.modifier?void 0:[l("--tw-ring-offset-width",E),l("--tw-ring-offset-shadow",O)];default:return E=X(E,$.modifier,t),E===null?void 0:[l("--tw-ring-offset-color",E)]}}{let E=t.resolve($.value.value,["--ring-offset-width"]);if(E)return $.modifier?void 0:[l("--tw-ring-offset-width",E),l("--tw-ring-offset-shadow",O)];if(T($.value.value))return $.modifier?void 0:[l("--tw-ring-offset-width",`${$.value.value}px`),l("--tw-ring-offset-shadow",O)]}{let E=te($,t,["--ring-offset-color","--color"]);if(E)return[l("--tw-ring-offset-color",E)]}}})}return i("ring-offset",()=>[{values:["current","inherit","transparent"],valueThemeKeys:["--ring-offset-color","--color"],modifiers:Array.from({length:21},(o,p)=>`${p*5}`)},{values:["0","1","2","4","8"],valueThemeKeys:["--ring-offset-width"]}]),r.functional("@container",o=>{let p=null;if(o.value===null?p="inline-size":o.value.kind==="arbitrary"?p=o.value.value:o.value.kind==="named"&&o.value.value==="normal"&&(p="normal"),p!==null)return o.modifier?[l("container-type",p),l("container-name",o.modifier.value)]:[l("container-type",p)]}),i("@container",()=>[{values:["normal"],valueThemeKeys:[],hasDefaultValue:!0}]),r}var _t=["number","integer","ratio","percentage"];function Sr(t){let r=t.params;return kn.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=q(n.value);ee(s,a=>{if(a.kind!=="function")return;if(a.value==="--spacing"&&!(e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return ee(a.nodes,u=>{if(u.kind!=="function"||u.value!=="--value"&&u.value!=="--modifier")return;let c=u.value;for(let d of u.nodes)if(d.kind==="word"){if(d.value==="integer")e[c].usedSpacingInteger||=!0;else if(d.value==="number"&&(e[c].usedSpacingNumber||=!0,e["--modifier"].usedSpacingNumber&&e["--value"].usedSpacingNumber))return 2}}),0;if(a.value!=="--value"&&a.value!=="--modifier")return;let f=D(Z(a.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;a.nodes=q(f.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 c=u.value.slice(1,-1);e[a.value].literals.add(c)}else if(u.kind==="word"&&u.value[0]==="-"&&u.value[1]==="-"){let c=u.value.replace(/-\*.*$/g,"");e[a.value].themeKeys.add(c)}else if(u.kind==="word"&&!(u.value[0]==="["&&u.value[u.value.length-1]==="]")&&!_t.includes(u.value)){console.warn(`Unsupported bare value data type: "${u.value}". +Only valid data types are: ${_t.map(x=>`"${x}"`).join(", ")}. +`);let c=u.value,d=structuredClone(a),m="\xB6";ee(d.nodes,(x,{replaceWith:y})=>{x.kind==="word"&&x.value===c&&y({kind:"word",value:m})});let g="^".repeat(Z([u]).length),w=Z([d]).indexOf(m),v=["```css",Z([a])," ".repeat(w)+g,"```"].join(` +`);console.warn(v)}}),n.value=Z(s)}),i.utilities.functional(r.slice(0,-2),n=>{let s=structuredClone(t),a=n.value,f=n.modifier;if(a===null)return;let u=!1,c=!1,d=!1,m=!1,g=new Map,w=!1;if(I([s],(v,{parent:x,replaceWith:y})=>{if(x?.kind!=="rule"&&x?.kind!=="at-rule"||v.kind!=="declaration"||!v.value)return;let V=q(v.value);(ee(V,(S,{replaceWith:R})=>{if(S.kind==="function"){if(S.value==="--value"){u=!0;let L=Cr(a,S,i);return L?(c=!0,L.ratio?w=!0:g.set(v,x),R(L.nodes),1):(u||=!1,y([]),2)}else if(S.value==="--modifier"){if(f===null)return y([]),2;d=!0;let L=Cr(f,S,i);return L?(m=!0,R(L.nodes),1):(d||=!1,y([]),2)}}})??0)===0&&(v.value=Z(V))}),u&&!c||d&&!m||w&&m||f&&!w&&!m)return null;if(w)for(let[v,x]of g){let y=x.nodes.indexOf(v);y!==-1&&x.nodes.splice(y,1)}return s.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:f,usedSpacingNumber:u,usedSpacingInteger:c,themeKeys:d}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let m of f)a.push(m);if(u)a.push(...at);else if(c)for(let m of at)T(m)&&a.push(m);for(let m of i.theme.keysInNamespaces(d))a.push(m.replace($r,(g,w,v)=>`${w}.${v}`))}return[{values:n,modifiers:s}]})}:wn.test(r)?i=>{i.utilities.static(r,()=>structuredClone(t.nodes))}:null}function Cr(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:q(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:q(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],f=i.theme.resolveWith(t.value,a,s);if(f){let[,u={}]=f;{let c=u[s.pop()];if(c)return{nodes:q(c)}}}}}else if(t.kind==="named"&&e.kind==="word"){if(!_t.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in t?t.fraction:t.value;if(!n)continue;let s=Y(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[a,f]=D(n,"/");if(!T(a)||!T(f))continue}else{if(s==="number"&&!xe(n))continue;if(s==="percentage"&&!T(n.slice(0,-1)))continue}return{nodes:q(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:q(t.value)};if("dataType"in t&&t.dataType&&t.dataType!==n)continue;if("dataType"in t&&t.dataType)return{nodes:q(t.value)};if(Y(t.value,[n])!==null)return{nodes:q(t.value)}}}}function pe(t,r,i,e,n=""){let s=!1,a=Ue(r,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Nr(u,i))));function f(u){return n?D(u,",").map(c=>n+c).join(","):u}return s?[l(t,f(Ue(r,e))),G("@supports (color: lab(from red l a b))",[l(t,f(a))])]:[l(t,f(a))]}function lt(t,r,i,e,n=""){let s=!1,a=D(r,",").map(f=>Ue(f,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Nr(u,i))))).map(f=>`drop-shadow(${f})`).join(" ");return s?[l(t,n+D(r,",").map(f=>`drop-shadow(${Ue(f,e)})`).join(" ")),G("@supports (color: lab(from red l a b))",[l(t,n+a)])]:[l(t,n+a)]}var Dt={"--alpha":bn,"--spacing":yn,"--theme":xn,theme:An};function bn(t,r,i,...e){let[n,s]=D(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 yn(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 xn(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 f=q(s);return Nn(f,a),Z(f)}return s}function An(t,r,i,...e){i=Cn(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 Er=new RegExp(Object.keys(Dt).map(t=>`${t}\\(`).join("|"));function Ve(t,r){let i=0;return I(t,e=>{if(e.kind==="declaration"&&e.value&&Er.test(e.value)){i|=8,e.value=Tr(e.value,e,r);return}e.kind==="at-rule"&&(e.name==="@media"||e.name==="@custom-media"||e.name==="@container"||e.name==="@supports")&&Er.test(e.params)&&(i|=8,e.params=Tr(e.params,e,r))}),i}function Tr(t,r,i){let e=q(t);return ee(e,(n,{replaceWith:s})=>{if(n.kind==="function"&&n.value in Dt){let a=D(Z(n.nodes).trim(),",").map(u=>u.trim()),f=Dt[n.value](i,r,...a);return s(q(f))}}),Z(e)}function Cn(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 st(t,r){let i=t.length,e=r.length,n=i=48&&a<=57&&f>=48&&f<=57){let u=s,c=s+1,d=s,m=s+1;for(a=t.charCodeAt(c);a>=48&&a<=57;)a=t.charCodeAt(++c);for(f=r.charCodeAt(m);f>=48&&f<=57;)f=r.charCodeAt(++m);let g=t.slice(u,c),w=r.slice(d,m),v=Number(g)-Number(w);if(v)return v;if(gw)return 1;continue}if(a!==f)return a-f}return t.length-r.length}var $n=/^\d+\/\d+$/;function Rr(t){let r=new B(n=>({name:n,utility:n,fraction:!1,modifiers:[]}));for(let n of t.utilities.keys("static")){let s=r.get(n);s.fraction=!1,s.modifiers=[]}for(let n of t.utilities.keys("functional")){let s=t.utilities.getCompletions(n);for(let a of s)for(let f of a.values){let u=f!==null&&$n.test(f),c=f===null?n:`${n}-${f}`,d=r.get(c);if(d.utility=n,d.fraction||=u,d.modifiers.push(...a.modifiers),a.supportsNegative){let m=r.get(`-${c}`);m.utility=`-${n}`,m.fraction||=u,m.modifiers.push(...a.modifiers)}}}if(r.size===0)return[];let i=Array.from(r.values());return i.sort((n,s)=>st(n.name,s.name)),Vn(i)}function Vn(t){let r=[],i=null,e=new Map,n=new B(()=>[]);for(let a of t){let{utility:f,fraction:u}=a;i||(i={utility:f,items:[]},e.set(f,i)),f!==i.utility&&(r.push(i),i={utility:f,items:[]},e.set(f,i)),u?n.get(f).push(a):i.items.push(a)}i&&r[r.length-1]!==i&&r.push(i);for(let[a,f]of n){let u=e.get(a);u&&u.items.push(...f)}let s=[];for(let a of r)for(let f of a.items)s.push([f.name,{modifiers:f.modifiers}]);return s}function Pr(t){let r=[];for(let[e,n]of t.variants.entries()){let f=function({value:u,modifier:c}={}){let d=e;u&&(d+=s?`-${u}`:u),c&&(d+=`/${c}`);let m=t.parseVariant(d);if(!m)return[];let g=M(".__placeholder__",[]);if(Ee(g,m,t.variants)===null)return[];let w=[];return Xe(g.nodes,(v,{path:x})=>{if(v.kind!=="rule"&&v.kind!=="at-rule"||v.nodes.length>0)return;x.sort((b,S)=>{let R=b.kind==="at-rule",L=S.kind==="at-rule";return R&&!L?-1:!R&&L?1:0});let y=x.flatMap(b=>b.kind==="rule"?b.selector==="&"?[]:[b.selector]:b.kind==="at-rule"?[`${b.name} ${b.params}`]:[]),V="";for(let b=y.length-1;b>=0;b--)V=V===""?y[b]:`${y[b]} { ${V} }`;w.push(V)}),w};var i=f;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:f});break}case"functional":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:f});break}case"compound":{r.push({name:e,values:a,isArbitrary:!0,hasDash:s,selectors:f});break}}}return r}function Or(t,r){let{astNodes:i,nodeSorting:e}=ge(Array.from(r),t),n=new Map(r.map(a=>[a,null])),s=0n;for(let a of i){let f=e.get(a)?.candidate;f&&n.set(f,n.get(f)??s++)}return r.map(a=>[a,n.get(a)??null])}var ut=/^@?[a-zA-Z0-9_-]*$/;var Kt=class{compareFns=new Map;variants=new Map;completions=new Map;groupOrder=null;lastOrder=0;static(r,i,{compounds:e,order:n}={}){this.set(r,{kind:"static",applyFn:i,compoundsWith:0,compounds:e??2,order:n})}fromAst(r,i){let e=[];I(i,n=>{n.kind==="rule"?e.push(n.selector):n.kind==="at-rule"&&n.name!=="@slot"&&e.push(`${n.name} ${n.params}`)}),this.static(r,n=>{let s=structuredClone(i);Ut(s,n.nodes),n.nodes=s},{compounds:Ae(e)})}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:Ae([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{g.nodes=d.map(w=>G(w,g.nodes))},{compounds:m})}i("*",[":is(& > *)"],{compounds:0}),i("**",[":is(& *)"],{compounds:0});function e(c,d){return d.map(m=>{m=m.trim();let g=D(m," ");return g[0]==="not"?g.slice(1).join(" "):c==="@container"?g[0][0]==="("?`not ${m}`:g[1]==="not"?`${g[0]} ${g.slice(2).join(" ")}`:`${g[0]} not ${g.slice(1).join(" ")}`:`not ${m}`})}let n=["@media","@supports","@container"];function s(c){for(let d of n){if(d!==c.name)continue;let m=D(c.params,",");return m.length>1?null:(m=e(c.name,m),F(c.name,m.join(", ")))}return null}function a(c){return c.includes("::")?null:`&:not(${D(c,",").map(m=>(m=m.replaceAll("&","*"),m)).join(", ")})`}r.compound("not",3,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative||d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule"&&g.kind!=="at-rule")return 0;if(g.nodes.length>0)return 0;let v=[],x=[];for(let V of w)V.kind==="at-rule"?v.push(V):V.kind==="rule"&&x.push(V);if(v.length>1)return 2;if(x.length>1)return 2;let y=[];for(let V of x){let b=a(V.selector);if(!b)return m=!1,2;y.push(M(b,[]))}for(let V of v){let b=s(V);if(!b)return m=!1,2;y.push(b)}return Object.assign(c,M("&",y)),m=!0,1}),c.kind==="rule"&&c.selector==="&"&&c.nodes.length===1&&Object.assign(c,c.nodes[0]),!m)return null}),r.suggest("not",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("not",c))),r.compound("group",2,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative)return null;let m=d.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}group\\/${d.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}group)`,g=!1;if(I([c],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let y of v.slice(0,-1))if(y.kind==="rule")return g=!1,2;let x=w.selector.replaceAll("&",m);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} *)`,g=!0}),!g)return null}),r.suggest("group",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("group",c))),r.compound("peer",2,(c,d)=>{if(d.variant.kind==="arbitrary"&&d.variant.relative)return null;let m=d.modifier?`:where(.${t.prefix?`${t.prefix}\\:`:""}peer\\/${d.modifier.value})`:`:where(.${t.prefix?`${t.prefix}\\:`:""}peer)`,g=!1;if(I([c],(w,{path:v})=>{if(w.kind!=="rule")return 0;for(let y of v.slice(0,-1))if(y.kind==="rule")return g=!1,2;let x=w.selector.replaceAll("&",m);D(x,",").length>1&&(x=`:is(${x})`),w.selector=`&:is(${x} ~ *)`,g=!0}),!g)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 z([F("@property","--tw-content",[l("syntax",'"*"'),l("initial-value",'""'),l("inherits","false")])])};var f=c;r.static("before",d=>{d.nodes=[M("&::before",[c(),l("content","var(--tw-content)"),...d.nodes])]},{compounds:0}),r.static("after",d=>{d.nodes=[M("&::after",[c(),l("content","var(--tw-content)"),...d.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=[M("&: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,d)=>{if(d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return m=!1,2;g.selector=`:where(${g.selector.replaceAll("&","*")}) &`,m=!0}),!m)return null}),r.suggest("in",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("in",c))),r.compound("has",2,(c,d)=>{if(d.modifier)return null;let m=!1;if(I([c],(g,{path:w})=>{if(g.kind!=="rule")return 0;for(let v of w.slice(0,-1))if(v.kind==="rule")return m=!1,2;g.selector=`&:has(${g.selector.replaceAll("&","*")})`,m=!0}),!m)return null}),r.suggest("has",()=>Array.from(r.keys()).filter(c=>r.compoundsWith("has",c))),r.functional("aria",(c,d)=>{if(!d.value||d.modifier)return null;d.value.kind==="arbitrary"?c.nodes=[M(`&[aria-${_r(d.value.value)}]`,c.nodes)]:c.nodes=[M(`&[aria-${d.value.value}="true"]`,c.nodes)]}),r.suggest("aria",()=>["busy","checked","disabled","expanded","hidden","pressed","readonly","required","selected"]),r.functional("data",(c,d)=>{if(!d.value||d.modifier)return null;c.nodes=[M(`&[data-${_r(d.value.value)}]`,c.nodes)]}),r.functional("nth",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-child(${d.value.value})`,c.nodes)]}),r.functional("nth-last",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-last-child(${d.value.value})`,c.nodes)]}),r.functional("nth-of-type",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-of-type(${d.value.value})`,c.nodes)]}),r.functional("nth-last-of-type",(c,d)=>{if(!d.value||d.modifier||d.value.kind==="named"&&!T(d.value.value))return null;c.nodes=[M(`&:nth-last-of-type(${d.value.value})`,c.nodes)]}),r.functional("supports",(c,d)=>{if(!d.value||d.modifier)return null;let m=d.value.value;if(m===null)return null;if(/^[\w-]*\s*\(/.test(m)){let g=m.replace(/\b(and|or|not)\b/g," $1 ");c.nodes=[F("@supports",g,c.nodes)];return}m.includes(":")||(m=`${m}: var(--tw)`),(m[0]!=="("||m[m.length-1]!==")")&&(m=`(${m})`),c.nodes=[F("@supports",m,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(d,m,g,w){if(d===m)return 0;let v=w.get(d);if(v===null)return g==="asc"?-1:1;let x=w.get(m);return x===null?g==="asc"?1:-1:ye(v,x,g)};var u=c;{let d=t.namespace("--breakpoint"),m=new B(g=>{switch(g.kind){case"static":return t.resolveValue(g.root,["--breakpoint"])??null;case"functional":{if(!g.value||g.modifier)return null;let w=null;return g.value.kind==="arbitrary"?w=g.value.value:g.value.kind==="named"&&(w=t.resolveValue(g.value.value,["--breakpoint"])),!w||w.includes("var(")?null:w}case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("max",(g,w)=>{if(w.modifier)return null;let v=m.get(w);if(v===null)return null;g.nodes=[F("@media",`(width < ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"desc",m)),r.suggest("max",()=>Array.from(d.keys()).filter(g=>g!==null)),r.group(()=>{for(let[g,w]of t.namespace("--breakpoint"))g!==null&&r.static(g,v=>{v.nodes=[F("@media",`(width >= ${w})`,v.nodes)]},{compounds:1});r.functional("min",(g,w)=>{if(w.modifier)return null;let v=m.get(w);if(v===null)return null;g.nodes=[F("@media",`(width >= ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"asc",m)),r.suggest("min",()=>Array.from(d.keys()).filter(g=>g!==null))}{let d=t.namespace("--container"),m=new B(g=>{switch(g.kind){case"functional":{if(g.value===null)return null;let w=null;return g.value.kind==="arbitrary"?w=g.value.value:g.value.kind==="named"&&(w=t.resolveValue(g.value.value,["--container"])),!w||w.includes("var(")?null:w}case"static":case"arbitrary":case"compound":return null}});r.group(()=>{r.functional("@max",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width < ${v})`:`(width < ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"desc",m)),r.suggest("@max",()=>Array.from(d.keys()).filter(g=>g!==null)),r.group(()=>{r.functional("@",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,g.nodes)]},{compounds:1}),r.functional("@min",(g,w)=>{let v=m.get(w);if(v===null)return null;g.nodes=[F("@container",w.modifier?`${w.modifier.value} (width >= ${v})`:`(width >= ${v})`,g.nodes)]},{compounds:1})},(g,w)=>c(g,w,"asc",m)),r.suggest("@min",()=>Array.from(d.keys()).filter(g=>g!==null)),r.suggest("@",()=>Array.from(d.keys()).filter(g=>g!==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 _r(t){if(t.includes("=")){let[r,...i]=D(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 Ut(t,r){I(t,(i,{replaceWith:e})=>{if(i.kind==="at-rule"&&i.name==="@slot")e(r);else if(i.kind==="at-rule"&&(i.name==="@keyframes"||i.name==="@property"))return Object.assign(i,z([F(i.name,i.params,i.nodes)])),1})}function Kr(t){let r=Vr(t),i=Dr(t),e=new B(u=>gr(u,f)),n=new B(u=>Array.from(mr(u,f))),s=new B(u=>{let c=Ur(u,f);try{Ve(c.map(({node:d})=>d),f)}catch{return[]}return c}),a=new B(u=>{for(let c of Qe(u))t.markUsedVariable(c)}),f={theme:t,utilities:r,variants:i,invalidCandidates:new Set,important:!1,candidatesToCss(u){let c=[];for(let d of u){let m=!1,{astNodes:g}=ge([d],this,{onInvalidCandidate(){m=!0}});g=be(g,f,0),g.length===0||m?c.push(null):c.push(oe(g))}return c},getClassOrder(u){return Or(this,u)},getClassList(){return Rr(this)},getVariants(){return Pr(this)},parseCandidate(u){return n.get(u)},parseVariant(u){return e.get(u)},compileAstNodes(u){return s.get(u)},printCandidate(u){return vr(f,u)},printVariant(u){return it(u)},getVariantOrder(){let u=Array.from(e.values());u.sort((g,w)=>this.variants.compare(g,w));let c=new Map,d,m=0;for(let g of u)g!==null&&(d!==void 0&&this.variants.compare(d,g)!==0&&m++,c.set(g,m),d=g);return c},resolveThemeValue(u,c=!0){let d=u.lastIndexOf("/"),m=null;d!==-1&&(m=u.slice(d+1).trim(),u=u.slice(0,d).trim());let g=t.resolve(null,[u],c?1:0)??void 0;return m&&g?Q(g,m):g},trackUsedVariables(u){a.get(u)}};return f}var Lt=["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 ge(t,r,{onInvalidCandidate:i}={}){let e=new Map,n=[],s=new Map;for(let f of t){if(r.invalidCandidates.has(f)){i?.(f);continue}let u=r.parseCandidate(f);if(u.length===0){i?.(f);continue}s.set(f,u)}let a=r.getVariantOrder();for(let[f,u]of s){let c=!1;for(let d of u){let m=r.compileAstNodes(d);if(m.length!==0){c=!0;for(let{node:g,propertySort:w}of m){let v=0n;for(let x of d.variants)v|=1n<{let c=e.get(f),d=e.get(u);if(c.variants-d.variants!==0n)return Number(c.variants-d.variants);let m=0;for(;m1)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,1}),t.nodes=a.nodes;return}if(n(t,r)===null)return null}function Lr(t){let r=t.options?.types??[];return r.length>1&&r.includes("any")}function Sn(t,r){if(t.kind==="arbitrary"){let a=t.value;return t.modifier&&(a=X(a,t.modifier,r.theme)),a===null?[]:[[l(t.property,a)]]}let i=r.utilities.get(t.root)??[],e=[],n=i.filter(a=>!Lr(a));for(let a of n){if(a.kind!==t.kind)continue;let f=a.compileFn(t);if(f!==void 0){if(f===null)return e;e.push(f)}}if(e.length>0)return e;let s=i.filter(a=>Lr(a));for(let a of s){if(a.kind!==t.kind)continue;let f=a.compileFn(t);if(f!==void 0){if(f===null)return e;e.push(f)}}return e}function jr(t){for(let r of t)r.kind!=="at-root"&&(r.kind==="declaration"?r.important=!0:(r.kind==="rule"||r.kind==="at-rule")&&jr(r.nodes))}function En(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 f=Lt.indexOf(s.value??"");if(f!==-1){r.add(f),n=!0;continue}}let a=Lt.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 je(t,r){let i=0,e=G("&",t),n=new Set,s=new B(()=>new Set),a=new B(()=>new Set);I([e],(m,{parent:g,path:w})=>{if(m.kind==="at-rule"){if(m.name==="@keyframes")return I(m.nodes,v=>{if(v.kind==="at-rule"&&v.name==="@apply")throw new Error("You cannot use `@apply` inside `@keyframes`.")}),1;if(m.name==="@utility"){let v=m.params.replace(/-\*$/,"");a.get(v).add(m),I(m.nodes,x=>{if(!(x.kind!=="at-rule"||x.name!=="@apply")){n.add(m);for(let y of Ir(x,r))s.get(m).add(y)}});return}if(m.name==="@apply"){if(g===null)return;i|=1,n.add(g);for(let v of Ir(m,r))for(let x of w)x!==m&&n.has(x)&&s.get(x).add(v)}}});let f=new Set,u=[],c=new Set;function d(m,g=[]){if(!f.has(m)){if(c.has(m)){let w=g[(g.indexOf(m)+1)%g.length];throw m.kind==="at-rule"&&m.name==="@utility"&&w.kind==="at-rule"&&w.name==="@utility"&&I(m.nodes,v=>{if(v.kind!=="at-rule"||v.name!=="@apply")return;let x=v.params.split(/\s+/g);for(let y of x)for(let V of r.parseCandidate(y))switch(V.kind){case"arbitrary":break;case"static":case"functional":if(w.params.replace(/-\*$/,"")===V.root)throw new Error(`You cannot \`@apply\` the \`${y}\` utility here because it creates a circular dependency.`);break;default:}}),new Error(`Circular dependency detected: + +${oe([m])} +Relies on: + +${oe([w])}`)}c.add(m);for(let w of s.get(m))for(let v of a.get(w))g.push(m),d(v,g),g.pop();f.add(m),c.delete(m),u.push(m)}}for(let m of n)d(m);for(let m of u)"nodes"in m&&I(m.nodes,(g,{replaceWith:w})=>{if(g.kind!=="at-rule"||g.name!=="@apply")return;let v=g.params.split(/(\s+)/g),x={},y=0;for(let[V,b]of v.entries())V%2===0&&(x[b]=y),y+=b.length;{let V=Object.keys(x),b=ge(V,r,{onInvalidCandidate:P=>{if(r.theme.prefix&&!P.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${P}\`. Did you mean \`${r.theme.prefix}:${P}\`?`);if(r.invalidCandidates.has(P))throw new Error(`Cannot apply utility class \`${P}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let K=D(P,":");if(K.length>1){let _=K.pop();if(r.candidatesToCss([_])[0]){let H=r.candidatesToCss(K.map(W=>`${W}:[--tw-variant-check:1]`)),j=K.filter((W,J)=>H[J]===null);if(j.length>0){if(j.length===1)throw new Error(`Cannot apply utility class \`${P}\` because the ${j.map(W=>`\`${W}\``)} variant does not exist.`);{let W=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${P}\` because the ${W.format(j.map(J=>`\`${J}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${P}\`. 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 \`${P}\``)}}),S=g.src,R=b.astNodes.map(P=>{let K=b.nodeSorting.get(P)?.candidate,_=K?x[K]:void 0;if(P=structuredClone(P),!S||!K||_===void 0)return I([P],j=>{j.src=S}),P;let H=[S[0],S[1],S[2]];return H[1]+=7+_,H[2]=H[1]+K.length,I([P],j=>{j.src=H}),P}),L=[];for(let P of R)if(P.kind==="rule")for(let K of P.nodes)L.push(K);else L.push(P);w(L)}});return i}function*Ir(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 jt(t,r,i,e=0,n=!1){let s=0,a=[];return I(t,(f,{replaceWith:u})=>{if(f.kind==="at-rule"&&(f.name==="@import"||f.name==="@reference")){let c=Tn(q(f.params));if(c===null)return;f.name==="@reference"&&(c.media="reference"),s|=2;let{uri:d,layer:m,media:g,supports:w}=c;if(d.startsWith("data:")||d.startsWith("http://")||d.startsWith("https://"))return;let v=se({},[]);return a.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${d}\` in \`${r}\`)`);let x=await i(d,r),y=ve(x.content,{from:n?x.path:void 0});await jt(y,x.base,i,e+1,n),v.nodes=Rn(f,[se({base:x.base},y)],m,g,w)})()),u(v),1}}),a.length>0&&await Promise.all(a),s}function Tn(t){let r,i=null,e=null,n=null;for(let s=0;s/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=ct(e);s&&t.theme.add(`--${s}`,""+n,7)}if(Object.hasOwn(r,"fontFamily")){let e=5;{let n=Te(r.fontFamily.sans);n&&t.theme.hasDefault("--font-sans")&&(t.theme.add("--default-font-family",n,e),t.theme.add("--default-font-feature-settings",Te(r.fontFamily.sans,"fontFeatureSettings")??"normal",e),t.theme.add("--default-font-variation-settings",Te(r.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let n=Te(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",Te(r.fontFamily.mono,"fontFeatureSettings")??"normal",e),t.theme.add("--default-mono-font-variation-settings",Te(r.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return r}function Pn(t){let r=[];return Fr(t,[],(i,e)=>{if(_n(i))return r.push([e,i]),1;if(Dn(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 On=/^[a-zA-Z0-9-_%/\.]+$/;function ct(t){if(t[0]==="container")return null;t=structuredClone(t),t[0]==="animation"&&(t[0]="animate"),t[0]==="aspectRatio"&&(t[0]="aspect"),t[0]==="borderRadius"&&(t[0]="radius"),t[0]==="boxShadow"&&(t[0]="shadow"),t[0]==="colors"&&(t[0]="color"),t[0]==="containers"&&(t[0]="container"),t[0]==="fontFamily"&&(t[0]="font"),t[0]==="fontSize"&&(t[0]="text"),t[0]==="letterSpacing"&&(t[0]="tracking"),t[0]==="lineHeight"&&(t[0]="leading"),t[0]==="maxWidth"&&(t[0]="container"),t[0]==="screens"&&(t[0]="breakpoint"),t[0]==="transitionTimingFunction"&&(t[0]="ease");for(let r of t)if(!On.test(r))return null;return t.map((r,i,e)=>r==="1"&&i!==e.length-1?"":r).map(r=>r.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(i,e,n)=>`${e}-${n.toLowerCase()}`)).filter((r,i)=>r!=="DEFAULT"||i!==t.length-1).join("-")}function _n(t){return typeof t=="number"||typeof t=="string"}function Dn(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 Fr(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")&&Fr(n,s,i)===2)return 2}}}function ft(t){let r=[];for(let i of D(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 Re(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let r=Object.getPrototypeOf(t);return r===null||Object.getPrototypeOf(r)===null}function Ie(t,r,i,e=[]){for(let n of r)if(n!=null)for(let s of Reflect.ownKeys(n)){e.push(s);let a=i(t[s],n[s],e);a!==void 0?t[s]=a:!Re(t[s])||!Re(n[s])?t[s]=n[s]:t[s]=Ie({},[t[s],n[s]],i,e),e.pop()}return t}function pt(t,r,i){return function(n,s){let a=n.lastIndexOf("/"),f=null;a!==-1&&(f=n.slice(a+1).trim(),n=n.slice(0,a).trim());let u=(()=>{let c=ft(n),[d,m]=Kn(t.theme,c),g=i(Mr(r()??{},c)??null);if(typeof g=="string"&&(g=g.replace("","1")),typeof d!="object")return typeof m!="object"&&m&4?g??d:d;if(g!==null&&typeof g=="object"&&!Array.isArray(g)){let w=Ie({},[g],(v,x)=>x);if(d===null&&Object.hasOwn(g,"__CSS_VALUES__")){let v={};for(let x in g.__CSS_VALUES__)v[x]=g[x],delete w[x];d=v}for(let v in d)v!=="__CSS_VALUES__"&&(g?.__CSS_VALUES__?.[v]&4&&Mr(w,v.split("-"))!==void 0||(w[we(v)]=d[v]));return w}if(Array.isArray(d)&&Array.isArray(m)&&Array.isArray(g)){let w=d[0],v=d[1];m[0]&4&&(w=g[0]??w);for(let x of Object.keys(v))m[1][x]&4&&(v[x]=g[1][x]??v[x]);return[w,v]}return d??g})();return f&&typeof u=="string"&&(u=Q(u,f)),u??s}}function Kn(t,r){if(r.length===1&&r[0].startsWith("--"))return[t.get([r[0]]),t.getOptions(r[0])];let i=ct(r),e=new Map,n=new B(()=>new Map),s=t.namespace(`--${i}`);if(s.size===0)return[null,0];let a=new Map;for(let[d,m]of s){if(!d||!d.includes("--")){e.set(d,m),a.set(d,t.getOptions(d?`--${i}-${d}`:`--${i}`));continue}let g=d.indexOf("--"),w=d.slice(0,g),v=d.slice(g+2);v=v.replace(/-([a-z])/g,(x,y)=>y.toUpperCase()),n.get(w===""?null:w).set(v,[m,t.getOptions(`--${i}${d}`)])}let f=t.getOptions(`--${i}`);for(let[d,m]of n){let g=e.get(d);if(typeof g!="string")continue;let w={},v={};for(let[x,[y,V]]of m)w[x]=y,v[x]=V;e.set(d,[g,w]),a.set(d,[f,v])}let u={},c={};for(let[d,m]of e)Wr(u,[d??"DEFAULT"],m);for(let[d,m]of a)Wr(c,[d??"DEFAULT"],m);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 Mr(t,r){for(let i=0;i0){let g=ze(n);e?e.nodes.push(g):r.push(g),n=""}let u=a,c=a+1;for(;c0){let c=ze(n);u.nodes.push(c),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Wn:case Fn:case Bn:{if(n.length>0){let u=ze(n);e?e.nodes.push(u):r.push(u)}n=String.fromCharCode(f);break}case Zr:{if(n.length>0){let d=ze(n);e?e.nodes.push(d):r.push(d)}n="";let u=a,c=0;for(let d=a+1;d0&&r.push(ze(n)),r}var ri=/^[a-z@][a-zA-Z0-9/%._-]*$/;function It({designSystem:t,ast:r,resolvedConfig:i,featuresRef:e,referenceMode:n}){let s={addBase(a){if(n)return;let f=ue(a);e.current|=Ve(f,t),r.push(F("@layer","base",f))},addVariant(a,f){if(!ut.test(a))throw new Error(`\`addVariant('${a}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(typeof f=="string"){if(f.includes(":merge("))return}else if(Array.isArray(f)){if(f.some(c=>c.includes(":merge(")))return}else if(typeof f=="object"){let c=function(d,m){return Object.entries(d).some(([g,w])=>g.includes(m)||typeof w=="object"&&c(w,m))};var u=c;if(c(f,":merge("))return}typeof f=="string"||Array.isArray(f)?t.variants.static(a,c=>{c.nodes=ii(f,c.nodes)},{compounds:Ae(typeof f=="string"?[f]:f)}):typeof f=="object"&&t.variants.fromAst(a,ue(f))},matchVariant(a,f,u){function c(m,g,w){let v=f(m,{modifier:g?.value??null});return ii(v,w)}try{let m=f("a",{modifier:null});if(typeof m=="string"&&m.includes(":merge("))return;if(Array.isArray(m)&&m.some(g=>g.includes(":merge(")))return}catch{}let d=Object.keys(u?.values??{});t.variants.group(()=>{t.variants.functional(a,(m,g)=>{if(!g.value){if(u?.values&&"DEFAULT"in u.values){m.nodes=c(u.values.DEFAULT,g.modifier,m.nodes);return}return null}if(g.value.kind==="arbitrary")m.nodes=c(g.value.value,g.modifier,m.nodes);else if(g.value.kind==="named"&&u?.values){let w=u.values[g.value.value];if(typeof w!="string")return;m.nodes=c(w,g.modifier,m.nodes)}})},(m,g)=>{if(m.kind!=="functional"||g.kind!=="functional")return 0;let w=m.value?m.value.value:"DEFAULT",v=g.value?g.value.value:"DEFAULT",x=u?.values?.[w]??w,y=u?.values?.[v]??v;if(u&&typeof u.sort=="function")return u.sort({value:x,modifier:m.modifier?.value??null},{value:y,modifier:g.modifier?.value??null});let V=d.indexOf(w),b=d.indexOf(v);return V=V===-1?d.length:V,b=b===-1?d.length:b,V!==b?V-b:xObject.entries(c));f=f.flatMap(([c,d])=>D(c,",").map(m=>[m.trim(),d]));let u=new B(()=>[]);for(let[c,d]of f){if(c.startsWith("@keyframes ")){n||r.push(G(c,ue(d)));continue}let m=dt(c),g=!1;if(Fe(m,w=>{if(w.kind==="selector"&&w.value[0]==="."&&ri.test(w.value.slice(1))){let v=w.value;w.value="&";let x=Me(m),y=v.slice(1),V=x==="&"?ue(d):[G(x,ue(d))];u.get(y).push(...V),g=!0,w.value=v;return}if(w.kind==="function"&&w.value===":not")return 1}),!g)throw new Error(`\`addUtilities({ '${c}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[c,d]of u)t.theme.prefix&&I(d,m=>{if(m.kind==="rule"){let g=dt(m.selector);Fe(g,w=>{w.kind==="selector"&&w.value[0]==="."&&(w.value=`.${t.theme.prefix}\\:${w.value.slice(1)}`)}),m.selector=Me(g)}}),t.utilities.static(c,m=>{let g=structuredClone(d);return ni(g,c,m.raw),e.current|=je(g,t),g})},matchUtilities(a,f){let u=f?.type?Array.isArray(f?.type)?f.type:[f.type]:["any"];for(let[d,m]of Object.entries(a)){let g=function({negative:w}){return v=>{if(v.value?.kind==="arbitrary"&&u.length>0&&!u.includes("any")&&(v.value.dataType&&!u.includes(v.value.dataType)||!v.value.dataType&&!Y(v.value.value,u)))return;let x=u.includes("color"),y=null,V=!1;{let R=f?.values??{};x&&(R=Object.assign({inherit:"inherit",transparent:"transparent",current:"currentcolor"},R)),v.value?v.value.kind==="arbitrary"?y=v.value.value:v.value.fraction&&R[v.value.fraction]?(y=R[v.value.fraction],V=!0):R[v.value.value]?y=R[v.value.value]:R.__BARE_VALUE__&&(y=R.__BARE_VALUE__(v.value)??null,V=(v.value.fraction!==null&&y?.includes("/"))??!1):y=R.DEFAULT??null}if(y===null)return;let b;{let R=f?.modifiers??null;v.modifier?R==="any"||v.modifier.kind==="arbitrary"?b=v.modifier.value:R?.[v.modifier.value]?b=R[v.modifier.value]:x&&!Number.isNaN(Number(v.modifier.value))?b=`${v.modifier.value}%`:b=null:b=null}if(v.modifier&&b===null&&!V)return v.value?.kind==="arbitrary"?null:void 0;x&&b!==null&&(y=Q(y,b)),w&&(y=`calc(${y} * -1)`);let S=ue(m(y,{modifier:b}));return ni(S,d,v.raw),e.current|=je(S,t),S}};var c=g;if(!ri.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\`.`);f?.supportsNegativeValues&&t.utilities.functional(`-${d}`,g({negative:!0}),{types:u}),t.utilities.functional(d,g({negative:!1}),{types:u}),t.utilities.suggest(d,()=>{let w=f?.values??{},v=new Set(Object.keys(w));v.delete("__BARE_VALUE__"),v.has("DEFAULT")&&(v.delete("DEFAULT"),v.add(null));let x=f?.modifiers??{},y=x==="any"?[]:Object.keys(x);return[{supportsNegative:f?.supportsNegativeValues??!1,values:Array.from(v),modifiers:y}]})}},addComponents(a,f){this.addUtilities(a,f)},matchComponents(a,f){this.matchUtilities(a,f)},theme:pt(t,()=>i.theme??{},a=>a),prefix(a){return a},config(a,f){let u=i;if(!a)return u;let c=ft(a);for(let d=0;dObject.entries(e));for(let[e,n]of i)if(typeof n!="object"){if(!e.startsWith("--")){if(n==="@slot"){r.push(G(e,[F("@slot")]));continue}e=e.replace(/([A-Z])/g,"-$1").toLowerCase()}r.push(l(e,String(n)))}else if(Array.isArray(n))for(let s of n)typeof s=="string"?r.push(l(e,s)):r.push(G(e,ue(s)));else n!==null&&r.push(G(e,ue(n)));return r}function ii(t,r){return(typeof t=="string"?[t]:t).flatMap(e=>{if(e.trim().endsWith("}")){let n=e.replace("}","{@slot}}"),s=ve(n);return Ut(s,r),s}else return G(e,r)})}function ni(t,r,i){I(t,e=>{if(e.kind==="rule"){let n=dt(e.selector);Fe(n,s=>{s.kind==="selector"&&s.value===`.${r}`&&(s.value=`.${de(i)}`)}),e.selector=Me(n)}})}function oi(t,r,i){for(let e of Gn(r))t.theme.addKeyframes(e)}function Gn(t){let r=[];if("keyframes"in t.theme)for(let[i,e]of Object.entries(t.theme.keyframes))r.push(F("@keyframes",i,ue(e)));return r}var mt={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 Ce(t){return{__BARE_VALUE__:t}}var le=Ce(t=>{if(T(t.value))return t.value}),re=Ce(t=>{if(T(t.value))return`${t.value}%`}),he=Ce(t=>{if(T(t.value))return`${t.value}px`}),li=Ce(t=>{if(T(t.value))return`${t.value}ms`}),gt=Ce(t=>{if(T(t.value))return`${t.value}deg`}),Yn=Ce(t=>{if(t.fraction===null)return;let[r,i]=D(t.fraction,"/");if(!(!T(r)||!T(i)))return t.fraction}),ai=Ce(t=>{if(T(Number(t.value)))return`repeat(${t.value}, minmax(0, 1fr))`}),si={accentColor:({theme:t})=>t("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",...Yn},backdropBlur:({theme:t})=>t("blur"),backdropBrightness:({theme:t})=>({...t("brightness"),...re}),backdropContrast:({theme:t})=>({...t("contrast"),...re}),backdropGrayscale:({theme:t})=>({...t("grayscale"),...re}),backdropHueRotate:({theme:t})=>({...t("hueRotate"),...gt}),backdropInvert:({theme:t})=>({...t("invert"),...re}),backdropOpacity:({theme:t})=>({...t("opacity"),...re}),backdropSaturate:({theme:t})=>({...t("saturate"),...re}),backdropSepia:({theme:t})=>({...t("sepia"),...re}),backgroundColor:({theme:t})=>t("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:t})=>t("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:t})=>({DEFAULT:"currentcolor",...t("colors")}),borderOpacity:({theme:t})=>t("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:t})=>t("spacing"),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px",...he},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:t})=>t("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:t})=>t("colors"),colors:()=>({...mt}),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",...le},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:t})=>t("borderColor"),divideOpacity:({theme:t})=>t("borderOpacity"),divideWidth:({theme:t})=>({...t("borderWidth"),...he}),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:t})=>t("colors"),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({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%",...t("spacing")}),flexGrow:{0:"0",DEFAULT:"1",...le},flexShrink:{0:"0",DEFAULT:"1",...le},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:t})=>t("spacing"),gradientColorStops:({theme:t})=>t("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",...le},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",...le},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",...le},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",...le},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))",...ai},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))",...ai},height:({theme:t})=>({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",...t("spacing")}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg",...gt},inset:({theme:t})=>({auto:"auto","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...t("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:t})=>({auto:"auto",...t("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",...le},maxHeight:({theme:t})=>({none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...t("spacing")}),maxWidth:({theme:t})=>({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",...t("spacing")}),minHeight:({theme:t})=>({full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content",...t("spacing")}),minWidth:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",...t("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",...le},outlineColor:({theme:t})=>t("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},padding:({theme:t})=>t("spacing"),placeholderColor:({theme:t})=>t("colors"),placeholderOpacity:({theme:t})=>t("opacity"),ringColor:({theme:t})=>({DEFAULT:"currentcolor",...t("colors")}),ringOffsetColor:({theme:t})=>t("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},ringOpacity:({theme:t})=>({DEFAULT:"0.5",...t("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg",...gt},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:t})=>t("spacing"),scrollPadding:({theme:t})=>t("spacing"),sepia:{0:"0",DEFAULT:"100%",...re},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",...gt},space:({theme:t})=>t("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:t})=>({none:"none",...t("colors")}),strokeWidth:{0:"0",1:"1",2:"2",...le},supports:{},data:{},textColor:({theme:t})=>t("colors"),textDecorationColor:({theme:t})=>t("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},textIndent:({theme:t})=>t("spacing"),textOpacity:({theme:t})=>t("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px",...he},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",...li},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms",...li},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:t})=>({"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%",...t("spacing")}),size:({theme:t})=>({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",...t("spacing")}),width:({theme:t})=>({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",...t("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",...le}};function ui(t){return{theme:{...si,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 Zn={blocklist:[],future:{},prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function Ft(t,r){let i={design:t,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(Zn)};for(let n of r)zt(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=Qn(i);return{resolvedConfig:{...i.result,content:i.content,theme:i.theme,plugins:i.plugins},replacedThemeKeys:e}}function Jn(t,r){if(Array.isArray(t)&&Re(t[0]))return t.concat(r);if(Array.isArray(r)&&Re(r[0])&&Re(t))return[t,...r];if(Array.isArray(r))return r}function zt(t,{config:r,base:i,path:e,reference:n}){let s=[];for(let u of r.plugins??[])"__isOptionsFunction"in u?s.push({...u(),reference:n}):"handler"in u?s.push({...u,reference:n}):s.push({handler:u,reference:n});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 u of r.presets??[])zt(t,{path:e,base:i,config:u,reference:n});for(let u of s)t.plugins.push(u),u.config&&zt(t,{path:e,base:i,config:u.config,reference:!!u.reference});let a=r.content??[],f=Array.isArray(a)?a:a.files;for(let u of f)t.content.files.push(typeof u=="object"?u:{base:i,pattern:u});t.configs.push(r)}function Qn(t){let r=new Set,i=pt(t.design,()=>t.theme,n),e=Object.assign(i,{theme:i,colors:mt});function n(s){return typeof s=="function"?s(e)??null:s??null}for(let s of t.configs){let a=s.theme??{},f=a.extend??{};for(let u in a)u!=="extend"&&r.add(u);Object.assign(t.theme,a);for(let u in f)t.extend[u]??=[],t.extend[u].push(f[u])}delete t.theme.extend;for(let s in t.extend){let a=[t.theme[s],...t.extend[s]];t.theme[s]=()=>{let f=a.map(n);return Ie({},f,Jn)}}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 ci(t,r){let i=t.theme.container||{};if(typeof i!="object"||i===null)return;let e=Xn(i,r);e.length!==0&&r.utilities.static("container",()=>structuredClone(e))}function Xn({center:t,padding:r,screens:i},e){let n=[],s=null;if(t&&n.push(l("margin-inline","auto")),(typeof r=="string"||typeof r=="object"&&r!==null&&"DEFAULT"in r)&&n.push(l("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((f,u)=>ye(f[1],u[1],"asc")),a.length>0){let[f]=a[0];n.push(F("@media",`(width >= --theme(--breakpoint-${f}))`,[l("max-width","none")]))}for(let[f,u]of Object.entries(i)){if(typeof u=="object")if("min"in u)u=u.min;else continue;s.set(f,F("@media",`(width >= ${u})`,[l("max-width",u)]))}}if(typeof r=="object"&&r!==null){let a=Object.entries(r).filter(([f])=>f!=="DEFAULT").map(([f,u])=>[f,e.theme.resolveValue(f,["--breakpoint"]),u]).filter(Boolean);a.sort((f,u)=>ye(f[1],u[1],"asc"));for(let[f,,u]of a)if(s&&s.has(f))s.get(f).nodes.push(l("padding-inline",u));else{if(s)continue;n.push(F("@media",`(width >= theme(--breakpoint-${f}))`,[l("padding-inline",u)]))}}if(s)for(let[,a]of s)n.push(a);return n}function fi({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 pi(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.static(`bg-gradient-to-${r}`,()=>[l("--tw-gradient-position",`to ${i} in oklab`),l("background-image","linear-gradient(var(--tw-gradient-stops))")]);t.utilities.static("bg-left-top",()=>[l("background-position","left top")]),t.utilities.static("bg-right-top",()=>[l("background-position","right top")]),t.utilities.static("bg-left-bottom",()=>[l("background-position","left bottom")]),t.utilities.static("bg-right-bottom",()=>[l("background-position","right bottom")]),t.utilities.static("object-left-top",()=>[l("object-position","left top")]),t.utilities.static("object-right-top",()=>[l("object-position","right top")]),t.utilities.static("object-left-bottom",()=>[l("object-position","left bottom")]),t.utilities.static("object-right-bottom",()=>[l("object-position","right bottom")]),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[l("max-width",i)]}),t.utilities.static("overflow-ellipsis",()=>[l("text-overflow","ellipsis")]),t.utilities.static("decoration-slice",()=>[l("-webkit-box-decoration-break","slice"),l("box-decoration-break","slice")]),t.utilities.static("decoration-clone",()=>[l("-webkit-box-decoration-break","clone"),l("box-decoration-break","clone")]),t.utilities.functional("flex-shrink",r=>{if(!r.modifier){if(!r.value)return[l("flex-shrink","1")];if(r.value.kind==="arbitrary")return[l("flex-shrink",r.value.value)];if(T(r.value.value))return[l("flex-shrink",r.value.value)]}}),t.utilities.functional("flex-grow",r=>{if(!r.modifier){if(!r.value)return[l("flex-grow","1")];if(r.value.kind==="arbitrary")return[l("flex-grow",r.value.value)];if(T(r.value.value))return[l("flex-grow",r.value.value)]}}),t.utilities.static("order-none",()=>[l("order","0")])}function di(t,r){let i=t.theme.screens||{},e=r.variants.get("min")?.order??0,n=[];for(let[a,f]of Object.entries(i)){let g=function(w){r.variants.static(a,v=>{v.nodes=[F("@media",m,v.nodes)]},{order:w})};var s=g;let u=r.variants.get(a),c=r.theme.resolveValue(a,["--breakpoint"]);if(u&&c&&!r.theme.hasDefault(`--breakpoint-${a}`))continue;let d=!0;typeof f=="string"&&(d=!1);let m=eo(f);d?n.push(g):g(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,f])=>(a>e&&(a+=n.length),[a,f])));for(let[a,f]of n.entries())f(e+a+1)}}function eo(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 mi(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,f=s?.compounds;r.variants.functional("aria",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in i?a?.(u,{...c,value:{kind:"arbitrary",value:i[d.value]}}):a?.(u,c)},{compounds:f})}if(Object.keys(e).length>0){let s=r.variants.get("supports"),a=s?.applyFn,f=s?.compounds;r.variants.functional("supports",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in e?a?.(u,{...c,value:{kind:"arbitrary",value:e[d.value]}}):a?.(u,c)},{compounds:f})}if(Object.keys(n).length>0){let s=r.variants.get("data"),a=s?.applyFn,f=s?.compounds;r.variants.functional("data",(u,c)=>{let d=c.value;return d&&d.kind==="named"&&d.value in n?a?.(u,{...c,value:{kind:"arbitrary",value:n[d.value]}}):a?.(u,c)},{compounds:f})}}var to=/^[a-z]+$/;async function hi({designSystem:t,base:r,ast:i,loadModule:e,sources:n}){let s=0,a=[],f=[];I(i,(m,{parent:g,replaceWith:w,context:v})=>{if(m.kind==="at-rule"){if(m.name==="@plugin"){if(g!==null)throw new Error("`@plugin` cannot be nested.");let x=m.params.slice(1,-1);if(x.length===0)throw new Error("`@plugin` must have a path.");let y={};for(let V of m.nodes??[]){if(V.kind!=="declaration")throw new Error(`Unexpected \`@plugin\` option: + +${oe([V])} + +\`@plugin\` options must be a flat list of declarations.`);if(V.value===void 0)continue;let b=V.value,S=D(b,",").map(R=>{if(R=R.trim(),R==="null")return null;if(R==="true")return!0;if(R==="false")return!1;if(Number.isNaN(Number(R))){if(R[0]==='"'&&R[R.length-1]==='"'||R[0]==="'"&&R[R.length-1]==="'")return R.slice(1,-1);if(R[0]==="{"&&R[R.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${oe([V]).trim()}\` is not supported. + +Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(R);return R});y[V.property]=S.length===1?S[0]:S}a.push([{id:x,base:v.base,reference:!!v.reference},Object.keys(y).length>0?y:null]),w([]),s|=4;return}if(m.name==="@config"){if(m.nodes.length>0)throw new Error("`@config` cannot have a body.");if(g!==null)throw new Error("`@config` cannot be nested.");f.push({id:m.params.slice(1,-1),base:v.base,reference:!!v.reference}),w([]),s|=4;return}}}),pi(t);let u=t.resolveThemeValue;if(t.resolveThemeValue=function(g,w){return g.startsWith("--")?u(g,w):(s|=gi({designSystem:t,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),t.resolveThemeValue(g,w))},!a.length&&!f.length)return 0;let[c,d]=await Promise.all([Promise.all(f.map(async({id:m,base:g,reference:w})=>{let v=await e(m,g,"config");return{path:m,base:v.base,config:v.module,reference:w}})),Promise.all(a.map(async([{id:m,base:g,reference:w},v])=>{let x=await e(m,g,"plugin");return{path:m,base:x.base,plugin:x.module,options:v,reference:w}}))]);return s|=gi({designSystem:t,base:r,ast:i,sources:n,configs:c,pluginDetails:d}),s}function gi({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};if("__isOptionsFunction"in y.plugin)return{config:{plugins:[y.plugin(y.options)]},base:y.base,reference:y.reference};throw new Error(`The plugin "${y.path}" does not accept options`)}),...n],{resolvedConfig:c}=Ft(t,[{config:ui(t.theme),base:r,reference:!0},...u,{config:{plugins:[fi]},base:r,reference:!0}]),{resolvedConfig:d,replacedThemeKeys:m}=Ft(t,u),g=t.resolveThemeValue;t.resolveThemeValue=function(V,b){if(V[0]==="-"&&V[1]==="-")return g(V,b);let S=v.theme(V,void 0);if(Array.isArray(S)&&S.length===2)return S[0];if(Array.isArray(S))return S.join(", ");if(typeof S=="string")return S};let w={designSystem:t,ast:i,resolvedConfig:c,featuresRef:{set current(y){a|=y}}},v=It({...w,referenceMode:!1}),x;for(let{handler:y,reference:V}of c.plugins)V?(x||=It({...w,referenceMode:!0}),y(x)):y(v);if(zr(t,d,m),oi(t,d,m),mi(d,t),di(d,t),ci(d,t),!t.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.`)),!to.test(c.prefix))throw new Error(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);t.theme.prefix=c.prefix}if(!t.important&&c.important===!0&&(t.important=!0),typeof c.important=="string"){let y=c.important;I(i,(V,{replaceWith:b,parent:S})=>{if(V.kind==="at-rule"&&!(V.name!=="@tailwind"||V.params!=="utilities"))return S?.kind==="rule"&&S.selector===y?2:(b(M(y,[V])),2)})}for(let y of c.blocklist)t.invalidCandidates.add(y);for(let y of c.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 V=!1;y.pattern[0]=="!"&&(V=!0,y.pattern=y.pattern.slice(1)),e.push({...y,negated:V})}return a}function vi(t){let r=[0];for(let n=0;n0;){let u=(a|0)>>1,c=s+u;r[c]<=n?(s=c+1,a=a-u-1):a=u}s-=1;let f=n-r[s];return{line:s+1,column:f}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let a=r[n],f=r[n+1]??a;return Math.min(Math.max(a+s,0),f)}return{find:i,findOffset:e}}function wi({ast:t}){let r=new B(n=>vi(n.code)),i=new B(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]),f=r.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),c=0;for(let g of u.split(` +`)){if(g.trim()!==""){let w=a.find(n.src[1]+c),v=f.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:v})}c+=g.length,c+=1}let d=a.find(n.src[2]),m=f.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...d},generatedPosition:m})});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 ki=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function ht(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 m=0;mht(m));let d=ht(u);for(let m of d)for(let g of c)i.push(e+g+m);return i}function ro(t){return ki.test(t)}function io(t){let r=t.match(ki);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 f=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=f<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let c=f0&&(s=-s);for(let d=f;c?d<=u:d>=u;d+=s)a.push(d.toString())}return a}var no=/^[a-z]+$/,tt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(tt||{});function oo(){throw new Error("No `loadModule` function provided to `compile`")}function lo(){throw new Error("No `loadStylesheet` function provided to `compile`")}function ao(t){let r=0,i=null;for(let e of D(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 Se=(f=>(f[f.None=0]="None",f[f.AtApply=1]="AtApply",f[f.AtImport=2]="AtImport",f[f.JsPluginCompat=4]="JsPluginCompat",f[f.ThemeFunction=8]="ThemeFunction",f[f.Utilities=16]="Utilities",f[f.Variants=32]="Variants",f))(Se||{});async function bi(t,{base:r="",from:i,loadModule:e=oo,loadStylesheet:n=lo}={}){let s=0;t=[se({base:r},t)],s|=await jt(t,r,n,0,i!==void 0);let a=null,f=new Je,u=[],c=[],d=null,m=null,g=[],w=[],v=[],x=[],y=null;I(t,(b,{parent:S,replaceWith:R,context:L})=>{if(b.kind==="at-rule"){if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(m!==null){R([]);return}if(L.reference){R([]);return}let P=D(b.params," ");for(let K of P)if(K.startsWith("source(")){let _=K.slice(7,-1);if(_==="none"){y=_;continue}if(_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");y={base:L.sourceBase??L.base,pattern:_.slice(1,-1)}}m=b,s|=16}if(b.name==="@utility"){if(S!==null)throw new Error("`@utility` cannot be nested.");if(b.nodes.length===0)throw new Error(`\`@utility ${b.params}\` is empty. Utilities should include at least one property.`);let P=Sr(b);if(P===null)throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);c.push(P)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.");if(S!==null)throw new Error("`@source` cannot be nested.");let P=!1,K=!1,_=b.params;if(_[0]==="n"&&_.startsWith("not ")&&(P=!0,_=_.slice(4)),_[0]==="i"&&_.startsWith("inline(")&&(K=!0,_=_.slice(7,-1)),_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`@source` paths must be quoted.");let H=_.slice(1,-1);if(K){let j=P?x:v,W=D(H," ");for(let J of W)for(let ie of ht(J))j.push(ie)}else w.push({base:L.base,pattern:H,negated:P});R([]);return}if(b.name==="@variant"&&(S===null?b.nodes.length===0?b.name="@custom-variant":(I(b.nodes,P=>{if(P.kind==="at-rule"&&P.name==="@slot")return b.name="@custom-variant",2}),b.name==="@variant"&&g.push(b)):g.push(b)),b.name==="@custom-variant"){if(S!==null)throw new Error("`@custom-variant` cannot be nested.");R([]);let[P,K]=D(b.params," ");if(!ut.test(P))throw new Error(`\`@custom-variant ${P}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(b.nodes.length>0&&K)throw new Error(`\`@custom-variant ${P}\` cannot have both a selector and a body.`);if(b.nodes.length===0){if(!K)throw new Error(`\`@custom-variant ${P}\` has no selector or body.`);let _=D(K.slice(1,-1),",");if(_.length===0||_.some(W=>W.trim()===""))throw new Error(`\`@custom-variant ${P} (${_.join(",")})\` selector is invalid.`);let H=[],j=[];for(let W of _)W=W.trim(),W[0]==="@"?H.push(W):j.push(W);u.push(W=>{W.variants.static(P,J=>{let ie=[];j.length>0&&ie.push(M(j.join(", "),J.nodes));for(let o of H)ie.push(G(o,J.nodes));J.nodes=ie},{compounds:Ae([...j,...H])})});return}else{u.push(_=>{_.variants.fromAst(P,b.nodes)});return}}if(b.name==="@media"){let P=D(b.params," "),K=[];for(let _ of P)if(_.startsWith("source(")){let H=_.slice(7,-1);I(b.nodes,(j,{replaceWith:W})=>{if(j.kind==="at-rule"&&j.name==="@tailwind"&&j.params==="utilities")return j.params+=` source(${H})`,W([se({sourceBase:L.base},[j])]),2})}else if(_.startsWith("theme(")){let H=_.slice(6,-1),j=H.includes("reference");I(b.nodes,W=>{if(W.kind!=="at-rule"){if(j)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return 0}if(W.name==="@theme")return W.params+=" "+H,1})}else if(_.startsWith("prefix(")){let H=_.slice(7,-1);I(b.nodes,j=>{if(j.kind==="at-rule"&&j.name==="@theme")return j.params+=` prefix(${H})`,1})}else _==="important"?a=!0:_==="reference"?b.nodes=[se({reference:!0},b.nodes)]:K.push(_);K.length>0?b.params=K.join(" "):P.length>0&&R(b.nodes)}if(b.name==="@theme"){let[P,K]=ao(b.params);if(L.reference&&(P|=2),K){if(!no.test(K))throw new Error(`The prefix "${K}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);f.prefix=K}return I(b.nodes,_=>{if(_.kind==="at-rule"&&_.name==="@keyframes")return f.addKeyframes(_),1;if(_.kind==="comment")return;if(_.kind==="declaration"&&_.property.startsWith("--")){f.add(we(_.property),_.value??"",P,_.src);return}let H=oe([F(b.name,b.params,[_])]).split(` +`).map((j,W,J)=>`${W===0||W>=J.length-2?" ":">"} ${j}`).join(` +`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`. + +${H}`)}),d?R([]):(d=M(":root, :host",[]),d.src=b.src,R([d])),1}}});let V=Kr(f);if(a&&(V.important=a),x.length>0)for(let b of x)V.invalidCandidates.add(b);s|=await hi({designSystem:V,base:r,ast:t,loadModule:e,sources:w});for(let b of u)b(V);for(let b of c)b(V);if(d){let b=[];for(let[R,L]of V.theme.entries()){if(L.options&2)continue;let P=l(de(R),L.value);P.src=L.src,b.push(P)}let S=V.theme.getKeyframes();for(let R of S)t.push(se({theme:!0},[z([R])]));d.nodes=[se({theme:!0},b)]}if(g.length>0){for(let b of g){let S=M("&",b.nodes),R=b.params,L=V.parseVariant(R);if(L===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${R}`);if(Ee(S,L,V.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${R}`);Object.assign(b,S)}s|=32}if(s|=Ve(t,V),s|=je(t,V),m){let b=m;b.kind="context",b.context={}}return I(t,(b,{replaceWith:S})=>{if(b.kind==="at-rule")return b.name==="@utility"&&S([]),1}),{designSystem:V,ast:t,sources:w,root:y,utilitiesNode:m,features:s,inlineCandidates:v}}async function yi(t,r={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:a,features:f,inlineCandidates:u}=await bi(t,r);e.unshift(Ze(`! tailwindcss v${Mt} | MIT License | https://tailwindcss.com `));function c(v){i.invalidCandidates.add(v)}let d=new Set,m=null,g=0,w=!1;for(let v of u)i.invalidCandidates.has(v)||(d.add(v),w=!0);return{sources:n,root:s,features:f,build(v){if(f===0)return t;if(!a)return m??=be(e,i,r.polyfills),m;let x=w,y=!1;w=!1;let V=d.size;for(let S of v)if(!i.invalidCandidates.has(S))if(S[0]==="-"&&S[1]==="-"){let R=i.theme.markUsedVariable(S);x||=R,y||=R}else d.add(S),x||=d.size!==V;if(!x)return m??=be(e,i,r.polyfills),m;let b=ge(d,i,{onInvalidCandidate:c}).astNodes;return r.from&&I(b,S=>{S.src??=a.src}),!y&&g===b.length?(m??=be(e,i,r.polyfills),m):(g=b.length,a.nodes=b,m=be(e,i,r.polyfills),m)}}}async function so(t,r={}){let i=ve(t,{from:r.from}),e=await yi(i,r),n=i,s=t;return{...e,build(a){let f=e.build(a);return f===n||(s=oe(f,!!r.from),n=f),s},buildSourceMap(){return wi({ast:n})}}}async function uo(t,r={}){return(await bi(ve(t),r)).designSystem}function We(){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 t in vt)t!=="default"&&(We[t]=vt[t]);module.exports=We; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3ab36ba484fe32b200cd53a0768e4d60354e4bd2 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/lib.mjs @@ -0,0 +1 @@ +import{a,b,c,d,e,f}from"./chunk-4WXWQT6Y.mjs";import"./chunk-G32FJCSR.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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6c11f7d9c7104c8ea65974778e6a97c1b5379e34 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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-B254mqw1.mjs'; +export { d as PluginAPI, P as PluginsConfig, T as ThemeConfig } from './types-B254mqw1.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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..305e84e2ec64ed4a7efada93ce8d0eca800674d7 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.d.ts @@ -0,0 +1,104 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-BIFUA2FY.js'; +import './colors-b_6i0Oi7.js'; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; +}; +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; +} + +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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.js b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..eca100caf8aa839dbccbcfaf890ab644a3742674 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.mjs b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/plugin.mjs new file mode 100644 index 0000000000000000000000000000000000000000..430fa2522dee47352031d52a9e969eb131a03be9 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/resolve-config-BIFUA2FY.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d9dbe2f707a40ecff28699792fe21f997927e7b --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e1cde16e3eced663175d9efb049bf42a799a589c --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/types-B254mqw1.d.mts b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/types-B254mqw1.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b3ac7a95a6ee083529ee6b9092ac64fe9ea84c32 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/dist/types-B254mqw1.d.mts @@ -0,0 +1,98 @@ +import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs'; + +type Config = UserConfig; +type PluginFn = (api: PluginAPI) => void; +type PluginWithConfig = { + handler: PluginFn; + config?: UserConfig; + /** @internal */ + reference?: boolean; +}; +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; +} + +export type { Config as C, Plugin as P, ThemeConfig as T, UserConfig as U, PluginFn as a, PluginWithConfig as b, PluginWithOptions as c, PluginAPI as d }; diff --git a/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/index.css b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/index.css new file mode 100644 index 0000000000000000000000000000000000000000..0792ea331489d66c5a97d176182c310634df1348 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/index.css @@ -0,0 +1,888 @@ +@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; + } + + /* + 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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/package.json b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0278a74369a22615de1e68a0be99050deb82d937 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/package.json @@ -0,0 +1,89 @@ +{ + "name": "tailwindcss", + "version": "4.1.11", + "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": { + "@ampproject/remapping": "^2.3.0", + "@types/node": "^20.19.0", + "dedent": "1.6.0", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "@tailwindcss/oxide": "^4.1.11" + }, + "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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/preflight.css b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/preflight.css new file mode 100644 index 0000000000000000000000000000000000000000..0976a40d4924e0876195f2edef5f7e7b5d911b0d --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/preflight.css @@ -0,0 +1,385 @@ +/* + 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; +} + +/* + 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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/theme.css b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/theme.css new file mode 100644 index 0000000000000000000000000000000000000000..52d447f7ffa0bbd5412bc76689b32ef77970e9e7 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/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/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/utilities.css b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/utilities.css new file mode 100644 index 0000000000000000000000000000000000000000..65dd5f63a7dff212950f378bf32188d9d6291439 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/node_modules/tailwindcss/utilities.css @@ -0,0 +1 @@ +@tailwind utilities; diff --git a/tools/ui/node_modules/@tailwindcss/vite/package.json b/tools/ui/node_modules/@tailwindcss/vite/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c4610f1edae86a2d739ea536a2f13659bbd404d5 --- /dev/null +++ b/tools/ui/node_modules/@tailwindcss/vite/package.json @@ -0,0 +1,42 @@ +{ + "name": "@tailwindcss/vite", + "version": "4.1.11", + "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-vite" + }, + "bugs": "https://github.com/tailwindlabs/tailwindcss/issues", + "homepage": "https://tailwindcss.com", + "files": [ + "dist/" + ], + "publishConfig": { + "provenance": true, + "access": "public" + }, + "exports": { + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.mjs" + } + }, + "dependencies": { + "@tailwindcss/oxide": "4.1.11", + "@tailwindcss/node": "4.1.11", + "tailwindcss": "4.1.11" + }, + "devDependencies": { + "@types/node": "^20.19.0", + "vite": "^7.0.0" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7" + }, + "scripts": { + "build": "tsup-node", + "dev": "pnpm run build -- --watch" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@testing-library/dom/LICENSE b/tools/ui/node_modules/@testing-library/dom/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4c43675bc4da5d353732ebb199ebaaf5eeeef014 --- /dev/null +++ b/tools/ui/node_modules/@testing-library/dom/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) 2017 Kent C. Dodds + +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/tools/ui/node_modules/@testing-library/dom/README.md b/tools/ui/node_modules/@testing-library/dom/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2011260acf6436e88aecb2197debae83aac4d3b9 --- /dev/null +++ b/tools/ui/node_modules/@testing-library/dom/README.md @@ -0,0 +1,402 @@ +
+

DOM Testing Library

+ + + octopus + + +

Simple and complete DOM testing utilities that encourage good testing +practices.

+ +[**Read the docs**](https://testing-library.com/dom) | +[Edit the docs](https://github.com/testing-library/testing-library-docs) + +
+ +
+ + +[![Build Status][build-badge]][build] +[![Code Coverage][coverage-badge]][coverage] +[![version][version-badge]][package] +[![downloads][downloads-badge]][npmtrends] +[![MIT License][license-badge]][license] +[![All Contributors][all-contributors-badge]](#contributors) +[![PRs Welcome][prs-badge]][prs] +[![Code of Conduct][coc-badge]][coc] +[![Discord][discord-badge]][discord] + +[![Watch on GitHub][github-watch-badge]][github-watch] +[![Star on GitHub][github-star-badge]][github-star] +[![Tweet][twitter-badge]][twitter] + + + + +## Table of Contents + + + + +- [The Problem](#the-problem) +- [This Solution](#this-solution) +- [Installation](#installation) +- [Documentation](#documentation) +- [Guiding Principles](#guiding-principles) +- [Contributors](#contributors) +- [LICENSE](#license) + + + +## The Problem + +You want to write maintainable tests for your Web UI. As a part of this goal, +you want your tests to avoid including implementation details of your components +and rather focus on making your tests give you the confidence for which they are +intended. As part of this, you want your testbase to be maintainable in the long +run so refactors of your components (changes to implementation but not +functionality) don't break your tests and slow you and your team down. + +## This Solution + +The `DOM Testing Library` is a very light-weight solution for testing DOM nodes +(whether simulated with [`JSDOM`](https://github.com/jsdom/jsdom) as provided by +default with [Jest][] or in the browser). The main utilities it provides involve +querying the DOM for nodes in a way that's similar to how the user finds +elements on the page. In this way, the library helps ensure your tests give you +confidence in your UI code. The `DOM Testing Library`'s primary guiding +principle is: + +> [The more your tests resemble the way your software is used, the more +> confidence they can give you.][guiding-principle] + +## Installation + +This module is distributed via [npm][npm] which is bundled with [node][node] and +should be installed as one of your project's `devDependencies`: + +``` +npm install --save-dev @testing-library/dom +``` + +> [**Docs**](https://testing-library.com/docs/install) + +## Documentation + +Read the docs (and discover framework and tool-specific implementations) at +[testing-library.com](https://testing-library.com/dom) + +## Guiding Principles + +> [The more your tests resemble the way your software is used, the more +> confidence they can give you.][guiding-principle] + +We try to only expose methods and utilities that encourage you to write tests +that closely resemble how your web pages are used. + +Utilities are included in this project based on the following guiding +principles: + +1. If it relates to rendering components, it deals with DOM nodes rather than + component instances, nor should it encourage dealing with component + instances. +2. It should be generally useful for testing the application components in the + way the user would use it. We _are_ making some trade-offs here because + we're using a computer and often a simulated browser environment, but in + general, utilities should encourage tests that use the components the way + they're intended to be used. +3. Utility implementations and APIs should be simple and flexible. + +At the end of the day, what we want is for this library to be pretty +light-weight, simple, and understandable. + +## Contributors + +Thanks goes to these people ([emoji key][emojis]): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Kent C. Dodds
Kent C. Dodds

💻 📖 🚇 ⚠️
Greg Bergé
Greg Bergé

🤔
Ryan Castner
Ryan Castner

📖
Daniel Sandiego
Daniel Sandiego

💻
Paweł Mikołajczyk
Paweł Mikołajczyk

💻
Alejandro Ñáñez Ortiz
Alejandro Ñáñez Ortiz

📖
Matt Parrish
Matt Parrish

🐛 💻 📖 ⚠️
Justin Hall
Justin Hall

📦
Anto Aravinth
Anto Aravinth

💻 ⚠️ 📖
Jonah Moses
Jonah Moses

📖
Łukasz Gandecki
Łukasz Gandecki

💻 ⚠️ 📖
Ivan Babak
Ivan Babak

🐛 🤔 💻 📖
Jesse Day
Jesse Day

💻
Ernesto García
Ernesto García

💬 💻 📖
Josef Maxx Blake
Josef Maxx Blake

💻 📖 ⚠️
Alex Cook
Alex Cook

📖 💡 👀
Daniel Cook
Daniel Cook

💻 📖 ⚠️
Thomas Chia
Thomas Chia

🐛 💻
Tim Deschryver
Tim Deschryver

💻 ⚠️ 👀
Alex Krolick
Alex Krolick

💻
Maddi Joyce
Maddi Joyce

💻
Peter Kamps
Peter Kamps

🐛 💻 ⚠️
Jonathan Stoye
Jonathan Stoye

📖 💻
Sanghyeon Lee
Sanghyeon Lee

💡
Justice Mba
Justice Mba

💻 📖 🤔
Wayne Crouch
Wayne Crouch

💻
Ben Elliott
Ben Elliott

💻
Ruben Costa
Ruben Costa

💻
Robert Smith
Robert Smith

🐛 🤔 📖
dadamssg
dadamssg

💻
Neil Kistner
Neil Kistner

💻 ⚠️
Ben Chauvette
Ben Chauvette

💻
Jeff Baumgardt
Jeff Baumgardt

💻 📖
Matan Kushner
Matan Kushner

💻 📖 🤔 ⚠️
Alex Wendte
Alex Wendte

💻 📖 ⚠️
Tamas Fodor
Tamas Fodor

📖
Benjamin Eckardt
Benjamin Eckardt

💻
Ryan Campbell
Ryan Campbell

📖
Taylor Briggs
Taylor Briggs

⚠️
John Gozde
John Gozde

💻
C. T. Lin
C. T. Lin

📖
Terrence Wong
Terrence Wong

💻
Soo Jae Hwang
Soo Jae Hwang

💻
Royston Shufflebotham
Royston Shufflebotham

🐛 💻 📖 ⚠️
Vadim Brodsky
Vadim Brodsky

💻
Eunjae Lee
Eunjae Lee

💻
David Peter
David Peter

💻
Shy Alter
Shy Alter

💻 📖
Łukasz Makuch
Łukasz Makuch

📦
Tyler Haas
Tyler Haas

💻 ⚠️
Vesa Laakso
Vesa Laakso

💻 ⚠️
Tulsi Sapkota
Tulsi Sapkota

💻
Tiago Nunes
Tiago Nunes

💻 ⚠️
JaxCavalera
JaxCavalera

💻 👀
bopfer
bopfer

⚠️
Jan Pfitzner
Jan Pfitzner

💻
David
David

💻
Diego Hernandez
Diego Hernandez

💻 ⚠️
Alex Young
Alex Young

💻
Paul Armstrong
Paul Armstrong

💻 ⚠️
Tamás Szabó
Tamás Szabó

💻 ⚠️
Dylan Piercey
Dylan Piercey

💻 ⚠️
Michael Lasky
Michael Lasky

💻 ⚠️ 📖
Sebastian Silbermann
Sebastian Silbermann

💻 ⚠️ 📖 🚇 👀
Dylan Vann
Dylan Vann

💻
Adrià Fontcuberta
Adrià Fontcuberta

💻 ⚠️ 📖
Thomas Lombart
Thomas Lombart

💻
Sam Horton
Sam Horton

💻 ⚠️
Andrew Hill
Andrew Hill

💻
Jan Amann
Jan Amann

💻 ⚠️
Brais Piñeiro
Brais Piñeiro

💻 ⚠️
Dominykas Blyžė
Dominykas Blyžė

💻 ⚠️
Olzhas Askar
Olzhas Askar

💻 ⚠️ 📖
Max Belsky
Max Belsky

💻 ⚠️
Michael Mantel
Michael Mantel

⚠️
Tom Nagle
Tom Nagle

💻
Westbrook Johnson
Westbrook Johnson

💻
Mohammad Aziz
Mohammad Aziz

💻 ⚠️
seetdev
seetdev

⚠️ 💻
Xavier Garcia Buils
Xavier Garcia Buils

💻 ⚠️
aw-davidson
aw-davidson

💻 ⚠️
Michaël De Boey
Michaël De Boey

💻
Minh Nguyen
Minh Nguyen

💻
Egill Sveinbjörnsson
Egill Sveinbjörnsson

💻
Pavel Pustovalov
Pavel Pustovalov

📖
Adam Palaniuk
Adam Palaniuk

💻 ⚠️
Yama-Tomo
Yama-Tomo

💻 ⚠️
Aaron Pettengill
Aaron Pettengill

💻 ⚠️
Kate W. Boyd
Kate W. Boyd

💻
Rahul Suryakanth
Rahul Suryakanth

💻 ⚠️
Jamie
Jamie

💻 ⚠️
Nicolas Stepien
Nicolas Stepien

💻
Ken Powers
Ken Powers

💻
Michał Zdunek
Michał Zdunek

💻
Ali Nasserzadeh
Ali Nasserzadeh

💻
Darek Kay
Darek Kay

📖 💻 ⚠️
Lukas
Lukas

💻 ⚠️
Tom Crockett
Tom Crockett

💻 ⚠️
Kevin Brewer
Kevin Brewer

💻 ⚠️
Ben Monro
Ben Monro

💻 🤔 ⚠️ 📖
Stephan Meijer
Stephan Meijer

🤔 💻 ⚠️
João Forja
João Forja

💻 ⚠️
Nick McCurdy
Nick McCurdy

📖 💻 ⚠️ 👀 🚇
Caleb Meredith
Caleb Meredith

💻
Marco Moretti
Marco Moretti

💻 ⚠️ 👀
Travis Jefferson
Travis Jefferson

💻 ⚠️
Maciej Jastrzebski
Maciej Jastrzebski

🐛
Geoff Harcourt
Geoff Harcourt

💻
Josh Goldberg
Josh Goldberg

💻 ⚠️
Ken Gregory
Ken Gregory

💻 ⚠️
Jacob Paris
Jacob Paris

💻 ⚠️
keiya sasaki
keiya sasaki

📖
Idan Entin
Idan Entin

💻 ⚠️
Deniz Susman
Deniz Susman

💻
Bianca Del Carretto
Bianca Del Carretto

⚠️ 💻
Josh Lalonde
Josh Lalonde

💻 ⚠️
Ioannis Papadopoulos
Ioannis Papadopoulos

💻 ⚠️
Maxwell Newlands
Maxwell Newlands

💻 ⚠️
Jared Luxenberg
Jared Luxenberg

💻 ⚠️
snizhana
snizhana

💻 ⚠️
Michael van Engelshoven
Michael van Engelshoven

👀
Asher Tuggle
Asher Tuggle

🐛
Winter LaMon
Winter LaMon

💻 ⚠️
Victor Cordova
Victor Cordova

💻 ⚠️
slowselfip
slowselfip

🐛
Dmitry Semigradsky
Dmitry Semigradsky

💻
Adam
Adam

💻 ⚠️
balavishnuvj
balavishnuvj

💻
Chris Colborne
Chris Colborne

💻
Romain Trotard
Romain Trotard

💻
Thomas Marshall
Thomas Marshall

💻 ⚠️
johnjessewood
johnjessewood

🐛 💻
Ari Perkkiö
Ari Perkkiö

🐛 💻 📖
Nathan Force
Nathan Force

💻
Philipp Fritsche
Philipp Fritsche

💻
Renato Alencar
Renato Alencar

💻 ⚠️
Simen Bekkhus
Simen Bekkhus

🐛
Dan Abramov
Dan Abramov

🐛 👀
Matan Borenkraout
Matan Borenkraout

💻
simcha90
simcha90

💻
Amit Miran
Amit Miran

🚇
Dominik Lesch
Dominik Lesch

📖
Gareth Jones
Gareth Jones

💻 ⚠️
Rayat Rahman
Rayat Rahman

💻
Nik Savchenko
Nik Savchenko

💻
Kevin Fleischman
Kevin Fleischman

💻 ⚠️
Beth Hitch
Beth Hitch

💻
Jack Laurence
Jack Laurence

💻
SantoJambit
SantoJambit

💻
Yashu Mittal
Yashu Mittal

📖
Ian VanSchooten
Ian VanSchooten

💻
Vanya Prokopovich
Vanya Prokopovich

🐛
James Nail
James Nail

🐛
Rob Caldecott
Rob Caldecott

🐛
Dennis273
Dennis273

💻
Jackson Hardaker
Jackson Hardaker

⚠️
Robin Drexler
Robin Drexler

💻
Omer Dolev
Omer Dolev

💻
Lirlev48
Lirlev48

💻
Tarnay Kálmán
Tarnay Kálmán

💻
Than Hutchins
Than Hutchins

💻
Raphaël LEMIEUX
Raphaël LEMIEUX

💻
Arthur Lauck Vilas Boas
Arthur Lauck Vilas Boas

📖
Daniel Acuña
Daniel Acuña

💻
Craig Morten
Craig Morten

💻 💬
Naor Peled
Naor Peled

💻
Julien Wajsberg
Julien Wajsberg

💻 🐛
Kevin BON
Kevin BON

💻 🐛
sieem
sieem

💻
+ + + + + + +This project follows the [all-contributors][all-contributors] specification. +Contributions of any kind welcome! + +## LICENSE + +[MIT](LICENSE) + + + +[npm]: https://www.npmjs.com/ +[node]: https://nodejs.org +[build-badge]: https://img.shields.io/github/workflow/status/testing-library/dom-testing-library/validate?logo=github&style=flat-square +[build]: https://github.com/testing-library/dom-testing-library/actions?query=workflow%3Avalidate +[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/dom-testing-library.svg?style=flat-square +[coverage]: https://codecov.io/github/testing-library/dom-testing-library +[version-badge]: https://img.shields.io/npm/v/@testing-library/dom.svg?style=flat-square +[package]: https://www.npmjs.com/package/@testing-library/dom +[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/dom.svg?style=flat-square +[npmtrends]: http://www.npmtrends.com/@testing-library/dom +[license-badge]: https://img.shields.io/npm/l/@testing-library/dom.svg?style=flat-square +[license]: https://github.com/testing-library/dom-testing-library/blob/main/LICENSE +[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square +[prs]: http://makeapullrequest.com +[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square +[coc]: https://github.com/testing-library/dom-testing-library/blob/main/CODE_OF_CONDUCT.md +[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/dom-testing-library.svg?style=social +[github-watch]: https://github.com/testing-library/dom-testing-library/watchers +[github-star-badge]: https://img.shields.io/github/stars/testing-library/dom-testing-library.svg?style=social +[github-star]: https://github.com/testing-library/dom-testing-library/stargazers +[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20dom-testing-library%20by%20%40testing-library%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fdom-testing-library%20%F0%9F%91%8D +[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/dom-testing-library.svg?style=social +[emojis]: https://github.com/all-contributors/all-contributors#emoji-key +[all-contributors]: https://github.com/all-contributors/all-contributors +[all-contributors-badge]: https://img.shields.io/github/all-contributors/testing-library/dom-testing-library?color=orange&style=flat-square +[set-immediate]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate +[guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106 +[jest]: https://facebook.github.io/jest +[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square +[discord]: https://discord.gg/testing-library + + diff --git a/tools/ui/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js b/tools/ui/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js new file mode 100644 index 0000000000000000000000000000000000000000..d23e7ab1e322613392d2ad04263fadee68e10ab1 --- /dev/null +++ b/tools/ui/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js @@ -0,0 +1,2951 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var prettyFormat = require('pretty-format'); +var domAccessibilityApi = require('dom-accessibility-api'); +var ariaQuery = require('aria-query'); +var lzString = require('lz-string'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} + +var prettyFormat__namespace = /*#__PURE__*/_interopNamespace(prettyFormat); +var lzString__default = /*#__PURE__*/_interopDefaultLegacy(lzString); + +/** + * Source: https://github.com/facebook/jest/blob/e7bb6a1e26ffab90611b2593912df15b69315611/packages/pretty-format/src/plugins/DOMElement.ts + */ +/* eslint-disable -- trying to stay as close to the original as possible */ +/* istanbul ignore file */ + +function escapeHTML(str) { + return str.replace(//g, '>'); +} +// Return empty string if keys is empty. +const printProps = (keys, props, config, indentation, depth, refs, printer) => { + const indentationNext = indentation + config.indent; + const colors = config.colors; + return keys.map(key => { + const value = props[key]; + let printed = printer(value, config, indentationNext, depth, refs); + if (typeof value !== 'string') { + if (printed.indexOf('\n') !== -1) { + printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation; + } + printed = '{' + printed + '}'; + } + return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close; + }).join(''); +}; + +// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#node_type_constants +const NodeTypeTextNode = 3; + +// Return empty string if children is empty. +const printChildren = (children, config, indentation, depth, refs, printer) => children.map(child => { + const printedChild = typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs); + if (printedChild === '' && typeof child === 'object' && child !== null && child.nodeType !== NodeTypeTextNode) { + // A plugin serialized this Node to '' meaning we should ignore it. + return ''; + } + return config.spacingOuter + indentation + printedChild; +}).join(''); +const printText = (text, config) => { + const contentColor = config.colors.content; + return contentColor.open + escapeHTML(text) + contentColor.close; +}; +const printComment = (comment, config) => { + const commentColor = config.colors.comment; + return commentColor.open + '' + commentColor.close; +}; + +// Separate the functions to format props, children, and element, +// so a plugin could override a particular function, if needed. +// Too bad, so sad: the traditional (but unnecessary) space +// in a self-closing tagColor requires a second test of printedProps. +const printElement = (type, printedProps, printedChildren, config, indentation) => { + const tagColor = config.colors.tag; + return tagColor.open + '<' + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '' + tagColor.close; +}; +const printElementAsLeaf = (type, config) => { + const tagColor = config.colors.tag; + return tagColor.open + '<' + type + tagColor.close + ' …' + tagColor.open + ' />' + tagColor.close; +}; +const ELEMENT_NODE$1 = 1; +const TEXT_NODE$1 = 3; +const COMMENT_NODE$1 = 8; +const FRAGMENT_NODE = 11; +const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/; +const isCustomElement = val => { + const { + tagName + } = val; + return Boolean(typeof tagName === 'string' && tagName.includes('-') || typeof val.hasAttribute === 'function' && val.hasAttribute('is')); +}; +const testNode = val => { + const constructorName = val.constructor.name; + const { + nodeType + } = val; + return nodeType === ELEMENT_NODE$1 && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE$1 && constructorName === 'Text' || nodeType === COMMENT_NODE$1 && constructorName === 'Comment' || nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment'; +}; +function nodeIsText(node) { + return node.nodeType === TEXT_NODE$1; +} +function nodeIsComment(node) { + return node.nodeType === COMMENT_NODE$1; +} +function nodeIsFragment(node) { + return node.nodeType === FRAGMENT_NODE; +} +function createDOMElementFilter(filterNode) { + return { + test: val => { + var _val$constructor2; + return ((val == null || (_val$constructor2 = val.constructor) == null ? void 0 : _val$constructor2.name) || isCustomElement(val)) && testNode(val); + }, + serialize: (node, config, indentation, depth, refs, printer) => { + if (nodeIsText(node)) { + return printText(node.data, config); + } + if (nodeIsComment(node)) { + return printComment(node.data, config); + } + const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase(); + if (++depth > config.maxDepth) { + return printElementAsLeaf(type, config); + } + return printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes).map(attr => attr.name).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce((props, attribute) => { + props[attribute.name] = attribute.value; + return props; + }, {}), config, indentation + config.indent, depth, refs, printer), printChildren(Array.prototype.slice.call(node.childNodes || node.children).filter(filterNode), config, indentation + config.indent, depth, refs, printer), config, indentation); + } + }; +} + +// We try to load node dependencies +let picocolors = null; +let readFileSync = null; +let codeFrameColumns = null; +try { + const nodeRequire = module && module.require; + readFileSync = nodeRequire.call(module, 'fs').readFileSync; + codeFrameColumns = nodeRequire.call(module, '@babel/code-frame').codeFrameColumns; + picocolors = nodeRequire.call(module, 'picocolors'); +} catch { + // We're in a browser environment +} + +// frame has the form "at myMethod (location/to/my/file.js:10:2)" +function getCodeFrame(frame) { + const locationStart = frame.indexOf('(') + 1; + const locationEnd = frame.indexOf(')'); + const frameLocation = frame.slice(locationStart, locationEnd); + const frameLocationElements = frameLocation.split(':'); + const [filename, line, column] = [frameLocationElements[0], parseInt(frameLocationElements[1], 10), parseInt(frameLocationElements[2], 10)]; + let rawFileContents = ''; + try { + rawFileContents = readFileSync(filename, 'utf-8'); + } catch { + return ''; + } + const codeFrame = codeFrameColumns(rawFileContents, { + start: { + line, + column + } + }, { + highlightCode: true, + linesBelow: 0 + }); + return picocolors.dim(frameLocation) + "\n" + codeFrame + "\n"; +} +function getUserCodeFrame() { + // If we couldn't load dependencies, we can't generate the user trace + /* istanbul ignore next */ + if (!readFileSync || !codeFrameColumns) { + return ''; + } + const err = new Error(); + const firstClientCodeFrame = err.stack.split('\n').slice(1) // Remove first line which has the form "Error: TypeError" + .find(frame => !frame.includes('node_modules/')); // Ignore frames from 3rd party libraries + + return getCodeFrame(firstClientCodeFrame); +} + +// Constant node.nodeType for text nodes, see: +// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#Node_type_constants +const TEXT_NODE = 3; +function jestFakeTimersAreEnabled() { + /* istanbul ignore else */ + // eslint-disable-next-line + if (typeof jest !== 'undefined' && jest !== null) { + return ( + // legacy timers + setTimeout._isMockFunction === true || + // modern timers + // eslint-disable-next-line prefer-object-has-own -- not supported by our support matrix + Object.prototype.hasOwnProperty.call(setTimeout, 'clock') + ); + } + // istanbul ignore next + return false; +} +function getDocument() { + /* istanbul ignore if */ + if (typeof window === 'undefined') { + throw new Error('Could not find default container'); + } + return window.document; +} +function getWindowFromNode(node) { + if (node.defaultView) { + // node is document + return node.defaultView; + } else if (node.ownerDocument && node.ownerDocument.defaultView) { + // node is a DOM node + return node.ownerDocument.defaultView; + } else if (node.window) { + // node is window + return node.window; + } else if (node.ownerDocument && node.ownerDocument.defaultView === null) { + throw new Error("It looks like the window object is not available for the provided node."); + } else if (node.then instanceof Function) { + throw new Error("It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?"); + } else if (Array.isArray(node)) { + throw new Error("It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?"); + } else if (typeof node.debug === 'function' && typeof node.logTestingPlaygroundURL === 'function') { + throw new Error("It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?"); + } else { + // The user passed something unusual to a calling function + throw new Error("The given node is not an Element, the node type is: " + typeof node + "."); + } +} +function checkContainerType(container) { + if (!container || !(typeof container.querySelector === 'function') || !(typeof container.querySelectorAll === 'function')) { + throw new TypeError("Expected container to be an Element, a Document or a DocumentFragment but got " + getTypeName(container) + "."); + } + function getTypeName(object) { + if (typeof object === 'object') { + return object === null ? 'null' : object.constructor.name; + } + return typeof object; + } +} + +const shouldHighlight = () => { + if (typeof process === 'undefined') { + // Don't colorize in non-node environments (e.g. Browsers) + return false; + } + let colors; + // Try to safely parse env COLORS: We will default behavior if any step fails. + try { + var _process$env; + const colorsJSON = (_process$env = process.env) == null ? void 0 : _process$env.COLORS; + if (colorsJSON) { + colors = JSON.parse(colorsJSON); + } + } catch { + // If this throws, process.env?.COLORS wasn't parsable. Since we only + // care about `true` or `false`, we can safely ignore the error. + } + if (typeof colors === 'boolean') { + // If `colors` is set explicitly (both `true` and `false`), use that value. + return colors; + } else { + // If `colors` is not set, colorize if we're in node. + return process.versions !== undefined && process.versions.node !== undefined; + } +}; +const { + DOMCollection +} = prettyFormat__namespace.plugins; + +// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#node_type_constants +const ELEMENT_NODE = 1; +const COMMENT_NODE = 8; + +// https://github.com/facebook/jest/blob/615084195ae1ae61ddd56162c62bbdda17587569/packages/pretty-format/src/plugins/DOMElement.ts#L50 +function filterCommentsAndDefaultIgnoreTagsTags(value) { + return value.nodeType !== COMMENT_NODE && (value.nodeType !== ELEMENT_NODE || !value.matches(getConfig().defaultIgnore)); +} +function prettyDOM(dom, maxLength, options) { + if (options === void 0) { + options = {}; + } + if (!dom) { + dom = getDocument().body; + } + if (typeof maxLength !== 'number') { + maxLength = typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.DEBUG_PRINT_LIMIT || 7000; + } + if (maxLength === 0) { + return ''; + } + if (dom.documentElement) { + dom = dom.documentElement; + } + let domTypeName = typeof dom; + if (domTypeName === 'object') { + domTypeName = dom.constructor.name; + } else { + // To don't fall with `in` operator + dom = {}; + } + if (!('outerHTML' in dom)) { + throw new TypeError("Expected an element or document but got " + domTypeName); + } + const { + filterNode = filterCommentsAndDefaultIgnoreTagsTags, + ...prettyFormatOptions + } = options; + const debugContent = prettyFormat__namespace.format(dom, { + plugins: [createDOMElementFilter(filterNode), DOMCollection], + printFunctionName: false, + highlight: shouldHighlight(), + ...prettyFormatOptions + }); + return maxLength !== undefined && dom.outerHTML.length > maxLength ? debugContent.slice(0, maxLength) + "..." : debugContent; +} +const logDOM = function () { + const userCodeFrame = getUserCodeFrame(); + if (userCodeFrame) { + console.log(prettyDOM(...arguments) + "\n\n" + userCodeFrame); + } else { + console.log(prettyDOM(...arguments)); + } +}; + +// It would be cleaner for this to live inside './queries', but +// other parts of the code assume that all exports from +// './queries' are query functions. +let config = { + testIdAttribute: 'data-testid', + asyncUtilTimeout: 1000, + // asyncWrapper and advanceTimersWrapper is to support React's async `act` function. + // forcing react-testing-library to wrap all async functions would've been + // a total nightmare (consider wrapping every findBy* query and then also + // updating `within` so those would be wrapped too. Total nightmare). + // so we have this config option that's really only intended for + // react-testing-library to use. For that reason, this feature will remain + // undocumented. + asyncWrapper: cb => cb(), + unstable_advanceTimersWrapper: cb => cb(), + eventWrapper: cb => cb(), + // default value for the `hidden` option in `ByRole` queries + defaultHidden: false, + // default value for the `ignore` option in `ByText` queries + defaultIgnore: 'script, style', + // showOriginalStackTrace flag to show the full error stack traces for async errors + showOriginalStackTrace: false, + // throw errors w/ suggestions for better queries. Opt in so off by default. + throwSuggestions: false, + // called when getBy* queries fail. (message, container) => Error + getElementError(message, container) { + const prettifiedDOM = prettyDOM(container); + const error = new Error([message, "Ignored nodes: comments, " + config.defaultIgnore + "\n" + prettifiedDOM].filter(Boolean).join('\n\n')); + error.name = 'TestingLibraryElementError'; + return error; + }, + _disableExpensiveErrorDiagnostics: false, + computedStyleSupportsPseudoElements: false +}; +function runWithExpensiveErrorDiagnosticsDisabled(callback) { + try { + config._disableExpensiveErrorDiagnostics = true; + return callback(); + } finally { + config._disableExpensiveErrorDiagnostics = false; + } +} +function configure(newConfig) { + if (typeof newConfig === 'function') { + // Pass the existing config out to the provided function + // and accept a delta in return + newConfig = newConfig(config); + } + + // Merge the incoming config delta + config = { + ...config, + ...newConfig + }; +} +function getConfig() { + return config; +} + +const labelledNodeNames = ['button', 'meter', 'output', 'progress', 'select', 'textarea', 'input']; +function getTextContent(node) { + if (labelledNodeNames.includes(node.nodeName.toLowerCase())) { + return ''; + } + if (node.nodeType === TEXT_NODE) return node.textContent; + return Array.from(node.childNodes).map(childNode => getTextContent(childNode)).join(''); +} +function getLabelContent(element) { + let textContent; + if (element.tagName.toLowerCase() === 'label') { + textContent = getTextContent(element); + } else { + textContent = element.value || element.textContent; + } + return textContent; +} + +// Based on https://github.com/eps1lon/dom-accessibility-api/pull/352 +function getRealLabels(element) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- types are not aware of older browsers that don't implement `labels` + if (element.labels !== undefined) { + var _labels; + return (_labels = element.labels) != null ? _labels : []; + } + if (!isLabelable(element)) return []; + const labels = element.ownerDocument.querySelectorAll('label'); + return Array.from(labels).filter(label => label.control === element); +} +function isLabelable(element) { + return /BUTTON|METER|OUTPUT|PROGRESS|SELECT|TEXTAREA/.test(element.tagName) || element.tagName === 'INPUT' && element.getAttribute('type') !== 'hidden'; +} +function getLabels(container, element, _temp) { + let { + selector = '*' + } = _temp === void 0 ? {} : _temp; + const ariaLabelledBy = element.getAttribute('aria-labelledby'); + const labelsId = ariaLabelledBy ? ariaLabelledBy.split(' ') : []; + return labelsId.length ? labelsId.map(labelId => { + const labellingElement = container.querySelector("[id=\"" + labelId + "\"]"); + return labellingElement ? { + content: getLabelContent(labellingElement), + formControl: null + } : { + content: '', + formControl: null + }; + }) : Array.from(getRealLabels(element)).map(label => { + const textToMatch = getLabelContent(label); + const formControlSelector = 'button, input, meter, output, progress, select, textarea'; + const labelledFormControl = Array.from(label.querySelectorAll(formControlSelector)).filter(formControlElement => formControlElement.matches(selector))[0]; + return { + content: textToMatch, + formControl: labelledFormControl + }; + }); +} + +function assertNotNullOrUndefined(matcher) { + if (matcher === null || matcher === undefined) { + throw new Error(// eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- implicitly converting `T` to `string` + "It looks like " + matcher + " was passed instead of a matcher. Did you do something like getByText(" + matcher + ")?"); + } +} +function fuzzyMatches(textToMatch, node, matcher, normalizer) { + if (typeof textToMatch !== 'string') { + return false; + } + assertNotNullOrUndefined(matcher); + const normalizedText = normalizer(textToMatch); + if (typeof matcher === 'string' || typeof matcher === 'number') { + return normalizedText.toLowerCase().includes(matcher.toString().toLowerCase()); + } else if (typeof matcher === 'function') { + return matcher(normalizedText, node); + } else { + return matchRegExp(matcher, normalizedText); + } +} +function matches(textToMatch, node, matcher, normalizer) { + if (typeof textToMatch !== 'string') { + return false; + } + assertNotNullOrUndefined(matcher); + const normalizedText = normalizer(textToMatch); + if (matcher instanceof Function) { + return matcher(normalizedText, node); + } else if (matcher instanceof RegExp) { + return matchRegExp(matcher, normalizedText); + } else { + return normalizedText === String(matcher); + } +} +function getDefaultNormalizer(_temp) { + let { + trim = true, + collapseWhitespace = true + } = _temp === void 0 ? {} : _temp; + return text => { + let normalizedText = text; + normalizedText = trim ? normalizedText.trim() : normalizedText; + normalizedText = collapseWhitespace ? normalizedText.replace(/\s+/g, ' ') : normalizedText; + return normalizedText; + }; +} + +/** + * Constructs a normalizer to pass to functions in matches.js + * @param {boolean|undefined} trim The user-specified value for `trim`, without + * any defaulting having been applied + * @param {boolean|undefined} collapseWhitespace The user-specified value for + * `collapseWhitespace`, without any defaulting having been applied + * @param {Function|undefined} normalizer The user-specified normalizer + * @returns {Function} A normalizer + */ + +function makeNormalizer(_ref) { + let { + trim, + collapseWhitespace, + normalizer + } = _ref; + if (!normalizer) { + // No custom normalizer specified. Just use default. + return getDefaultNormalizer({ + trim, + collapseWhitespace + }); + } + if (typeof trim !== 'undefined' || typeof collapseWhitespace !== 'undefined') { + // They've also specified a value for trim or collapseWhitespace + throw new Error('trim and collapseWhitespace are not supported with a normalizer. ' + 'If you want to use the default trim and collapseWhitespace logic in your normalizer, ' + 'use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer'); + } + return normalizer; +} +function matchRegExp(matcher, text) { + const match = matcher.test(text); + if (matcher.global && matcher.lastIndex !== 0) { + console.warn("To match all elements we had to reset the lastIndex of the RegExp because the global flag is enabled. We encourage to remove the global flag from the RegExp."); + matcher.lastIndex = 0; + } + return match; +} + +function getNodeText(node) { + if (node.matches('input[type=submit], input[type=button], input[type=reset]')) { + return node.value; + } + return Array.from(node.childNodes).filter(child => child.nodeType === TEXT_NODE && Boolean(child.textContent)).map(c => c.textContent).join(''); +} + +const elementRoleList = buildElementRoleList(ariaQuery.elementRoles); + +/** + * @param {Element} element - + * @returns {boolean} - `true` if `element` and its subtree are inaccessible + */ +function isSubtreeInaccessible(element) { + if (element.hidden === true) { + return true; + } + if (element.getAttribute('aria-hidden') === 'true') { + return true; + } + const window = element.ownerDocument.defaultView; + if (window.getComputedStyle(element).display === 'none') { + return true; + } + return false; +} + +/** + * Partial implementation https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion + * which should only be used for elements with a non-presentational role i.e. + * `role="none"` and `role="presentation"` will not be excluded. + * + * Implements aria-hidden semantics (i.e. parent overrides child) + * Ignores "Child Presentational: True" characteristics + * + * @param {Element} element - + * @param {object} [options] - + * @param {function (element: Element): boolean} options.isSubtreeInaccessible - + * can be used to return cached results from previous isSubtreeInaccessible calls + * @returns {boolean} true if excluded, otherwise false + */ +function isInaccessible(element, options) { + if (options === void 0) { + options = {}; + } + const { + isSubtreeInaccessible: isSubtreeInaccessibleImpl = isSubtreeInaccessible + } = options; + const window = element.ownerDocument.defaultView; + // since visibility is inherited we can exit early + if (window.getComputedStyle(element).visibility === 'hidden') { + return true; + } + let currentElement = element; + while (currentElement) { + if (isSubtreeInaccessibleImpl(currentElement)) { + return true; + } + currentElement = currentElement.parentElement; + } + return false; +} +function getImplicitAriaRoles(currentNode) { + // eslint bug here: + // eslint-disable-next-line no-unused-vars + for (const { + match, + roles + } of elementRoleList) { + if (match(currentNode)) { + return [...roles]; + } + } + return []; +} +function buildElementRoleList(elementRolesMap) { + function makeElementSelector(_ref) { + let { + name, + attributes + } = _ref; + return "" + name + attributes.map(_ref2 => { + let { + name: attributeName, + value, + constraints = [] + } = _ref2; + const shouldNotExist = constraints.indexOf('undefined') !== -1; + const shouldBeNonEmpty = constraints.indexOf('set') !== -1; + const hasExplicitValue = typeof value !== 'undefined'; + if (hasExplicitValue) { + return "[" + attributeName + "=\"" + value + "\"]"; + } else if (shouldNotExist) { + return ":not([" + attributeName + "])"; + } else if (shouldBeNonEmpty) { + return "[" + attributeName + "]:not([" + attributeName + "=\"\"])"; + } + return "[" + attributeName + "]"; + }).join(''); + } + function getSelectorSpecificity(_ref3) { + let { + attributes = [] + } = _ref3; + return attributes.length; + } + function bySelectorSpecificity(_ref4, _ref5) { + let { + specificity: leftSpecificity + } = _ref4; + let { + specificity: rightSpecificity + } = _ref5; + return rightSpecificity - leftSpecificity; + } + function match(element) { + let { + attributes = [] + } = element; + + // https://github.com/testing-library/dom-testing-library/issues/814 + const typeTextIndex = attributes.findIndex(attribute => attribute.value && attribute.name === 'type' && attribute.value === 'text'); + if (typeTextIndex >= 0) { + // not using splice to not mutate the attributes array + attributes = [...attributes.slice(0, typeTextIndex), ...attributes.slice(typeTextIndex + 1)]; + } + const selector = makeElementSelector({ + ...element, + attributes + }); + return node => { + if (typeTextIndex >= 0 && node.type !== 'text') { + return false; + } + return node.matches(selector); + }; + } + let result = []; + + // eslint bug here: + // eslint-disable-next-line no-unused-vars + for (const [element, roles] of elementRolesMap.entries()) { + result = [...result, { + match: match(element), + roles: Array.from(roles), + specificity: getSelectorSpecificity(element) + }]; + } + return result.sort(bySelectorSpecificity); +} +function getRoles(container, _temp) { + let { + hidden = false + } = _temp === void 0 ? {} : _temp; + function flattenDOM(node) { + return [node, ...Array.from(node.children).reduce((acc, child) => [...acc, ...flattenDOM(child)], [])]; + } + return flattenDOM(container).filter(element => { + return hidden === false ? isInaccessible(element) === false : true; + }).reduce((acc, node) => { + let roles = []; + // TODO: This violates html-aria which does not allow any role on every element + if (node.hasAttribute('role')) { + roles = node.getAttribute('role').split(' ').slice(0, 1); + } else { + roles = getImplicitAriaRoles(node); + } + return roles.reduce((rolesAcc, role) => Array.isArray(rolesAcc[role]) ? { + ...rolesAcc, + [role]: [...rolesAcc[role], node] + } : { + ...rolesAcc, + [role]: [node] + }, acc); + }, {}); +} +function prettyRoles(dom, _ref6) { + let { + hidden, + includeDescription + } = _ref6; + const roles = getRoles(dom, { + hidden + }); + // We prefer to skip generic role, we don't recommend it + return Object.entries(roles).filter(_ref7 => { + let [role] = _ref7; + return role !== 'generic'; + }).map(_ref8 => { + let [role, elements] = _ref8; + const delimiterBar = '-'.repeat(50); + const elementsString = elements.map(el => { + const nameString = "Name \"" + domAccessibilityApi.computeAccessibleName(el, { + computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements + }) + "\":\n"; + const domString = prettyDOM(el.cloneNode(false)); + if (includeDescription) { + const descriptionString = "Description \"" + domAccessibilityApi.computeAccessibleDescription(el, { + computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements + }) + "\":\n"; + return "" + nameString + descriptionString + domString; + } + return "" + nameString + domString; + }).join('\n\n'); + return role + ":\n\n" + elementsString + "\n\n" + delimiterBar; + }).join('\n'); +} +const logRoles = function (dom, _temp2) { + let { + hidden = false + } = _temp2 === void 0 ? {} : _temp2; + return console.log(prettyRoles(dom, { + hidden + })); +}; + +/** + * @param {Element} element - + * @returns {boolean | undefined} - false/true if (not)selected, undefined if not selectable + */ +function computeAriaSelected(element) { + // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings + // https://www.w3.org/TR/html-aam-1.0/#details-id-97 + if (element.tagName === 'OPTION') { + return element.selected; + } + + // explicit value + return checkBooleanAttribute(element, 'aria-selected'); +} + +/** + * @param {Element} element - + * @returns {boolean} - + */ +function computeAriaBusy(element) { + // https://www.w3.org/TR/wai-aria-1.1/#aria-busy + return element.getAttribute('aria-busy') === 'true'; +} + +/** + * @param {Element} element - + * @returns {boolean | undefined} - false/true if (not)checked, undefined if not checked-able + */ +function computeAriaChecked(element) { + // implicit value from html-aam mappings: https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings + // https://www.w3.org/TR/html-aam-1.0/#details-id-56 + // https://www.w3.org/TR/html-aam-1.0/#details-id-67 + if ('indeterminate' in element && element.indeterminate) { + return undefined; + } + if ('checked' in element) { + return element.checked; + } + + // explicit value + return checkBooleanAttribute(element, 'aria-checked'); +} + +/** + * @param {Element} element - + * @returns {boolean | undefined} - false/true if (not)pressed, undefined if not press-able + */ +function computeAriaPressed(element) { + // https://www.w3.org/TR/wai-aria-1.1/#aria-pressed + return checkBooleanAttribute(element, 'aria-pressed'); +} + +/** + * @param {Element} element - + * @returns {boolean | string | null} - + */ +function computeAriaCurrent(element) { + var _ref9, _checkBooleanAttribut; + // https://www.w3.org/TR/wai-aria-1.1/#aria-current + return (_ref9 = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref9 : false; +} + +/** + * @param {Element} element - + * @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able + */ +function computeAriaExpanded(element) { + // https://www.w3.org/TR/wai-aria-1.1/#aria-expanded + return checkBooleanAttribute(element, 'aria-expanded'); +} +function checkBooleanAttribute(element, attribute) { + const attributeValue = element.getAttribute(attribute); + if (attributeValue === 'true') { + return true; + } + if (attributeValue === 'false') { + return false; + } + return undefined; +} + +/** + * @param {Element} element - + * @returns {number | undefined} - number if implicit heading or aria-level present, otherwise undefined + */ +function computeHeadingLevel(element) { + // https://w3c.github.io/html-aam/#el-h1-h6 + // https://w3c.github.io/html-aam/#el-h1-h6 + const implicitHeadingLevels = { + H1: 1, + H2: 2, + H3: 3, + H4: 4, + H5: 5, + H6: 6 + }; + // explicit aria-level value + // https://www.w3.org/TR/wai-aria-1.2/#aria-level + const ariaLevelAttribute = element.getAttribute('aria-level') && Number(element.getAttribute('aria-level')); + return ariaLevelAttribute || implicitHeadingLevels[element.tagName]; +} + +/** + * @param {Element} element - + * @returns {number | undefined} - + */ +function computeAriaValueNow(element) { + const valueNow = element.getAttribute('aria-valuenow'); + return valueNow === null ? undefined : +valueNow; +} + +/** + * @param {Element} element - + * @returns {number | undefined} - + */ +function computeAriaValueMax(element) { + const valueMax = element.getAttribute('aria-valuemax'); + return valueMax === null ? undefined : +valueMax; +} + +/** + * @param {Element} element - + * @returns {number | undefined} - + */ +function computeAriaValueMin(element) { + const valueMin = element.getAttribute('aria-valuemin'); + return valueMin === null ? undefined : +valueMin; +} + +/** + * @param {Element} element - + * @returns {string | undefined} - + */ +function computeAriaValueText(element) { + const valueText = element.getAttribute('aria-valuetext'); + return valueText === null ? undefined : valueText; +} + +const normalize = getDefaultNormalizer(); +function escapeRegExp(string) { + return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} +function getRegExpMatcher(string) { + return new RegExp(escapeRegExp(string.toLowerCase()), 'i'); +} +function makeSuggestion(queryName, element, content, _ref) { + let { + variant, + name + } = _ref; + let warning = ''; + const queryOptions = {}; + const queryArgs = [['Role', 'TestId'].includes(queryName) ? content : getRegExpMatcher(content)]; + if (name) { + queryOptions.name = getRegExpMatcher(name); + } + if (queryName === 'Role' && isInaccessible(element)) { + queryOptions.hidden = true; + warning = "Element is inaccessible. This means that the element and all its children are invisible to screen readers.\n If you are using the aria-hidden prop, make sure this is the right choice for your case.\n "; + } + if (Object.keys(queryOptions).length > 0) { + queryArgs.push(queryOptions); + } + const queryMethod = variant + "By" + queryName; + return { + queryName, + queryMethod, + queryArgs, + variant, + warning, + toString() { + if (warning) { + console.warn(warning); + } + let [text, options] = queryArgs; + text = typeof text === 'string' ? "'" + text + "'" : text; + options = options ? ", { " + Object.entries(options).map(_ref2 => { + let [k, v] = _ref2; + return k + ": " + v; + }).join(', ') + " }" : ''; + return queryMethod + "(" + text + options + ")"; + } + }; +} +function canSuggest(currentMethod, requestedMethod, data) { + return data && (!requestedMethod || requestedMethod.toLowerCase() === currentMethod.toLowerCase()); +} +function getSuggestedQuery(element, variant, method) { + var _element$getAttribute, _getImplicitAriaRoles; + if (variant === void 0) { + variant = 'get'; + } + // don't create suggestions for script and style elements + if (element.matches(getConfig().defaultIgnore)) { + return undefined; + } + + //We prefer to suggest something else if the role is generic + const role = (_element$getAttribute = element.getAttribute('role')) != null ? _element$getAttribute : (_getImplicitAriaRoles = getImplicitAriaRoles(element)) == null ? void 0 : _getImplicitAriaRoles[0]; + if (role !== 'generic' && canSuggest('Role', method, role)) { + return makeSuggestion('Role', element, role, { + variant, + name: domAccessibilityApi.computeAccessibleName(element, { + computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements + }) + }); + } + const labelText = getLabels(document, element).map(label => label.content).join(' '); + if (canSuggest('LabelText', method, labelText)) { + return makeSuggestion('LabelText', element, labelText, { + variant + }); + } + const placeholderText = element.getAttribute('placeholder'); + if (canSuggest('PlaceholderText', method, placeholderText)) { + return makeSuggestion('PlaceholderText', element, placeholderText, { + variant + }); + } + const textContent = normalize(getNodeText(element)); + if (canSuggest('Text', method, textContent)) { + return makeSuggestion('Text', element, textContent, { + variant + }); + } + if (canSuggest('DisplayValue', method, element.value)) { + return makeSuggestion('DisplayValue', element, normalize(element.value), { + variant + }); + } + const alt = element.getAttribute('alt'); + if (canSuggest('AltText', method, alt)) { + return makeSuggestion('AltText', element, alt, { + variant + }); + } + const title = element.getAttribute('title'); + if (canSuggest('Title', method, title)) { + return makeSuggestion('Title', element, title, { + variant + }); + } + const testId = element.getAttribute(getConfig().testIdAttribute); + if (canSuggest('TestId', method, testId)) { + return makeSuggestion('TestId', element, testId, { + variant + }); + } + return undefined; +} + +// This is so the stack trace the developer sees is one that's +// closer to their code (because async stack traces are hard to follow). +function copyStackTrace(target, source) { + target.stack = source.stack.replace(source.message, target.message); +} +function waitFor(callback, _ref) { + let { + container = getDocument(), + timeout = getConfig().asyncUtilTimeout, + showOriginalStackTrace = getConfig().showOriginalStackTrace, + stackTraceError, + interval = 50, + onTimeout = error => { + Object.defineProperty(error, 'message', { + value: getConfig().getElementError(error.message, container).message + }); + return error; + }, + mutationObserverOptions = { + subtree: true, + childList: true, + attributes: true, + characterData: true + } + } = _ref; + if (typeof callback !== 'function') { + throw new TypeError('Received `callback` arg must be a function'); + } + return new Promise(async (resolve, reject) => { + let lastError, intervalId, observer; + let finished = false; + let promiseStatus = 'idle'; + const overallTimeoutTimer = setTimeout(handleTimeout, timeout); + const usingJestFakeTimers = jestFakeTimersAreEnabled(); + if (usingJestFakeTimers) { + const { + unstable_advanceTimersWrapper: advanceTimersWrapper + } = getConfig(); + checkCallback(); + // this is a dangerous rule to disable because it could lead to an + // infinite loop. However, eslint isn't smart enough to know that we're + // setting finished inside `onDone` which will be called when we're done + // waiting or when we've timed out. + // eslint-disable-next-line no-unmodified-loop-condition + while (!finished) { + if (!jestFakeTimersAreEnabled()) { + const error = new Error("Changed from using fake timers to real timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to real timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830"); + if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError); + reject(error); + return; + } + + // In this rare case, we *need* to wait for in-flight promises + // to resolve before continuing. We don't need to take advantage + // of parallelization so we're fine. + // https://stackoverflow.com/a/59243586/971592 + // eslint-disable-next-line no-await-in-loop + await advanceTimersWrapper(async () => { + // we *could* (maybe should?) use `advanceTimersToNextTimer` but it's + // possible that could make this loop go on forever if someone is using + // third party code that's setting up recursive timers so rapidly that + // the user's timer's don't get a chance to resolve. So we'll advance + // by an interval instead. (We have a test for this case). + jest.advanceTimersByTime(interval); + }); + + // Could have timed-out + if (finished) { + break; + } + // It's really important that checkCallback is run *before* we flush + // in-flight promises. To be honest, I'm not sure why, and I can't quite + // think of a way to reproduce the problem in a test, but I spent + // an entire day banging my head against a wall on this. + checkCallback(); + } + } else { + try { + checkContainerType(container); + } catch (e) { + reject(e); + return; + } + intervalId = setInterval(checkRealTimersCallback, interval); + const { + MutationObserver + } = getWindowFromNode(container); + observer = new MutationObserver(checkRealTimersCallback); + observer.observe(container, mutationObserverOptions); + checkCallback(); + } + function onDone(error, result) { + finished = true; + clearTimeout(overallTimeoutTimer); + if (!usingJestFakeTimers) { + clearInterval(intervalId); + observer.disconnect(); + } + if (error) { + reject(error); + } else { + resolve(result); + } + } + function checkRealTimersCallback() { + if (jestFakeTimersAreEnabled()) { + const error = new Error("Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830"); + if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError); + return reject(error); + } else { + return checkCallback(); + } + } + function checkCallback() { + if (promiseStatus === 'pending') return; + try { + const result = runWithExpensiveErrorDiagnosticsDisabled(callback); + if (typeof (result == null ? void 0 : result.then) === 'function') { + promiseStatus = 'pending'; + result.then(resolvedValue => { + promiseStatus = 'resolved'; + onDone(null, resolvedValue); + }, rejectedValue => { + promiseStatus = 'rejected'; + lastError = rejectedValue; + }); + } else { + onDone(null, result); + } + // If `callback` throws, wait for the next mutation, interval, or timeout. + } catch (error) { + // Save the most recent callback error to reject the promise with it in the event of a timeout + lastError = error; + } + } + function handleTimeout() { + let error; + if (lastError) { + error = lastError; + if (!showOriginalStackTrace && error.name === 'TestingLibraryElementError') { + copyStackTrace(error, stackTraceError); + } + } else { + error = new Error('Timed out in waitFor.'); + if (!showOriginalStackTrace) { + copyStackTrace(error, stackTraceError); + } + } + onDone(onTimeout(error), null); + } + }); +} +function waitForWrapper(callback, options) { + // create the error here so its stack trace is as close to the + // calling code as possible + const stackTraceError = new Error('STACK_TRACE_MESSAGE'); + return getConfig().asyncWrapper(() => waitFor(callback, { + stackTraceError, + ...options + })); +} + +/* +eslint + max-lines-per-function: ["error", {"max": 200}], +*/ + +function getElementError(message, container) { + return getConfig().getElementError(message, container); +} +function getMultipleElementsFoundError(message, container) { + return getElementError(message + "\n\n(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).", container); +} +function queryAllByAttribute(attribute, container, text, _temp) { + let { + exact = true, + collapseWhitespace, + trim, + normalizer + } = _temp === void 0 ? {} : _temp; + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + return Array.from(container.querySelectorAll("[" + attribute + "]")).filter(node => matcher(node.getAttribute(attribute), node, text, matchNormalizer)); +} +function queryByAttribute(attribute, container, text, options) { + const els = queryAllByAttribute(attribute, container, text, options); + if (els.length > 1) { + throw getMultipleElementsFoundError("Found multiple elements by [" + attribute + "=" + text + "]", container); + } + return els[0] || null; +} + +// this accepts a query function and returns a function which throws an error +// if more than one elements is returned, otherwise it returns the first +// element or null +function makeSingleQuery(allQuery, getMultipleError) { + return function (container) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + const els = allQuery(container, ...args); + if (els.length > 1) { + const elementStrings = els.map(element => getElementError(null, element).message).join('\n\n'); + throw getMultipleElementsFoundError(getMultipleError(container, ...args) + "\n\nHere are the matching elements:\n\n" + elementStrings, container); + } + return els[0] || null; + }; +} +function getSuggestionError(suggestion, container) { + return getConfig().getElementError("A better query is available, try this:\n" + suggestion.toString() + "\n", container); +} + +// this accepts a query function and returns a function which throws an error +// if an empty list of elements is returned +function makeGetAllQuery(allQuery, getMissingError) { + return function (container) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + const els = allQuery(container, ...args); + if (!els.length) { + throw getConfig().getElementError(getMissingError(container, ...args), container); + } + return els; + }; +} + +// this accepts a getter query function and returns a function which calls +// waitFor and passing a function which invokes the getter. +function makeFindQuery(getter) { + return (container, text, options, waitForOptions) => { + return waitForWrapper(() => { + return getter(container, text, options); + }, { + container, + ...waitForOptions + }); + }; +} +const wrapSingleQueryWithSuggestion = (query, queryAllByName, variant) => function (container) { + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + const element = query(container, ...args); + const [{ + suggest = getConfig().throwSuggestions + } = {}] = args.slice(-1); + if (element && suggest) { + const suggestion = getSuggestedQuery(element, variant); + if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) { + throw getSuggestionError(suggestion.toString(), container); + } + } + return element; +}; +const wrapAllByQueryWithSuggestion = (query, queryAllByName, variant) => function (container) { + for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + args[_key4 - 1] = arguments[_key4]; + } + const els = query(container, ...args); + const [{ + suggest = getConfig().throwSuggestions + } = {}] = args.slice(-1); + if (els.length && suggest) { + // get a unique list of all suggestion messages. We are only going to make a suggestion if + // all the suggestions are the same + const uniqueSuggestionMessages = [...new Set(els.map(element => { + var _getSuggestedQuery; + return (_getSuggestedQuery = getSuggestedQuery(element, variant)) == null ? void 0 : _getSuggestedQuery.toString(); + }))]; + if ( + // only want to suggest if all the els have the same suggestion. + uniqueSuggestionMessages.length === 1 && !queryAllByName.endsWith( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- TODO: Can this be null at runtime? + getSuggestedQuery(els[0], variant).queryName)) { + throw getSuggestionError(uniqueSuggestionMessages[0], container); + } + } + return els; +}; + +// TODO: This deviates from the published declarations +// However, the implementation always required a dyadic (after `container`) not variadic `queryAllBy` considering the implementation of `makeFindQuery` +// This is at least statically true and can be verified by accepting `QueryMethod` +function buildQueries(queryAllBy, getMultipleError, getMissingError) { + const queryBy = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllBy, getMultipleError), queryAllBy.name, 'query'); + const getAllBy = makeGetAllQuery(queryAllBy, getMissingError); + const getBy = makeSingleQuery(getAllBy, getMultipleError); + const getByWithSuggestions = wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'get'); + const getAllWithSuggestions = wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name.replace('query', 'get'), 'getAll'); + const findAllBy = makeFindQuery(wrapAllByQueryWithSuggestion(getAllBy, queryAllBy.name, 'findAll')); + const findBy = makeFindQuery(wrapSingleQueryWithSuggestion(getBy, queryAllBy.name, 'find')); + return [queryBy, getAllWithSuggestions, getByWithSuggestions, findAllBy, findBy]; +} + +var queryHelpers = /*#__PURE__*/Object.freeze({ + __proto__: null, + getElementError: getElementError, + wrapAllByQueryWithSuggestion: wrapAllByQueryWithSuggestion, + wrapSingleQueryWithSuggestion: wrapSingleQueryWithSuggestion, + getMultipleElementsFoundError: getMultipleElementsFoundError, + queryAllByAttribute: queryAllByAttribute, + queryByAttribute: queryByAttribute, + makeSingleQuery: makeSingleQuery, + makeGetAllQuery: makeGetAllQuery, + makeFindQuery: makeFindQuery, + buildQueries: buildQueries +}); + +function queryAllLabels(container) { + return Array.from(container.querySelectorAll('label,input')).map(node => { + return { + node, + textToMatch: getLabelContent(node) + }; + }).filter(_ref => { + let { + textToMatch + } = _ref; + return textToMatch !== null; + }); +} +const queryAllLabelsByText = function (container, text, _temp) { + let { + exact = true, + trim, + collapseWhitespace, + normalizer + } = _temp === void 0 ? {} : _temp; + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + const textToMatchByLabels = queryAllLabels(container); + return textToMatchByLabels.filter(_ref2 => { + let { + node, + textToMatch + } = _ref2; + return matcher(textToMatch, node, text, matchNormalizer); + }).map(_ref3 => { + let { + node + } = _ref3; + return node; + }); +}; +const queryAllByLabelText = function (container, text, _temp2) { + let { + selector = '*', + exact = true, + collapseWhitespace, + trim, + normalizer + } = _temp2 === void 0 ? {} : _temp2; + checkContainerType(container); + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + const matchingLabelledElements = Array.from(container.querySelectorAll('*')).filter(element => { + return getRealLabels(element).length || element.hasAttribute('aria-labelledby'); + }).reduce((labelledElements, labelledElement) => { + const labelList = getLabels(container, labelledElement, { + selector + }); + labelList.filter(label => Boolean(label.formControl)).forEach(label => { + if (matcher(label.content, label.formControl, text, matchNormalizer) && label.formControl) { + labelledElements.push(label.formControl); + } + }); + const labelsValue = labelList.filter(label => Boolean(label.content)).map(label => label.content); + if (matcher(labelsValue.join(' '), labelledElement, text, matchNormalizer)) { + labelledElements.push(labelledElement); + } + if (labelsValue.length > 1) { + labelsValue.forEach((labelValue, index) => { + if (matcher(labelValue, labelledElement, text, matchNormalizer)) { + labelledElements.push(labelledElement); + } + const labelsFiltered = [...labelsValue]; + labelsFiltered.splice(index, 1); + if (labelsFiltered.length > 1) { + if (matcher(labelsFiltered.join(' '), labelledElement, text, matchNormalizer)) { + labelledElements.push(labelledElement); + } + } + }); + } + return labelledElements; + }, []).concat(queryAllByAttribute('aria-label', container, text, { + exact, + normalizer: matchNormalizer + })); + return Array.from(new Set(matchingLabelledElements)).filter(element => element.matches(selector)); +}; + +// the getAll* query would normally look like this: +// const getAllByLabelText = makeGetAllQuery( +// queryAllByLabelText, +// (c, text) => `Unable to find a label with the text of: ${text}`, +// ) +// however, we can give a more helpful error message than the generic one, +// so we're writing this one out by hand. +const getAllByLabelText = function (container, text) { + for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + rest[_key - 2] = arguments[_key]; + } + const els = queryAllByLabelText(container, text, ...rest); + if (!els.length) { + const labels = queryAllLabelsByText(container, text, ...rest); + if (labels.length) { + const tagNames = labels.map(label => getTagNameOfElementAssociatedWithLabelViaFor(container, label)).filter(tagName => !!tagName); + if (tagNames.length) { + throw getConfig().getElementError(tagNames.map(tagName => "Found a label with the text of: " + text + ", however the element associated with this label (<" + tagName + " />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <" + tagName + " />, you can use aria-label or aria-labelledby instead.").join('\n\n'), container); + } else { + throw getConfig().getElementError("Found a label with the text of: " + text + ", however no form control was found associated to that label. Make sure you're using the \"for\" attribute or \"aria-labelledby\" attribute correctly.", container); + } + } else { + throw getConfig().getElementError("Unable to find a label with the text of: " + text, container); + } + } + return els; +}; +function getTagNameOfElementAssociatedWithLabelViaFor(container, label) { + const htmlFor = label.getAttribute('for'); + if (!htmlFor) { + return null; + } + const element = container.querySelector("[id=\"" + htmlFor + "\"]"); + return element ? element.tagName.toLowerCase() : null; +} + +// the reason mentioned above is the same reason we're not using buildQueries +const getMultipleError$7 = (c, text) => "Found multiple elements with the text of: " + text; +const queryByLabelText = wrapSingleQueryWithSuggestion(makeSingleQuery(queryAllByLabelText, getMultipleError$7), queryAllByLabelText.name, 'query'); +const getByLabelText = makeSingleQuery(getAllByLabelText, getMultipleError$7); +const findAllByLabelText = makeFindQuery(wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'findAll')); +const findByLabelText = makeFindQuery(wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'find')); +const getAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(getAllByLabelText, getAllByLabelText.name, 'getAll'); +const getByLabelTextWithSuggestions = wrapSingleQueryWithSuggestion(getByLabelText, getAllByLabelText.name, 'get'); +const queryAllByLabelTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByLabelText, queryAllByLabelText.name, 'queryAll'); + +const queryAllByPlaceholderText = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + checkContainerType(args[0]); + return queryAllByAttribute('placeholder', ...args); +}; +const getMultipleError$6 = (c, text) => "Found multiple elements with the placeholder text of: " + text; +const getMissingError$6 = (c, text) => "Unable to find an element with the placeholder text of: " + text; +const queryAllByPlaceholderTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByPlaceholderText, queryAllByPlaceholderText.name, 'queryAll'); +const [queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText] = buildQueries(queryAllByPlaceholderText, getMultipleError$6, getMissingError$6); + +const queryAllByText = function (container, text, _temp) { + let { + selector = '*', + exact = true, + collapseWhitespace, + trim, + ignore = getConfig().defaultIgnore, + normalizer + } = _temp === void 0 ? {} : _temp; + checkContainerType(container); + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + let baseArray = []; + if (typeof container.matches === 'function' && container.matches(selector)) { + baseArray = [container]; + } + return [...baseArray, ...Array.from(container.querySelectorAll(selector))] + // TODO: `matches` according lib.dom.d.ts can get only `string` but according our code it can handle also boolean :) + .filter(node => !ignore || !node.matches(ignore)).filter(node => matcher(getNodeText(node), node, text, matchNormalizer)); +}; +const getMultipleError$5 = (c, text) => "Found multiple elements with the text: " + text; +const getMissingError$5 = function (c, text, options) { + if (options === void 0) { + options = {}; + } + const { + collapseWhitespace, + trim, + normalizer, + selector + } = options; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + const normalizedText = matchNormalizer(text.toString()); + const isNormalizedDifferent = normalizedText !== text.toString(); + const isCustomSelector = (selector != null ? selector : '*') !== '*'; + return "Unable to find an element with the text: " + (isNormalizedDifferent ? normalizedText + " (normalized from '" + text + "')" : text) + (isCustomSelector ? ", which matches selector '" + selector + "'" : '') + ". This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible."; +}; +const queryAllByTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByText, queryAllByText.name, 'queryAll'); +const [queryByText, getAllByText, getByText, findAllByText, findByText] = buildQueries(queryAllByText, getMultipleError$5, getMissingError$5); + +const queryAllByDisplayValue = function (container, value, _temp) { + let { + exact = true, + collapseWhitespace, + trim, + normalizer + } = _temp === void 0 ? {} : _temp; + checkContainerType(container); + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + return Array.from(container.querySelectorAll("input,textarea,select")).filter(node => { + if (node.tagName === 'SELECT') { + const selectedOptions = Array.from(node.options).filter(option => option.selected); + return selectedOptions.some(optionNode => matcher(getNodeText(optionNode), optionNode, value, matchNormalizer)); + } else { + return matcher(node.value, node, value, matchNormalizer); + } + }); +}; +const getMultipleError$4 = (c, value) => "Found multiple elements with the display value: " + value + "."; +const getMissingError$4 = (c, value) => "Unable to find an element with the display value: " + value + "."; +const queryAllByDisplayValueWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll'); +const [queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue] = buildQueries(queryAllByDisplayValue, getMultipleError$4, getMissingError$4); + +// Valid tags are img, input, area and custom elements +const VALID_TAG_REGEXP = /^(img|input|area|.+-.+)$/i; +const queryAllByAltText = function (container, alt, options) { + if (options === void 0) { + options = {}; + } + checkContainerType(container); + return queryAllByAttribute('alt', container, alt, options).filter(node => VALID_TAG_REGEXP.test(node.tagName)); +}; +const getMultipleError$3 = (c, alt) => "Found multiple elements with the alt text: " + alt; +const getMissingError$3 = (c, alt) => "Unable to find an element with the alt text: " + alt; +const queryAllByAltTextWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByAltText, queryAllByAltText.name, 'queryAll'); +const [queryByAltText, getAllByAltText, getByAltText, findAllByAltText, findByAltText] = buildQueries(queryAllByAltText, getMultipleError$3, getMissingError$3); + +const isSvgTitle = node => { + var _node$parentElement; + return node.tagName.toLowerCase() === 'title' && ((_node$parentElement = node.parentElement) == null ? void 0 : _node$parentElement.tagName.toLowerCase()) === 'svg'; +}; +const queryAllByTitle = function (container, text, _temp) { + let { + exact = true, + collapseWhitespace, + trim, + normalizer + } = _temp === void 0 ? {} : _temp; + checkContainerType(container); + const matcher = exact ? matches : fuzzyMatches; + const matchNormalizer = makeNormalizer({ + collapseWhitespace, + trim, + normalizer + }); + return Array.from(container.querySelectorAll('[title], svg > title')).filter(node => matcher(node.getAttribute('title'), node, text, matchNormalizer) || isSvgTitle(node) && matcher(getNodeText(node), node, text, matchNormalizer)); +}; +const getMultipleError$2 = (c, title) => "Found multiple elements with the title: " + title + "."; +const getMissingError$2 = (c, title) => "Unable to find an element with the title: " + title + "."; +const queryAllByTitleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTitle, queryAllByTitle.name, 'queryAll'); +const [queryByTitle, getAllByTitle, getByTitle, findAllByTitle, findByTitle] = buildQueries(queryAllByTitle, getMultipleError$2, getMissingError$2); + +/* eslint-disable complexity */ +const queryAllByRole = function (container, role, _temp) { + let { + hidden = getConfig().defaultHidden, + name, + description, + queryFallbacks = false, + selected, + busy, + checked, + pressed, + current, + level, + expanded, + value: { + now: valueNow, + min: valueMin, + max: valueMax, + text: valueText + } = {} + } = _temp === void 0 ? {} : _temp; + checkContainerType(container); + if (selected !== undefined) { + var _allRoles$get; + // guard against unknown roles + if (((_allRoles$get = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get.props['aria-selected']) === undefined) { + throw new Error("\"aria-selected\" is not supported on role \"" + role + "\"."); + } + } + if (busy !== undefined) { + var _allRoles$get2; + // guard against unknown roles + if (((_allRoles$get2 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get2.props['aria-busy']) === undefined) { + throw new Error("\"aria-busy\" is not supported on role \"" + role + "\"."); + } + } + if (checked !== undefined) { + var _allRoles$get3; + // guard against unknown roles + if (((_allRoles$get3 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get3.props['aria-checked']) === undefined) { + throw new Error("\"aria-checked\" is not supported on role \"" + role + "\"."); + } + } + if (pressed !== undefined) { + var _allRoles$get4; + // guard against unknown roles + if (((_allRoles$get4 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get4.props['aria-pressed']) === undefined) { + throw new Error("\"aria-pressed\" is not supported on role \"" + role + "\"."); + } + } + if (current !== undefined) { + var _allRoles$get5; + /* istanbul ignore next */ + // guard against unknown roles + // All currently released ARIA versions support `aria-current` on all roles. + // Leaving this for symmetry and forward compatibility + if (((_allRoles$get5 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get5.props['aria-current']) === undefined) { + throw new Error("\"aria-current\" is not supported on role \"" + role + "\"."); + } + } + if (level !== undefined) { + // guard against using `level` option with any role other than `heading` + if (role !== 'heading') { + throw new Error("Role \"" + role + "\" cannot have \"level\" property."); + } + } + if (valueNow !== undefined) { + var _allRoles$get6; + // guard against unknown roles + if (((_allRoles$get6 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get6.props['aria-valuenow']) === undefined) { + throw new Error("\"aria-valuenow\" is not supported on role \"" + role + "\"."); + } + } + if (valueMax !== undefined) { + var _allRoles$get7; + // guard against unknown roles + if (((_allRoles$get7 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get7.props['aria-valuemax']) === undefined) { + throw new Error("\"aria-valuemax\" is not supported on role \"" + role + "\"."); + } + } + if (valueMin !== undefined) { + var _allRoles$get8; + // guard against unknown roles + if (((_allRoles$get8 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get8.props['aria-valuemin']) === undefined) { + throw new Error("\"aria-valuemin\" is not supported on role \"" + role + "\"."); + } + } + if (valueText !== undefined) { + var _allRoles$get9; + // guard against unknown roles + if (((_allRoles$get9 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get9.props['aria-valuetext']) === undefined) { + throw new Error("\"aria-valuetext\" is not supported on role \"" + role + "\"."); + } + } + if (expanded !== undefined) { + var _allRoles$get0; + // guard against unknown roles + if (((_allRoles$get0 = ariaQuery.roles.get(role)) == null ? void 0 : _allRoles$get0.props['aria-expanded']) === undefined) { + throw new Error("\"aria-expanded\" is not supported on role \"" + role + "\"."); + } + } + const subtreeIsInaccessibleCache = new WeakMap(); + function cachedIsSubtreeInaccessible(element) { + if (!subtreeIsInaccessibleCache.has(element)) { + subtreeIsInaccessibleCache.set(element, isSubtreeInaccessible(element)); + } + return subtreeIsInaccessibleCache.get(element); + } + return Array.from(container.querySelectorAll( + // Only query elements that can be matched by the following filters + makeRoleSelector(role))).filter(node => { + const isRoleSpecifiedExplicitly = node.hasAttribute('role'); + if (isRoleSpecifiedExplicitly) { + const roleValue = node.getAttribute('role'); + if (queryFallbacks) { + return roleValue.split(' ').filter(Boolean).some(roleAttributeToken => roleAttributeToken === role); + } + // other wise only send the first token to match + const [firstRoleAttributeToken] = roleValue.split(' '); + return firstRoleAttributeToken === role; + } + const implicitRoles = getImplicitAriaRoles(node); + return implicitRoles.some(implicitRole => { + return implicitRole === role; + }); + }).filter(element => { + if (selected !== undefined) { + return selected === computeAriaSelected(element); + } + if (busy !== undefined) { + return busy === computeAriaBusy(element); + } + if (checked !== undefined) { + return checked === computeAriaChecked(element); + } + if (pressed !== undefined) { + return pressed === computeAriaPressed(element); + } + if (current !== undefined) { + return current === computeAriaCurrent(element); + } + if (expanded !== undefined) { + return expanded === computeAriaExpanded(element); + } + if (level !== undefined) { + return level === computeHeadingLevel(element); + } + if (valueNow !== undefined || valueMax !== undefined || valueMin !== undefined || valueText !== undefined) { + let valueMatches = true; + if (valueNow !== undefined) { + valueMatches && (valueMatches = valueNow === computeAriaValueNow(element)); + } + if (valueMax !== undefined) { + valueMatches && (valueMatches = valueMax === computeAriaValueMax(element)); + } + if (valueMin !== undefined) { + valueMatches && (valueMatches = valueMin === computeAriaValueMin(element)); + } + if (valueText !== undefined) { + var _computeAriaValueText; + valueMatches && (valueMatches = matches((_computeAriaValueText = computeAriaValueText(element)) != null ? _computeAriaValueText : null, element, valueText, text => text)); + } + return valueMatches; + } + // don't care if aria attributes are unspecified + return true; + }).filter(element => { + if (name === undefined) { + // Don't care + return true; + } + return matches(domAccessibilityApi.computeAccessibleName(element, { + computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements + }), element, name, text => text); + }).filter(element => { + if (description === undefined) { + // Don't care + return true; + } + return matches(domAccessibilityApi.computeAccessibleDescription(element, { + computedStyleSupportsPseudoElements: getConfig().computedStyleSupportsPseudoElements + }), element, description, text => text); + }).filter(element => { + return hidden === false ? isInaccessible(element, { + isSubtreeInaccessible: cachedIsSubtreeInaccessible + }) === false : true; + }); +}; +function makeRoleSelector(role) { + var _roleElements$get; + const explicitRoleSelector = "*[role~=\"" + role + "\"]"; + const roleRelations = (_roleElements$get = ariaQuery.roleElements.get(role)) != null ? _roleElements$get : new Set(); + const implicitRoleSelectors = new Set(Array.from(roleRelations).map(_ref => { + let { + name + } = _ref; + return name; + })); + + // Current transpilation config sometimes assumes `...` is always applied to arrays. + // `...` is equivalent to `Array.prototype.concat` for arrays. + // If you replace this code with `[explicitRoleSelector, ...implicitRoleSelectors]`, make sure every transpilation target retains the `...` in favor of `Array.prototype.concat`. + return [explicitRoleSelector].concat(Array.from(implicitRoleSelectors)).join(','); +} +const getNameHint = name => { + let nameHint = ''; + if (name === undefined) { + nameHint = ''; + } else if (typeof name === 'string') { + nameHint = " and name \"" + name + "\""; + } else { + nameHint = " and name `" + name + "`"; + } + return nameHint; +}; +const getMultipleError$1 = function (c, role, _temp2) { + let { + name + } = _temp2 === void 0 ? {} : _temp2; + return "Found multiple elements with the role \"" + role + "\"" + getNameHint(name); +}; +const getMissingError$1 = function (container, role, _temp3) { + let { + hidden = getConfig().defaultHidden, + name, + description + } = _temp3 === void 0 ? {} : _temp3; + if (getConfig()._disableExpensiveErrorDiagnostics) { + return "Unable to find role=\"" + role + "\"" + getNameHint(name); + } + let roles = ''; + Array.from(container.children).forEach(childElement => { + roles += prettyRoles(childElement, { + hidden, + includeDescription: description !== undefined + }); + }); + let roleMessage; + if (roles.length === 0) { + if (hidden === false) { + roleMessage = 'There are no accessible roles. But there might be some inaccessible roles. ' + 'If you wish to access them, then set the `hidden` option to `true`. ' + 'Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole'; + } else { + roleMessage = 'There are no available roles.'; + } + } else { + roleMessage = ("\nHere are the " + (hidden === false ? 'accessible' : 'available') + " roles:\n\n " + roles.replace(/\n/g, '\n ').replace(/\n\s\s\n/g, '\n\n') + "\n").trim(); + } + let nameHint = ''; + if (name === undefined) { + nameHint = ''; + } else if (typeof name === 'string') { + nameHint = " and name \"" + name + "\""; + } else { + nameHint = " and name `" + name + "`"; + } + let descriptionHint = ''; + if (description === undefined) { + descriptionHint = ''; + } else if (typeof description === 'string') { + descriptionHint = " and description \"" + description + "\""; + } else { + descriptionHint = " and description `" + description + "`"; + } + return ("\nUnable to find an " + (hidden === false ? 'accessible ' : '') + "element with the role \"" + role + "\"" + nameHint + descriptionHint + "\n\n" + roleMessage).trim(); +}; +const queryAllByRoleWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByRole, queryAllByRole.name, 'queryAll'); +const [queryByRole, getAllByRole, getByRole, findAllByRole, findByRole] = buildQueries(queryAllByRole, getMultipleError$1, getMissingError$1); + +const getTestIdAttribute = () => getConfig().testIdAttribute; +const queryAllByTestId = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + checkContainerType(args[0]); + return queryAllByAttribute(getTestIdAttribute(), ...args); +}; +const getMultipleError = (c, id) => "Found multiple elements by: [" + getTestIdAttribute() + "=\"" + id + "\"]"; +const getMissingError = (c, id) => "Unable to find an element by: [" + getTestIdAttribute() + "=\"" + id + "\"]"; +const queryAllByTestIdWithSuggestions = wrapAllByQueryWithSuggestion(queryAllByTestId, queryAllByTestId.name, 'queryAll'); +const [queryByTestId, getAllByTestId, getByTestId, findAllByTestId, findByTestId] = buildQueries(queryAllByTestId, getMultipleError, getMissingError); + +var queries = /*#__PURE__*/Object.freeze({ + __proto__: null, + queryAllByLabelText: queryAllByLabelTextWithSuggestions, + queryByLabelText: queryByLabelText, + getAllByLabelText: getAllByLabelTextWithSuggestions, + getByLabelText: getByLabelTextWithSuggestions, + findAllByLabelText: findAllByLabelText, + findByLabelText: findByLabelText, + queryByPlaceholderText: queryByPlaceholderText, + queryAllByPlaceholderText: queryAllByPlaceholderTextWithSuggestions, + getByPlaceholderText: getByPlaceholderText, + getAllByPlaceholderText: getAllByPlaceholderText, + findAllByPlaceholderText: findAllByPlaceholderText, + findByPlaceholderText: findByPlaceholderText, + queryByText: queryByText, + queryAllByText: queryAllByTextWithSuggestions, + getByText: getByText, + getAllByText: getAllByText, + findAllByText: findAllByText, + findByText: findByText, + queryByDisplayValue: queryByDisplayValue, + queryAllByDisplayValue: queryAllByDisplayValueWithSuggestions, + getByDisplayValue: getByDisplayValue, + getAllByDisplayValue: getAllByDisplayValue, + findAllByDisplayValue: findAllByDisplayValue, + findByDisplayValue: findByDisplayValue, + queryByAltText: queryByAltText, + queryAllByAltText: queryAllByAltTextWithSuggestions, + getByAltText: getByAltText, + getAllByAltText: getAllByAltText, + findAllByAltText: findAllByAltText, + findByAltText: findByAltText, + queryByTitle: queryByTitle, + queryAllByTitle: queryAllByTitleWithSuggestions, + getByTitle: getByTitle, + getAllByTitle: getAllByTitle, + findAllByTitle: findAllByTitle, + findByTitle: findByTitle, + queryByRole: queryByRole, + queryAllByRole: queryAllByRoleWithSuggestions, + getAllByRole: getAllByRole, + getByRole: getByRole, + findAllByRole: findAllByRole, + findByRole: findByRole, + queryByTestId: queryByTestId, + queryAllByTestId: queryAllByTestIdWithSuggestions, + getByTestId: getByTestId, + getAllByTestId: getAllByTestId, + findAllByTestId: findAllByTestId, + findByTestId: findByTestId +}); + +/** + * @typedef {{[key: string]: Function}} FuncMap + */ + +/** + * @param {HTMLElement} element container + * @param {FuncMap} queries object of functions + * @param {Object} initialValue for reducer + * @returns {FuncMap} returns object of functions bound to container + */ +function getQueriesForElement(element, queries$1, initialValue) { + if (queries$1 === void 0) { + queries$1 = queries; + } + if (initialValue === void 0) { + initialValue = {}; + } + return Object.keys(queries$1).reduce((helpers, key) => { + const fn = queries$1[key]; + helpers[key] = fn.bind(null, element); + return helpers; + }, initialValue); +} + +const isRemoved = result => !result || Array.isArray(result) && !result.length; + +// Check if the element is not present. +// As the name implies, waitForElementToBeRemoved should check `present` --> `removed` +function initialCheck(elements) { + if (isRemoved(elements)) { + throw new Error('The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.'); + } +} +async function waitForElementToBeRemoved(callback, options) { + // created here so we get a nice stacktrace + const timeoutError = new Error('Timed out in waitForElementToBeRemoved.'); + if (typeof callback !== 'function') { + initialCheck(callback); + const elements = Array.isArray(callback) ? callback : [callback]; + const getRemainingElements = elements.map(element => { + let parent = element.parentElement; + if (parent === null) return () => null; + while (parent.parentElement) parent = parent.parentElement; + return () => parent.contains(element) ? element : null; + }); + callback = () => getRemainingElements.map(c => c()).filter(Boolean); + } + initialCheck(callback()); + return waitForWrapper(() => { + let result; + try { + result = callback(); + } catch (error) { + if (error.name === 'TestingLibraryElementError') { + return undefined; + } + throw error; + } + if (!isRemoved(result)) { + throw timeoutError; + } + return undefined; + }, options); +} + +/* +eslint + require-await: "off" +*/ + +const eventMap = { + // Clipboard Events + copy: { + EventType: 'ClipboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + cut: { + EventType: 'ClipboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + paste: { + EventType: 'ClipboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + // Composition Events + compositionEnd: { + EventType: 'CompositionEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + compositionStart: { + EventType: 'CompositionEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + compositionUpdate: { + EventType: 'CompositionEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + // Keyboard Events + keyDown: { + EventType: 'KeyboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + charCode: 0, + composed: true + } + }, + keyPress: { + EventType: 'KeyboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + charCode: 0, + composed: true + } + }, + keyUp: { + EventType: 'KeyboardEvent', + defaultInit: { + bubbles: true, + cancelable: true, + charCode: 0, + composed: true + } + }, + // Focus Events + focus: { + EventType: 'FocusEvent', + defaultInit: { + bubbles: false, + cancelable: false, + composed: true + } + }, + blur: { + EventType: 'FocusEvent', + defaultInit: { + bubbles: false, + cancelable: false, + composed: true + } + }, + focusIn: { + EventType: 'FocusEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + focusOut: { + EventType: 'FocusEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + // Form Events + change: { + EventType: 'Event', + defaultInit: { + bubbles: true, + cancelable: false + } + }, + input: { + EventType: 'InputEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + invalid: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: true + } + }, + submit: { + EventType: 'Event', + defaultInit: { + bubbles: true, + cancelable: true + } + }, + reset: { + EventType: 'Event', + defaultInit: { + bubbles: true, + cancelable: true + } + }, + // Mouse Events + click: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + button: 0, + composed: true + } + }, + contextMenu: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + dblClick: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + drag: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + dragEnd: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + dragEnter: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + dragExit: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + dragLeave: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + dragOver: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + dragStart: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + drop: { + EventType: 'DragEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + mouseDown: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + mouseEnter: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: false, + cancelable: false, + composed: true + } + }, + mouseLeave: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: false, + cancelable: false, + composed: true + } + }, + mouseMove: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + mouseOut: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + mouseOver: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + mouseUp: { + EventType: 'MouseEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + // Selection Events + select: { + EventType: 'Event', + defaultInit: { + bubbles: true, + cancelable: false + } + }, + // Touch Events + touchCancel: { + EventType: 'TouchEvent', + defaultInit: { + bubbles: true, + cancelable: false, + composed: true + } + }, + touchEnd: { + EventType: 'TouchEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + touchMove: { + EventType: 'TouchEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + touchStart: { + EventType: 'TouchEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + // UI Events + resize: { + EventType: 'UIEvent', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + scroll: { + EventType: 'UIEvent', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + // Wheel Events + wheel: { + EventType: 'WheelEvent', + defaultInit: { + bubbles: true, + cancelable: true, + composed: true + } + }, + // Media Events + abort: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + canPlay: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + canPlayThrough: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + durationChange: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + emptied: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + encrypted: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + ended: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + loadedData: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + loadedMetadata: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + loadStart: { + EventType: 'ProgressEvent', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + pause: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + play: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + playing: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + progress: { + EventType: 'ProgressEvent', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + rateChange: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + seeked: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + seeking: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + stalled: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + suspend: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + timeUpdate: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + volumeChange: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + waiting: { + EventType: 'Event', + defaultInit: { + bubbles: false, + cancelable: false + } + }, + // Events + load: { + // TODO: load events can be UIEvent or Event depending on what generated them + // This is where this abstraction breaks down. + // But the common targets are ,