@joy-ride/game 0.0.0-stage → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +164 -2
- package/THIRD_PARTY_NOTICES.md +136 -0
- package/bookmarklet.d.ts +11 -0
- package/bookmarklet.js +25 -0
- package/embed-assets/attractor-B0xCt_Fj.mp3 +0 -0
- package/embed-assets/audi-rs3-top-Zwm7ZQ20.webp +0 -0
- package/embed-assets/bmw-m4-top-GKSf0h28.webp +0 -0
- package/embed-assets/boost-BLJDRtPH.mp3 +0 -0
- package/embed-assets/bullet-ricochet-1-BKWD_WRI.mp3 +0 -0
- package/embed-assets/bullet-ricochet-2-CmbSTqg5.mp3 +0 -0
- package/embed-assets/bullet-ricochet-3-DV3Th6nn.mp3 +0 -0
- package/embed-assets/burning-fire--0zItqR0.mp3 +0 -0
- package/embed-assets/collision-hard-b_eauD-v.mp3 +0 -0
- package/embed-assets/collision-medium-Bhw86k_p.mp3 +0 -0
- package/embed-assets/collision-soft-DIwEkPCV.mp3 +0 -0
- package/embed-assets/collision-soft-fVT-mQmJ.mp3 +0 -0
- package/embed-assets/combustible-explosion-XvpDzpm9.mp3 +0 -0
- package/embed-assets/crush-BZKARh2Y.mp3 +0 -0
- package/embed-assets/electric-bolt-Cg9Fmi6S.mp3 +0 -0
- package/embed-assets/electric-charge-zw1IjLo4.mp3 +0 -0
- package/embed-assets/electric-gt-top-DTcvEjMR.webp +0 -0
- package/embed-assets/flamethrower-B5pUrS5p.mp3 +0 -0
- package/embed-assets/ford-mustang-gt-top-DVzZTm7G.webp +0 -0
- package/embed-assets/ghost-mode-B33_bxYX.mp3 +0 -0
- package/embed-assets/inter-latin-variable-Dx4kXJAl.woff2 +0 -0
- package/embed-assets/jeep-wrangler-top-Dr43LU9c.webp +0 -0
- package/embed-assets/lamborghini-huracan-evo-top-BCJJwrTj.webp +0 -0
- package/embed-assets/logo-backing-DQNUb3C2.svg +1 -0
- package/embed-assets/machine-gun-C4ag4X6T.mp3 +0 -0
- package/embed-assets/porsche-911-997-top-BE6uRNL4.webp +0 -0
- package/embed-assets/rocket-explosion-DKnN7_wY.mp3 +0 -0
- package/embed-assets/rocket-launch-C-Yvbb7P.mp3 +0 -0
- package/embed-assets/roof-rocket-v1-Bs4IEw-s.webp +0 -0
- package/embed-assets/side-gun-v1-BnpvZN1b.webp +0 -0
- package/embed-assets/subaru-wrx-top-dLvMFYDs.webp +0 -0
- package/embed-assets/tire-screech-DEsAg1CH.mp3 +0 -0
- package/embed-chunks/CodeBlock-SbsdRltK.js +22 -0
- package/embed-chunks/Documentation-it27YLKx.js +33 -0
- package/embed-chunks/EmbedPanel-yRsx9glF.js +1 -0
- package/embed-chunks/JoyRideView-o-2qdJkr.js +1 -0
- package/embed-chunks/X.es-d7B7rOGv.js +1 -0
- package/embed-chunks/configuration~index~embed-CG9auZKS.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet-C8RUCiUX.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~JoyRideView~browser-sessio~iaaa3ndj-BBrKrH7m.js +1 -0
- package/embed-chunks/controls~index~embed-B_C92tUz.js +1 -0
- package/embed-chunks/definitions~index~embed-CDMM_m1T.js +1 -0
- package/embed-chunks/definitions~index~embed~bookmarklet-BfjknPZN.js +1 -0
- package/embed-chunks/definitions~index~embed~bookmarklet~vehicle-popover~Documentation~JoyRideView~browser-sessi~fklztn3g-Dt96jol6.js +1 -0
- package/embed-chunks/definitions~index~embed~vehicle-popover~browser-session-core~renderer-RDNEXk_b.js +1 -0
- package/embed-chunks/react-vendor~index~embed-BNCMh3YF.js +9 -0
- package/embed-chunks/rolldown-runtime-XKyaHtl9.js +1 -0
- package/embed-chunks/runtime~JoyRideView~browser-session-core-Ya-yv4PC.js +1 -0
- package/embed-chunks/runtime~browser-session-core-DUfZaJcj.js +1 -0
- package/embed-chunks/runtime~index~embed-B2Zpd22X.js +210 -0
- package/embed-chunks/runtime~index~embed~vehicle-popover~browser-session-core~renderer-OqE9OpvH.js +1 -0
- package/embed-chunks/runtime~vehicle-popover-DI44kx2W.js +1 -0
- package/embed-chunks/runtime~vehicle-popover~browser-session-core-BC-HGK32.js +1 -0
- package/embed-chunks/runtime~vehicle-popover~browser-session-core~renderer-CHG4ymHM.js +4 -0
- package/embed-chunks/runtime~vehicle-popover~renderer-DwVymD49.js +1077 -0
- package/embed-chunks/src-BJXg-amK.js +2 -0
- package/embed-chunks/vehicle-catalog~index~embed-DcyLaPhV.js +1 -0
- package/embed-chunks/vehicle-popover-CtdtJ1cl.js +1 -0
- package/embed.js +1 -0
- package/index-sebzwsKw.d.ts +2492 -0
- package/index.d.ts +3 -0
- package/index.js +1 -0
- package/npm-chunks/CodeBlock-35k1cnjA.js +22 -0
- package/npm-chunks/Documentation-B6U46upd.js +33 -0
- package/npm-chunks/EmbedPanel-dnDwQhT5.js +1 -0
- package/npm-chunks/JoyRideView-C2nOVKZu.js +1 -0
- package/npm-chunks/X.es-VqSWeM6N.js +1 -0
- package/npm-chunks/configuration~react-CKBQFWEF.js +1 -0
- package/npm-chunks/configuration~react~browser-session-core-CyXr42pk.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~Documentation~JoyRideView~browser-session-co~fvauaeow-zf1LIsS8.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~JoyRideView~browser-session-core-BQ8wO_VE.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~JoyRideView~browser-session-core~renderer-DJhBwBho.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~JoyRideView~browser-session-core~renderer-B70Mpi9X.js +1 -0
- package/npm-chunks/controls~react~vehicle-popover~Documentation~JoyRideView~browser-session-core-CLDwfJ48.js +1 -0
- package/npm-chunks/controls~react~vehicle-popover~JoyRideView~browser-session-core~renderer-Cnf30Q_A.js +1 -0
- package/npm-chunks/definitions~react~browser-session-core-acRq5AYt.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~Documentation~JoyRideView~browser-session-core-BZJqthWX.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~Documentation~JoyRideView~browser-session-core~renderer-Dt96jol6.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~browser-session-core~renderer-RDNEXk_b.js +1 -0
- package/npm-chunks/input-DHpsGB-l.js +1 -0
- package/npm-chunks/rolldown-runtime-XKyaHtl9.js +1 -0
- package/npm-chunks/runtime~JoyRideView~browser-session-core-CuSPCh9O.js +1 -0
- package/npm-chunks/runtime~browser-session-core-BenGnDZN.js +1 -0
- package/npm-chunks/runtime~react-BKEnJfDK.js +1 -0
- package/npm-chunks/runtime~react~JoyRideView~browser-session-core-BRSYGakW.js +1 -0
- package/npm-chunks/runtime~react~browser-session-core-Cr50FE3R.js +1 -0
- package/npm-chunks/runtime~react~vehicle-popover-khBccGFq.js +1 -0
- package/npm-chunks/runtime~react~vehicle-popover~browser-session-core-BzXBN4rK.js +210 -0
- package/npm-chunks/runtime~react~vehicle-popover~browser-session-core~renderer-Be8cIaU4.js +1 -0
- package/npm-chunks/runtime~vehicle-popover-PLJOXbUU.js +1 -0
- package/npm-chunks/runtime~vehicle-popover~browser-session-core-Ddxp7Nuh.js +1 -0
- package/npm-chunks/runtime~vehicle-popover~browser-session-core~renderer-jVG7K050.js +4 -0
- package/npm-chunks/runtime~vehicle-popover~renderer-CYXkRwO4.js +1077 -0
- package/npm-chunks/sync-shadow-theme-Bqi_M9ro.js +1 -0
- package/npm-chunks/theme-C4ZE2-nQ.js +2 -0
- package/npm-chunks/vehicle-catalog~react~browser-session-core-BzB5J-Lm.js +1 -0
- package/npm-chunks/vehicle-catalog~react~vehicle-popover~browser-session-core-B1wVsjdQ.js +1 -0
- package/npm-chunks/vehicle-popover-D0e1ZKfF.js +1 -0
- package/package.json +65 -4
- package/playground-DrT_x51v.d.ts +1255 -0
- package/react.d.ts +15 -0
- package/react.js +25 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jacob Kelley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,165 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<a href="https://jakiestfu.github.io/joy-ride/">
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/joy-ride-logo-dark.svg">
|
|
6
|
+
<source media="(prefers-color-scheme: light)" srcset="packages/ui/assets/joy-ride-logo.svg">
|
|
7
|
+
<img src="packages/ui/assets/joy-ride-logo.svg" alt="Joy Ride" width="220">
|
|
8
|
+
</picture>
|
|
9
|
+
</a>
|
|
10
|
+
|
|
11
|
+
# The page less traveled.
|
|
12
|
+
|
|
13
|
+
A browser toy for vehicular misconduct. Add one script and turn your page into a playground.
|
|
14
|
+
|
|
15
|
+
Joy Ride combines a fixed-step vehicle simulation, Canvas 2D rendering, and WebGL2 effects. It reads marked DOM elements as scenery and interactive objects, drawing destructible text and images on canvas. Smoke, fire, and pickup refraction run on the GPU.
|
|
16
|
+
|
|
17
|
+
[](https://www.npmjs.com/package/@joy-ride/game)
|
|
18
|
+
[](https://www.npmjs.com/package/@joy-ride/game)
|
|
19
|
+
[](packages/ui/src/documentation/api.md#public-typescript-contracts)
|
|
20
|
+
[](https://github.com/jakiestfu/joy-ride/actions/workflows/website-deployment.yml)
|
|
21
|
+
[](https://github.com/jakiestfu/joy-ride/actions/workflows/performance.yml?query=branch%3Amain+event%3Apush)
|
|
22
|
+
[](LICENSE.md)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
[Play the demo](https://jakiestfu.github.io/joy-ride/) · [API guide](packages/ui/src/documentation/api.md) · [Documentation map](docs/README.md)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<a href="https://jakiestfu.github.io/joy-ride/">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/images/scene-1-dark.png">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/images/scene-1.png">
|
|
34
|
+
<img src="docs/images/scene-1.png" alt="A Porsche skidding into Joy Ride, with glowing brake lights, tire smoke, and fresh skid marks. Play the demo." width="1120">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
## Add it to a page
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<h1
|
|
44
|
+
data-jr-breakable
|
|
45
|
+
data-jr-burnable
|
|
46
|
+
>
|
|
47
|
+
Make a mess.
|
|
48
|
+
</h1>
|
|
49
|
+
<div
|
|
50
|
+
data-jr-solid
|
|
51
|
+
>
|
|
52
|
+
A wall
|
|
53
|
+
</div>
|
|
54
|
+
<div
|
|
55
|
+
data-jr-liquid="paint"
|
|
56
|
+
>
|
|
57
|
+
Paint
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<script
|
|
61
|
+
type="module"
|
|
62
|
+
src="https://unpkg.com/@joy-ride/game@latest/embed.js"
|
|
63
|
+
data-jr-mount
|
|
64
|
+
></script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The script starts automatically. Drive with **WASD** or the arrow keys, and click the car to change vehicles and settings.
|
|
68
|
+
|
|
69
|
+
## Use JavaScript
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npm install @joy-ride/game
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The JavaScript entry bundles its own React and React DOM. It works in a plain
|
|
76
|
+
JavaScript application without installing a framework and starts only when you
|
|
77
|
+
call `mount()`.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { mount } from '@joy-ride/game';
|
|
81
|
+
|
|
82
|
+
const ride = mount({
|
|
83
|
+
game: { quality: 'high', vehicleDestructible: false },
|
|
84
|
+
dialog: { showGameSettings: false },
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
await ride.ready;
|
|
88
|
+
|
|
89
|
+
// Call ride.dispose() when the host view is removed.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Game settings control visuals, sound, performance, and playground rules. Dialog
|
|
93
|
+
settings control the embedded UI. Mount on the client after page elements exist.
|
|
94
|
+
|
|
95
|
+
## Use React
|
|
96
|
+
|
|
97
|
+
Use the React entry in an application with React 19 and React DOM 19. It shares
|
|
98
|
+
the application's React runtime and owns mounting and cleanup.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
'use client';
|
|
102
|
+
|
|
103
|
+
import { JoyRide } from '@joy-ride/game/react';
|
|
104
|
+
|
|
105
|
+
export const JoyRideExperience = () => (
|
|
106
|
+
<JoyRide
|
|
107
|
+
initialOptions={{
|
|
108
|
+
game: { quality: 'high', vehicleDestructible: false },
|
|
109
|
+
dialog: { showGameSettings: false },
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The CDN, JavaScript, and React integrations use the same mount configuration and
|
|
116
|
+
controller. Choose one integration per page. React's `settings` prop applies live
|
|
117
|
+
`game` and `dialog` updates; `initialOptions` is read when the component mounts.
|
|
118
|
+
Use a new React `key` to replace the authored setup. See the
|
|
119
|
+
[React reference](packages/ui/src/documentation/api.md#react) for controller refs,
|
|
120
|
+
readiness, and errors.
|
|
121
|
+
|
|
122
|
+
Import `@joy-ride/game` for self-contained JavaScript or `@joy-ride/game/react`
|
|
123
|
+
for a React application. React and React DOM are optional peers at the package
|
|
124
|
+
level, so the root import does not require them.
|
|
125
|
+
|
|
126
|
+
## Make it yours
|
|
127
|
+
|
|
128
|
+
- [Page objects](packages/ui/src/documentation/api.md#page-objects): make elements breakable, movable, crushable, or paintable.
|
|
129
|
+
- [Objectives](packages/ui/src/documentation/api.md#objectives): collect pickups, crush or break targets, ignite objects, and reach a score.
|
|
130
|
+
- [Settings](packages/ui/src/documentation/api.md#settings): configure sound, tools, lighting, and the vehicle hint.
|
|
131
|
+
- [Script options](packages/ui/src/documentation/api.md#script-tag-options): choose an arrival target, apply presets, or handle page navigation.
|
|
132
|
+
- [Advanced integrations](packages/ui/src/documentation/api.md#advanced-integrations): use your own interface or canvas.
|
|
133
|
+
|
|
134
|
+
## Develop locally
|
|
135
|
+
|
|
136
|
+
Use Node 24 or newer.
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
corepack pnpm install
|
|
140
|
+
corepack pnpm dev
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Open `http://127.0.0.1:5173/`. Run `corepack pnpm check` for tests and performance checks, or `corepack pnpm build` for the production site. Run `pre-commit install` once to enable commit checks.
|
|
144
|
+
|
|
145
|
+
For vehicle tuning and JSON import/export, run `pnpm run vehicle-editor`. See the [vehicle editor guide](docs/vehicle-editor.md).
|
|
146
|
+
|
|
147
|
+
For transparent vehicle scene PNGs, run `pnpm screenshots`; its independent test fixture server starts automatically. Add `--readme` to refresh the framed README images. See [scene captures](tests/README.md#scene-captures) for options.
|
|
148
|
+
|
|
149
|
+
The site uses Next.js App Router with a static export. Its [Open Graph image](apps/site/src/app/opengraph-image.tsx) uses `next/og` and the dark README scene, and is generated automatically during the site build. Run `pnpm sync:audio` after adding or removing audio files so both the Next.js site and Vite game bundles use the same asset manifest.
|
|
150
|
+
|
|
151
|
+
For contributor details, see the [package map](docs/package-architecture.md), [testing guide](tests/README.md), [audio guide](packages/engine/src/assets/audio/README.md), and [publishing guide](docs/npm-publishing.md).
|
|
152
|
+
|
|
153
|
+
## Contributing
|
|
154
|
+
|
|
155
|
+
Start with [CONTRIBUTING.md](CONTRIBUTING.md) for setup, project boundaries, and checks. Please follow the [Code of Conduct](CODE_OF_CONDUCT.md), and report vulnerabilities through the [security policy](SECURITY.md).
|
|
156
|
+
|
|
157
|
+
The CI badge reflects the **Website deployment** workflow, which runs `pnpm check:ci` before building the site. The separate **Performance** workflow runs CPU performance gates. GPU frame-rate checks run in a suitable local graphics environment; see the [testing guide](tests/README.md).
|
|
158
|
+
|
|
159
|
+
## AI usage
|
|
160
|
+
|
|
161
|
+
This project was developed with Codex as a coding collaborator, contributing to implementation, refactoring, testing, and documentation. A human maintainer directed the work, made design decisions, and reviewed the output. The project's direction and responsibility for released changes remain with its human maintainer.
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
Joy Ride is released under the [MIT License](LICENSE.md). Bundled third-party code keeps its own license; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## MIT-licensed code
|
|
4
|
+
|
|
5
|
+
The following components are included in Joy Ride. The MIT license below applies
|
|
6
|
+
to both.
|
|
7
|
+
|
|
8
|
+
- [WebGL Fluid Simulation](https://github.com/PavelDoGreat/WebGL-Fluid-Simulation),
|
|
9
|
+
commit `a2d292931f19d9b3b9f564e23e6c32729d2121c3`;
|
|
10
|
+
adapted in `packages/engine/src/rendering/webgl-fluid/solver.ts`.
|
|
11
|
+
- [Engine_Sim](https://github.com/YigitSalihEmecen/Engine_Sim),
|
|
12
|
+
commit `c3ff61031050f1fc280a864f4bb445f30aeaa0a3`;
|
|
13
|
+
adapted in `packages/engine/src/vendor/engine-sim/`.
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Copyright (c) 2017 Pavel Dobryakov
|
|
17
|
+
Copyright (c) Yigit Salih Emecen
|
|
18
|
+
|
|
19
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
21
|
+
in the Software without restriction, including without limitation the rights
|
|
22
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
24
|
+
furnished to do so, subject to the following conditions:
|
|
25
|
+
|
|
26
|
+
The above copyright notice and this permission notice shall be included in all
|
|
27
|
+
copies or substantial portions of the Software.
|
|
28
|
+
|
|
29
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
+
SOFTWARE.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Inter font
|
|
39
|
+
|
|
40
|
+
Inter Latin variable font, from `@fontsource-variable/inter` 5.3.0.
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
44
|
+
|
|
45
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
46
|
+
This license is copied below, and is also available with a FAQ at:
|
|
47
|
+
http://scripts.sil.org/OFL
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
-----------------------------------------------------------
|
|
51
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
52
|
+
-----------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
PREAMBLE
|
|
55
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
56
|
+
development of collaborative font projects, to support the font creation
|
|
57
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
58
|
+
open framework in which fonts may be shared and improved in partnership
|
|
59
|
+
with others.
|
|
60
|
+
|
|
61
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
62
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
63
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
64
|
+
redistributed and/or sold with any software provided that any reserved
|
|
65
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
66
|
+
however, cannot be released under any other type of license. The
|
|
67
|
+
requirement for fonts to remain under this license does not apply
|
|
68
|
+
to any document created using the fonts or their derivatives.
|
|
69
|
+
|
|
70
|
+
DEFINITIONS
|
|
71
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
72
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
73
|
+
include source files, build scripts and documentation.
|
|
74
|
+
|
|
75
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
76
|
+
copyright statement(s).
|
|
77
|
+
|
|
78
|
+
"Original Version" refers to the collection of Font Software components as
|
|
79
|
+
distributed by the Copyright Holder(s).
|
|
80
|
+
|
|
81
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
82
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
83
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
84
|
+
new environment.
|
|
85
|
+
|
|
86
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
87
|
+
writer or other person who contributed to the Font Software.
|
|
88
|
+
|
|
89
|
+
PERMISSION & CONDITIONS
|
|
90
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
91
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
92
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
93
|
+
Software, subject to the following conditions:
|
|
94
|
+
|
|
95
|
+
1) Neither the Font Software nor any of its individual components,
|
|
96
|
+
in Original or Modified Versions, may be sold by itself.
|
|
97
|
+
|
|
98
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
99
|
+
redistributed and/or sold with any software, provided that each copy
|
|
100
|
+
contains the above copyright notice and this license. These can be
|
|
101
|
+
included either as stand-alone text files, human-readable headers or
|
|
102
|
+
in the appropriate machine-readable metadata fields within text or
|
|
103
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
104
|
+
|
|
105
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
106
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
107
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
108
|
+
presented to the users.
|
|
109
|
+
|
|
110
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
111
|
+
Software shall not be used to promote, endorse or advertise any
|
|
112
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
113
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
114
|
+
permission.
|
|
115
|
+
|
|
116
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
117
|
+
must be distributed entirely under this license, and must not be
|
|
118
|
+
distributed under any other license. The requirement for fonts to
|
|
119
|
+
remain under this license does not apply to any document created
|
|
120
|
+
using the Font Software.
|
|
121
|
+
|
|
122
|
+
TERMINATION
|
|
123
|
+
This license becomes null and void if any of the above conditions are
|
|
124
|
+
not met.
|
|
125
|
+
|
|
126
|
+
DISCLAIMER
|
|
127
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
128
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
129
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
130
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
131
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
132
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
133
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
134
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
135
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
136
|
+
```
|
package/bookmarklet.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as PlaygroundConfiguration } from "./playground-DrT_x51v.js";
|
|
2
|
+
/** A self-contained bookmark URL that captures the complete configuration. */
|
|
3
|
+
export declare function bookmarkletUrl(configuration: PlaygroundConfiguration): string;
|
|
4
|
+
/** A declarative CDN embed that mounts from its own attributes. */
|
|
5
|
+
export declare function fullEmbedCode(configuration: PlaygroundConfiguration): string;
|
|
6
|
+
/** Browser-native, on-demand CDN loading for a client-side application or React effect. */
|
|
7
|
+
export declare const asyncEmbedCode: (configuration: PlaygroundConfiguration) => string;
|
|
8
|
+
/** A bundled client-side entry point, when the host installs the npm package. */
|
|
9
|
+
export declare const npmEmbedCode: (configuration: PlaygroundConfiguration) => string;
|
|
10
|
+
/** The native React integration owns the ride's lifetime and uses the host React runtime. */
|
|
11
|
+
export declare const reactEmbedCode: (configuration: PlaygroundConfiguration) => string;
|
package/bookmarklet.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{t as e}from"./embed-chunks/configuration~index~embed~bookmarklet-C8RUCiUX.js";var t=`https://unpkg.com/@joy-ride/game@latest/embed.js`,n=`https://unpkg.com/@joy-ride/game@latest/index.js`;function r(n){let r=e(n),i=r.definitions?.vehicles;if(!i)return r;let a=typeof document<`u`&&document.baseURI||t;return{...r,definitions:{...r.definitions,vehicles:Object.fromEntries(Object.entries(i).map(([e,t])=>[e,{...t,...t.image?.src?{image:{...t.image,src:new URL(t.image.src,a).href}}:{}}]))}}}function i(e){return`javascript:(()=>{const u=${JSON.stringify(t)},o=${JSON.stringify(r(e))},d=window.JoyRide;if(d){d.active?d.active.dispose():d.mount(o);return}const s=document.createElement('script');s.type='module';s.src=u;s.async=true;s.charset='utf-8';s.onload=()=>window.JoyRide.mount(o);document.head.append(s)})()`}function a(e){return JSON.stringify(r(e),null,2).replace(/^(\s*)"([A-Za-z_$][\w$]*)":/gm,`$1$2:`).replace(/</g,`\\u003c`)}function o(e){return`<script
|
|
2
|
+
type="module"
|
|
3
|
+
src="${t}"
|
|
4
|
+
data-jr-mount='${JSON.stringify(r(e),null,2).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/'/g,`'`).replace(/\n/g,`
|
|
5
|
+
`)}'
|
|
6
|
+
><\/script>`}var s=e=>`const { default: JoyRide } = await import('${n}');
|
|
7
|
+
|
|
8
|
+
const ride = JoyRide.mount(${a(e)});
|
|
9
|
+
|
|
10
|
+
// Call ride.dispose() when the host view is removed.`,c=e=>`import { mount } from '@joy-ride/game';
|
|
11
|
+
|
|
12
|
+
const ride = mount(${a(e)});
|
|
13
|
+
|
|
14
|
+
// Call ride.dispose() when the host view is removed.`,l=e=>`'use client';
|
|
15
|
+
|
|
16
|
+
import { JoyRide } from '@joy-ride/game/react';
|
|
17
|
+
|
|
18
|
+
export const JoyRideExperience = () => (
|
|
19
|
+
<JoyRide
|
|
20
|
+
initialOptions={${a(e).replace(/\n/g,`
|
|
21
|
+
`)}}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// Render <JoyRideExperience /> inside your page.`;export{s as asyncEmbedCode,i as bookmarkletUrl,o as fullEmbedCode,c as npmEmbedCode,l as reactEmbedCode};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="116" viewBox="-8 -8 192 116"><polygon fill="white" points="16.67,90.79 18.25,89.60 21.20,78.96 24.21,74.97 25.86,74.94 27.38,74.84 30.27,73.41 33.34,70.11 35.05,68.07 36.52,68.55 39.35,60.31 42.46,54.41 44.24,52.07 45.67,51.53 48.42,38.07 51.57,38.66 53.42,38.36 54.82,27.83 57.50,31.85 60.68,35.57 62.61,36.32 63.97,31.49 66.57,44.49 69.79,45.01 71.80,43.81 73.13,41.26 75.65,46.97 78.89,64.74 80.98,46.54 82.30,45.25 84.73,49.76 87.99,50.40 90.16,48.50 91.46,44.39 93.82,41.91 97.08,41.40 99.33,41.31 100.64,40.73 102.91,44.30 106.17,42.94 108.50,43.76 109.81,44.33 112.00,44.59 115.25,44.48 117.67,40.43 118.99,43.74 121.09,45.93 124.34,39.94 126.84,40.35 128.17,40.91 130.19,41.28 133.42,39.44 136.00,39.87 137.35,39.86 139.30,38.89 142.49,38.93 145.15,37.12 146.54,36.27 148.41,36.91 151.57,36.66 154.30,34.29 155.73,33.01 157.52,33.21 160.64,33.26 161.92,32.29 161.10,43.29 159.79,43.84 158.30,46.41 156.61,49.34 153.56,50.27 150.65,61.39 149.11,65.58 147.48,68.51 144.49,68.82 141.52,68.30 139.92,69.50 138.35,71.67 135.42,72.43 132.39,73.30 130.73,74.01 129.22,67.30 126.34,70.03 123.27,70.52 121.54,70.14 120.08,71.96 117.27,74.84 114.15,72.67 112.35,69.34 110.93,75.25 108.20,76.25 105.04,75.70 103.16,72.99 101.78,70.12 99.12,69.50 95.93,77.96 93.98,78.58 92.62,77.95 90.05,79.18 86.82,70.33 84.80,74.86 83.46,77.35 80.97,80.40 77.72,83.01 75.61,86.38 74.30,88.29 71.88,76.70 68.63,78.57 66.44,81.52 65.13,81.61 62.80,80.97 59.54,81.21 57.26,82.46 55.96,75.36 53.71,78.58 50.45,80.81 48.09,85.60 46.78,89.63 44.61,90.98 41.36,90.31 38.92,92.33 37.60,94.82 35.52,97.78 32.28,98.92 29.76,99.80 28.42,94.92 26.42,97.72 23.20,98.43 20.60,98.91 19.24,100.44 17.31,103.38"/><g fill="white"><circle cx="18" cy="66" r="1.2"/><circle cx="29" cy="46" r=".8"/><circle cx="48" cy="32" r="1"/><circle cx="99" cy="31" r=".7"/><circle cx="165" cy="34" r="1"/><circle cx="171" cy="39" r=".7"/></g></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-vendor~index~embed-BNCMh3YF.js";import{a as i,i as a,o,s}from"./X.es-d7B7rOGv.js";import{T as c}from"./vehicle-popover-CtdtJ1cl.js";var l=t(n(),1),u=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),d=l.forwardRef((e,t)=>l.createElement(a,{ref:t,...e,weights:u}));d.displayName=`CopyIcon`;var f=`identifier keyword string class property entity jsxliterals sign comment break space`.split(` `),[p,m,h,g,_,v,y,b,x,S,C]=f.map((e,t)=>t);new Map(f.map((e,t)=>[e,t]));function ee(e,t){let n=[],r=0,i=[],a=!1;function o(e){let t=``,i=Array(e.length);for(let n=0;n<e.length;n++){let[r,a]=e[n];t+=a,i[n]={type:f[r],value:a}}n.push({index:r++,value:t,tokens:i,annotations:[]})}for(let e=0;e<t.length;e++){let n=t[e],[r,s]=n;if(r!==S){if(s.includes(`
|
|
2
|
+
`)){let e=s.split(`
|
|
3
|
+
`);for(let t=0;t<e.length;t++){let n=t<e.length-1,a=e[t];i.push([r,n&&a.endsWith(`\r`)?a.slice(0,-1):a]),n&&(o(i),i.length=0)}}else i.push(n);a=!1}else{if(a)o([]);else{let e=i[i.length-1];s===`
|
|
4
|
+
`&&e&&e[1].endsWith(`\r`)&&(i[i.length-1]=[e[0],e[1].slice(0,-1)]),o(i),i.length=0}e===t.length-1&&o([]),a=!0}}return i.length&&o(i),{value:e,lines:n}}function te(e,t){let n={index:e.index,value:e.value,tokens:e.tokens,annotations:e.annotations,className:`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,style:{},properties:{}};return t?.(n),n}function ne({type:e,value:t},n,r){let i=n?.[e],a={type:e,value:t,className:`sh__token--${e}${i?` ${i}`:``}`,style:{color:`var(--sh-${e})`},properties:{}};return r?.(a),a}function w(e,t){let n=t?.cx,r=t?.mark,i=t?.markLine;return e.lines.map(e=>{let t=te(e,i);return{type:`element`,tagName:`span`,children:e.tokens.map(e=>{let t=ne(e,n,r);return{type:`element`,tokenType:t.type,tagName:`span`,children:[{type:`text`,value:t.value}],properties:{...t.properties,className:t.className,style:t.style}}}),properties:{...t.properties,className:t.className,style:t.style}}})}Object.fromEntries(f.map(e=>[e,`<span class="sh__token--${e}" style="color:var(--sh-${e})">`]));var T=new Set(`+-*/%=!&|^~?:.,;()[]{}<>#@\\`.split(``)),E=()=>0,D=e=>{let t=e.charCodeAt(0);return t<128?t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36:/[\p{L}\p{N}]/u.test(e)},O=e=>e>=48&&e<=57,k=(e,t)=>{let n=e.charCodeAt(t);return n<128?n===32||n===9||n===11||n===12:/\s/.test(e[t])},A=e=>{let t=e.charCodeAt(0);return t<128?t>=65&&t<=90:/^\p{Lu}/u.test(e)};function j(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return e[t]===`:`}function M(e,t){if(typeof t?.tokenize==`function`)return t.tokenize(e,t);let n=t?.keywords||new Set,r=t?.typeKeywords||new Set,i=t?.onCommentStart||E,a=t?.onCommentEnd||E,o=t?.caseInsensitive?e=>e.toLowerCase():e=>e,s=[],c=``;function l(e,t){t&&(s.push([e,t]),e!==C&&e!==S&&(c=t))}for(let s=0;s<e.length;){let u=e[s],d=e[s+1],f=i(u,d,s,e);if(f){let t=s++;for(;s<e.length;){if(a(e[s-1],e[s],s,e,t)==f){s++;break}s++}l(x,e.slice(t,s));continue}let v=t?.onLiteral?.(u,s,e);if(v)l(h,e.slice(s,s+v)),s+=v;else{if(typeof t?.onQuote==`function`&&u===`'`){let n=t.onQuote(u,s,e);if(typeof n==`number`&&n>=1){l(p,e.slice(s,s+n)),s+=n;continue}}if(u===`"`||u===`'`||t?.templateStrings&&u==="`"){let n=u,r=s++;for(;s<e.length;){if(e[s]===`\\`)s++;else if(e[s]===n){s++;break}s++}let i=e.slice(r,s);l(t?.quotedKeys&&j(e,s)?_:h,i)}else if(u===`
|
|
5
|
+
`||u===`\r`&&d===`
|
|
6
|
+
`){let e=u===`\r`?`\r
|
|
7
|
+
`:u;l(S,e),s+=e.length}else if(k(e,s)){let t=s++;for(;s<e.length&&k(e,s);)s++;l(C,e.slice(t,s))}else if(D(u)){let t=s++;for(;s<e.length&&D(e[s]);)s++;if(O(u.charCodeAt(0))&&e[s]===`.`&&O(e.charCodeAt(s+1)))for(s++;s<e.length&&D(e[s]);)s++;let i=e.slice(t,s),a=o(i);l(r.has(a)?g:n.has(a)?m:c===`.`?_:O(i.charCodeAt(0))||i===`null`||A(i)?g:p,i)}else T.has(u)?(l(b,u),s++):(l(h,u),s++)}}return s}function N(e,t){let n=ee(e,M(e,t));if(t?.annotateLine)for(let e of n.lines)t.annotateLine(e);return n}var P=new Set([`<`,`>`,`{`,`}`,`[`,`]`]),F=new Set(`for.do.while.if.else.return.function.var.let.const.true.false.undefined.this.new.delete.typeof.in.instanceof.void.break.continue.switch.case.default.throw.try.catch.finally.debugger.with.yield.async.await.class.extends.super.import.export.from.static`.split(`.`)),re=new Set([...F,`type`,`interface`,`enum`,`implements`,`readonly`,`abstract`,`declare`,`namespace`,`module`,`private`,`protected`,`public`,`override`,`keyof`,`infer`,`is`,`asserts`,`satisfies`,`as`,`unknown`,`never`,`any`,`number`,`string`,`boolean`,`bigint`,`symbol`,`object`]),ie=new Set([`+`,`-`,`*`,`/`,`%`,`=`,`!`,`&`,`|`,`^`,`~`,`!`,`?`,`:`,`.`,`,`,`;`,`'`,`"`,`.`,`(`,`)`,`[`,`]`,`#`,`@`,`\\`,...P]),ae={keywords:F,onCommentStart:z,onCommentEnd:B,jsx:!0,regex:!0,templateStrings:!0};function oe(e){return{...ae,...e}}function se(e){let t=0;return/\binterface\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(e)&&(t+=2),/\benum\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(e)&&(t+=2),/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(e)&&(t+=1),/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(e)&&(t+=1),/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(e)&&(t+=1),t>=2}function ce(e,t){let n=0,r=0;for(let i=t;i<e.length;i++){let t=e[i];if(t===`"`||t===`'`){let n=t;for(;++i<e.length&&e[i]!==n;)e[i]===`\\`&&i++}else if(t===`{`)r++;else if(t===`}`){if(!r)return-1;r--}else if(t===`;`&&!r)return-1;else if(t===`<`)n++;else if(t===`>`&&e[i-1]!==`=`&&--n===0)return i+1}return-1}function le(e,t){let n=ce(e,t);return n<0||!/^\s*\(/.test(e.slice(n))?!1:/\)\s*(?::[\s\S]{0,120}?)?=>/.test(e.slice(n,n+320))}function ue(e,t){let n=e.charCodeAt(t);return n<128?n===32||n>=9&&n<=13:/\s/.test(e[t])}function I(e,t){if(!e)return!1;for(let n=0;n<e.length;n++)if(!ue(e,n)||!t&&(e[n]===`
|
|
8
|
+
`||e[n]===`\r`))return!1;return!0}function L(e){if(!e)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=128||n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===95||n===36))return!1}return!0}function de(e){for(let t=0;t<e.length;t++)if(!ie.has(e[t]))return!1;return!0}function fe(e){return/^[0-9A-Z\p{Lu}]/u.test(e)||e===`null`}function pe(e){if(!e||e.length!==1)return!1;let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122}function me(e){if(!e||e.length!==1)return!1;let t=e.charCodeAt(0);return t>=128||t>=65&&t<=90||t>=97&&t<=122||t===36||t===95}function R(e){return me(e[0])&&L(e)}function he(e){return e==="`"}function ge(e){return e===`"`||e===`'`}function z(e,t){return e===`/`?t===`*`?2:+(t===`/`):0}function B(e,t){return e===`*`&&t===`/`?2:+(t===`
|
|
9
|
+
`)}function _e(e,t){let n=t+1;for(;n<e.length&&ue(e,n);)n++;return e[n]===`:`}function ve(e,t){let n=oe(t),r=n.keywords!==ae.keywords,i=n.typescript,a=()=>(i??=se(e))?re:F,o=r?n.keywords:i==null?void 0:a(),s=e=>o?o.has(e):F.has(e)||re.has(e)&&(o=a()).has(e),{onCommentStart:c,onCommentEnd:l}=n,u=n.typeKeywords instanceof Set?n.typeKeywords:null,d=n.jsx!==!1,f=n.regex!==!1,ee=n.templateStrings!==!1,te=n.caseInsensitive?e=>e.toLowerCase():e=>e,ne=e=>ee&&he(e),w=``,T=-1,E=[-1,``],D=[-2,``],O=[],k=!1,A=0,j=0,M=0,N=[],B=e=>{N.push([A,j,M]),A=e,j=M=0,k=!0},V=()=>{[A,j,M]=N.pop()||[0,0,0],k=N.length>0},H=()=>k&&!j&&!A,U=()=>A,W=()=>H()&&N.length,G=null,ye=0,K=!1,q=[],J=()=>G!==null,be=()=>K,Y=()=>q.length>0&&q[q.length-1]===-1,xe=()=>q.length>0&&q[q.length-1]>=0,X=()=>J()||Y();function Se(e){let t=e===`
|
|
10
|
+
`||e===`\r
|
|
11
|
+
`;if(U()){if(J())return h;let[,t]=E;if(R(e)){if(t===`<`||t===`</`)return v;if(!M&&I(O[O.length-1]?.[1],!0))return _}}if(W())return y;if(J()||Y())return h;if(u&&u.has(te(e)))return E[1]===`.`?p:g;if(s(te(e)))return E[1]===`.`?p:m;if(t)return S;if(I(e))return C;if(de(e))return b;if(fe(e))return U()&&!M?p:g;if(R(e)){let e=E[1]===`.`&&R(D[1]);if(!X()&&!e)return p;if(e)return _}return h}let Z=(e,t)=>{if(t&&(w=t),w){T=typeof e==`number`?e:Se(w);let t=[T,w];T!==C&&T!==S&&(D=E,E=t),U()&&T===b&&((w===`{`||w==="${")&&M++,w===`}`&&M--),O.push(t)}w=``};for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],o=e[t+1];if(typeof n.onQuote==`function`&&r===`'`&&!J()&&!W()&&!Y()){let i=n.onQuote(r,t,e);if(typeof i==`number`&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,e.length-t),r=t+n;Z(),w=e.slice(t,r),Z(p),t=r-1;continue}}if(ge(r)&&!W()&&!Y()){Z();let i=!1;if(G&&r===G?(G=null,i=!0):G||(G=r,ye=O.length),Z(h,r),n.quotedKeys&&i&&_e(e,t))for(let e=ye;e<O.length;e++)O[e][0]=_;continue}if(ne(r)&&!J()&&!W()){Z(),Y()?q.pop():q.push(-1),Z(h,r);continue}if(Y()&&r===`$`&&o===`{`){q[q.length-1]=0,Z(h),Z(b,"${"),t++;continue}if(xe()&&!J()&&!W()){let e=q.length-1;if(r===`{`&&q[e]++,r===`}`){if(q[e]===0){Z(),q[e]=-1,Z(b,r);continue}q[e]--}}if(d&&r===`<`&&!X()&&!W()){let r=w.trim()||E[1],i=R(r)&&!s(r)||fe(r)||r===`)`||r===`]`||le(e,t)?ce(e,t):-1;if(i>t){Z();for(let[r,o]of ve(e.slice(t,i),{...n,jsx:!1,typescript:a()===re}))Z(r,o);t=i-1;continue}}if(H()&&r===`{`){Z(),Z(b,r),j=1;continue}if(d&&r===`<`&&!X()&&(o===`>`||e.slice(t,t+3)===`</>`)){Z();let e=o===`/`;e?V():B(0),Z(b,e?`</>`:`<>`),t+=e?2:1;continue}if(k){if((!A||M)&&r===`<`&&!X()&&(o===`/`||me(o))){Z(),o===`/`?(A=2,w=`</`,t++):(B(1),w=r),Z(b);continue}if(A){if(r===`>`&&!`/=`.includes(i)&&!X()&&!M){Z(),A===1?A=0:V(),Z(b,r);continue}if(r===`/`&&o===`>`&&!X()&&!M){w!==`<`&&w!==`/`&&Z(),V(),w=`/>`,t++,Z(b);continue}if(r===`<`&&!X()&&!M){Z(),w=r,Z(b);continue}if(r===`-`&&w&&!X()&&!W()){let n=t+1;for(;n<e.length&&/[$\w-]/.test(e[n]);)n++;Z(_,w+e.slice(t,n)),t=n-1;continue}if(o===`=`&&!X()&&!I(r)){I(w)&&Z();let e=w+r;if(R(e)){Z(_,e);continue}}}}if(d&&!A&&r===`<`&&(me(o)||o===`/`)){let n=t-1;for(;n>=0&&ue(e,n);)n--;let i=n>=0?e[n]:``,[a,c]=E,l=!1,u=!1;if(w&&!I(w)){let e=w;fe(e)||e===`true`||e===`false`?l=!0:s(e)&&R(e)?u=!0:R(e)&&(l=!0)}let d=r===`<`&&/[$\w\]\)]/.test(i)&&(l||!u&&(a===p||a===g||a===b&&(c===`)`||c===`]`))),f=r===`<`&&le(e,t);r!==`<`||o!==`/`&&!pe(o)||d||f||X()||W()||be()||(Z(),o===`/`?A=2:B(1))}let u=ge(r)||ne(r),m=Y(),v=f&&!k&&r===`/`&&!z(r,o),y=W();if(u||m||ge(G)){w+=r,r===`\\`&&(w+=e[++t]||``);let n=G?`"'\\`:Y()?"`$\\":``;if(n){let r=t+1;for(;r<e.length&&!n.includes(e[r]);)r++;w+=e.slice(t+1,r),t=r-1}}else if(v){Z();let[n,i]=E;if(v&&n!==-1&&!(n===b&&i!==`)`||n===x)){w=r,Z();continue}K=!0;let a=t++,o=!1,s=!1;for(;t<e.length&&e[t]!==`
|
|
12
|
+
`;t++){let n=e[t];if(n===`\\`){if(e[t+1]===`
|
|
13
|
+
`)break;t++}else if(n===`[`&&(s=!0),n===`]`&&(s=!1),n===`/`&&!s){for(o=!0;e.charCodeAt(t+1)>=97&&e.charCodeAt(t+1)<=122;)t++;break}}K=!1,a!==t&&o?(w=e.slice(a,t+1),Z(h)):(w=r,Z(),t=a)}else if(c(r,o,t,e)){Z();let n=t,i=c(r,o,t,e);if(i)for(;t<e.length&&l(e[t-1],e[t],t,e)!=i;t++);w=e.slice(n,t+1),Z(x)}else if(r===` `||r===`
|
|
14
|
+
`||r===`\r`&&o===`
|
|
15
|
+
`){if(r===` `&&(I(w)||!w||y)){let n=t+1;for(;e[n]===` `;)n++;w+=e.slice(t,n),t=n-1,e[n]===`<`&&Z()}else Z(),w=r,r===`\r`&&(w=`\r
|
|
16
|
+
`,t++),Z()}else{if(j&&r===`}`)Z(),w=r,Z(),j--;else if(y&&!P.has(r)||Y()||(L(r)===L(w[w.length-1])||H())&&!ie.has(r)){if(w+=r,y&&!P.has(r)&&c===z){let n=t+1;for(;n<e.length&&!`
|
|
17
|
+
\r/<>{}[]`.includes(e[n]);)n++;w+=e.slice(t+1,n),t=n-1}}else i===`<`&&r===`/`&&(w=`</`),Z(),(i!==`<`||r!==`/`)&&(w=r),r===`<`&&o===`/`||r===`/`&&o===`>`?(w=r+o,Z(),t++):P.has(r)&&Z();if(!A&&!y&&c===z&&L(r)){let n=t+1;for(;n<e.length&&L(e[n]);)n++;w+=e.slice(t+1,n),t=n-1}j&&r===`{`&&j++}}return Z(),O}var V=ve,H=e({tokenize:()=>U}),U=(e,t)=>ve(e,{...t,typescript:!0}),W=e({keywords:()=>G,onCommentEnd:()=>K,onCommentStart:()=>ye,onLiteral:()=>q,tokenize:()=>Ce}),G=new Set([`@media`,`@import`,`@keyframes`,`@font-face`,`@supports`,`@page`,`@counter-style`,`@font-feature-values`,`@viewport`,`@counter-style`,`@font-feature-values`,`@document`]),ye=(e,t)=>+(e+t===`/*`),K=(e,t)=>+(e+t===`*/`),q=(e,t,n)=>e===`#`&&n.slice(t).match(/^#(?:[\da-f]{8}|[\da-f]{6}|[\da-f]{4}|[\da-f]{3})(?![\w-])/i)?.[0].length||0,J=e=>e===C||e===S||e===x,be=([e,t])=>e===p||e===g||e===b&&t===`-`,Y=([e])=>e===p||e===g||e===_,xe=e=>Y(e)&&!/^\d/.test(e[1]),X=([e,t])=>e===b&&t===`-`,Se=e=>{let t=[];for(let n=0;n<e.length;n++){let r=n,i=n;if(X(e[i])){for(;e[i]&&X(e[i]);)i++;if(!e[i]||!xe(e[i])){t.push(e[n]);continue}r=i++}else if(xe(e[i]))i++;else{t.push(e[n]);continue}let a=r>n;for(;e[i]&&X(e[i]);){let t=i;for(;e[i]&&X(e[i]);)i++;if(!e[i]||!Y(e[i])){i=t;break}a=!0,i++}if(!a){t.push(e[n]);continue}let o=e.slice(n,i).map(([,e])=>e).join(``);t.push([e[r][0],o]),n=i-1}return t},Z=(e,t)=>{let n=0,r=0;for(let i=t;i<e.length;i++){let[t,a]=e[i];if(t===b){if(a===`(`)n++;else if(a===`)`)n--;else if(a===`[`)r++;else if(a===`]`)r--;else if(!n&&!r&&a===`{`)return!0;else if(!n&&!r&&(a===`;`||a===`}`))return!1}}return!1},Ce=(e,t)=>{let n=Se(M(e,{...t,tokenize:void 0})),r=[],i=0,a=!1;for(let e=0;e<n.length;e++){let t=n[e],[o,s]=t;if(o===b&&s===`{`){i++,a=!0,r.push(t);continue}if(o===b&&s===`}`){i--,a=!1,r.push(t);continue}if(o===b&&s===`;`){a=i>0,r.push(t);continue}if(!a||J(o)){r.push(t);continue}let c=e,l=e;for(;l<n.length&&be(n[l]);)l++;let u=l;for(;u<n.length&&J(n[u][0]);)u++;if(l>c&&n[u]?.[0]===b&&n[u][1]===`:`&&!Z(n,u+1)){let t=n.slice(c,l).map(([,e])=>e).join(``);r.push([_,t]),e=l-1}else r.push(t);a=!1}return r},we={keywords:new Set,jsx:!0,regex:!1,templateStrings:!1,onCommentStart:(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,onCommentEnd:(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0},Q=e=>V(e,we),Te=/^<\s*(script|style)\b/i,Ee=e=>RegExp(`</\\s*${e}\\s*>`,`ig`);function De(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return-1}function Oe(e){let t=[],n=new Set,r=0;for(;r<e.length;){if(e.startsWith(`<!--`,r)){let t=e.indexOf(`-->`,r+4);r=t===-1?e.length:t+3;continue}if(e[r]!==`<`){r++;continue}let i=De(e,r);if(i===-1)break;let a=e.slice(r,i).match(Te);if(!a){r=i;continue}let o=a[1].toLowerCase();if(n.has(o)){r=i;continue}let s=Ee(o);s.lastIndex=i;let c=s.exec(e);c?(t.push({start:r,openEnd:i,closeStart:c.index,end:s.lastIndex,tag:o}),r=s.lastIndex):(n.add(o),r=i)}return t}function ke(e){let t=Oe(e);if(!t.length)return Q(e);let n=[],r=e=>{for(let t=0;t<e.length;t++)n.push(e[t])},i=0;for(let n of t){let{start:t,openEnd:a,closeStart:o,end:s,tag:c}=n;r(Q(e.slice(i,t))),r(Q(e.slice(t,a))),r(c===`style`?Ce(e.slice(a,o),W):V(e.slice(a,o),{jsx:!1})),r(Q(e.slice(o,s))),i=s}return r(Q(e.slice(i))),n}var Ae=e({jsx:()=>!0,keywords:()=>je,onCommentEnd:()=>Pe,onCommentStart:()=>Ne,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>Me}),je=new Set([]),Me=ke,Ne=(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,Pe=(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0,Fe=(e,t)=>{let n=e+t;return n===`//`?1:n===`/*`?2:0},Ie=(e,t)=>t===`
|
|
18
|
+
`?1:e+t===`*/`?2:0,Le=e({keywords:()=>Re,onCommentEnd:()=>Ie,onCommentStart:()=>Fe,quotedKeys:()=>!0}),Re=new Set([`true`,`false`,`null`]),ze=e=>+(e===`#`),Be=(e,t)=>+(t===`
|
|
19
|
+
`),Ve=e({keywords:()=>He,onCommentEnd:()=>Be,onCommentStart:()=>ze}),He=new Set([`case`,`coproc`,`do`,`done`,`elif`,`else`,`esac`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`readonly`,`return`,`select`,`then`,`time`,`until`,`while`]),$=r(),Ue=s(`group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50 data-[size=sm]:text-xs`,{variants:{variant:{default:`border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30`,destructive:`border border-destructive/30 text-destructive dark:border-destructive/40`}},defaultVariants:{variant:`default`}});function We({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,$.jsx)(`div`,{"data-slot":`code-block`,"data-variant":t,"data-size":n,className:o(Ue({variant:t}),e),...r})}function Ge({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`code-block-header`,className:o(`flex min-w-0 shrink-0 items-center gap-2 px-3 pt-3 text-muted-foreground group-data-[size=sm]/code-block:px-2.5 group-data-[size=sm]/code-block:pt-2.5 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0`,e),...t})}function Ke({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`code-block-title`,className:o(`min-w-0 truncate font-sans text-sm font-medium text-foreground group-data-[size=sm]/code-block:text-xs group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5`,e),...t})}function qe({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`code-block-actions`,className:o(`-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-2 [[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-1.5 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-1.5 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10`,e),...t})}function Je({value:e,variant:t=`ghost`,size:n=`icon-xs`,className:r,onClick:a,...s}){let[u,f]=l.useState(!1);return l.useEffect(()=>{if(!u)return;let e=setTimeout(()=>f(!1),2e3);return()=>clearTimeout(e)},[u]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{"data-slot":`code-block-copy-button`,"data-copied":u||void 0,variant:t,size:n,"aria-label":u?`Copied`:`Copy`,className:o(r),onClick:t=>{a?.(t),navigator.clipboard.writeText(e).then(()=>f(!0)).catch(()=>{})},...s,children:u?(0,$.jsx)(c,{className:`size-3.5`}):(0,$.jsx)(d,{className:`size-3.5`})}),(0,$.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,children:u?`Copied`:``})]})}function Ye({className:e,children:t,style:n,wrap:r=!1,lineNumbers:i=!1,startLine:a=1,...s}){return(0,$.jsx)(`pre`,{"data-slot":`code-block-content`,"data-wrap":r||void 0,"data-numbered":i||void 0,dir:`ltr`,tabIndex:0,style:{counterReset:`line ${a-1}`,...n},className:o(`min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-3 py-3 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-2.5 group-data-[size=sm]/code-block:py-2.5 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap`,e),...s,children:(0,$.jsx)(`code`,{"data-slot":`code-block-code`,className:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`,children:i&&typeof t==`string`?t.replace(/\n$/,``).split(`
|
|
20
|
+
`).map((e,t)=>(0,$.jsx)(Ze,{children:e},t)):t})})}var Xe=s(`relative -mx-3 block min-h-lh px-3 group-data-[size=sm]/code-block:-mx-2.5 group-data-[size=sm]/code-block:px-2.5 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']`,{variants:{variant:{default:``,added:`bg-muted after:content-['+']`,removed:`bg-destructive/10 after:text-destructive after:content-['−']`,highlighted:`bg-muted`}},defaultVariants:{variant:`default`}});function Ze({className:e,variant:t=`default`,children:n,...r}){let i=n==null||n===``||Array.isArray(n)&&n.length===0;return(0,$.jsx)(`span`,{"data-slot":`code-block-line`,"data-variant":t,className:o(Xe({variant:t}),e),...r,children:(0,$.jsx)(`span`,{"data-slot":`code-block-line-content`,className:`min-w-0`,children:i?`
|
|
21
|
+
`:n})})}var Qe={javascript:{tokenize:e=>V(e,void 0)},typescript:H,jsx:{tokenize:e=>V(e,void 0)},tsx:H,html:{...Ae,tokenize:e=>Me(e,Ae)},css:W,json:Le,shell:Ve},$e={"--sh-class":`#704f8e`,"--sh-identifier":`#282624`,"--sh-sign":`#77736e`,"--sh-property":`#1f6173`,"--sh-entity":`#a55042`,"--sh-jsxliterals":`#915c20`,"--sh-string":`#39744f`,"--sh-keyword":`#a83c45`,"--sh-comment":`#77736e`},et={"--sh-class":`#c8a4d6`,"--sh-identifier":`#eae8e3`,"--sh-sign":`#a3a09a`,"--sh-property":`#95bec7`,"--sh-entity":`#e7a18d`,"--sh-jsxliterals":`#e5c28c`,"--sh-string":`#a9cfae`,"--sh-keyword":`#e7a1aa`,"--sh-comment":`#a3a09a`},tt={javascript:`JavaScript`,typescript:`TypeScript`,jsx:`JSX`,tsx:`TSX`,html:`HTML`,css:`CSS`,json:`JSON`,shell:`Terminal`,text:`Text`};function nt({code:e,language:t=`text`,title:n,toolbar:r,panelId:i,labelledBy:a,theme:o,maxHeight:s=400,height:c,compact:u=!1,wrap:d=!1,copyable:f=!0,className:p=``,propertyLinks:m,onLocalLink:h}){let g=n??tt[t],_=(0,l.useMemo)(()=>t===`text`?null:w(N(e,Qe[t])),[e,t]);return(0,$.jsxs)(We,{size:u?`sm`:`default`,className:`${o===`dark`?`bg-zinc-950 text-zinc-50 border-zinc-800`:o===`light`?`bg-white text-zinc-900 border-zinc-200`:``} ${p}`,style:o?o===`dark`?et:$e:void 0,onKeyDown:e=>{e.key!==`Escape`&&e.stopPropagation()},children:[(0,$.jsxs)(Ge,{className:`border-b border-border pb-2`,children:[r??(0,$.jsxs)(Ke,{className:`font-mono text-xs`,children:[g,n&&(0,$.jsx)(`span`,{className:`ml-2 text-[10px] font-normal text-muted-foreground`,children:tt[t]})]}),f&&(0,$.jsx)(qe,{children:(0,$.jsx)(Je,{value:e,"aria-label":`Copy ${g}`})})]}),(0,$.jsx)(Ye,{id:i,role:a?`tabpanel`:void 0,"aria-labelledby":a,"aria-label":a?void 0:`${g} example`,wrap:d,style:{maxHeight:s,height:c},children:_?_.map((e,t)=>(0,$.jsxs)(l.Fragment,{children:[(0,$.jsx)(`span`,{className:`min-h-lh`,children:e.children.map((t,n)=>{let r=t.children.map(e=>e.value).join(``),i=e.children.slice(n+1).find(e=>e.tokenType!==`space`),a=(t.tokenType===`identifier`||t.tokenType===`property`)&&i?.children.map(e=>e.value).join(``)===`:`?m?.[r]:void 0;return(0,$.jsx)(`span`,{className:t.properties.className,style:t.properties.style,children:a?(0,$.jsx)(`a`,{className:`joy-docs-property-link`,href:a,onClick:e=>{h&&a.startsWith(`#jr-doc-`)&&(e.preventDefault(),h(a.slice(1)))},children:r}):r},n)})}),t<_.length-1?`
|
|
22
|
+
`:null]},t)):e})]})}export{nt as t};
|