diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..398605c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - run: yarn install --frozen-lockfile + + - run: yarn build + + - uses: actions/configure-pages@v5 + + - uses: actions/upload-pages-artifact@v3 + with: + path: docs + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/deploy-pages@v4 + id: deployment diff --git a/.gitignore b/.gitignore index 98599df..251ce6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,23 @@ -*node_modules \ No newline at end of file +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/README.md b/README.md index 680bae4..b476303 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Varun Nadgir \ No newline at end of file +# Varun Nadgir Portfolio Website + +Interactive solar system simulation made with Vite and React-three-fiber diff --git a/blog/12notematrix.html b/blog/12notematrix.html deleted file mode 100644 index a67c90f..0000000 --- a/blog/12notematrix.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - 12-Tone Matrix - - - - - - - - - - - - - - - -
-
-
-

12-Tone Atonal Matrix

-
-
-
-

In general, composed music follows certain tonal rules that guide the composer when writing chord - progressions, melody lines, and entire harmonies. The word "tonal" usually implies some notes are more prominent - than others, such as the root (I) or the dominant (V). However, in atonal music, no note is used more often than - another, meaning there is no root. This 12x12 atonal matrix gives us a way to write music so that this - rule can be followed.

-

First, the composer has to select the "initial row": a 12-note sequence that uses each of the 12 notes in - Western music only once. Second, the inverse of this row is placed in the first column. To find the inverse, - first we assign numerical values to the notes in our initial row. That is, the root is called 0, one half step - up is 1, another half step is 2, and so on until 11. The value placed in the inverse column will simply be (12 - - initial row). Third, all other cells are filled in by adding up the top-most row value with the left-most column - value. Remember that this is mod12, so any sum larger than 12 is replaced with the proper value. Now that a - number value has been put into every cell of this matrix, we can convert it back to notes to make it more - readible. This completed matrix is what we can now use to write an atonal piece.

-

Rules: -

    -
  1. Select any row/column in your palette
  2. -
  3. Once you begin a row, you must follow it to completion
  4. -
  5. You must play all the pitches in order
  6. -
  7. You may not skip any pitches, and you may not repeat any pitches
  8. -
  9. Notes may occur in any octave and may last any duration
  10. -
  11. You may begin two or more notes simultaneously as long as they occur sequentially in the row.
  12. -
  13. Any number of rows may be played concurrently
  14. -
-

Because of the way we generated the matrix, these rules ensure that no note gets used more than another, - meaning no note can be considered the root. For more information, as well as a sound clip and images, check out - The Carolingian Realm. -


- - - -
-


If you would like to change the 12-note matrix, click here to open the document and change it directly. You must change the original row - to your own 12-tone sequence (using each note only once), and then change the Legend to reflect the new - numerical assignments. Then the final matrix will change on its own. Once you've done that, well... that's the - easy part. The hard part is actually writing something that sounds good!

- -
- - - \ No newline at end of file diff --git a/blog/aboutme.html b/blog/aboutme.html deleted file mode 100644 index 3371529..0000000 --- a/blog/aboutme.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - About Me - - - - - - - - - - - - - - - -
-
-
-

About Me

-
-
-
- - -
- - - \ No newline at end of file diff --git a/blog/colorpuzzle/entries.html b/blog/colorpuzzle/entries.html deleted file mode 100644 index b46e4d9..0000000 --- a/blog/colorpuzzle/entries.html +++ /dev/null @@ -1,241 +0,0 @@ -
-
-

UE5 Color Puzzle

-

Creating a Puzzle Prototype Game in Unreal Engine 5

-
-
-
- - - - -

- -

In this blog series, I'd like to walk you through the development of my UE5 puzzle game prototype. Using - Blueprints and some assets from the Epic Games Marketplace, I took a simple idea and turned it into a - fully functional color puzzle. I'll give a high level overview of the structure and logic of the puzzle, as well as - provide videos of the progress made during each iteration. At the end, I'll share my full walkthrough video so you - can see all of the node graphs in full detail if you are intersted. Hope you enjoy!

- - i. Introduction
- ii. Base Puzzle Logic
- iii. Dynamic Material Instances
- iv. Shader Design
- v. Level Design
- vi. Summary & Final Thoughts
-
- -
-
-

Introduction

-
-
-
- - -
- -

The rules of the game are simple: set the individual R, G, and B color channels so that they mix into the target - color (chosen randomly). If the player's color is close enough (based on a tolerance we can set), the player - succeeds.

- -

By keeping the basic rules and win condition of this puzzle brief and straightforward, I wanted to use this project - as an opportunity to get hands-on with a variety of tools and features in Unreal Engine 5. Being somewhat new to - the engine, but otherwise comfortable with graphics, I wanted to see how multiple Actors can communicate. - Additionally, I hoped to create a visually pleasing shader/material to complement the puzzle scenario.

- -

Using Unreal Engine 5.3.2, I began with the basic third-person template with Quinn as my ThirdPersonCharacter. I - created a new empty level and set up a few Input Actions: Z (Crank Down), X (Crank Up), and E - (Interact). For now, I am using the default world lighting that Unreal provides and have given myself a large plane - to stand on, which means I have an empty level that I can run around in as Quinn.

- -

To reach the image above, we'll take this in stages. Let's first get the basic game logic working!

-
-
- -
-
-

Base Puzzle Logic

-
-
-
-
- -

There are a few things our puzzle needs to do at minimum. We need to generate a random color when the level - starts, we need to let the player control the three independent color channels, and we need to be checking if the - combination of those color channels matches the random color we generated. Using Unreal's GameState Actor, we can - achieve a lot of this!

- -

I first created a Blueprint for an Actor called ColorPicker. This would be a generic Actor that holds a valve that - can be spun by the player. As the parent Actor, it carries only rotation logic; but if we create three instances of - it, then allow them to independently control three different GameState variables, we can keep our node graphs clean. - Below is a clip of the generic ColorPicker responding to the Player when they are within the interaction range.

- - - - - -

Next we have to set the GameState up with the variables we want to track. To keep it brief, we need to track six - float values that are between 0.0 and 1.0. Three of them are static and determine the color the Player must create, - and three of them are initialized to an abritrary value. By hooking up the Z and X keys to the independent - ColorPickers, we can allow the Player to control those three values. In the clip below, notice the details pane and - how the values are changing in accordance with the Player's input.

- - - - - -

Next, let's actually use these GameState values to affect the scene! By creating a base material that defines - a fluid aesthetic, we can then create Dynamic Material Instances so that the same liquid effect can be given - different base colors.

- -
- -
-
-

Dynamic Material Instances

-
-
-
-
- -

Just like the Blueprints, I give a full breakdown of my final material effect in my walkthrough video, so I - encourage you to check that out if interested. Essentially, I played around with various combinations of noise - patterns to create an effect that looked like a liquid and wanted it to be interesting enough to work during - this testing phase. By using Event Dispatchers, I was able to use the ColorPickers to inform the separate material - instances to update their base color, which I had exposed as a Vector Parameter. Below you can see a clip of my - three ColorPickers being used to update the colors of several materials.

- - - - - -

After getting this communication in place, I was able to take some time to play with some different arrangements - and meshes. Ultimately, I decided I wanted to have three falling streams of liquid mixing into a single pool. Below - is a clip that shows the basic idea I am going for.

- - - - - -

Now comes one of the super fun parts of the project - developing the shader!

- -
- -
-
-

Shader Design

-
-
-
-
- -

After a couple of iterations, I stumbled on a visual style that stuck out to me. The clip below shows an early - stage of the style I would proceed with.

- - - - - -

Not only do we want the shader to mimic a fluid somewhat, we also want to sell the illusion of there being one - continuous body of liquid. Here, I chose to add some color lerping near the bottoms of the falling streams, making - the transition between meshes appear smoother. I also went with a world position offset effect to make the - liquid appear as if it were bubbling, which added some activity to the liquid so it didn't appear flat. On top of - that, I wanted to provide additional feedback in the form of a UI progress bar. This would give the player an even - better idea of how close they were getting to the right answer. The below clips include a percentage in the bar, - which I ultimately did not keep in the final.

- - - - - - - - -
- -
-
-

Level Design

-
-
-
-
- -

With the shader effect coming together, I started to brainstorm a scene and environment that would complement it. - The first that came to mind was an alchemist's lab or a sewer. Thanks to the rotating free assets in the Epic Games - Marketplace, I was fortunate to have some set pieces and prefabs that fit this idea ready to use. I also found some - free SFX for things like the sound of steam releasing or ambient water drops. With all of these elements, the level - really started coming alive. See the clip below for the first demo in the new environment.

- - - - - -

In addition to some background props to help set the scene, I have also updated the ColorPickers to appear as pipes - so that they are more convincing. Although I continued to tweak and adjust things past this point, it is safe to say - we have achieved our original goals! Having connected all of these parts together in my first prototype, I am very - happy with the progress I've made. In the next and final post, I'll do an overview of the project architecture, talk - about some of the final tweaks I made, and share my final walkthrough video with you so you can see it all in - detail. Thanks for reading!

- -
- - -
-
-

Summary & Final Thoughts

-
-
-
-
- -

To visualize the communication of parts, here is a sequence diagram of the running game loop. The classes in this - diagram are the Blueprints, and the processes being run are functions or events found within them. Click to enlarge - the diagram.

- - - -

The diagram only contains the actions and events that are crucial to the game loop and resolution of the win - condition; to see everything in detail, please watch the full walkthrough video. In it, I describe the project - in its entirety and walk through every node graph.

- - - - - -

Thanks for reading to the end! This project was a blast to work on, since it let me use a bunch of different parts - of Unreal Engine that I hadn't explored before. Having set up character input, dynamic materials, and cross-actor - communication in this project, I'm excited to play around in game engines and DCC software further. For now, I - appreciate you following along and I hope you enjoyed!

- -
\ No newline at end of file diff --git a/blog/colorpuzzle/index.html b/blog/colorpuzzle/index.html deleted file mode 100644 index 24d5fbc..0000000 --- a/blog/colorpuzzle/index.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - UE5 Color Puzzle - - - - - - - - - - - - - - - - - -
-
- -
- -
- -
- - - -
- -
- - - - - - - \ No newline at end of file diff --git a/blog/index.html b/blog/index.html deleted file mode 100644 index 6cc464c..0000000 --- a/blog/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - Blog - - - - - - - - - - - - - - - -
-
-
-

My Blog

-
-
- -

About Me
- An introduction to who I am and what I do -

-
- - -

UE5 Color Puzzle
- How to create a puzzle game using UE5 Blueprints -

-
- - -

Hexagonal Tiling with Unreal Engine
- How to make a procedural hex grid using UE5 and C++ -

-
- - -

Making Art with Processing
- Learning how to make art with Java -

-
- - -

Roadtrip2020
- A writeup of my incredible cross country trip -

-
- - -

LoL Item Masher
- Now outdated, this was a fun app to make during a hackathon
- (opens in new tab) -

-
- - -

Atonal Matrix
- How to create atonal music using the 12-tone matrix -

-
- - -

Short Story
- An undergrad assignment I'm proud of
- Warning: Explicit language -

-
- -
- - -
- - - \ No newline at end of file diff --git a/blog/learnprocessing/entries.html b/blog/learnprocessing/entries.html deleted file mode 100644 index b3e70f6..0000000 --- a/blog/learnprocessing/entries.html +++ /dev/null @@ -1,520 +0,0 @@ -
-
-

Processing

-

Making Art with Code

-
-
-
-

Processing is an incredible application, allowing users to create amazing visuals in both 2D and 3D with just some - knowledge of Java. In this blog series, I will be documenting my learning journey, both to "think aloud" as - well as to share the cool things I make. If you'd like to follow along and learn with me, go ahead and download Processing on your machine.

- i. Introduction
- ii. Getting Started
-
- iii. Using Classes
-
- iv. Controlled Looping
-
- v. Dipping into 3D
-
- vi. TBD
-
- -
-
-

Introduction

-
-
-
-
-

Before I begin, let me also shout out two amazing resources I've been using to learn. It's always good to read the - docs - and Processing has pretty high quality ones - but this journey has been made so much more fun thanks to Daniel Shiffman and his channel The Coding Train. You'll see his name on a lot - of the Processing docs, and he has put an insane amount of effort into making hundreds of videos to teach you the - fundamentals of Processing and even programming in general. In particular, I watched almost the entirety of his Coding - Challenges playlist, and I still refer back to a handful of them when trying to brainstorm new creations.

- -

The other creator I must thank is thedotisblack. On his channel, you can dive right into some incredibly cool animations and see - how he makes them. I've picked up a few neat tricks from what he's shared and I'm sure I will be inspired by him - again. Sometimes when I am stumped, I'll just browse through his videos to remind myself of the kinds of things I - hope to create and hop right back in!

- -

Since I am still pretty early in my journey, there are bound to be other resources and creators I find along the - way. If you - come across any art or artist you'd like to share with me, feel free to send me a message or email!

- -

Now... let's get to it!

-
- -
-
-

Getting Started

-
-
-
-
-

When creating animations with Processing, there are two core functions that need to be invoked - setup() - and - draw(). In the setup() function, we can do things like set the canvas dimensions, assign values to - global variables, - instantiate objects for later manipulation, and any other steps that need to happen on or before the first frame. - Then, - in draw(), we can apply transformations, scaling, variable recalculation, and lots more to bring the canvas - to life. - Each unit of time in our case here is a single frame, or one whole execution of the draw() function. -

- -
- -
    
-// setup function
-void setup() {
-  size(600, 600);
-  background(0);
-  ellipse(width/2, height/2, 100, 100);
-}
-
-// render function
-void draw() {
-  // what do we want to make happen?
-}
-  
-
- -

In this example, we're setting our canvas to 600px by 600px and giving it a black background. Although the default - color mode is RGB and usually requires 3 values, we can shorthand black and white with 0 and 255 respectively. When - creating the ellipse, you'll notice I used variables called width and height without ever creating or - assigning them. That's because Processing holds on to a number of system variables as well - width and - height being the dimensions of the canvas itself. By setting the center of the ellipse to half the width and - height of the canvas, we ensure it will be centered in our view even if we were to set the dimensions to something - other than (600, 600). -

- -

- -

We've drawn our first shape to the canvas! Now to make it do something interesting. Why not make it slide to the - right and then wrap back around to the left side for a simple and satisfying loop? Here's how we might achieve that. -

- -
-
    
-int x, y;
-int speed = 5;
-
-// setup function
-void setup() {
-  size(600, 600);
-  background(0);
-  x = width/2;
-  y = height/2;
-}
-
-// render function
-void draw() {
-  ellipse(x, y, 100, 100);
-  x += speed;
-  if (x >= width) {
-    x = 0;
-  }
-}
-  
-
- -

Now, we initialize some variables globally, since we would like to change them later on within the draw() - scope. The variables x and y are set to half the width and height so that we can simplify our - formulas, while speed is set to an arbitrary value of 5. We can play with this one to adjust how quickly the - circle will slide.

- -

This time around, we create our ellipse within draw() because we want to be able to change where we place it - and draw its new location each frame. We also add a check for when x goes beyond the width of the canvas, - setting it back to 0 which would send it back to the left side. Everything seems about right, so then how does it - look?

- -

- -

Wait a second... ah, that's right. Currently, when we draw new frames, they are being overlaid on each other and - creating this trailing effect. It looks cool, but wasn't quite what we wanted. Luckily, this is an easy fix.

- -
-
    
-int x, y;
-int speed = 5;
-
-// setup function
-void setup() {
-  size(600, 600);
-  background(0);
-  x = width/2;
-  y = height/2;
-}
-
-// render function
-void draw() {
-  background(0);
-  ellipse(x, y, 100, 100);
-  x += speed;
-  if (x >= width) {
-    x = 0;
-  }
-}
-  
-
- -

All that is needed here is a background(0) in the render loop. Now, before new circles are drawn, the entire - canvas will be set to a black background again. This should now give us the desired effect.

- -

- -

Excellent!

- -

As we'll see in later entries, both methods can be utilised depending on the context and type of effect we are - going for. Next time, we'll look at the map() function for rescaling values as well as the random() - function for some of its clever uses. Thanks for reading and see you in the next one!

-
- -
-
-

Using Classes

-
-
-
-
-

Now that we have a basic grasp of the two core functions and getting a shape on screen, why not try to make - something truly generative? One of the first examples I learned was to create a raining effect, so let's go through - that together. Let's first try and get a basic shape to fall from the top of the screen to the bottom, and then - extend that logic.

- -
-
    
-float x, y; // starting position of the shape
-float len = 10; // length of the shape
-float speed = 5; // fall speed
-
-void setup() {
-  size(600, 480);
-  x = width/2;
-  y = 0;
-}
-
-void draw() {
-  background(200);
-  strokeWeight(4);
-  stroke(0, 0, 200);
-  line(x, y, x, y+len);
-  y += speed;
-}
-  
-
- -

- -

This gives us a line segment drawn in the center of the screen with weight 4, and it falls at a rate of 5 pixels - per frame. If we want to extend this to mimic falling rain, then we can use this basic behavior in the form of a - Drop class. To do this in Processing, we just create a new tab and name it Drop. Instead of creating global - variables in our main file, we can instead have these be inherent properties of a Drop. At time of creation, we can - assign a Drop a new starting height, fall speed, stroke weight, or really anything we want.

- -
-
    
-class Drop {
-  float x = random(width); // random horizontal position
-  float y = random(-500, -100); // random height, can be offscreen
-  float z = random(0, 20); // create sense of depth
-  float len = map(z, 0, 20, 10, 20); // length of Drop
-  float yspeed = map(z, 0, 20, 4, 10); // speed of Drop
-
-  // fall & reset method
-  void fall() {
-    y = y + yspeed;
-
-    if (y > height) {
-      y = random(-200, -100);
-      yspeed = map(z, 0, 20, 4, 10);
-    }
-  }
-
-  // display method
-  void show() {
-    float thick = map(z, 0, 20, 1, 3);
-    strokeWeight(thick);
-    stroke(0, 0, 200);
-    line(x, y, x, y+len);
-  }
-}
-  
-
- -

Two functions are doing a lot of the heavy lifting in here - random() and map(). The random() - function gives us a number in the given range of two arguments, or a number from 0 to the given single argument. It - is being used in this class for multiple purposes, such as giving the Drop a random starting position, both - horizontally and vertically. These values are such that a new Drop may start well offscreen before passing through - the visible canvas. The value of z here lets us do some neat tricks to create a sense of depth despite - rendering in 2D, with the use of the map() function. To use this function, we tell it a value, its original - range, and then the new range to which to scale it. This means we can take the value of z and use it to - inform multiple features of the Drop, like its stroke weight and fall speed, allowing us to give each Drop a - separated, staggered animation for falling.

- -

Now that we've defined the class and its methods, we can go back to our main script to initialize, draw, and update - a large number of Drops. Since most of our behavior and logic is stored in the Drop class, we should have pretty - simple setup() and draw() functions.

- -
-
    
-// initialize array of 500 Drop objects
-Drop[] drops = new Drop[500];
-
-// setup function 
-void setup() {
-  size(600, 480);
-
-  // loop through and create a new Drop for every index
-  for (int i = 0; i < drops.length; i++) {
-    drops[i] = new Drop();
-  }
-}
-
-// render function
-void draw() {
-  background(200);
-
-  // each frame, show and update the new location
-  for (int i = 0; i < drops.length; i++) {
-    drops[i].show();
-    drops[i].fall();
-  }
-}
-  
-
- -

- -

If you were to run this in Processing, it would appear to rain endlessly. Unfortunately, having to export to gif - means I have to use a limited number of frames. In fact, this may even motivate a shift over to p5.js at some point, - the Javascript library built to support a lot of the same functionality as Processing. However, before moving on, - there are still more fundamentals to Processing to discuss!

- -

Now that we've built and utilized a Class, we can certainly imagine how dynamic some of our creations can be. Just - like random() and map(), there are lots of functions available to us that are simple in concept, yet - lead to awesome results. Next time, we'll take a look at involving a morphing color palette. Additionally, we'll - even try to solve the problem of having limited frames for gif uploads - is there a way we can ensure a smooth loop - in a limited frame count?

- -

Thanks for reading and see you next time!

- -
- -
-
-

Controlled Looping

-
-
-
-
-

Technically, we've already achived a smooth loop in one of our first examples - the white circle moving right then - reseting to the left. Let's take a quick look at it again to see how it was achieved.

- -

- -

Remember when I told you that Processing provides us with a number of system variables? It's time I introduce the - frameCount variable, a counter that is incremented by Processing for us on every render cycle of the - draw() function. In the case of the moving circle, I knew I would achieve a loop at 120 frames, based on the - width of the canvas and the travel speed (x displacement). By having Processing export a .png image every frame, I - can hard stop the program after 120 images, and then use some other method of stitching them together into a gif (I - use ezgif.com). -

- -

The uses of frameCount don't stop there - it can even be leveraged for some great artistic generations using - colors. You may have once seen colors expressed in a color wheel, showing how various hues can blend into each other - seamlessly and eventually loop back to the start. If we can somehow make use of this seamless transitioning, then we - should be able to have our colors loop as well.

- -
-
    
-// setup function
-void setup() {
-  size(600, 600);
-  colorMode(HSB); // hue, saturation, brightness
-}
-
-// render function
-void draw() {
-  background(0);
-  float shift = map(frameCount%60, 0, 60, 0, 255);
-
-  for (int r = 900; r > 0; r -= 20) {
-    strokeWeight(4);
-    stroke((r+shift)%255, 255, 255);
-    noFill();
-    ellipse(width/2, height/2, r, r);
-  }
-  
-  // uncomment to export
-  // saveFrame("output/gif-"+nf(frameCount, 3)+".png");
-
-  // if (frameCount == 60) {
-  //   exit();
-  // }
-}
-  
-
- -

- -

Couple of things to note - the default color mode in Processing is RGB, where the color is based on values of red, - green, and blue. By using color mode HSB, we instead need to provide a hue, saturation, and brightness. In this - mode, going from 0 to 255 lets us traverse the "color wheel", meaning it can neatly loop. The other clever trick - being used is the modulo operator in combination with the map() function. With this, we are telling - Processing that we want to divide the current frameCount by 60, and use this remainder to inform what color - to use. This means, every 60 frames, we should traverse the color wheel one time. To export, we would just - un-comment the lines at the bottom and our images would save in an /output folder of our sketch.

- -

All in all, the output is pretty mesmerizing! Since our loop has the radius of each concentric circle decreasing by - 20, what would happen if we create a new set of circles offset from these and have the colors of those propogate - outwards instead of inwards? Something like this:

- -
-
    
-// setup function
-void setup() {
-  size(600, 600);
-  colorMode(HSB);
-}
-
-// render function
-void draw() {
-  background(0);
-  float shift = map(frameCount%60, 0, 60, 0, 255);
-
-  for (int r = 900; r > 0; r -= 20) {
-    strokeWeight(4);
-    stroke((r+shift)%255, 255, 255);
-    noFill();
-    ellipse(width/2, height/2, r, r);
-  }
-
-  for (int r = 10; r < 900; r += 20) {
-    strokeWeight(4);
-    stroke((r+255-shift)%255, 255, 255);
-    noFill();
-    ellipse(width/2, height/2, r, r);
-  }
-  
-  // uncomment to export 
-  // saveFrame("output/gif-"+nf(frameCount, 3)+".png");
-
-  // if (frameCount == 60) {
-  //   exit();
-  // }
-}
-  
-
- -

- -

Now that is cool! And all just in 60 frames!

- -

I am still currently going through some videos of my own, so no concrete plans yet on the subject of the next - entry. At the moment, I am playing around with map generation, noise algorithms, and cellular automata, but with - such a vast number of ideas and topics to play with, it's hard to pick just a few! But as always, thank you for - reading and I'll see you in the next one.

- -
- -
-
-

Dipping into 3D

-
-
-
-
- -

I've been playing around with 3D more recently, and now that I've made something cool enough to share, I thought it - would be nice to show you how it works in code and I will do my best to walk you through how to make something like - this on your own! - One change you might notice immediately in the code below is the addition of a new argument in the size() - function - this is - how we tell Processing to use a 3D renderer, in this case P3D.

- -
-
    
-// setup function
-void setup() {
-  size(800, 800, P3D); // use 3D renderer
-  colorMode(HSB); // hue, saturation, brightness
-}
-
-// render function
-void draw() {
-  background(0);
-  translate(width/2, height/2); // translate origin to center
-
-  rotateX(radians(60)); // comment this line out for 2D top view
-
-  noFill();
-  strokeWeight(3);
-
-  for (int i = 0; i < 55; i++) {
-    // define line color using frame count and circle position
-    float strokeCol = map(sin(radians(frameCount + i * 10)), -1, 1, 0, 255);
-    stroke(strokeCol, 255, 255);
-
-    // beginShape & endShape for custom shapes
-    beginShape();
-    for (int j = 0; j < 360; j += 5) {
-      int rad = i * 5;
-      float x = rad * cos(radians(j));
-      float y = rad * sin(radians(j));
-      float z = sin(radians(frameCount + i * 10)) * 200;
-      vertex(x, y, z);
-    }
-    endShape(CLOSE);
-  }
-}
-  
-
- -

Here is what this sketch will look like if we comment out the rotateX() function, meaning our sketch is - still functionally 2D like the others. This is basically our "top view".

- -

- -

First, you can probably notice a similar pattern to a previous post where I use the global variable - frameCount to inform my sketch on what to color something. By also using the loop variable i, it can - also be offset by the position of the shape itself. Next, instead of calling ellipse() like I have before, I - am instead using beginShape() and endShape(), a pair of functions that can be used to define a custom - shape with calls to vertex() between them. In this example, I am using the loop variable j to - increment around the radius and place a vertex at a number of equally spaced points. The CLOSE argument - simply tells Processing to close off the shape by connecting the final vertex with the first one. A smaller - increment means more vertices, meaning our shape is closer to resembling a circle. I encourage you to try this with - larger increments, or even dynamic increments to see what sort of shapes and patterns you might get! -

- -

Now let's have our big reveal. By applying rotateX() (and remember, we have to supply our angle in radians), - we tell our renderer to perform the necessary transformations for the illusion of depth. Now our Z axis comes fully - into view.

- -

- -

Another satisfying and smooth loop! Thanks to the oscillatory nature of the sine function, we are able to capture - the entirety of one phase, export our frames, and stitch it together into a nice gif!

- -
- -
-
-

Coming Soon...

-
-
-
-
- -

Entries here are currently on hold as I pursue a few other projects. In fact, I recommend checking out the rest of my blog or portfolio for other WIP or completed demos!

-
\ No newline at end of file diff --git a/blog/learnprocessing/index.html b/blog/learnprocessing/index.html deleted file mode 100644 index 0a5d700..0000000 --- a/blog/learnprocessing/index.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - Processing - - - - - - - - - - - - - - - - -
-
- -
- -
- -
- - - -
- -
- - - - - - - \ No newline at end of file diff --git a/blog/roadtrip2020/entries.html b/blog/roadtrip2020/entries.html deleted file mode 100644 index c34b960..0000000 --- a/blog/roadtrip2020/entries.html +++ /dev/null @@ -1,602 +0,0 @@ -
-
-

Roadtrip 2020

-
-
-
-
-

Day 1: September 26, 2020 (Philadelphia PA)

-

Day 2: September 27, 2020 (Cave City KY)

-

Day 3: September 28, 2020 (Memphis TN, Hot Springs AK)

-

Day 4: September 29, 2020 (Hot Springs AK)

-

Day 5: September 30, 2020 (Dallas TX, Carlsbad NM)

-

Day 6: October 1, 2020 (Lincoln National Forest, White - Sands National Park, Albuquerque NM)

-

Day 7: October 2, 2020 (Painted Desert / Petrified Forest - National Park)

-

Day 8: October 3, 2020 (Moab UT, Canyonlands National Park - / Island in the Sky)

-

Day 9: October 4, 2020 (Salt Lake City UT, Reno NV)

-

Day 10: October 5, 2020 (Lake Tahoe CA, Oakland CA)

-

Final: Final Thoughts

-
- -
-
-

September 26, 2020

-
-
-
-

And we're off! My travelmates came by to pick me up just after noon, and our first stop was... my parent's house! - Since our first major stop on the trip was Philly to see my brother, I couldn't possibly leave without - bringing him some of mom's homecooked food. After chatting and getting some last minute travel tips from my parents, - we left for real.

-

It's a pretty normal drive, one I've done a number of times with my family already. In fact, the drive went even - more smoothly than I had expected. For some reason, I was under the impression the drive to Philly would be - around 6 hours, but in fact it's closer to 4.5. We just stopped once in New Haven, after which I took to the wheel - to bring us the rest of the way to my brother's new place.

- -

- -

Upon reaching his apartment, I had to admit to the rest that I hadn't eaten yet. It must have been how late I - stayed up the night before and just my general sense of excitement, but yeah - it occurred to me shortly before - arriving that I was actually very hungry. Fortunately, my brother and I have made it a habit to get halal food - cart every time I visit, and this time was no exception. After picking up our dinner, we continued walking - around Philly to a spot called Cira Green. It's a nice little park on a roof with music, a large TV screen, - spots for picnicking, and a good view of the streets below.

- - -

After eating, it was time to vibe out back at the apartment. The thing about hanging out with a brother you - don't get to see often - you don't even necessarily have to be doing anything in particular to enjoy the time - together. We had some drinks, talked about our plans for the rest of our trip / his semester, watched some bad - movies, and eventually slept after a fun night together.

- -

- -

Our first big stretch of driving was going to be the next day...

-
- -
-
-

September 27, 2020

-
-
-
-

Not too many pictures taken today. After all, it was a long 11.5 hour drive to Cave City, KY - most of which I - spent in the back seat resting up for my turn. We drove through Columbus and Cincinnati, OH, where I eventually took - night shift and got us to the motel in Kentucky. Definitely not as homey as my brother's place. However, we had - officially passed through into Central Time!

- -

- -

And honestly, that's about it. We called it a night as soon as we got there and prepared for a shorter, but still - significant, drive the next day. Unfortunately for our Mammoth Cave plans, we found out that a large storm would be - passing through the area. Not wanting to get stuck in the thunder, lightning, and poor driving conditions that would - accompany it, we chose to just push on ahead. Funnily enough, that same storm ended up passing through MA and - visited our friends and family back home.

- -

In the morning, our complimentary breakfast consisted of a granola bar, an apple, a cinnamon cake, and a bottle of - water. Since the motel couldn't provide breakfast in their lobby, they were simply handing out lunchbags of assorted - breakfast things. Not particularly excited about the foodstuffs they included, we decided that there's no reason to - turn down free drinking water for a long trip, so we took our lunchbags and headed to get breakfast at a Cracker - Barrel nearby. -

- -

It was okay. The real highlight was seeing someone open carrying while paying for their breakfast. Wouldn't want - to be anywhere near that man's bacon, that's for sure.

-
- -
-
-

September 28, 2020

-
-
-
-

Now I know I cheated a little bit by including today's breakfast in yesterday's post, but that's just how - uneventful yesterday was. Today, we have pictures again! Following breakfast, we began on our 4.5 hour drive down to - Memphis, TN, a place known for Elvis, rock & roll, blues, and the lively Beale St.

- -

- -

Ah right, we're in a pandemic. While disappointing that the streets weren't full of people and the sound of music, - it was a uniquely bizarre and special experience being one of just a handful of groups of people there. And lucky - for us, the sound of music wasn't missing for long.

- -

In a little cutout next to King's Palace Cafe, there was a live band playing the blues to a small crowd of people - - socially distanced at separate tables, of course. What a find this was! It made me realize just how long it had - been since my last live show, which honestly I can't remember. It might have been Marc Rebillet at the Sinclair? I - dunno.

- -

- -

Seriously, I can't tell you just how awesome it was, to be able to just relax with a beer and listen to some live - blues outdoors. On this unusually quiet street, there were still people trying to liven things up, and doing it as - safely as they could. After a beer and a few jams, we decided it was time to head back to the car to continue the - drive to Arkansas, making sure to tip the band as we left.

- -

On our way back to the car, we also found a little music shop. I bought my first vinyl (Radiohead - OK Computer - OKNOTOK), and a couple of gifts for musician friends back home. It would be a couple of days before I realized, "Oh, - yeah, I should get a record player, huh?" We also made sure to say bye to Elvis before leaving.

- -

- -

The drive to Hot Springs, AK would be another 3 hours from Memphis. It was evening/night shift, so my turn to - drive now. It was a fairly quiet drive for the majority of it, elevating to hauntingly quiet as we reached closer to - Hot Springs. For about 45 minutes off of the interstate, we just went down winding roads to get to our inn.

- -

- -

Once we arrived at our room, we decided it would be a good idea to stay here for two nights. We had just spent two - very long days driving - why not stay and enjoy Hot Springs National Park and get a chance to sleep in for a night? - Once suggested, it was heartily agreed upon by everyone, and so we hopped in bed, excited to not have to drive the - next day.

- -
- -
-
-

September 29, 2020

-
-
-
-

Finally - rest day. Although, like any other day, we got into the car first thing in the morning, the key - difference today would be the short 10 minute drive to Hot Springs downtown. A nice, quiet town with a lot of - history, it was our first experience actually out and about in a new place. What a great idea to dodge the storm in - Kentucky - the weather here was beautiful.

- -

- -

You can actually get drinking water straight from the hot springs that give the town its name. Full of minerals - and just under boiling temp, something about it was extremely satisfying. Locals and visitors alike gathered around - the literal watering hole to fill their jugs and cartons, and later on during our walk, we found another fountain - sourced from a cool water spring.

- -

- -

- -

At one time a popular vacation spot for American elite, Hot Springs AK is famous for its bathhouses. On Bathhouse - Row, you can find a number of old buildings, some of which retain their architecture but have been repurposed into - lodging or eateries, while a couple of others are still actively in business as bathhouses. Unfortunately for us, - they only provide their bath and massage services from Thursday to Sunday, and it was Wednesday. Unlucky, but it's - fine. This just means the massage after the trip will be that much better.

- -

We went up a short but steep trail to the Hot Springs Mountain Tower, where we got a nice 360 view of the - surrounding area. Kind of reminded me of the view from Sugarloaf back in Sunderland MA. Funnily enough, there's - another Sugarloaf here in Hot Springs. See if you can spot the rollercoaster/theme park among the trees in the first - pic.

- -

- -

- -

On our way back down from the observation tower, we actually caught a glimpse of some of the spring water pouring - through cracks in the stones, creating a small pool. This was very nice, because of our incorrect initial assumption - that a place called Hot Springs would have large outdoor hot springs. A consolation prize.

- -

- -

After a great day of walking around town and some light hiking, we treated ourselves to some pizza and beer at the - Grateful Head. The rest of the night would be fairly low-key, taking extra time to make sure all of our stuff was - packed. The next day would be a significant bit of driving again - New Mexico to be the goal.

-
- -
-
-

September 30, 2020

-
-
-
-

After a full day to ourselves, free from driving, we hit the road again with a renewed vigor. Before the trip, we - had questions on how we would handle long stretches of driving, but after making it this far, we knew there was - nothing to worry about. Our first stop today was Dallas, about 4.5 hours from Hot Springs and a good spot to stop - for lunch. The hottest day yet, we finally hit 33 C (91 F) as we entered the Texas border.

- -

- -

Our stop for lunch was a place called Pepe & Mito's, a local Tex-Mex restaurant that did not disappoint. I would - have taken a picture of my chimichanga, but I ate it too fast. We walked around for a little bit to take in the heat - and the fact that we had made it down to Texas and were nearing the meat of our trip. Back in 2011 or 12, I had done - the drive from MA to Fort Worth with another friend, so it was very cool how I could recognize some of the highways - and scenery.

- -

The next leg of the trip was completely new for me, and it would be approximately 7 hours to Carlsbad, NM. This - drive was one of the best of the trip - fields of wind turbines as far as the eye can see, an orange sunset in the - distance, and barely any traffic. And the scenery was no less amazing once we hit nighttime, either, since all the - wind turbines in the distance turned into little red flashing lights. At one point, the entire horizon became a - dotted line of little warning lights blinking in sync with each other.

- -

When we got off the main interstate, it was rather surprising that this new single lane highway still had a speed - limit of 75. Out here were fields of oil rigs and exhaust pipes that looked like massive candles, which could be - seen flickering from miles away since there were no streetlights. As we passed into New Mexico, our scenery did not - change at all. However, as we got closer to our destination, we passed through some small towns every so often. It - was at the edge of one of these small towns that we found our night's lodging - Karbani Inn.

- -

- -

- -

What appeared to be a metal box in the middle of nowhere, was the genius that was Karbani Inn. A bunch of metal - shipping containers repurposed with plumbing and electricity, it was honestly a very cozy accommodation. We spent - the night planning our stops for the next few days, while drinking beers under a clear night sky. It wasn't too long - before we were visited by a cute furry friend.

- -

- -

- -

Initially surprised that we would run into what appeared to be a very well-fed stray, we found out later it was - actually the owner's cat. Despite our offerings of chips, crackers, and pieces of fruit, he was focused on getting - into one of the trash bins. Meowing non-stop, he finally made it to the McDonald's bag in the trash, only to find - out it was empty. Perhaps too ashamed to accept our snacks after that, he left after a few more meows. Ultimately, - we decided we would drive through Lincoln National Forest to get to White Sands National Park the next day.

- -

- -

After a tasty breakfast burrito from the food cart near the Inn, we set off.

-
- -
-
-

October 1, 2020

-
-
-
-

Happy October!

- -

Despite waking up slightly late today, we still managed to make good time leaving Karbani Inn. We'd be driving - through some winding mountain paths today, so we made sure to use our daylight hours well. Our first stop would be - Cloudcroft, NM, a small village up in Lincoln National Forest where people like to ski and enjoy the mountain views. -

- -

- -

Only 2.5 hours out of Carlsbad, the drive was beautiful. After driving through the flat terrain of Texas, it was - wonderful to be back up in higher elevation. Since we wanted to spend most of our day at White Sands, we didn't stop - to check out the town or the hiking spots around here, but we did go to one of the viewpoints up there. Sierra - Blanca Viewpoint up in Cloudcroft gives a great view over to Sierra Blanca's peak, which is about 30 miles away. -

- -

- -

The drive back down the other side of Lincoln National Forest was a nice break for our little car, as it could be - heard struggling up some of the steep grades earlier. The views of the mountainside and beyond were marvelous - - while New England surely does have mountain views and hiking, the views down below are certainly not the same. - Rather than the trees and hills we have at home, the sights below were sand and desert. The ride from Cloudcroft - down to White Sands was just under an hour. Although we could see hints of the white sand as we approached the park - entrance, we didn't quite grasp the scale of it until we got into the park itself.

- -

- -

- -

- -

Needless to say, this park was one of the first awe-inspiring visits of the trip thus far. Never had I seen - anything like this. The day was brutally hot, yet the white sand was cool to the touch. Visitors were sledding down - the dunes, families were having picnics, and the general atmosphere here was magical. Depending where you got out of - your car, the entire horizon would be white. And on a day like today, there was hardly a cloud in the sky. We spent - a good few hours in the picnic area, snacking on fruit and crackers and thinking about where we wanted to go next. -

- -

It was at this time we had our first communication breakdown. When we started to realize that it would simply not - be possible to hit all of our planned spots in the remaining days of the trip, it became difficult deciding which - places to cut and which to keep. An awkward silence lingered over our group as we slowly finished our snacks, and we - eventually decided to put off the final decision until we reached Albuquerque. A decent midpoint between our - remaining route options, Albuquerque was a reasonable place to stop for the night.

- -

The drive to Albuquerque was about 4 hours from White Sands, and fortunately for us, it was a full harvest moon - tonight. Not only did we get a beautiful sunset, but shortly after, we got to witness the cresting of the moon along - the mountain range on the horizon. It was enormous, and I only wish we were able to get a picture of it. Thankfully, - this sight did raise our spirits a bit from earlier. After getting dinner at Cheba Hut Toasted Subs in Albuquerque, - we called it for the night and decided to plan our day in the morning.

- -
- -
-
-

October 2, 2020

-
-
-
-

After some discussion in the morning, we eventually decided that the Petrified Forest was a stop we could not - miss, although we would still have to skip the Grand Canyon and Zion National Park. Unfortunate, but it would was a - necessary sacrifice to make good time on the rest of the trip. From Albuquerque, the trip would be about 3.5 hours - along the historic Route 66, now I-40. The Petrified Forest is actually found within a larger landmark known as the - Painted Desert. Aptly named, the layers of sand and stone had shades of blue/lavender, red/orange, grey, and likely - more at other strata. Honestly, it's hard to put into words the beauty and wonder of this place, so I'll just let - the pictures speak for themselves. Enjoy.

- -

- -

- -

- -

- -

- -

- -

I wish I had more to say about the Painted Desert / Petrified Forest, other than to go there if you ever have the - chance. Despite the number of hours we spent there, there was still more we could have seen, but unfortunately we - had to prepare to leave since the park was preparing to close soon. At the picnic area near the exit, we took some - time to make noodles on our portable propane stove - it was quite the janky setup. But there's something special - about the taste of roadside noodles made in a rush.

- -

Our next stop was Canyonlands in Utah, so we started our approximately 4 hour drive. This night gave us a bit of a - scare, since we were struggling to find lodging. Every place we called was completely booked and meant that we would - have to continue driving into the night. Finally, in Blanding, UT, we were able to secure the final two rooms at the - Four Corners Inn. Up until now, I could safely that the Petrified Forest was my favourite stop of the trip. It - wouldn't be long for something to rival it, though, since tomorrow we would be seeing Canyonlands.

-
- -
-
-

October 3, 2020

-
-
-
-

Good morning, Utah! To be completely honest, I had no idea what was in store for the day. Of course, I've looked - at pictures of popular parks and landscapes around the United States, but they had always existed as isolated spots - in my brain. It wasn't until this trip that I actually understood the scale and how they connected. Utah is - humongous, and everywhere you look there are mountains, whether near or in the distance. In our excitement to - explore the Canyonlands, we didn't realize right away that our GPS target wasn't quite where we wanted to go (we - just put in "Canyonlands" and went where it took us lol). No doubt, it was spectacular. Our altitude dropped - significantly as we drove through these cliffs, but this was primarily a hiking and climbing area for people with - serious gear. We drove around the south end of the park for a couple hours before circling back.

- -

- -

On the way to Moab, we saw signs for Wilson Arch, a sandstone structure named after Joe Wilson, a pioneer who - lived nearby. It was impossible to miss, and we decided it would be a fun stop to walk around and hike for a little - bit.

- -

- -

- -

- -

- -

There were a lot of families enjoying the simpler approaches, meanwhile other daredevils were belaying each other - down from the top of the arch. We hiked up to the base of the arch and enjoyed the shade and the company of someone - else's dog, looking out at the view. It was really cool how this was right along the highway, no official entrance, - no line to get in, just nature. After spending about an hour up here, we continued on to Moab.

- -

Moab is a neat little town. In some ways, it reminded me a little bit of Northampton, MA. We stopped for food in - town and to top up on some supplies, and also got some extra food to-go for dinner since we were still considering - camping somewhere potentially. On the way to Island in the Sky, we also drove up to Arches National Park. However, - once we saw the approach from down below, we decided it was not something the car would be able to handle. I think - maybe we could have done it, but it will remain one of the trip's unanswered questions.

- -

- -

Hello from Island in the Sky. There aren't many selfies from this trip, so I hope you extra enjoy this one. The - entire park exists on a large plateau from which you can view all of the surrounding area. Once you go through the - park entrance, there are just miles of cliffside road. Serpentining through these roads was an exhilerating - experience, as a lot of the curves had no guardrails. You simply had to control your vehicle's speed and turn - carefully. Every so often, there were viewpoints to stop at, which we did. I even got to climb a few rocks for - better views.

- -

- -

- -

- -

- -

After taking in the whole park, we reminded ourselves that we still needed to look into the possibility of camping - somewhere, if that was still our plan. To no one's surprise, all of the camping spots within the park had been - reserved. While there are some free campgrounds along highways, they are also first come first serve, meaning they - are generally packed if you aren't there well before sundown. Our plan to camp would not pan out, so we chose to - drive onward to Provo, UT - just south of Salt Lake City. On the way, we decided if we couldn't camp, we could at - least have dinner outside as the sun set. And where better to do that than on the side of a single lane highway? -

- -

- -

After a quick meal, we drove on. Tomorrow, we'd be checking out the Salt Lake itself before taking on a huge drive - over to Reno, NV. The end of the trip was closing in fast.

- -
- -
-
-

October 4, 2020

-
-
-
-

Before embarking on the long journey to Reno, we stopped at Penny Ann's Cafe for a hearty breakfast, and even had - to pack our remaining pancakes to go. Afterwards, we went to the Great Salt Lake itself to check out the marina and - the beach. Looking at reviews of the place, there was a common theme of "it's nice but it smells awful," and boy did - it live up to that. Lots of the beach had dried up and large colonies of tiny flies carpeted the sand. Taking steps - through the sand caused them all to disperse in sync, almost like dust in the wind. Check out my second selfie of - the trip.

- -

- -

As we returned to our car to head out, we started talking to an older couple that was cleaning their RV in the - parking lot. We clearly looked like travelers, and they were amazed we were here from so far away. It was nice to - talk to some local folks and drop the "us and them". Honestly, that's one of the biggest lessons from this trip. - News and social media tend to feed us a lot of negativity, but there really are normal people everywhere. Hopefully - we don't forget that.

- -

Back in the car, we prepared for a long 8ish hour drive. Normally, I had been taking the evening/night shift for - driving, but today I wanted to drive first. With the sun beating down through the driver side window, I got us about - 4-5 hours through the trip in almost a single shot. The speed limit for a lot of this highway was 80 mph. Now don't - tell anyone, but I miiiiight have hit 110 mph at one point. After the mountains in Utah, there was a large stretch - of just pure desert. For miles and miles, nothing could be seen in the distance except for more road.

- -

Come nighttime, we made it to Reno, NV. We joked about wanting to go do some penny slots and $1 blackjack, but - truthfully, we were way too tired to do anything like that. Instead, we found a nice spot for dinner with a lot of - different options. I got myself an authentic and delicious thali at a place called... Thali. With one payment, I got - free roti and rice refills with my amazing plate of food.

- -

- -

- -

After dinner, we called it for the night. Tomorrow would be our final day of exploration and adventure, so we - wanted to be fully awake and ready.

-
- -
-
-

October 5, 2020

-
-
-
-

From Reno, we headed out for Lake Tahoe. Right on the border of NV and CA, we would officially be passing into - California today. We made plans to pick up breakfast from Ernie's Coffee Shop, a busy spot among all the other - attractions in Tahoe and about an hour away. After arriving and picking up our food, we entered into the actual park - areas, and sat down to eat along the water at Pope Beach. Honestly, I don't think I'll ever see water as clear as - what you can find here at Lake Tahoe. Even as the light waves splashed up onto shore, the view of the bottom was - completely clean and unobstructed.

- -

- -

- -

We sat and enjoyed the water here for about an hour before cleaning up to go drive around the loop a bit more. - Around the lake are many hiking and beach spots, so our plan was to drive clockwise for a bit, staying on the - California side. Occasionally, we'd stop at viewpoints along the way, sometimes even trekking into the woods further - just for fun. It was pretty busy up here for a Monday, at least to my untrained eye. Perhaps it should be even more - busy here were it not for the pandemic. We passed a number of large houses built along the mountainside, likely - priced at several millions. Something tells me those houses are worth every penny, considering the views here.

- -

- -

- -

We continued on to Meek's Bay, another beach, where we sat on the rocks for another half hour. It was a great - relaxing experience, meditating there. Taking in all the sounds of this wonderful place, it was very calming and - helped to round out and balance the exciting and hectic past few days. After we took it all in, we decided it was - time to continue.

- -

The last leg of our trip would take us through the mountains, with lots of warning signs for the steep grades we'd - have to endure. The car groaned as some points, but it was only a little bit farther now. At one point, we got stuck - in traffic due to two completely independent accidents. One car with a few minor dents had pulled over on the side - of the road, waiting for some sort of assistance. However, he was going to have to wait - further down the road was - a massive accident involving an 18-wheeler. The front of this truck appeared to have exploded - metal pieces lay - strewn all over the road and the parts of the truck that were still intact were charred and black. It took a while - to make it past, but once we did, it was smooth sailing.

- -

Our trip finally came to a close 3.5 hours later, when we arrived in Oakland. We pulled in to our Airbnb and took - a while to finally realize that the trip was over. It was honestly a bit sad, as the last few days had been some of - the most spectacular of the trip. I was still riding the high of being able to see so much of the country I'd been - waiting to see, and so it was tough to accept that I'd be heading home soon. But arriving here was not all bad! - Tomorrow would be my free day here in the Bay Area, and so I'd made plans to borrow the car and see some other - friends.

- -

Technically Day 11:

- -

On my free day, I met with one of our family friends for lunch, and then met with two of my online friends for - dinner. In between, I stopped by Presidio Park in San Francisco, hoping to get some sort of view of the Golden Gate - Bridge. Unfortunately, it was an extremely foggy day, so all I could hear were the sounds of the ocean waves and - occasional fog horns. Not a big deal - I'd already seen the Golden Gate Bridge a few times on previous trips, and - the park had a certain charm of its own when shrouded in fog. I arrived back at the Airbnb in the middle of the - night and went straight to bed. Tomorrow would be a day of no schedule, no driving, and relaxing only. Well, and - packing for my flight the following day.

- -

-
- -
-
-

Final Thoughts

-
-
-
-

In Summary...

- -

- -

And so that brings my trip to a close. After a short, bittersweet plane ride back to MA, I met up with my parents. - The first thing I did upon arriving home was to take a shower, trying to keep whatever germs I'd brought from across - the country to a minimum. We enjoyed a nice dinner together and I shared a lot of the pictures I shared with you all - here.

- -

National Parks Visited:

-

1. Hot Springs National Park
- 2. White Sands National Park
- 3. Petrified Forest National Park (Painted Desert)
- 4. Canyonlands National Park (Island in the Sky)

- -

Other Landmarks Visited:

-

1. Beale Street, Memphis TN
- 2. Lincoln National Forest
- 3. Great Salt Lake
- 4. Tahoe National Forest

- -

So after a collective ~70 hours of driving, passing through 15 states, and approximately 4.9k - miles traveled, I can now say that I've driven across the country. This is an experience I recommend to anyone - and everyone, especially if you've only lived in a coastal city. The country is enormous and, though I'd seen - pictures and read about them, these sights and landmarks always felt so distant until now. I will absolutely be - doing a trip like this again, hopefully sooner rather than later, because who knows when such an opportunity will - come by again. I'm eternally grateful to my friends for inviting me on this trip with them, as these are memories - that I will have forever. I hope you've enjoyed my recollection of the trip, I've certainly enjoyed reliving it - through blogging. Hope to have some more exciting stuff for you all soon.

- -

Peace!

- -
\ No newline at end of file diff --git a/blog/roadtrip2020/index.html b/blog/roadtrip2020/index.html deleted file mode 100644 index 7e900d1..0000000 --- a/blog/roadtrip2020/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - Roadtrip 2020 - - - - - - - - - - - - - - -
-
- -
- -
- -
- - - -
- -
- - - - - \ No newline at end of file diff --git a/blog/shortstory.html b/blog/shortstory.html deleted file mode 100644 index 3baeb1b..0000000 --- a/blog/shortstory.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - Will Jail for Food - - - - - - - - - - - - - - - - -
-
-
-

Will Jail for Food

-
-
-
- - - - -
- - - - \ No newline at end of file diff --git a/blog/ue5hexgrid/entries.html b/blog/ue5hexgrid/entries.html deleted file mode 100644 index a89619f..0000000 --- a/blog/ue5hexgrid/entries.html +++ /dev/null @@ -1,417 +0,0 @@ -
-
-

UE5 Hex Grid

-

Create Procedural Grids in Unreal Engine 5

-
-
-
-

In this blog series, we will look at how to create procedural hexagonal tile grids in Unreal Engine 5. I'll do my - best - to explain what details I can, but will assume some basic familiarity with Unreal Engine and C++ (or any language, - really). If you are more comfortable working with Blueprints in Unreal, you should still be able to follow along! -

- - i. Introduction
- ii. Classes and Grid Logic
-
- iii. 2D Perlin Noise and Applying Textures
-
- -
- -
-
-

Introduction

-
-
-
-
-

As someone new to Unreal but familiar with coding, I felt more of a pull towards C++ development over learning - Blueprints. I've also been playing a lot of Civilization 5 and 6 around the time of writing this, and so I've had - the picture of hexagon maps in my head and thought it'd be a good exercise to get some practice with the engine. I - won't be getting into environment - setup in this series, but do keep in mind that setting up Unreal Engine with your code editor of choice may take - some time and troubleshooting. In my case, I am using Visual Studio Code and Unreal Engine 5.4.4. I also created my - own regular hexagon tile in Blender and exported it for use in Unreal, which I recommend doing for full control of - the tile, but I'm sure you can also find one online somewhere. -

- -

I'd also like to point you to two great resources that helped me. The first is this video from Gisli's game - development channel. He creates a tool that generates a hexagonal grid using Blueprints and shows the whole process, - and the higher level concepts are still relevant when working with C++. The other is this blog post from Red Blob Games. This - is likely the best blog post around for understand how hex tiling works and the numerous ways you can set up - coordinate systems with them (a bit overkill for this project but exciting to learn nonetheless).

- -

The key takeaway: the dimensions of a regular hexagon make it so you cannot simply offset by a - single width value to get proper tiling - with some trigonometry, you would find that you need to use sqrt(3) - somewhere depending on if you are using - flat-top or pointy-top orientation. We'll be working with flat-top orientation here, but the formulae and logic can - be easily repurposed to work with pointy-top.

- -

Now, let's get into it!

- -
- -
-
-

Classes and Grid Logic

-
-
-
-
- -

First, let's define a simple HexTile class. This class represents a single hexagonal tile, which we will provide - with - a mesh and material. By using C++ to expose these variables to Unreal Engine's editor, we can use Unreal's UI to - find and assign these easily. To create the class, we need to define a HexTile.h and a HexTile.cpp. The first is a - header - file where we declare variables, functions, and expose things to the editor. The second is where we define the class - logic. Let's take a look at both real quick:

- - -

HexTile.h:

-
-

-#pragma once
-
-#include "CoreMinimal.h"
-#include "GameFramework/Actor.h"
-#include "HexTile.generated.h"
-
-// allcaps methods are for interfacing UE5
-
-// initialize as a subclass of Actor
-UCLASS() 
-class TILETACTICS_API AHexTile : public AActor
-{
-    GENERATED_BODY()
-
-public:
-    AHexTile();
-
-    // lets you assign a mesh in the editor
-    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Hex Tile")
-    UStaticMeshComponent* MeshComponent;
-
-    // setter method for the material
-    UFUNCTION(BlueprintCallable, Category = "Hex Tile")
-    void SetTileMaterial(UMaterialInterface* MyMaterial);
-
-    // setter method for the mesh
-    UFUNCTION(BlueprintCallable, Category = "Hex Tile")
-    void SetTileMesh(UStaticMesh* NewMesh);
-
-// these are inherited from Actor
-protected:
-    virtual void BeginPlay() override;
-    virtual void OnConstruction(const FTransform& Transform) override;
-};
-    
-
- -

HexTile.cpp:

-
-

-#include "HexTile.h"
-
-// constructor
-AHexTile::AHexTile()
-{
-    PrimaryActorTick.bCanEverTick = false; // disable tick for performance
-    
-    MeshComponent = CreateDefaultSubobject(TEXT("MeshComponent"));
-    RootComponent = MeshComponent;
-}
-
-// called when simulation starts
-void AHexTile::BeginPlay()
-{
-    Super::BeginPlay();
-}
-
-// called when actor spawns or is changed
-void AHexTile::OnConstruction(const FTransform& Transform)
-{
-    Super::OnConstruction(Transform);
-}
-
-// this sets the tile mesh to the given mesh
-void AHexTile::SetTileMesh(UStaticMesh* NewMesh)
-{
-    if (NewMesh)
-    {
-        MeshComponent->SetStaticMesh(NewMesh);
-    }
-}
-
-// this sets the tile material to the given material
-void AHexTile::SetTileMaterial(UMaterialInterface* MyMaterial)
-{
-    if (MyMaterial)
-    {
-        MeshComponent->SetMaterial(0, MyMaterial);
-    }
-}      
-    
-
- -

The parts in all caps in the header file are UE functions for interfacing with the editor and determining what to expose, while the rest is basically boilerplate code. In the cpp file, we write the rest of our logic. With these set, we are able to use the UI of Unreal to control variables or function calls without needing to recompile the code. However, changing any core functionality or global constants will likely require a recompile or a refactor to expose it to the editor as well. Not necessarily impossible, but just something to think about.

- -

Next, we want to make an Actor that behaves as the grid origin or generator - something that does the math of positioning the tiles and then spawns them accordingly. We will give this Actor the ability to use the Tile's setter functions to change how to look as well. In fact, we can get pretty creative with what we expose to the editor here and come up with our own custom constants or variables. This is the part that can contain a lot of math, so let's do the fun part of showing the demo first 😏

- -

- -

What you're seeing here is a hex grid with an adjustable width and height, which is then performing the act of spawning the tiles where needed. This is being done when a custom button is pressed, but you can also refactor this to happen every frame (and in turn, more expensive). The dark black floor material was just a stock material picked from the default asset library. We can call this Actor the HexGridOrigin, indicating that it is the (0, 0) coordinate of the 2D grid. Just like in the Tile class where we had to provide the mesh and material through the editor, we can provide these to the HexGridOrigin as well, which can then apply different textures based on rules we come up with. We'll look at noise and heights in the next one, where I'll share the full .h and .cpp code for the HexGridOrigin class.

- -

See you there!

- -
- -
-
-

2D Perlin Noise and Textures

-
-
-
-
- -

To build off from the last post, let's give these tiles a height using Perlin noise, and then use that to determine what material to apply. We'll also theorycraft some other variables we could introduce to add some spice to the map generation. First off, let me share the header and cpp files for the HexGridOrigin class. If you're just skimming through, you probably want to see the AHexGridOrigin::BuildGrid() function in the .cpp file.

- -

HexGridOrigin.h:

-
-

-#pragma once
-
-#include "CoreMinimal.h"
-#include "GameFramework/Actor.h"
-#include "HexTile.h"
-#include "HexGridOrigin.generated.h"
-
-// custom rendering type
-UENUM(BlueprintType)
-enum class EHexGridMode : uint8
-{
-  Tile UMETA(DisplayName = "Tile"),
-  Fill UMETA(DisplayName = "Fill")
-};
-
-UCLASS()
-class TILETACTICS_API AHexGridOrigin : public AActor
-{
-  GENERATED_BODY()
-
-public:
-  AHexGridOrigin();
-
-  // set class of HexTile in editor
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  TSubclassOf HexTileClass;
-
-  // set all materials that will be needed
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials")
-  UMaterialInterface *GrassMaterial;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials")
-  UMaterialInterface *StoneMaterial;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials")
-  UMaterialInterface *SnowMaterial;
-
-  // ...
-  // add any more material options here
-
-  // set mesh that will be passed to HexTile
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Tile")
-  UStaticMesh *TileMesh;
-
-  // grid properties 
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  int32 GridWidth;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  int32 GridHeight;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  float GridSpacing;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid", meta = (Delta = "0.01"))
-  float NoiseStrength;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  int32 ZScaling;
-
-  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid")
-  EHexGridMode GridMode;
-
-  // array to keep track of spawned HexTile actors
-  UPROPERTY()
-  TArray SpawnedTiles;
-
-  // buttons
-  UFUNCTION(BlueprintCallable, Category = "Hex Grid", CallInEditor)
-  void BuildGrid();
-
-  UFUNCTION(BlueprintCallable, Category = "Hex Grid", CallInEditor)
-  void ClearGrid();
-
-protected:
-  virtual void BeginPlay() override;
-};
-
-    
-
- -

HexGridOrigin.cpp:

-
-

-#include "HexGridOrigin.h"
-#include "HexTile.h"
-#include "Kismet/KismetMathLibrary.h"
-
-// constructor
-AHexGridOrigin::AHexGridOrigin()
-{
-    // don't need per tick calcs
-  PrimaryActorTick.bCanEverTick = false;
-
-  // initial grid settings
-  GridMode = EHexGridMode::Tile;
-  GridWidth = 5;
-  GridHeight = 5;
-  GridSpacing = 100.0f;
-  NoiseStrength = 0.1f;
-  ZScaling = 10;
-}
-
-// when simulation starts
-void AHexGridOrigin::BeginPlay()
-{
-  Super::BeginPlay();
-
-  BuildGrid();
-}
-
-// this does the whole thing
-void AHexGridOrigin::BuildGrid()
-{
-    // clear previous tiles
-    for (AHexTile *Tile : SpawnedTiles)
-    {
-        if (Tile)
-        {
-            Tile->Destroy();
-        }
-    }
-    SpawnedTiles.Empty();
-
-    // calculate X and Y spacing
-    float YSpacing = GridSpacing * 1.5f;
-    float XSpacing = FMath::Sqrt(3.0f) * GridSpacing;
-
-    // set clamp ranges for noise and scaling
-    float MinNoiseValue = 0.1f;
-    float MaxNoiseValue = 1.0f;
-    float MinZScale = 0.1f; 
-
-    for (int32 y = 0; y < GridHeight; ++y)
-    {
-        for (int32 x = 0; x < GridWidth; ++x)
-        {
-            float XPos = x * XSpacing;
-            float YPos = y * YSpacing;
-
-            // odd row offset
-            if (y % 2 != 0)
-            {
-                XPos += (XSpacing / 2.0f);
-            }
-
-            // store the X and Y of the centerpoint, Z comes later
-            FVector CenterPoint(XPos, YPos, 0.0f);
-
-            // get a noise value
-            float NoiseValue = FMath::PerlinNoise2D(FVector2D(CenterPoint.X, CenterPoint.Y) * NoiseStrength); 
-            NoiseValue = FMath::Clamp(NoiseValue, MinNoiseValue, MaxNoiseValue);  // clamp it
-
-            float RoundedZ = UKismetMathLibrary::Round(NoiseValue * 20.0f) * 0.05f; // round it
-            if (HexTileClass)
-            {
-                AHexTile *NewTile = GetWorld()->SpawnActor(HexTileClass, CenterPoint, FRotator::ZeroRotator);
-                if (NewTile)
-                {
-                    NewTile->SetTileMesh(TileMesh); 
-
-                    // grid mode branches
-                    if (GridMode == EHexGridMode::Tile)
-                    {
-                        // Tile Mode: set the tile's center at the Z point
-                        CenterPoint.Z = RoundedZ * ZScaling;
-                        NewTile->SetActorLocation(CenterPoint);
-                    }
-                    else if (GridMode == EHexGridMode::Fill)
-                    {
-                        // Fill Mode: scale the mesh up to the Z point
-                        FVector NewScale = NewTile->GetActorScale3D();
-                        NewScale.Z = FMath::Max(RoundedZ * ZScaling, MinZScale);
-                        NewTile->SetActorScale3D(NewScale);
-                    }
-
-                    // use the Z height to determine material
-                    UMaterialInterface *TileMaterial;
-                    if (RoundedZ < 0.33f) // low thresh
-                    {
-                        TileMaterial = GrassMaterial; 
-                    }
-                    else if (RoundedZ < 0.55f)  // middle thresh
-                    {
-                        TileMaterial = StoneMaterial;
-                    }
-                    else  // high 
-                    {
-                        TileMaterial = SnowMaterial;
-                    }
-
-                    NewTile->SetTileMaterial(TileMaterial);
-                    SpawnedTiles.Add(NewTile); 
-                }
-            }
-        }
-    }
-}
-
-// destroys all actors
-void AHexGridOrigin::ClearGrid()
-{
-  for (AHexTile *Tile : SpawnedTiles)
-  {
-    if (Tile)
-    {
-      Tile->Destroy();
-    }
-  }
-  SpawnedTiles.Empty();
-}
-
-    
-
- -

- -

Beyond Perlin noise, we also added: -

- - What else could we add for cool effects or generative patterns? In this demo, I created a HexGridOrigin Actor that spawns several Tile Actors so that I had individual control of each Tile when necessary, but is there a better way to achieve this? As one of my first projects in Unreal Engine, I've still got a lot to learn! Hope this was a fun read for you, and if you have any questions or suggestions, don't hesitate to get in touch. -

- -

Until next time!

- -
\ No newline at end of file diff --git a/blog/ue5hexgrid/index.html b/blog/ue5hexgrid/index.html deleted file mode 100644 index 1d8f504..0000000 --- a/blog/ue5hexgrid/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - HexGrid - - - - - - - - - - - - - - - - -
-
- -
- -
- -
- - - -
- -
- - - - - - - \ No newline at end of file diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..84e566f --- /dev/null +++ b/docs/404.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + Varun Nadgir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..e1ab4e4 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +www.varun.pro diff --git a/docs/DataViswithggplotPart1.pdf b/docs/DataViswithggplotPart1.pdf deleted file mode 100644 index d4475f9..0000000 Binary files a/docs/DataViswithggplotPart1.pdf and /dev/null differ diff --git a/docs/NCVSCodebook.pdf b/docs/NCVSCodebook.pdf deleted file mode 100644 index 8c9f531..0000000 Binary files a/docs/NCVSCodebook.pdf and /dev/null differ diff --git a/docs/VarunIntroDataScienceCertificate.pdf b/docs/VarunIntroDataScienceCertificate.pdf deleted file mode 100644 index 1934be6..0000000 Binary files a/docs/VarunIntroDataScienceCertificate.pdf and /dev/null differ diff --git a/docs/VarunNadgirMIT-BDACertificate.pdf b/docs/VarunNadgirMIT-BDACertificate.pdf deleted file mode 100644 index 695f0bd..0000000 Binary files a/docs/VarunNadgirMIT-BDACertificate.pdf and /dev/null differ diff --git a/docs/assets/Bozon-CevoYLZk.jpg b/docs/assets/Bozon-CevoYLZk.jpg new file mode 100644 index 0000000..d22ab42 Binary files /dev/null and b/docs/assets/Bozon-CevoYLZk.jpg differ diff --git a/docs/assets/ELVTR Certificate Varun-Cy_j69Hf.pdf b/docs/assets/ELVTR Certificate Varun-Cy_j69Hf.pdf new file mode 100644 index 0000000..8efc28c Binary files /dev/null and b/docs/assets/ELVTR Certificate Varun-Cy_j69Hf.pdf differ diff --git a/docs/assets/ELVTR Letter of Recommendation Varun-BhnfjI7U.pdf b/docs/assets/ELVTR Letter of Recommendation Varun-BhnfjI7U.pdf new file mode 100644 index 0000000..06e8cb0 Binary files /dev/null and b/docs/assets/ELVTR Letter of Recommendation Varun-BhnfjI7U.pdf differ diff --git a/docs/assets/GlassdoorReviews-4gN0czWB.pdf b/docs/assets/GlassdoorReviews-4gN0czWB.pdf new file mode 100644 index 0000000..046aa78 Binary files /dev/null and b/docs/assets/GlassdoorReviews-4gN0czWB.pdf differ diff --git a/docs/NCVSFinalReport.pdf b/docs/assets/NCVSFinalReport-C9HxjFNJ.pdf similarity index 100% rename from docs/NCVSFinalReport.pdf rename to docs/assets/NCVSFinalReport-C9HxjFNJ.pdf diff --git a/images/PuzzleHighlight.png b/docs/assets/PuzzleHighlight-D4mPfPxa.png similarity index 100% rename from images/PuzzleHighlight.png rename to docs/assets/PuzzleHighlight-D4mPfPxa.png diff --git a/blog/colorpuzzle/images/QuickDemo.webm b/docs/assets/QuickDemo-D5eZnWuz.webm similarity index 100% rename from blog/colorpuzzle/images/QuickDemo.webm rename to docs/assets/QuickDemo-D5eZnWuz.webm diff --git a/docs/assets/SteamGameRatings-m13-sOPk.pdf b/docs/assets/SteamGameRatings-m13-sOPk.pdf new file mode 100644 index 0000000..9d34759 Binary files /dev/null and b/docs/assets/SteamGameRatings-m13-sOPk.pdf differ diff --git a/blog/colorpuzzle/images/UMLDiagram.png b/docs/assets/UMLDiagram-COktgWIm.png similarity index 100% rename from blog/colorpuzzle/images/UMLDiagram.png rename to docs/assets/UMLDiagram-COktgWIm.png diff --git a/docs/assets/Varun Nadgir Resume-Bv6dpI9X.pdf b/docs/assets/Varun Nadgir Resume-Bv6dpI9X.pdf new file mode 100644 index 0000000..d293497 Binary files /dev/null and b/docs/assets/Varun Nadgir Resume-Bv6dpI9X.pdf differ diff --git a/docs/VarunDataScienceCareerTrackCertificate.pdf b/docs/assets/VarunDataScienceCareerTrackCertificate-qnkRtQP7.pdf similarity index 100% rename from docs/VarunDataScienceCareerTrackCertificate.pdf rename to docs/assets/VarunDataScienceCareerTrackCertificate-qnkRtQP7.pdf diff --git a/docs/VarunNadgir-MIT-ADSP.pdf b/docs/assets/VarunNadgir-MIT-ADSP-CVlKunOP.pdf similarity index 100% rename from docs/VarunNadgir-MIT-ADSP.pdf rename to docs/assets/VarunNadgir-MIT-ADSP-CVlKunOP.pdf diff --git a/docs/assets/alagard-6c8L4DuC.ttf b/docs/assets/alagard-6c8L4DuC.ttf new file mode 100644 index 0000000..c7ed1d9 Binary files /dev/null and b/docs/assets/alagard-6c8L4DuC.ttf differ diff --git a/docs/assets/barnjam-Cpig6lJy.jpg b/docs/assets/barnjam-Cpig6lJy.jpg new file mode 100644 index 0000000..4bd2546 Binary files /dev/null and b/docs/assets/barnjam-Cpig6lJy.jpg differ diff --git a/docs/assets/bighead-_9vMFswt.gif b/docs/assets/bighead-_9vMFswt.gif new file mode 100644 index 0000000..13792a1 Binary files /dev/null and b/docs/assets/bighead-_9vMFswt.gif differ diff --git a/blog/roadtrip2020/images/day10_1.jpg b/docs/assets/day10_1-DlsEdUkL.jpg similarity index 100% rename from blog/roadtrip2020/images/day10_1.jpg rename to docs/assets/day10_1-DlsEdUkL.jpg diff --git a/blog/roadtrip2020/images/day10_2.mp4 b/docs/assets/day10_2-D2wZkA93.mp4 similarity index 100% rename from blog/roadtrip2020/images/day10_2.mp4 rename to docs/assets/day10_2-D2wZkA93.mp4 diff --git a/blog/roadtrip2020/images/day10_3.jpg b/docs/assets/day10_3-CH_gXzTi.jpg similarity index 100% rename from blog/roadtrip2020/images/day10_3.jpg rename to docs/assets/day10_3-CH_gXzTi.jpg diff --git a/blog/roadtrip2020/images/day10_4.jpg b/docs/assets/day10_4-C4-o0d_Z.jpg similarity index 100% rename from blog/roadtrip2020/images/day10_4.jpg rename to docs/assets/day10_4-C4-o0d_Z.jpg diff --git a/blog/roadtrip2020/images/day10_5.jpg b/docs/assets/day10_5-DCB34iWY.jpg similarity index 100% rename from blog/roadtrip2020/images/day10_5.jpg rename to docs/assets/day10_5-DCB34iWY.jpg diff --git a/blog/roadtrip2020/images/day1_1.jpg b/docs/assets/day1_1-CcHoYYXM.jpg similarity index 100% rename from blog/roadtrip2020/images/day1_1.jpg rename to docs/assets/day1_1-CcHoYYXM.jpg diff --git a/blog/roadtrip2020/images/day1_2.jpeg b/docs/assets/day1_2-BueBmuji.jpeg similarity index 100% rename from blog/roadtrip2020/images/day1_2.jpeg rename to docs/assets/day1_2-BueBmuji.jpeg diff --git a/blog/roadtrip2020/images/day2_1.jpg b/docs/assets/day2_1-X58ToZyc.jpg similarity index 100% rename from blog/roadtrip2020/images/day2_1.jpg rename to docs/assets/day2_1-X58ToZyc.jpg diff --git a/blog/roadtrip2020/images/day3_1.jpg b/docs/assets/day3_1-DT4kGV30.jpg similarity index 100% rename from blog/roadtrip2020/images/day3_1.jpg rename to docs/assets/day3_1-DT4kGV30.jpg diff --git a/blog/roadtrip2020/images/day3_2.jpg b/docs/assets/day3_2-AImV-c_S.jpg similarity index 100% rename from blog/roadtrip2020/images/day3_2.jpg rename to docs/assets/day3_2-AImV-c_S.jpg diff --git a/blog/roadtrip2020/images/day3_3.jpg b/docs/assets/day3_3-C2_T6J7Q.jpg similarity index 100% rename from blog/roadtrip2020/images/day3_3.jpg rename to docs/assets/day3_3-C2_T6J7Q.jpg diff --git a/blog/roadtrip2020/images/day3_4.jpg b/docs/assets/day3_4-lU9hE16x.jpg similarity index 100% rename from blog/roadtrip2020/images/day3_4.jpg rename to docs/assets/day3_4-lU9hE16x.jpg diff --git a/blog/roadtrip2020/images/day4_1.jpeg b/docs/assets/day4_1-BMDJnScs.jpeg similarity index 100% rename from blog/roadtrip2020/images/day4_1.jpeg rename to docs/assets/day4_1-BMDJnScs.jpeg diff --git a/blog/roadtrip2020/images/day4_2.jpeg b/docs/assets/day4_2-CPN80mWs.jpeg similarity index 100% rename from blog/roadtrip2020/images/day4_2.jpeg rename to docs/assets/day4_2-CPN80mWs.jpeg diff --git a/blog/roadtrip2020/images/day4_3.jpg b/docs/assets/day4_3-UHvuphef.jpg similarity index 100% rename from blog/roadtrip2020/images/day4_3.jpg rename to docs/assets/day4_3-UHvuphef.jpg diff --git a/blog/roadtrip2020/images/day4_4.jpg b/docs/assets/day4_4-B6KNMzYW.jpg similarity index 100% rename from blog/roadtrip2020/images/day4_4.jpg rename to docs/assets/day4_4-B6KNMzYW.jpg diff --git a/blog/roadtrip2020/images/day4_5.jpeg b/docs/assets/day4_5-Dtu12EHc.jpeg similarity index 100% rename from blog/roadtrip2020/images/day4_5.jpeg rename to docs/assets/day4_5-Dtu12EHc.jpeg diff --git a/blog/roadtrip2020/images/day4_6.mp4 b/docs/assets/day4_6-pOg3q0P7.mp4 similarity index 100% rename from blog/roadtrip2020/images/day4_6.mp4 rename to docs/assets/day4_6-pOg3q0P7.mp4 diff --git a/blog/roadtrip2020/images/day5_1.jpg b/docs/assets/day5_1-S-B17XIY.jpg similarity index 100% rename from blog/roadtrip2020/images/day5_1.jpg rename to docs/assets/day5_1-S-B17XIY.jpg diff --git a/blog/roadtrip2020/images/day5_2.jpeg b/docs/assets/day5_2-DD9Gi_Yb.jpeg similarity index 100% rename from blog/roadtrip2020/images/day5_2.jpeg rename to docs/assets/day5_2-DD9Gi_Yb.jpeg diff --git a/blog/roadtrip2020/images/day5_3.jpeg b/docs/assets/day5_3-DXGbOsLP.jpeg similarity index 100% rename from blog/roadtrip2020/images/day5_3.jpeg rename to docs/assets/day5_3-DXGbOsLP.jpeg diff --git a/blog/roadtrip2020/images/day5_4.jpeg b/docs/assets/day5_4-C3qFgqE_.jpeg similarity index 100% rename from blog/roadtrip2020/images/day5_4.jpeg rename to docs/assets/day5_4-C3qFgqE_.jpeg diff --git a/blog/roadtrip2020/images/day5_5.mp4 b/docs/assets/day5_5-D-B0dw9-.mp4 similarity index 100% rename from blog/roadtrip2020/images/day5_5.mp4 rename to docs/assets/day5_5-D-B0dw9-.mp4 diff --git a/blog/roadtrip2020/images/day5_6.webp b/docs/assets/day5_6-DK9HFYc9.webp similarity index 100% rename from blog/roadtrip2020/images/day5_6.webp rename to docs/assets/day5_6-DK9HFYc9.webp diff --git a/blog/roadtrip2020/images/day6_1.jpg b/docs/assets/day6_1-COnGpWP_.jpg similarity index 100% rename from blog/roadtrip2020/images/day6_1.jpg rename to docs/assets/day6_1-COnGpWP_.jpg diff --git a/blog/roadtrip2020/images/day6_2.jpg b/docs/assets/day6_2-CYxWvVZH.jpg similarity index 100% rename from blog/roadtrip2020/images/day6_2.jpg rename to docs/assets/day6_2-CYxWvVZH.jpg diff --git a/blog/roadtrip2020/images/day6_3.jpg b/docs/assets/day6_3-N_aoz-_7.jpg similarity index 100% rename from blog/roadtrip2020/images/day6_3.jpg rename to docs/assets/day6_3-N_aoz-_7.jpg diff --git a/blog/roadtrip2020/images/day6_4.jpg b/docs/assets/day6_4-DtCsGGz7.jpg similarity index 100% rename from blog/roadtrip2020/images/day6_4.jpg rename to docs/assets/day6_4-DtCsGGz7.jpg diff --git a/blog/roadtrip2020/images/day6_5.jpg b/docs/assets/day6_5-ClvSf9Nq.jpg similarity index 100% rename from blog/roadtrip2020/images/day6_5.jpg rename to docs/assets/day6_5-ClvSf9Nq.jpg diff --git a/blog/roadtrip2020/images/day7_1.jpg b/docs/assets/day7_1-CktTIrP9.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_1.jpg rename to docs/assets/day7_1-CktTIrP9.jpg diff --git a/blog/roadtrip2020/images/day7_2.jpg b/docs/assets/day7_2-CtbXSG-L.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_2.jpg rename to docs/assets/day7_2-CtbXSG-L.jpg diff --git a/blog/roadtrip2020/images/day7_3.jpg b/docs/assets/day7_3-CJqhRo7D.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_3.jpg rename to docs/assets/day7_3-CJqhRo7D.jpg diff --git a/blog/roadtrip2020/images/day7_4.jpg b/docs/assets/day7_4-phXPv4jw.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_4.jpg rename to docs/assets/day7_4-phXPv4jw.jpg diff --git a/blog/roadtrip2020/images/day7_5.jpg b/docs/assets/day7_5-DI0QMciJ.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_5.jpg rename to docs/assets/day7_5-DI0QMciJ.jpg diff --git a/blog/roadtrip2020/images/day7_6.jpg b/docs/assets/day7_6-DNmv-DQl.jpg similarity index 100% rename from blog/roadtrip2020/images/day7_6.jpg rename to docs/assets/day7_6-DNmv-DQl.jpg diff --git a/blog/roadtrip2020/images/day8_1.jpg b/docs/assets/day8_1-BfuJ1lKv.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_1.jpg rename to docs/assets/day8_1-BfuJ1lKv.jpg diff --git a/blog/roadtrip2020/images/day8_10.jpg b/docs/assets/day8_10-B5vYD2kf.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_10.jpg rename to docs/assets/day8_10-B5vYD2kf.jpg diff --git a/blog/roadtrip2020/images/day8_11.jpg b/docs/assets/day8_11-CRIjEHpa.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_11.jpg rename to docs/assets/day8_11-CRIjEHpa.jpg diff --git a/blog/roadtrip2020/images/day8_2.jpg b/docs/assets/day8_2-TIFQZm8x.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_2.jpg rename to docs/assets/day8_2-TIFQZm8x.jpg diff --git a/blog/roadtrip2020/images/day8_3.jpg b/docs/assets/day8_3-C77oSQLF.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_3.jpg rename to docs/assets/day8_3-C77oSQLF.jpg diff --git a/blog/roadtrip2020/images/day8_4.jpg b/docs/assets/day8_4-DH9uEuKU.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_4.jpg rename to docs/assets/day8_4-DH9uEuKU.jpg diff --git a/blog/roadtrip2020/images/day8_5.jpg b/docs/assets/day8_5-BnAkoa2E.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_5.jpg rename to docs/assets/day8_5-BnAkoa2E.jpg diff --git a/blog/roadtrip2020/images/day8_6.jpg b/docs/assets/day8_6-C9bzpPEg.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_6.jpg rename to docs/assets/day8_6-C9bzpPEg.jpg diff --git a/blog/roadtrip2020/images/day8_7.jpg b/docs/assets/day8_7-BgNfhhdM.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_7.jpg rename to docs/assets/day8_7-BgNfhhdM.jpg diff --git a/blog/roadtrip2020/images/day8_8.jpg b/docs/assets/day8_8-BxypN839.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_8.jpg rename to docs/assets/day8_8-BxypN839.jpg diff --git a/blog/roadtrip2020/images/day8_9.jpg b/docs/assets/day8_9-DJH9MhTP.jpg similarity index 100% rename from blog/roadtrip2020/images/day8_9.jpg rename to docs/assets/day8_9-DJH9MhTP.jpg diff --git a/blog/roadtrip2020/images/day9_1.jpg b/docs/assets/day9_1-VAUzjW5d.jpg similarity index 100% rename from blog/roadtrip2020/images/day9_1.jpg rename to docs/assets/day9_1-VAUzjW5d.jpg diff --git a/blog/roadtrip2020/images/day9_2.jpg b/docs/assets/day9_2-WI5WjawW.jpg similarity index 100% rename from blog/roadtrip2020/images/day9_2.jpg rename to docs/assets/day9_2-WI5WjawW.jpg diff --git a/blog/roadtrip2020/images/day9_3.jpg b/docs/assets/day9_3-Dg2pPm6_.jpg similarity index 100% rename from blog/roadtrip2020/images/day9_3.jpg rename to docs/assets/day9_3-Dg2pPm6_.jpg diff --git a/docs/assets/endllmless-B_qw0jTM.gif b/docs/assets/endllmless-B_qw0jTM.gif new file mode 100644 index 0000000..b8e087a Binary files /dev/null and b/docs/assets/endllmless-B_qw0jTM.gif differ diff --git a/blog/roadtrip2020/images/fullmap.png b/docs/assets/fullmap-BNEEylDm.png similarity index 100% rename from blog/roadtrip2020/images/fullmap.png rename to docs/assets/fullmap-BNEEylDm.png diff --git a/docs/assets/index-BF7J7Mqh.css b/docs/assets/index-BF7J7Mqh.css new file mode 100644 index 0000000..5a5506e --- /dev/null +++ b/docs/assets/index-BF7J7Mqh.css @@ -0,0 +1 @@ +@font-face{font-family:alagard;src:url(/assets/alagard-6c8L4DuC.ttf) format("truetype");font-weight:400;font-style:normal}:root{--nav-item-height: 32px}html,body,#root{font-family:alagard,Cambria,Times New Roman,serif;font-size:18px;width:100%;height:100%;margin:0;padding:0;overflow:hidden}.app-root{position:relative;width:100vw;height:100vh;overflow:hidden;background:#000;-webkit-user-select:none;user-select:none}.r3f-root{position:absolute;inset:0;z-index:0}.r3f-root canvas,.r3f-canvas{width:100%;height:100%;display:block}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:#ffffff14;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);border-radius:10px}::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#7aa7ff,#3e5bd6);border-radius:10px;border:2px solid rgba(0,0,0,.2)}::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#98b7ff,#4c6ce0)}*{scrollbar-width:thin;scrollbar-color:#4c6ce0 rgba(255,255,255,.08)}.dom-root{position:absolute;inset:0;color:#fff;pointer-events:none}.dom-body{-webkit-user-select:none;user-select:none;pointer-events:none;position:absolute;margin-top:5vh;margin-left:1vw}.debug-panel{position:fixed;right:.5rem;bottom:.5rem;color:#fff;font-size:.75rem;font-family:alagard,Cambria,Times New Roman,serif;background:none;border:none;padding:0;pointer-events:none;z-index:1000}.dom-nav{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:calc(100% - 20px);pointer-events:auto;z-index:10}.dom-footer{position:fixed;bottom:0;left:0;width:100%;display:flex;align-items:center;padding:8px;box-sizing:border-box;z-index:20}.settings-gear-button{pointer-events:auto;margin-right:8px}.dom-nav button,.dom-nav a,.dom-footer button,.settings-tray button,.detail-pane-footer button{font-family:alagard,Cambria,Times New Roman,serif;min-height:var(--nav-item-height);padding:0 10px;border-radius:4px;box-sizing:border-box;cursor:pointer;border:1px solid rgba(255,255,255,.6);background:#0009;color:#fff;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.dom-nav button,.dom-nav a,.dom-footer button,.detail-pane-footer button{font-size:16px}.detail-pane-project-image-wrapper{display:flex;flex-direction:column;align-items:center;gap:.75rem;margin:0 0 1rem}.detail-pane-project-image{max-width:100%;max-height:260px;object-fit:contain;display:block}.detail-pane-doc-preview{margin:1rem 0;display:flex;justify-content:center}.detail-pane-doc-iframe{width:100%;max-width:100%;height:640px;border:none;border-radius:6px}.detail-pane-links{margin-top:1rem;margin-bottom:1.5rem;text-align:center}.detail-pane-links-heading{font-size:1rem;margin-bottom:.6rem}.detail-pane-links-buttons{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.detail-pane-link-button{padding:.4rem 1rem;font-family:alagard,Cambria,Times New Roman,serif;font-size:.9rem;color:#fff;background:#1a1a1a;border:1px solid #444;border-radius:6px;cursor:pointer;transition:background .2s ease,border-color .2s ease}.detail-pane-link-button:hover{background:#f90;border-color:#f90;color:#000}.detail-pane-tech-row{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem}.detail-pane-tech-chip{display:flex;align-items:center;gap:.35rem}.detail-pane-tech-strip{display:flex;flex-wrap:wrap;justify-content:center;gap:2rem;padding:.5rem 0}.detail-pane-tech-icon-wrapper{display:flex;align-items:center;justify-content:center}.detail-pane-tech-icon{height:48px;width:auto;object-fit:contain;display:block}.detail-pane-tech-label{font-size:.85rem}.settings-tray button{font-size:14px;transition:transform .12s ease,filter .12s ease}.settings-tray button:active{transform:scale(.96);filter:brightness(1.2)}.dom-nav button[aria-pressed=true],.settings-tray button[aria-pressed=true]{border-color:#fff;background:#ffffff26}.dom-nav-icon{width:var(--nav-item-height);height:var(--nav-item-height);padding:0!important;border-radius:4px;flex:0 0 var(--nav-item-height);display:inline-flex;align-items:center;justify-content:center}.dom-nav-icon img{width:100%;height:100%;object-fit:contain;display:block;padding:0;margin:0}.dom-nav a.external-icon{background:#929292dd}.detail-pane--music .detail-pane-body{font-size:18px}.music-embed-card{margin-bottom:1.25rem;padding-bottom:1rem;border-bottom:1px solid rgba(148,163,184,.4)}.music-embed-title{margin:0 0 .25rem;font-size:1.05rem}.music-embed-note{margin:0 0 .5rem;font-size:.9rem;opacity:.85}.music-embed-frame-wrapper{width:100%;border-radius:10px;overflow:hidden}.music-embed-frame{width:100%;aspect-ratio:16 / 9;border:none;display:block}.music-profile-link-wrapper{margin-bottom:1rem}.music-profile-link{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .75rem;border-radius:999px;font-size:.9rem;font-weight:500;text-decoration:none;background:#94a3b829;border:1px solid rgba(148,163,184,.45);color:#e5e7eb;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.music-profile-link:hover{background:#94a3b84d}.settings-tray{display:flex;flex-direction:row;gap:6px;padding:8px 10px;border-radius:12px;background:#050a1ef2;border:1px solid rgba(148,163,184,.7);box-shadow:0 0 24px #0f172ae6;color:#e5e7eb;transform:translate(-8px);opacity:0;pointer-events:none;transition:transform .25s ease-out,opacity .25s ease-out}.settings-tray--open{transform:translate(0);opacity:1;pointer-events:auto}.planet-overlay-root{position:fixed;inset:0;z-index:10;font-size:20px;pointer-events:none;padding:72px 24px 80px;box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between}.planet-overlay-box{box-sizing:border-box;padding:.75rem 1.5rem 1.5rem;border-radius:18px;background:#050a1edb;border:1px solid rgba(148,163,184,.7);box-shadow:0 0 30px #0f172af2;color:#e5e7eb;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);pointer-events:auto;font-family:alagard,Cambria,Times New Roman,serif;position:relative;flex:0 0 auto;min-width:0;min-height:0;max-width:clamp(380px,36vw,720px);max-height:100%;display:flex;flex-direction:column}.planet-overlay-box h2{margin:0 0 .25rem}.planet-overlay-box--left{margin-right:0}.planet-overlay-box--right{margin-left:auto}.overlay-close-button{position:absolute;top:10px;right:12px;border:none;background:transparent;color:#e5e7eb;font-size:24px;line-height:1;cursor:pointer;padding:0}.overlay-close-button:hover{opacity:.8}.blog-info{display:flex;flex-direction:column;min-height:0}.blog-info p{margin-top:4px;margin-bottom:4px}.blog-info ul{margin-top:1%}.info-item-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0;margin:.75rem 0 0;display:flex;flex-direction:column;gap:6px}.info-item-list-item{margin:0}.info-item-button{width:100%;text-align:left;display:flex;flex-direction:column;gap:2px;border-radius:8px;border:1px solid rgba(148,163,184,.7);background:#0f172ad9;padding:8px 10px;cursor:pointer;color:#e5e7eb;font-family:alagard,Cambria,Times New Roman,serif}.info-item-button:hover{background:#1e40af99}.info-item-title{font-size:20px}.info-item-description{font-size:16px;opacity:.8}.info-item-tech-row{display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.35rem}.info-item-tech-icon{height:20px;width:auto;object-fit:contain}.detail-pane{max-width:100%;font-family:alagard,Cambria,Times New Roman,serif;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.detail-pane-header{flex:0 0 auto;margin-bottom:.75rem}.detail-pane-header h2{margin:0 0 .25rem}.detail-pane-subtitle{margin:0;font-size:18px;opacity:.8}.detail-pane-body{flex:1 1 auto;min-height:0;overflow-y:auto;font-size:22px;line-height:1.5}.detail-pane-body h3{margin:.5rem 0 .25rem;font-size:22px}.detail-pane-body p{margin:.4rem 0}.detail-pane-body strong,.detail-pane-body b{font-weight:700}.detail-pane-body ul,.detail-pane-body ol{list-style:disc outside;margin:.4rem 0 .4rem 1.4rem;padding-left:0}.detail-pane-body ul li,.detail-pane-body ol li{display:list-item}.detail-pane-body,.info-item-list{-webkit-overflow-scrolling:touch}.detail-pane-body--docs{display:flex;flex-direction:column;gap:.75rem}.docs-controls-row{display:flex;align-items:flex-start}.docs-list{display:flex;flex-direction:column;gap:.6rem;width:100%}.docs-item{display:flex;flex-direction:column}.docs-item--active .docs-item-title{background:#788cff8c}.docs-item-title{width:100%;text-align:center;padding:.35rem .6rem;border-radius:0;border:1px solid rgba(255,255,255,.3);background:#00000080;font-family:alagard,Cambria,Times New Roman,serif;font-size:clamp(.7rem,1.6vw,.95rem);color:#fff;cursor:pointer;box-shadow:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.docs-item-title:hover{background:#506effbf}.docs-item-actions{margin-top:.25rem;display:flex;gap:.35rem;justify-content:center}.docs-action-button{padding:.2rem .5rem;border-radius:0;border:1px solid rgba(255,255,255,.3);background:#00000080;font-family:alagard,Cambria,Times New Roman,serif;font-size:.75rem;color:#fff;cursor:pointer;box-shadow:none;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.docs-action-button:hover{background:#ffffff1f}.docs-viewer{height:45vh;max-height:60vh;overflow:hidden;border-radius:6px}.docs-viewer-frame{width:100%;height:100%;border:none}.blog-image,.blog-entry-image{display:block;width:85%;justify-self:center;margin:.75rem auto 1rem;border-radius:10px;border:1px solid rgba(148,163,184,.7)}.detail-pane-footer{flex:0 0 auto;margin-top:.75rem;padding-top:.5rem;border-top:1px solid rgba(148,163,184,.6);display:flex;justify-content:flex-start;gap:8px}.detail-pane-footer button:disabled{opacity:.4;cursor:default}.page-link{border:none;background:transparent;padding:0;margin:0;font:inherit;color:#e5e7eb;text-decoration:underline;cursor:pointer}.page-link:hover{color:#fd7e00}.page-link:focus-visible{outline:2px solid rgba(248,250,252,.9);outline-offset:2px}.about-photo-wrapper{position:relative;display:block;width:85%;justify-self:center;margin:.75rem 0 1rem;border-radius:10px;border:1px solid rgba(148,163,184,.7);margin-left:auto;margin-right:auto;aspect-ratio:1 / 1;overflow:hidden}.about-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:opacity .4s ease}.about-photo.base{opacity:1}.about-photo.hover{opacity:0}.about-photo-wrapper:hover .hover{opacity:1}.about-photo-wrapper:hover .base{opacity:0}.guestbook-body{font-family:alagard,Cambria,Times New Roman,serif;display:flex;flex-direction:column;gap:1rem}.guestbook-form{display:flex;flex-direction:column;gap:1rem}.guestbook-label{display:flex;flex-direction:column;font-weight:700;gap:.25rem}.guestbook-input,.guestbook-textarea,.guestbook-captcha-input{padding:8px;border-radius:6px;border:1px solid #555;background:#111;color:#fff}.guestbook-submit-button{font-family:alagard,Cambria,Times New Roman,serif;padding:10px 14px;text-align:center;border-radius:6px;background:#444;color:#fff;font-weight:700;cursor:pointer;text-decoration:none}.guestbook-submit-button.disabled{opacity:.4;cursor:not-allowed}.guestbook-captcha-row{display:flex;align-items:center;gap:8px}.guestbook-warning{color:#f55;font-size:.9rem}.code-block{position:relative;margin:1.5rem 0;border-radius:8px;background:#050814;border:1px solid rgba(255,255,255,.08);overflow:hidden;font-size:.9rem}.code-block-header{display:flex;justify-content:space-between;align-items:center;padding:.4rem .75rem;border-bottom:1px solid rgba(255,255,255,.08);background:radial-gradient(circle at top left,#20253b,#050814)}.code-block-lang{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;opacity:.7}.code-block-copy{font-family:alagard,Cambria,Times New Roman,serif;font-size:.75rem;padding:.15rem .6rem;border-radius:999px;border:1px solid rgba(255,255,255,.24);background:transparent;color:inherit;cursor:pointer}.code-block-copy:hover{background:#ffffff0f}.code-block-pre{margin:0;padding:.75rem .9rem;overflow-x:auto}.code-block-pre::-webkit-scrollbar{height:6px}.code-block-pre::-webkit-scrollbar-thumb{border-radius:999px}.code-block-code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;white-space:pre;line-height:1.5}@media(max-width:600px){.code-block{margin:1rem 0;font-size:.8rem}.code-block-pre{padding:.6rem .7rem}}@media(max-width:600px){.dom-nav{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;max-width:100%;white-space:normal;overflow:visible}.dom-nav button,.dom-nav a{flex:1 1 auto;min-width:0;padding:0 6px;font-size:14px}.dom-nav-icon{flex:0 0 var(--nav-item-height)}.planet-overlay-root{padding:0}.planet-overlay-box{left:8px;right:8px;max-width:none;width:auto}.planet-overlay-box--left,.planet-overlay-box--right{height:45vh;max-height:45vh}.planet-overlay-box--left{position:fixed;top:56px;border-radius:12px;overflow:hidden;height:calc((100dvh - 56px)*.65);max-height:calc((100dvh - 56px)*.65)}.planet-overlay-box--right{position:fixed;left:8px;right:8px;bottom:0;border-radius:12px;overflow:hidden;height:calc((100dvh - 56px)*.35);max-height:calc((100dvh - 56px)*.35)}.dom-footer{position:fixed;bottom:0;left:0;width:100%;padding:8px;box-sizing:border-box}.settings-tray{position:absolute;left:8px;bottom:calc(var(--nav-item-height) + 16px);flex-direction:column;align-items:stretch;max-width:calc(100% - 16px);transform:translateY(8px);opacity:0;pointer-events:none}.settings-tray--open{transform:translateY(0);opacity:1;pointer-events:auto}.settings-tray button{width:100%;text-align:left}.dom-body{position:absolute;top:56px;left:50%;transform:translate(-50%);width:90vw;max-width:480px;margin:0;text-align:center;padding:0 8px;pointer-events:none;-webkit-user-select:none;user-select:none}} diff --git a/docs/assets/index-BU365GF-.js b/docs/assets/index-BU365GF-.js new file mode 100644 index 0000000..cf278ee --- /dev/null +++ b/docs/assets/index-BU365GF-.js @@ -0,0 +1,4999 @@ +function pT(a,e){for(var t=0;tn[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&n(f)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();function jb(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Jv={exports:{}},e0={};var U_;function mT(){if(U_)return e0;U_=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,o){var f=null;if(o!==void 0&&(f=""+o),s.key!==void 0&&(f=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:a,type:n,key:f,ref:s!==void 0?s:null,props:o}}return e0.Fragment=e,e0.jsx=t,e0.jsxs=t,e0}var L_;function gT(){return L_||(L_=1,Jv.exports=mT()),Jv.exports}var R=gT(),$v={exports:{}},Kt={};var z_;function yT(){if(z_)return Kt;z_=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.iterator;function S(Y){return Y===null||typeof Y!="object"?null:(Y=v&&Y[v]||Y["@@iterator"],typeof Y=="function"?Y:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,w={};function A(Y,oe,Te){this.props=Y,this.context=oe,this.refs=w,this.updater=Te||M}A.prototype.isReactComponent={},A.prototype.setState=function(Y,oe){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,oe,"setState")},A.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function D(){}D.prototype=A.prototype;function N(Y,oe,Te){this.props=Y,this.context=oe,this.refs=w,this.updater=Te||M}var U=N.prototype=new D;U.constructor=N,T(U,A.prototype),U.isPureReactComponent=!0;var I=Array.isArray;function z(){}var j={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function B(Y,oe,Te){var Ne=Te.ref;return{$$typeof:a,type:Y,key:oe,ref:Ne!==void 0?Ne:null,props:Te}}function P(Y,oe){return B(Y.type,oe,Y.props)}function W(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===a}function se(Y){var oe={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(Te){return oe[Te]})}var ae=/\/+/g;function ce(Y,oe){return typeof Y=="object"&&Y!==null&&Y.key!=null?se(""+Y.key):oe.toString(36)}function ue(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(z,z):(Y.status="pending",Y.then(function(oe){Y.status==="pending"&&(Y.status="fulfilled",Y.value=oe)},function(oe){Y.status==="pending"&&(Y.status="rejected",Y.reason=oe)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function V(Y,oe,Te,Ne,Qe){var le=typeof Y;(le==="undefined"||le==="boolean")&&(Y=null);var xe=!1;if(Y===null)xe=!0;else switch(le){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(Y.$$typeof){case a:case e:xe=!0;break;case y:return xe=Y._init,V(xe(Y._payload),oe,Te,Ne,Qe)}}if(xe)return Qe=Qe(Y),xe=Ne===""?"."+ce(Y,0):Ne,I(Qe)?(Te="",xe!=null&&(Te=xe.replace(ae,"$&/")+"/"),V(Qe,oe,Te,"",function(at){return at})):Qe!=null&&(W(Qe)&&(Qe=P(Qe,Te+(Qe.key==null||Y&&Y.key===Qe.key?"":(""+Qe.key).replace(ae,"$&/")+"/")+xe)),oe.push(Qe)),1;xe=0;var Ge=Ne===""?".":Ne+":";if(I(Y))for(var et=0;et>>1,ve=V[he];if(0>>1;hes(Te,J))Nes(Qe,Te)?(V[he]=Qe,V[Ne]=J,he=Ne):(V[he]=Te,V[oe]=J,he=oe);else if(Nes(Qe,J))V[he]=Qe,V[Ne]=J,he=Ne;else break e}}return $}function s(V,$){var J=V.sortIndex-$.sortIndex;return J!==0?J:V.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;a.unstable_now=function(){return o.now()}}else{var f=Date,d=f.now();a.unstable_now=function(){return f.now()-d}}var p=[],m=[],y=1,x=null,v=3,S=!1,M=!1,T=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function U(V){for(var $=t(m);$!==null;){if($.callback===null)n(m);else if($.startTime<=V)n(m),$.sortIndex=$.expirationTime,e(p,$);else break;$=t(m)}}function I(V){if(T=!1,U(V),!M)if(t(p)!==null)M=!0,z||(z=!0,se());else{var $=t(m);$!==null&&ue(I,$.startTime-V)}}var z=!1,j=-1,q=5,B=-1;function P(){return w?!0:!(a.unstable_now()-BV&&P());){var he=x.callback;if(typeof he=="function"){x.callback=null,v=x.priorityLevel;var ve=he(x.expirationTime<=V);if(V=a.unstable_now(),typeof ve=="function"){x.callback=ve,U(V),$=!0;break t}x===t(p)&&n(p),U(V)}else n(p);x=t(p)}if(x!==null)$=!0;else{var Y=t(m);Y!==null&&ue(I,Y.startTime-V),$=!1}}break e}finally{x=null,v=J,S=!1}$=void 0}}finally{$?se():z=!1}}}var se;if(typeof N=="function")se=function(){N(W)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,ce=ae.port2;ae.port1.onmessage=W,se=function(){ce.postMessage(null)}}else se=function(){A(W,0)};function ue(V,$){j=A(function(){V(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(V){V.callback=null},a.unstable_forceFrameRate=function(V){0>V||125he?(V.sortIndex=J,e(m,V),t(p)===null&&V===t(m)&&(T?(D(j),j=-1):T=!0,ue(I,J-he))):(V.sortIndex=ve,e(p,V),M||S||(M=!0,z||(z=!0,se()))),V},a.unstable_shouldYield=P,a.unstable_wrapCallback=function(V){var $=v;return function(){var J=v;v=$;try{return V.apply(this,arguments)}finally{v=J}}}})(n2)),n2}var I_;function bT(){return I_||(I_=1,t2.exports=vT()),t2.exports}var i2={exports:{}},Ba={};var F_;function _T(){if(F_)return Ba;F_=1;var a=bh();function e(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),i2.exports=_T(),i2.exports}var H_;function AT(){if(H_)return t0;H_=1;var a=bT(),e=bh(),t=ST();function n(i){var r="https://react.dev/errors/"+i;if(1ve||(i.current=he[ve],he[ve]=null,ve--)}function Te(i,r){ve++,he[ve]=i.current,i.current=r}var Ne=Y(null),Qe=Y(null),le=Y(null),xe=Y(null);function Ge(i,r){switch(Te(le,r),Te(Qe,i),Te(Ne,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?n_(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=n_(r),i=i_(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}oe(Ne),Te(Ne,i)}function et(){oe(Ne),oe(Qe),oe(le)}function at(i){i.memoizedState!==null&&Te(xe,i);var r=Ne.current,u=i_(r,i.type);r!==u&&(Te(Qe,i),Te(Ne,u))}function lt(i){Qe.current===i&&(oe(Ne),oe(Qe)),xe.current===i&&(oe(xe),Kp._currentValue=J)}var Rt,yt;function Ue(i){if(Rt===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Rt=r&&r[1]||"",yt=-1)":-1b||ie[h]!==Se[b]){var Le=` +`+ie[h].replace(" at new "," at ");return i.displayName&&Le.includes("")&&(Le=Le.replace("",i.displayName)),Le}while(1<=h&&0<=b);break}}}finally{Z=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Ue(u):""}function Xe(i,r){switch(i.tag){case 26:case 27:case 5:return Ue(i.type);case 16:return Ue("Lazy");case 13:return i.child!==r&&r!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return ke(i.type,!1);case 11:return ke(i.type.render,!1);case 1:return ke(i.type,!0);case 31:return Ue("Activity");default:return""}}function tt(i){try{var r="",u=null;do r+=Xe(i,u),u=i,i=i.return;while(i);return r}catch(h){return` +Error generating stack: `+h.message+` +`+h.stack}}var qe=Object.prototype.hasOwnProperty,ot=a.unstable_scheduleCallback,nt=a.unstable_cancelCallback,ht=a.unstable_shouldYield,K=a.unstable_requestPaint,F=a.unstable_now,ye=a.unstable_getCurrentPriorityLevel,Oe=a.unstable_ImmediatePriority,Pe=a.unstable_UserBlockingPriority,Re=a.unstable_NormalPriority,Mt=a.unstable_LowPriority,ct=a.unstable_IdlePriority,wt=a.log,_t=a.unstable_setDisableYieldValue,je=null,Ye=null;function St(i){if(typeof wt=="function"&&_t(i),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(je,i)}catch{}}var te=Math.clz32?Math.clz32:ee,Ae=Math.log,Ze=Math.LN2;function ee(i){return i>>>=0,i===0?32:31-(Ae(i)/Ze|0)|0}var Ke=256,Je=262144,it=4194304;function We(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ie(i,r,u){var h=i.pendingLanes;if(h===0)return 0;var b=0,E=i.suspendedLanes,L=i.pingedLanes;i=i.warmLanes;var k=h&134217727;return k!==0?(h=k&~E,h!==0?b=We(h):(L&=k,L!==0?b=We(L):u||(u=k&~i,u!==0&&(b=We(u))))):(k=h&~E,k!==0?b=We(k):L!==0?b=We(L):u||(u=h&~i,u!==0&&(b=We(u)))),b===0?0:r!==0&&r!==b&&(r&E)===0&&(E=b&-b,u=r&-r,E>=u||E===32&&(u&4194048)!==0)?r:b}function ft(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Tt(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ln(){var i=it;return it<<=1,(it&62914560)===0&&(it=4194304),i}function Qt(i){for(var r=[],u=0;31>u;u++)r.push(i);return r}function $n(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ei(i,r,u,h,b,E){var L=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var k=i.entanglements,ie=i.expirationTimes,Se=i.hiddenUpdates;for(u=L&~u;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Sr=/[\n"\\]/g;function Hn(i){return i.replace(Sr,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Qs(i,r,u,h,b,E,L,k){i.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?i.type=L:i.removeAttribute("type"),r!=null?L==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+fn(r)):i.value!==""+fn(r)&&(i.value=""+fn(r)):L!=="submit"&&L!=="reset"||i.removeAttribute("value"),r!=null?wi(i,L,fn(r)):u!=null?wi(i,L,fn(u)):h!=null&&i.removeAttribute("value"),b==null&&E!=null&&(i.defaultChecked=!!E),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?i.name=""+fn(k):i.removeAttribute("name")}function kn(i,r,u,h,b,E,L,k){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.type=E),r!=null||u!=null){if(!(E!=="submit"&&E!=="reset"||r!=null)){Bn(i);return}u=u!=null?""+fn(u):"",r=r!=null?""+fn(r):u,k||r===i.value||(i.value=r),i.defaultValue=r}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=k?i.checked:!!h,i.defaultChecked=!!h,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(i.name=L),Bn(i)}function wi(i,r,u){r==="number"&&bi(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Ti(i,r,u,h){if(i=i.options,r){r={};for(var b=0;b"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Df=!1;if($s)try{var tu={};Object.defineProperty(tu,"passive",{get:function(){Df=!0}}),window.addEventListener("test",tu,tu),window.removeEventListener("test",tu,tu)}catch{Df=!1}var ao=null,Nf=null,so=null;function Of(){if(so)return so;var i,r=Nf,u=r.length,h,b="value"in ao?ao.value:ao.textContent,E=b.length;for(i=0;i=lo),lu=" ",Vh=!1;function Bf(i,r){switch(i){case"keyup":return kh.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yl(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var co=!1;function If(i,r){switch(i){case"compositionend":return Yl(r);case"keypress":return r.which!==32?null:(Vh=!0,lu);case"textInput":return i=r.data,i===lu&&Vh?null:i;default:return null}}function Sm(i,r){if(co)return i==="compositionend"||!al&&Bf(i,r)?(i=Of(),so=Nf=ao=null,co=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:u,offset:r-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Wh(u)}}function jf(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?jf(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Hf(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=bi(i.document);r instanceof i.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)i=r.contentWindow;else break;r=bi(i.document)}return r}function Jl(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var Tm=$s&&"documentMode"in document&&11>=document.documentMode,$l=null,kf=null,ec=null,qa=!1;function Vf(i,r,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;qa||$l==null||$l!==bi(h)||(h=$l,"selectionStart"in h&&Jl(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ec&&Ql(ec,h)||(ec=h,h=hg(kf,"onSelect"),0>=L,b-=L,ir=1<<32-te(r)+b|u<rn?(_n=Ct,Ct=null):_n=Ct.sibling;var zn=we(me,Ct,_e[rn],Fe);if(zn===null){Ct===null&&(Ct=_n);break}i&&Ct&&zn.alternate===null&&r(me,Ct),re=E(zn,re,rn),Ln===null?Pt=zn:Ln.sibling=zn,Ln=zn,Ct=_n}if(rn===_e.length)return u(me,Ct),mn&&Tr(me,rn),Pt;if(Ct===null){for(;rn<_e.length;rn++)Ct=Ve(me,_e[rn],Fe),Ct!==null&&(re=E(Ct,re,rn),Ln===null?Pt=Ct:Ln.sibling=Ct,Ln=Ct);return mn&&Tr(me,rn),Pt}for(Ct=h(Ct);rn<_e.length;rn++)_n=De(Ct,me,rn,_e[rn],Fe),_n!==null&&(i&&_n.alternate!==null&&Ct.delete(_n.key===null?rn:_n.key),re=E(_n,re,rn),Ln===null?Pt=_n:Ln.sibling=_n,Ln=_n);return i&&Ct.forEach(function(Rc){return r(me,Rc)}),mn&&Tr(me,rn),Pt}function jt(me,re,_e,Fe){if(_e==null)throw Error(n(151));for(var Pt=null,Ln=null,Ct=re,rn=re=0,_n=null,zn=_e.next();Ct!==null&&!zn.done;rn++,zn=_e.next()){Ct.index>rn?(_n=Ct,Ct=null):_n=Ct.sibling;var Rc=we(me,Ct,zn.value,Fe);if(Rc===null){Ct===null&&(Ct=_n);break}i&&Ct&&Rc.alternate===null&&r(me,Ct),re=E(Rc,re,rn),Ln===null?Pt=Rc:Ln.sibling=Rc,Ln=Rc,Ct=_n}if(zn.done)return u(me,Ct),mn&&Tr(me,rn),Pt;if(Ct===null){for(;!zn.done;rn++,zn=_e.next())zn=Ve(me,zn.value,Fe),zn!==null&&(re=E(zn,re,rn),Ln===null?Pt=zn:Ln.sibling=zn,Ln=zn);return mn&&Tr(me,rn),Pt}for(Ct=h(Ct);!zn.done;rn++,zn=_e.next())zn=De(Ct,me,rn,zn.value,Fe),zn!==null&&(i&&zn.alternate!==null&&Ct.delete(zn.key===null?rn:zn.key),re=E(zn,re,rn),Ln===null?Pt=zn:Ln.sibling=zn,Ln=zn);return i&&Ct.forEach(function(hT){return r(me,hT)}),mn&&Tr(me,rn),Pt}function Wn(me,re,_e,Fe){if(typeof _e=="object"&&_e!==null&&_e.type===T&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case S:e:{for(var Pt=_e.key;re!==null;){if(re.key===Pt){if(Pt=_e.type,Pt===T){if(re.tag===7){u(me,re.sibling),Fe=b(re,_e.props.children),Fe.return=me,me=Fe;break e}}else if(re.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===q&&pl(Pt)===re.type){u(me,re.sibling),Fe=b(re,_e.props),bu(Fe,_e),Fe.return=me,me=Fe;break e}u(me,re);break}else r(me,re);re=re.sibling}_e.type===T?(Fe=wr(_e.props.children,me.mode,Fe,_e.key),Fe.return=me,me=Fe):(Fe=hu(_e.type,_e.key,_e.props,null,me.mode,Fe),bu(Fe,_e),Fe.return=me,me=Fe)}return L(me);case M:e:{for(Pt=_e.key;re!==null;){if(re.key===Pt)if(re.tag===4&&re.stateNode.containerInfo===_e.containerInfo&&re.stateNode.implementation===_e.implementation){u(me,re.sibling),Fe=b(re,_e.children||[]),Fe.return=me,me=Fe;break e}else{u(me,re);break}else r(me,re);re=re.sibling}Fe=Ls(_e,me.mode,Fe),Fe.return=me,me=Fe}return L(me);case q:return _e=pl(_e),Wn(me,re,_e,Fe)}if(ue(_e))return Et(me,re,_e,Fe);if(se(_e)){if(Pt=se(_e),typeof Pt!="function")throw Error(n(150));return _e=Pt.call(_e),jt(me,re,_e,Fe)}if(typeof _e.then=="function")return Wn(me,re,td(_e),Fe);if(_e.$$typeof===N)return Wn(me,re,yu(me,_e),Fe);_u(me,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,re!==null&&re.tag===6?(u(me,re.sibling),Fe=b(re,_e),Fe.return=me,me=Fe):(u(me,re),Fe=Wf(_e,me.mode,Fe),Fe.return=me,me=Fe),L(me)):u(me,re)}return function(me,re,_e,Fe){try{Mo=0;var Pt=Wn(me,re,_e,Fe);return Ao=null,Pt}catch(Ct){if(Ct===So||Ct===Bs)throw Ct;var Ln=fa(29,Ct,null,me.mode);return Ln.lanes=Fe,Ln.return=me,Ln}finally{}}}var ml=cc(!0),zm=cc(!1),Eo=!1;function up(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fp(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function rr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ur(i,r,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(vn&2)!==0){var b=h.pending;return b===null?r.next=r:(r.next=b.next,b.next=r),h.pending=r,r=ac(i),Yf(i,null,u),r}return du(i,h,r,u),ac(i)}function wo(i,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var h=r.lanes;h&=i.pendingLanes,u|=h,r.lanes=u,Qo(i,u)}}function nd(i,r){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,E=null;if(u=u.firstBaseUpdate,u!==null){do{var L={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};E===null?b=E=L:E=E.next=L,u=u.next}while(u!==null);E===null?b=E=r:E=E.next=r}else b=E=r;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=r:i.next=r,u.lastBaseUpdate=r}var dp=!1;function Su(){if(dp){var i=Ps;if(i!==null)throw i}}function gl(i,r,u,h){dp=!1;var b=i.updateQueue;Eo=!1;var E=b.firstBaseUpdate,L=b.lastBaseUpdate,k=b.shared.pending;if(k!==null){b.shared.pending=null;var ie=k,Se=ie.next;ie.next=null,L===null?E=Se:L.next=Se,L=ie;var Le=i.alternate;Le!==null&&(Le=Le.updateQueue,k=Le.lastBaseUpdate,k!==L&&(k===null?Le.firstBaseUpdate=Se:k.next=Se,Le.lastBaseUpdate=ie))}if(E!==null){var Ve=b.baseState;L=0,Le=Se=ie=null,k=E;do{var we=k.lane&-536870913,De=we!==k.lane;if(De?(pn&we)===we:(h&we)===we){we!==0&&we===Or&&(dp=!0),Le!==null&&(Le=Le.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Et=i,jt=k;we=r;var Wn=u;switch(jt.tag){case 1:if(Et=jt.payload,typeof Et=="function"){Ve=Et.call(Wn,Ve,we);break e}Ve=Et;break e;case 3:Et.flags=Et.flags&-65537|128;case 0:if(Et=jt.payload,we=typeof Et=="function"?Et.call(Wn,Ve,we):Et,we==null)break e;Ve=x({},Ve,we);break e;case 2:Eo=!0}}we=k.callback,we!==null&&(i.flags|=64,De&&(i.flags|=8192),De=b.callbacks,De===null?b.callbacks=[we]:De.push(we))}else De={lane:we,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Le===null?(Se=Le=De,ie=Ve):Le=Le.next=De,L|=we;if(k=k.next,k===null){if(k=b.shared.pending,k===null)break;De=k,k=De.next,De.next=null,b.lastBaseUpdate=De,b.shared.pending=null}}while(!0);Le===null&&(ie=Ve),b.baseState=ie,b.firstBaseUpdate=Se,b.lastBaseUpdate=Le,E===null&&(b.shared.lanes=0),as|=L,i.lanes=L,i.memoizedState=Ve}}function or(i,r){if(typeof i!="function")throw Error(n(191,i));i.call(r)}function Xi(i,r){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;iE?E:8;var L=V.T,k={};V.T=k,Tu(i,!1,r,u);try{var ie=b(),Se=V.S;if(Se!==null&&Se(k,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Le=op(ie,h);fc(i,r,Le,ga(i))}else fc(i,r,h,ga(i))}catch(Ve){fc(i,r,{then:function(){},status:"rejected",reason:Ve},ga())}finally{$.p=E,L!==null&&k.types!==null&&(L.types=k.types),V.T=L}}function Sv(){}function zp(i,r,u,h){if(i.tag!==5)throw Error(n(476));var b=eg(i).queue;Lp(i,b,r,J,u===null?Sv:function(){return Pp(i),u(h)})}function eg(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:J},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:u},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function Pp(i){var r=eg(i);r.next===null&&(r=i.alternate.memoizedState),fc(i,r.next.queue,{},ga())}function Bp(){return Fi(Kp)}function qi(){return hi().memoizedState}function Ip(){return hi().memoizedState}function Av(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var u=ga();i=rr(u);var h=Ur(r,i,u);h!==null&&(c(h,r,u),wo(h,r,u)),r={cache:ap()},i.payload=r;return}r=r.return}}function Mv(i,r,u){var h=ga();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Pr(i)?xl(r,u):(u=ic(i,r,u,h),u!==null&&(c(u,i,h),Da(u,r,h)))}function tg(i,r,u){var h=ga();fc(i,r,u,h)}function fc(i,r,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Pr(i))xl(r,b);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var L=r.lastRenderedState,k=E(L,u);if(b.hasEagerState=!0,b.eagerState=k,Kn(k,L))return du(i,r,b,0),On===null&&go(),!1}catch{}finally{}if(u=ic(i,r,b,h),u!==null)return c(u,i,h),Da(u,r,h),!0}return!1}function Tu(i,r,u,h){if(h={lane:2,revertLane:Cv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Pr(i)){if(r)throw Error(n(479))}else r=ic(i,u,h,2),r!==null&&c(r,i,2)}function Pr(i){var r=i.alternate;return i===kt||r!==null&&r===kt}function xl(i,r){lr=ad=!0;var u=i.pending;u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r}function Da(i,r,u){if((u&4194048)!==0){var h=r.lanes;h&=i.pendingLanes,u|=h,r.lanes=u,Qo(i,u)}}var Cu={readContext:Fi,use:rd,useCallback:ai,useContext:ai,useEffect:ai,useImperativeHandle:ai,useLayoutEffect:ai,useInsertionEffect:ai,useMemo:ai,useReducer:ai,useRef:ai,useState:ai,useDebugValue:ai,useDeferredValue:ai,useTransition:ai,useSyncExternalStore:ai,useId:ai,useHostTransitionStatus:ai,useFormState:ai,useActionState:ai,useOptimistic:ai,useMemoCache:ai,useCacheRefresh:ai};Cu.useEffectEvent=ai;var ng={readContext:Fi,use:rd,useCallback:function(i,r){return pa().memoizedState=[i,r===void 0?null:r],i},useContext:Fi,useEffect:Km,useImperativeHandle:function(i,r,u){u=u!=null?u.concat([i]):null,fd(4194308,4,Rp.bind(null,r,i),u)},useLayoutEffect:function(i,r){return fd(4194308,4,i,r)},useInsertionEffect:function(i,r){fd(4,2,i,r)},useMemo:function(i,r){var u=pa();r=r===void 0?null:r;var h=i();if(yl){St(!0);try{i()}finally{St(!1)}}return u.memoizedState=[h,r],h},useReducer:function(i,r,u){var h=pa();if(u!==void 0){var b=u(r);if(yl){St(!0);try{u(r)}finally{St(!1)}}}else b=r;return h.memoizedState=h.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},h.queue=i,i=i.dispatch=Mv.bind(null,kt,i),[h.memoizedState,i]},useRef:function(i){var r=pa();return i={current:i},r.memoizedState=i},useState:function(i){i=wu(i);var r=i.queue,u=tg.bind(null,kt,r);return r.dispatch=u,[i.memoizedState,u]},useDebugValue:pd,useDeferredValue:function(i,r){var u=pa();return Op(u,i,r)},useTransition:function(){var i=wu(!1);return i=Lp.bind(null,kt,i.queue,!0,!1),pa().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,u){var h=kt,b=pa();if(mn){if(u===void 0)throw Error(n(407));u=u()}else{if(u=r(),On===null)throw Error(n(349));(pn&127)!==0||Fm(h,r,u)}b.memoizedState=u;var E={value:u,getSnapshot:r};return b.queue=E,Km(Ep.bind(null,h,E,i),[i]),h.flags|=2048,uc(9,{destroy:void 0},Mp.bind(null,h,E,u,r),null),u},useId:function(){var i=pa(),r=On.identifierPrefix;if(mn){var u=ar,h=ir;u=(h&~(1<<32-te(h)-1)).toString(32)+u,r="_"+r+"R_"+u,u=sd++,0<\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof h.is=="string"?L.createElement("select",{is:h.is}):L.createElement("select"),h.multiple?E.multiple=!0:h.size&&(E.size=h.size);break;default:E=typeof h.is=="string"?L.createElement(b,{is:h.is}):L.createElement(b)}}E[nn]=r,E[fi]=h;e:for(L=r.child;L!==null;){if(L.tag===5||L.tag===6)E.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===r)break e;for(;L.sibling===null;){if(L.return===null||L.return===r)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}r.stateNode=E;e:switch(ya(E,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Oa(r)}}return Pn(r),Do(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,u),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==h&&Oa(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(n(166));if(i=le.current,ul(r)){if(i=r.stateNode,u=r.memoizedProps,h=null,b=Bi,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}i[nn]=r,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||e_(i.nodeValue,u)),i||hn(r,!0)}else i=pg(i).createTextNode(h),i[nn]=r,r.stateNode=i}return Pn(r),null;case 31:if(u=r.memoizedState,i===null||i.memoizedState!==null){if(h=ul(r),u!==null){if(i===null){if(!h)throw Error(n(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[nn]=r}else fl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pn(r),i=!1}else u=ep(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return r.flags&256?(Za(r),r):(Za(r),null);if((r.flags&128)!==0)throw Error(n(558))}return Pn(r),null;case 13:if(h=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=ul(r),h!==null&&h.dehydrated!==null){if(i===null){if(!b)throw Error(n(318));if(b=r.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(n(317));b[nn]=r}else fl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pn(r),b=!1}else b=ep(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return r.flags&256?(Za(r),r):(Za(r),null)}return Za(r),(r.flags&128)!==0?(r.lanes=u,r):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=r.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),E=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==b&&(h.flags|=2048)),u!==i&&u&&(r.child.flags|=8192),xc(r,r.updateQueue),Pn(r),null);case 4:return et(),i===null&&Ov(r.stateNode.containerInfo),Pn(r),null;case 10:return ys(r.type),Pn(r),null;case 19:if(oe(ii),h=r.memoizedState,h===null)return Pn(r),null;if(b=(r.flags&128)!==0,E=h.rendering,E===null)if(b)Iu(h,!1);else{if(Un!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(E=id(i),E!==null){for(r.flags|=128,Iu(h,!1),i=E.updateQueue,r.updateQueue=i,xc(r,i),r.subtreeFlags=0,i=u,u=r.child;u!==null;)na(u,i),u=u.sibling;return Te(ii,ii.current&1|2),mn&&Tr(r,h.treeForkCount),r.child}i=i.sibling}h.tail!==null&&F()>rs&&(r.flags|=128,b=!0,Iu(h,!1),r.lanes=4194304)}else{if(!b)if(i=id(E),i!==null){if(r.flags|=128,b=!0,i=i.updateQueue,r.updateQueue=i,xc(r,i),Iu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!E.alternate&&!mn)return Pn(r),null}else 2*F()-h.renderingStartTime>rs&&u!==536870912&&(r.flags|=128,b=!0,Iu(h,!1),r.lanes=4194304);h.isBackwards?(E.sibling=r.child,r.child=E):(i=h.last,i!==null?i.sibling=E:r.child=E,h.last=E)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=F(),i.sibling=null,u=ii.current,Te(ii,b?u&1|2:u&1),mn&&Tr(r,h.treeForkCount),i):(Pn(r),null);case 22:case 23:return Za(r),aa(),h=r.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(u&536870912)!==0&&(r.flags&128)===0&&(Pn(r),r.subtreeFlags&6&&(r.flags|=8192)):Pn(r),u=r.updateQueue,u!==null&&xc(r,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048),i!==null&&oe(_o),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ys(Ot),Pn(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function vd(i,r){switch(vo(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return ys(Ot),et(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return lt(r),null;case 31:if(r.memoizedState!==null){if(Za(r),r.alternate===null)throw Error(n(340));fl()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Za(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));fl()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return oe(ii),null;case 4:return et(),null;case 10:return ys(r.type),null;case 22:case 23:return Za(r),aa(),i!==null&&oe(_o),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return ys(Ot),null;case 25:return null;default:return null}}function bl(i,r){switch(vo(r),r.tag){case 3:ys(Ot),et();break;case 26:case 27:case 5:lt(r);break;case 4:et();break;case 31:r.memoizedState!==null&&Za(r);break;case 13:Za(r);break;case 19:oe(ii);break;case 10:ys(r.type);break;case 22:case 23:Za(r),aa(),i!==null&&oe(_o);break;case 24:ys(Ot)}}function fr(i,r){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&i)===i){h=void 0;var E=u.create,L=u.inst;h=E(),L.destroy=h}u=u.next}while(u!==b)}}catch(k){Vn(r,r.return,k)}}function _s(i,r,u){try{var h=r.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var E=b.next;h=E;do{if((h.tag&i)===i){var L=h.inst,k=L.destroy;if(k!==void 0){L.destroy=void 0,b=r;var ie=u,Se=k;try{Se()}catch(Le){Vn(b,ie,Le)}}}h=h.next}while(h!==E)}}catch(Le){Vn(r,r.return,Le)}}function No(i){var r=i.updateQueue;if(r!==null){var u=i.stateNode;try{Xi(r,u)}catch(h){Vn(i,i.return,h)}}}function kp(i,r,u){u.props=Yi(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){Vn(i,r,h)}}function dr(i,r){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(b){Vn(i,r,b)}}function ns(i,r){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(b){Vn(i,r,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){Vn(i,r,b)}else u.current=null}function is(i){var r=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){Vn(i,i.return,b)}}function Ss(i,r,u){try{var h=i.stateNode;Bw(h,i.type,u,r),h[fi]=r}catch(b){Vn(i,i.return,b)}}function Si(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Mc(i.type)||i.tag===4}function hr(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Si(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Mc(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Jt(i,r,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(i),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=Js));else if(h!==4&&(h===27&&Mc(i.type)&&(u=i.stateNode,r=null),i=i.child,i!==null))for(Jt(i,r,u),i=i.sibling;i!==null;)Jt(i,r,u),i=i.sibling}function Tn(i,r,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,r?u.insertBefore(i,r):u.appendChild(i);else if(h!==4&&(h===27&&Mc(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Tn(i,r,u),i=i.sibling;i!==null;)Tn(i,r,u),i=i.sibling}function pi(i){var r=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,b=r.attributes;b.length;)r.removeAttributeNode(b[0]);ya(r,h,u),r[nn]=i,r[fi]=u}catch(E){Vn(i,i.return,E)}}var As=!1,Jn=!1,Ir=!1,Fu=typeof WeakSet=="function"?WeakSet:Set,ri=null;function vc(i,r){if(i=i.containerInfo,zv=_g,i=Hf(i),Jl(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,E=h.focusNode;h=h.focusOffset;try{u.nodeType,E.nodeType}catch{u=null;break e}var L=0,k=-1,ie=-1,Se=0,Le=0,Ve=i,we=null;t:for(;;){for(var De;Ve!==u||b!==0&&Ve.nodeType!==3||(k=L+b),Ve!==E||h!==0&&Ve.nodeType!==3||(ie=L+h),Ve.nodeType===3&&(L+=Ve.nodeValue.length),(De=Ve.firstChild)!==null;)we=Ve,Ve=De;for(;;){if(Ve===i)break t;if(we===u&&++Se===b&&(k=L),we===E&&++Le===h&&(ie=L),(De=Ve.nextSibling)!==null)break;Ve=we,we=Ve.parentNode}Ve=De}u=k===-1||ie===-1?null:{start:k,end:ie}}else u=null}u=u||{start:0,end:0}}else u=null;for(Pv={focusedElem:i,selectionRange:u},_g=!1,ri=r;ri!==null;)if(r=ri,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,ri=i;else for(;ri!==null;){switch(r=ri,E=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u title"))),ya(E,h,u),E[nn]=i,be(E),h=E;break e;case"link":var L=y_("link","href",b).get(h+(u.href||""));if(L){for(var k=0;kWn&&(L=Wn,Wn=jt,jt=L);var me=Zh(k,jt),re=Zh(k,Wn);if(me&&re&&(De.rangeCount!==1||De.anchorNode!==me.node||De.anchorOffset!==me.offset||De.focusNode!==re.node||De.focusOffset!==re.offset)){var _e=Ve.createRange();_e.setStart(me.node,me.offset),De.removeAllRanges(),jt>Wn?(De.addRange(_e),De.extend(re.node,re.offset)):(_e.setEnd(re.node,re.offset),De.addRange(_e))}}}}for(Ve=[],De=k;De=De.parentNode;)De.nodeType===1&&Ve.push({element:De,left:De.scrollLeft,top:De.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;ku?32:u,V.T=null,u=Ml,Ml=null;var E=Vs,L=Ms;if(ti=0,os=Vs=null,Ms=0,(vn&6)!==0)throw Error(n(331));var k=vn;if(vn|=4,Al(E.current),ei(E,E.current,L,u),vn=k,Gp(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(je,E)}catch{}return!0}finally{$.p=b,V.T=h,Gr(i,r)}}function k1(i,r,u){r=Ta(u,r),r=jp(i.stateNode,r,2),i=Ur(i,r,2),i!==null&&($n(i,2),zo(i))}function Vn(i,r,u){if(i.tag===3)k1(i,i,u);else for(;r!==null;){if(r.tag===3){k1(r,i,u);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(pr===null||!pr.has(h))){i=Ta(u,i),u=pc(2),h=Ur(r,u,2),h!==null&&(Na(u,h,r,i),$n(h,2),zo(h));break}}r=r.return}}function Ev(i,r,u){var h=i.pingCache;if(h===null){h=i.pingCache=new Ed;var b=new Set;h.set(r,b)}else b=h.get(r),b===void 0&&(b=new Set,h.set(r,b));b.has(u)||(Fn=!0,b.add(u),i=Mw.bind(null,i,r,u),r.then(i,i))}function Mw(i,r,u){var h=i.pingCache;h!==null&&h.delete(r),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,On===i&&(pn&u)===u&&(Un===4||Un===3&&(pn&62914560)===pn&&300>F()-kr?(vn&2)===0&&ge(i,0):Hs|=u,ss===pn&&(ss=0)),zo(i)}function V1(i,r){r===0&&(r=ln()),i=yo(i,r),i!==null&&($n(i,r),zo(i))}function Ew(i){var r=i.memoizedState,u=0;r!==null&&(u=r.retryLane),V1(i,u)}function ww(i,r){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(n(314))}h!==null&&h.delete(r),V1(i,u)}function Tw(i,r){return ot(i,r)}var ug=null,Cd=null,wv=!1,fg=!1,Tv=!1,Ac=0;function zo(i){i!==Cd&&i.next===null&&(Cd===null?ug=Cd=i:Cd=Cd.next=i),fg=!0,wv||(wv=!0,Rw())}function Gp(i,r){if(!Tv&&fg){Tv=!0;do for(var u=!1,h=ug;h!==null;){if(i!==0){var b=h.pendingLanes;if(b===0)var E=0;else{var L=h.suspendedLanes,k=h.pingedLanes;E=(1<<31-te(42|i)+1)-1,E&=b&~(L&~k),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(u=!0,Y1(h,E))}else E=pn,E=Ie(h,h===On?E:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(E&3)===0||ft(h,E)||(u=!0,Y1(h,E));h=h.next}while(u);Tv=!1}}function Cw(){G1()}function G1(){fg=wv=!1;var i=0;Ac!==0&&Fw()&&(i=Ac);for(var r=F(),u=null,h=ug;h!==null;){var b=h.next,E=X1(h,r);E===0?(h.next=null,u===null?ug=b:u.next=b,b===null&&(Cd=u)):(u=h,(i!==0||(E&3)!==0)&&(fg=!0)),h=b}ti!==0&&ti!==5||Gp(i),Ac!==0&&(Ac=0)}function X1(i,r){for(var u=i.suspendedLanes,h=i.pingedLanes,b=i.expirationTimes,E=i.pendingLanes&-62914561;0k)break;var Le=ie.transferSize,Ve=ie.initiatorType;Le&&t_(Ve)&&(ie=ie.responseEnd,L+=Le*(ie"u"?null:document;function h_(i,r,u){var h=Rd;if(h&&typeof r=="string"&&r){var b=Hn(r);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),d_.has(b)||(d_.add(b),i={rel:i,crossOrigin:u,href:r},h.querySelector(b)===null&&(r=h.createElement("link"),ya(r,"link",i),be(r),h.head.appendChild(r)))}}function Ww(i){Cl.D(i),h_("dns-prefetch",i,null)}function Zw(i,r){Cl.C(i,r),h_("preconnect",i,r)}function Kw(i,r,u){Cl.L(i,r,u);var h=Rd;if(h&&i&&r){var b='link[rel="preload"][as="'+Hn(r)+'"]';r==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+Hn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+Hn(u.imageSizes)+'"]')):b+='[href="'+Hn(i)+'"]';var E=b;switch(r){case"style":E=Dd(i);break;case"script":E=Nd(i)}gr.has(E)||(i=x({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:i,as:r},u),gr.set(E,i),h.querySelector(b)!==null||r==="style"&&h.querySelector(Wp(E))||r==="script"&&h.querySelector(Zp(E))||(r=h.createElement("link"),ya(r,"link",i),be(r),h.head.appendChild(r)))}}function Qw(i,r){Cl.m(i,r);var u=Rd;if(u&&i){var h=r&&typeof r.as=="string"?r.as:"script",b='link[rel="modulepreload"][as="'+Hn(h)+'"][href="'+Hn(i)+'"]',E=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Nd(i)}if(!gr.has(E)&&(i=x({rel:"modulepreload",href:i},r),gr.set(E,i),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Zp(E)))return}h=u.createElement("link"),ya(h,"link",i),be(h),u.head.appendChild(h)}}}function Jw(i,r,u){Cl.S(i,r,u);var h=Rd;if(h&&i){var b=Ee(h).hoistableStyles,E=Dd(i);r=r||"default";var L=b.get(E);if(!L){var k={loading:0,preload:null};if(L=h.querySelector(Wp(E)))k.loading=5;else{i=x({rel:"stylesheet",href:i,"data-precedence":r},u),(u=gr.get(E))&&Vv(i,u);var ie=L=h.createElement("link");be(ie),ya(ie,"link",i),ie._p=new Promise(function(Se,Le){ie.onload=Se,ie.onerror=Le}),ie.addEventListener("load",function(){k.loading|=1}),ie.addEventListener("error",function(){k.loading|=2}),k.loading|=4,gg(L,r,h)}L={type:"stylesheet",instance:L,count:1,state:k},b.set(E,L)}}}function $w(i,r){Cl.X(i,r);var u=Rd;if(u&&i){var h=Ee(u).hoistableScripts,b=Nd(i),E=h.get(b);E||(E=u.querySelector(Zp(b)),E||(i=x({src:i,async:!0},r),(r=gr.get(b))&&Gv(i,r),E=u.createElement("script"),be(E),ya(E,"link",i),u.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(b,E))}}function eT(i,r){Cl.M(i,r);var u=Rd;if(u&&i){var h=Ee(u).hoistableScripts,b=Nd(i),E=h.get(b);E||(E=u.querySelector(Zp(b)),E||(i=x({src:i,async:!0,type:"module"},r),(r=gr.get(b))&&Gv(i,r),E=u.createElement("script"),be(E),ya(E,"link",i),u.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(b,E))}}function p_(i,r,u,h){var b=(b=le.current)?mg(b):null;if(!b)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=Dd(u.href),u=Ee(b).hoistableStyles,h=u.get(r),h||(h={type:"style",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Dd(u.href);var E=Ee(b).hoistableStyles,L=E.get(i);if(L||(b=b.ownerDocument||b,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(i,L),(E=b.querySelector(Wp(i)))&&!E._p&&(L.instance=E,L.state.loading=5),gr.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},gr.set(i,u),E||tT(b,i,u,L.state))),r&&h===null)throw Error(n(528,""));return L}if(r&&h!==null)throw Error(n(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Nd(u),u=Ee(b).hoistableScripts,h=u.get(r),h||(h={type:"script",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function Dd(i){return'href="'+Hn(i)+'"'}function Wp(i){return'link[rel="stylesheet"]['+i+"]"}function m_(i){return x({},i,{"data-precedence":i.precedence,precedence:null})}function tT(i,r,u,h){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=i.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),ya(r,"link",u),be(r),i.head.appendChild(r))}function Nd(i){return'[src="'+Hn(i)+'"]'}function Zp(i){return"script[async]"+i}function g_(i,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var h=i.querySelector('style[data-href~="'+Hn(u.href)+'"]');if(h)return r.instance=h,be(h),h;var b=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),be(h),ya(h,"style",b),gg(h,u.precedence,i),r.instance=h;case"stylesheet":b=Dd(u.href);var E=i.querySelector(Wp(b));if(E)return r.state.loading|=4,r.instance=E,be(E),E;h=m_(u),(b=gr.get(b))&&Vv(h,b),E=(i.ownerDocument||i).createElement("link"),be(E);var L=E;return L._p=new Promise(function(k,ie){L.onload=k,L.onerror=ie}),ya(E,"link",h),r.state.loading|=4,gg(E,u.precedence,i),r.instance=E;case"script":return E=Nd(u.src),(b=i.querySelector(Zp(E)))?(r.instance=b,be(b),b):(h=u,(b=gr.get(E))&&(h=x({},u),Gv(h,b)),i=i.ownerDocument||i,b=i.createElement("script"),be(b),ya(b,"link",h),i.head.appendChild(b),r.instance=b);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(h=r.instance,r.state.loading|=4,gg(h,u.precedence,i));return r.instance}function gg(i,r,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,E=b,L=0;L title"):null)}function nT(i,r,u){if(u===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function v_(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function iT(i,r,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Dd(h.href),E=r.querySelector(Wp(b));if(E){r=E._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=xg.bind(i),r.then(i,i)),u.state.loading|=4,u.instance=E,be(E);return}E=r.ownerDocument||r,h=m_(h),(b=gr.get(b))&&Vv(h,b),E=E.createElement("link"),be(E);var L=E;L._p=new Promise(function(k,ie){L.onload=k,L.onerror=ie}),ya(E,"link",h),u.instance=E}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=xg.bind(i),r.addEventListener("load",u),r.addEventListener("error",u))}}var Xv=0;function aT(i,r){return i.stylesheets&&i.count===0&&bg(i,i.stylesheets),0Xv?50:800)+r);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function xg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bg(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var vg=null;function bg(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,vg=new Map,r.forEach(sT,i),vg=null,xg.call(i))}function sT(i,r){if(!(r.state.loading&4)){var u=vg.get(i);if(u)var h=u.get(null);else{u=new Map,vg.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),e2.exports=AT(),e2.exports}var gA=MT();const yA=Q.createContext(null),ET=({children:a})=>{const[e,t]=Q.useState(!1),[n,s]=Q.useState(null),[o,f]=Q.useState(0),d=()=>f(m=>m+1),p=Q.useMemo(()=>({cameraLockedOnPlanet:e,setCameraLockedOnPlanet:t,activePlanetId:n,setActivePlanetId:s,homeRecenterToken:o,requestHomeRecenter:d}),[e,n,o]);return R.jsx(yA.Provider,{value:p,children:a})},Rx=()=>{const a=Q.useContext(yA);if(!a)throw new Error("usePlanetUI must be used within PlanetUIProvider");return a},xA=Q.createContext(null),wT=({children:a})=>{const[e,t]=Q.useState(!1),[n,s]=Q.useState(!0),[o,f]=Q.useState(!1),[d,p]=Q.useState(!0),[m,y]=Q.useState(!1),[x,v]=Q.useState("low"),[S,M]=Q.useState(!0),[T,w]=Q.useState("off"),[A,D]=Q.useState(!1),N=Q.useMemo(()=>({paused:e,setPaused:t,togglePaused:()=>t(U=>!U),showOrbits:n,setShowOrbits:s,toggleShowOrbits:()=>s(U=>!U),settingsOpen:o,setSettingsOpen:f,toggleSettingsOpen:()=>f(U=>!U),shadowsEnabled:d,setShadowsEnabled:p,toggleShadowsEnabled:()=>p(U=>!U),debugEnabled:m,setDebugEnabled:y,toggleDebugEnabled:()=>y(U=>!U),quality:x,setQuality:v,toggleQuality:()=>v(U=>U==="low"?"medium":U==="medium"?"high":"low"),throttlePhysics:T,setThrottlePhysics:w,toggleThrottlePhysics:()=>w(U=>U==="off"?"light":U==="light"?"aggressive":"off"),domHeavyActive:A,setDomHeavyActive:D,showMoons:S,setShowMoons:M,toggleShowMoons:()=>M(U=>!U)}),[e,n,o,d,m,x,S,T,A]);return R.jsx(xA.Provider,{value:N,children:a})},eo=()=>{const a=Q.useContext(xA);if(!a)throw new Error("useSettings must be used within a SettingsProvider");return a},vA=Q.createContext(null),TT=({children:a,measurementId:e})=>{const t=(...v)=>{typeof window<"u"&&typeof window.gtag=="function"&&window.gtag(...v)},n=Q.useCallback(v=>{t("event","navigate",{destination:v})},[]),s=Q.useCallback(v=>{v&&t("event","select_planet",{planet_id:v})},[]),o=Q.useCallback((v,S)=>{t("event","open_overlay",{type:v,id:S})},[]),f=Q.useCallback((v,S)=>{t("event","close_overlay",{type:v,id:S})},[]),d=Q.useCallback((v,S)=>{t("event","external_click",{platform:v,url:S})},[]),p=Q.useCallback((v,S)=>{t("event","setting_change",{setting:v,value:String(S)})},[]),m=Q.useCallback((v,S)=>{e&&t("config",e,{page_path:v,page_title:S||document.title})},[e]),y=Q.useCallback((v,S={})=>{e&&t("event",v,S)},[e]),x=Q.useMemo(()=>({trackPageView:m,trackEvent:y,trackNavigation:n,trackPlanetSelect:s,trackOverlayOpen:o,trackOverlayClose:f,trackExternalLink:d,trackSettingToggle:p}),[m,y,n,s,o,f,d,p]);return R.jsx(vA.Provider,{value:x,children:a})},bf=()=>{const a=Q.useContext(vA);if(!a)throw new Error("useGTag must be used within a GTagProvider");return a};var a2={exports:{}},Rl={};var V_;function CT(){return V_||(V_=1,Rl.ConcurrentRoot=1,Rl.ContinuousEventPriority=8,Rl.DefaultEventPriority=32,Rl.DiscreteEventPriority=2,Rl.IdleEventPriority=268435456,Rl.LegacyRoot=0,Rl.NoEventPriority=0),Rl}var G_;function RT(){return G_||(G_=1,a2.exports=CT()),a2.exports}var Cy=RT();const _h="181",af={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},sf={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},bA=0,mb=1,_A=2,DT=3,SA=0,Dx=1,v0=2,Zr=3,Hl=0,Ma=1,Qr=2,Go=0,df=1,Uy=2,gb=3,yb=4,AA=5,Ic=100,MA=101,EA=102,wA=103,TA=104,CA=200,RA=201,DA=202,NA=203,Ly=204,zy=205,OA=206,UA=207,LA=208,zA=209,PA=210,BA=211,IA=212,FA=213,jA=214,Py=0,By=1,Iy=2,yf=3,Fy=4,jy=5,Hy=6,ky=7,Z0=0,HA=1,kA=2,Xo=0,VA=1,GA=2,XA=3,Hb=4,qA=5,YA=6,WA=7,xb="attached",ZA="detached",Nx=300,kl=301,Hc=302,D0=303,N0=304,Sh=306,O0=1e3,Aa=1001,U0=1002,Ea=1003,kb=1004,NT=1004,ih=1005,OT=1005,Ui=1006,b0=1007,UT=1007,ko=1008,LT=1008,xr=1009,Vb=1010,Gb=1011,lh=1012,Ox=1013,Vl=1014,Rs=1015,_f=1016,Ux=1017,Lx=1018,ch=1020,Xb=35902,qb=35899,Yb=1021,Wb=1022,Ha=1023,uh=1026,fh=1027,zx=1028,K0=1029,Px=1030,Bx=1031,zT=1032,Ix=1033,_0=33776,S0=33777,A0=33778,M0=33779,Vy=35840,Gy=35841,Xy=35842,qy=35843,Yy=36196,Wy=37492,Zy=37496,Ky=37808,Qy=37809,Jy=37810,$y=37811,ex=37812,tx=37813,nx=37814,ix=37815,ax=37816,sx=37817,rx=37818,ox=37819,lx=37820,cx=37821,ux=36492,fx=36494,dx=36495,hx=36283,px=36284,mx=36285,gx=36286,KA=2200,QA=2201,JA=2202,L0=2300,yx=2301,Ry=2302,lf=2400,cf=2401,z0=2402,Fx=2500,Zb=2501,PT=0,BT=1,IT=2,$A=3200,eM=3201,FT=3202,jT=3203,Xc=0,tM=1,Il="",_a="srgb",kc="srgb-linear",P0="linear",Gn="srgb",HT=0,rf=7680,kT=7681,VT=7682,GT=7683,XT=34055,qT=34056,YT=5386,WT=512,ZT=513,KT=514,QT=515,JT=516,$T=517,eC=518,vb=519,nM=512,iM=513,aM=514,Kb=515,sM=516,rM=517,oM=518,lM=519,B0=35044,hf=35048,tC=35040,nC=35045,iC=35049,aC=35041,sC=35046,rC=35050,oC=35042,lC="100",bb="300 es",Ws=2e3,dh=2001,cC={COMPUTE:"compute",RENDER:"render"},uC={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},fC={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function cM(a){for(let e=a.length-1;e>=0;--e)if(a[e]>=65535)return!0;return!1}const dC={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ah(a,e){return new dC[a](e)}function I0(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}function uM(){const a=I0("canvas");return a.style.display="block",a}const X_={};let Vc=null;function hC(a){Vc=a}function pC(){return Vc}function F0(...a){const e="THREE."+a.shift();Vc?Vc("log",e,...a):console.log(e,...a)}function mt(...a){const e="THREE."+a.shift();Vc?Vc("warn",e,...a):console.warn(e,...a)}function Yt(...a){const e="THREE."+a.shift();Vc?Vc("error",e,...a):console.error(e,...a)}function hh(...a){const e=a.join(" ");e in X_||(X_[e]=!0,mt(...a))}function mC(a,e,t){return new Promise(function(n,s){function o(){switch(a.clientWaitSync(e,a.SYNC_FLUSH_COMMANDS_BIT,0)){case a.WAIT_FAILED:s();break;case a.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:n()}}setTimeout(o,t)})}let Zo=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let o=0,f=s.length;o>8&255]+Ia[a>>16&255]+Ia[a>>24&255]+"-"+Ia[e&255]+Ia[e>>8&255]+"-"+Ia[e>>16&15|64]+Ia[e>>24&255]+"-"+Ia[t&63|128]+Ia[t>>8&255]+"-"+Ia[t>>16&255]+Ia[t>>24&255]+Ia[n&255]+Ia[n>>8&255]+Ia[n>>16&255]+Ia[n>>24&255]).toLowerCase()}function Xt(a,e,t){return Math.max(e,Math.min(t,a))}function Qb(a,e){return(a%e+e)%e}function gC(a,e,t,n,s){return n+(a-e)*(s-n)/(t-e)}function yC(a,e,t){return a!==e?(t-a)/(e-a):0}function E0(a,e,t){return(1-t)*a+t*e}function xC(a,e,t,n){return E0(a,e,1-Math.exp(-t*n))}function vC(a,e=1){return e-Math.abs(Qb(a,e*2)-e)}function bC(a,e,t){return a<=e?0:a>=t?1:(a=(a-e)/(t-e),a*a*(3-2*a))}function _C(a,e,t){return a<=e?0:a>=t?1:(a=(a-e)/(t-e),a*a*a*(a*(a*6-15)+10))}function SC(a,e){return a+Math.floor(Math.random()*(e-a+1))}function AC(a,e){return a+Math.random()*(e-a)}function MC(a){return a*(.5-Math.random())}function EC(a){a!==void 0&&(q_=a);let e=q_+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function wC(a){return a*pf}function TC(a){return a*ph}function CC(a){return(a&a-1)===0&&a!==0}function RC(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function DC(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}function NC(a,e,t,n,s){const o=Math.cos,f=Math.sin,d=o(t/2),p=f(t/2),m=o((e+n)/2),y=f((e+n)/2),x=o((e-n)/2),v=f((e-n)/2),S=o((n-e)/2),M=f((n-e)/2);switch(s){case"XYX":a.set(d*y,p*x,p*v,d*m);break;case"YZY":a.set(p*v,d*y,p*x,d*m);break;case"ZXZ":a.set(p*x,p*v,d*y,d*m);break;case"XZX":a.set(d*y,p*M,p*S,d*m);break;case"YXY":a.set(p*S,d*y,p*M,d*m);break;case"ZYZ":a.set(p*M,p*S,d*y,d*m);break;default:mt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function fs(a,e){switch(e.constructor){case Float32Array:return a;case Uint32Array:return a/4294967295;case Uint16Array:return a/65535;case Uint8Array:return a/255;case Int32Array:return Math.max(a/2147483647,-1);case Int16Array:return Math.max(a/32767,-1);case Int8Array:return Math.max(a/127,-1);default:throw new Error("Invalid component type.")}}function an(a,e){switch(e.constructor){case Float32Array:return a;case Uint32Array:return Math.round(a*4294967295);case Uint16Array:return Math.round(a*65535);case Uint8Array:return Math.round(a*255);case Int32Array:return Math.round(a*2147483647);case Int16Array:return Math.round(a*32767);case Int8Array:return Math.round(a*127);default:throw new Error("Invalid component type.")}}const Q0={DEG2RAD:pf,RAD2DEG:ph,generateUUID:Ks,clamp:Xt,euclideanModulo:Qb,mapLinear:gC,inverseLerp:yC,lerp:E0,damp:xC,pingpong:vC,smoothstep:bC,smootherstep:_C,randInt:SC,randFloat:AC,randFloatSpread:MC,seededRandom:EC,degToRad:wC,radToDeg:TC,isPowerOfTwo:CC,ceilPowerOfTwo:RC,floorPowerOfTwo:DC,setQuaternionFromProperEuler:NC,normalize:an,denormalize:fs};class ze{constructor(e=0,t=0){ze.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),o=this.x-e.x,f=this.y-e.y;return this.x=o*n-f*s+e.x,this.y=o*s+f*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ka{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,o,f,d){let p=n[s+0],m=n[s+1],y=n[s+2],x=n[s+3],v=o[f+0],S=o[f+1],M=o[f+2],T=o[f+3];if(d<=0){e[t+0]=p,e[t+1]=m,e[t+2]=y,e[t+3]=x;return}if(d>=1){e[t+0]=v,e[t+1]=S,e[t+2]=M,e[t+3]=T;return}if(x!==T||p!==v||m!==S||y!==M){let w=p*v+m*S+y*M+x*T;w<0&&(v=-v,S=-S,M=-M,T=-T,w=-w);let A=1-d;if(w<.9995){const D=Math.acos(w),N=Math.sin(D);A=Math.sin(A*D)/N,d=Math.sin(d*D)/N,p=p*A+v*d,m=m*A+S*d,y=y*A+M*d,x=x*A+T*d}else{p=p*A+v*d,m=m*A+S*d,y=y*A+M*d,x=x*A+T*d;const D=1/Math.sqrt(p*p+m*m+y*y+x*x);p*=D,m*=D,y*=D,x*=D}}e[t]=p,e[t+1]=m,e[t+2]=y,e[t+3]=x}static multiplyQuaternionsFlat(e,t,n,s,o,f){const d=n[s],p=n[s+1],m=n[s+2],y=n[s+3],x=o[f],v=o[f+1],S=o[f+2],M=o[f+3];return e[t]=d*M+y*x+p*S-m*v,e[t+1]=p*M+y*v+m*x-d*S,e[t+2]=m*M+y*S+d*v-p*x,e[t+3]=y*M-d*x-p*v-m*S,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,o=e._z,f=e._order,d=Math.cos,p=Math.sin,m=d(n/2),y=d(s/2),x=d(o/2),v=p(n/2),S=p(s/2),M=p(o/2);switch(f){case"XYZ":this._x=v*y*x+m*S*M,this._y=m*S*x-v*y*M,this._z=m*y*M+v*S*x,this._w=m*y*x-v*S*M;break;case"YXZ":this._x=v*y*x+m*S*M,this._y=m*S*x-v*y*M,this._z=m*y*M-v*S*x,this._w=m*y*x+v*S*M;break;case"ZXY":this._x=v*y*x-m*S*M,this._y=m*S*x+v*y*M,this._z=m*y*M+v*S*x,this._w=m*y*x-v*S*M;break;case"ZYX":this._x=v*y*x-m*S*M,this._y=m*S*x+v*y*M,this._z=m*y*M-v*S*x,this._w=m*y*x+v*S*M;break;case"YZX":this._x=v*y*x+m*S*M,this._y=m*S*x+v*y*M,this._z=m*y*M-v*S*x,this._w=m*y*x-v*S*M;break;case"XZY":this._x=v*y*x-m*S*M,this._y=m*S*x-v*y*M,this._z=m*y*M+v*S*x,this._w=m*y*x+v*S*M;break;default:mt("Quaternion: .setFromEuler() encountered an unknown order: "+f)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],o=t[8],f=t[1],d=t[5],p=t[9],m=t[2],y=t[6],x=t[10],v=n+d+x;if(v>0){const S=.5/Math.sqrt(v+1);this._w=.25/S,this._x=(y-p)*S,this._y=(o-m)*S,this._z=(f-s)*S}else if(n>d&&n>x){const S=2*Math.sqrt(1+n-d-x);this._w=(y-p)/S,this._x=.25*S,this._y=(s+f)/S,this._z=(o+m)/S}else if(d>x){const S=2*Math.sqrt(1+d-n-x);this._w=(o-m)/S,this._x=(s+f)/S,this._y=.25*S,this._z=(p+y)/S}else{const S=2*Math.sqrt(1+x-n-d);this._w=(f-s)/S,this._x=(o+m)/S,this._y=(p+y)/S,this._z=.25*S}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,o=e._z,f=e._w,d=t._x,p=t._y,m=t._z,y=t._w;return this._x=n*y+f*d+s*m-o*p,this._y=s*y+f*p+o*d-n*m,this._z=o*y+f*m+n*p-s*d,this._w=f*y-n*d-s*p-o*m,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,s=e._y,o=e._z,f=e._w,d=this.dot(e);d<0&&(n=-n,s=-s,o=-o,f=-f,d=-d);let p=1-t;if(d<.9995){const m=Math.acos(d),y=Math.sin(m);p=Math.sin(p*m)/y,t=Math.sin(t*m)/y,this._x=this._x*p+n*t,this._y=this._y*p+s*t,this._z=this._z*p+o*t,this._w=this._w*p+f*t,this._onChangeCallback()}else this._x=this._x*p+n*t,this._y=this._y*p+s*t,this._z=this._z*p+o*t,this._w=this._w*p+f*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class X{constructor(e=0,t=0,n=0){X.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Y_.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Y_.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*s,this.y=o[1]*t+o[4]*n+o[7]*s,this.z=o[2]*t+o[5]*n+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,o=e.elements,f=1/(o[3]*t+o[7]*n+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*s+o[12])*f,this.y=(o[1]*t+o[5]*n+o[9]*s+o[13])*f,this.z=(o[2]*t+o[6]*n+o[10]*s+o[14])*f,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,o=e.x,f=e.y,d=e.z,p=e.w,m=2*(f*s-d*n),y=2*(d*t-o*s),x=2*(o*n-f*t);return this.x=t+p*m+f*x-d*y,this.y=n+p*y+d*m-o*x,this.z=s+p*x+o*y-f*m,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*s,this.y=o[1]*t+o[5]*n+o[9]*s,this.z=o[2]*t+o[6]*n+o[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this.z=Xt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this.z=Xt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,o=e.z,f=t.x,d=t.y,p=t.z;return this.x=s*p-o*d,this.y=o*f-n*p,this.z=n*d-s*f,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return s2.copy(this).projectOnVector(e),this.sub(s2)}reflect(e){return this.sub(s2.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const s2=new X,Y_=new ka;class en{constructor(e,t,n,s,o,f,d,p,m){en.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,o,f,d,p,m)}set(e,t,n,s,o,f,d,p,m){const y=this.elements;return y[0]=e,y[1]=s,y[2]=d,y[3]=t,y[4]=o,y[5]=p,y[6]=n,y[7]=f,y[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,o=this.elements,f=n[0],d=n[3],p=n[6],m=n[1],y=n[4],x=n[7],v=n[2],S=n[5],M=n[8],T=s[0],w=s[3],A=s[6],D=s[1],N=s[4],U=s[7],I=s[2],z=s[5],j=s[8];return o[0]=f*T+d*D+p*I,o[3]=f*w+d*N+p*z,o[6]=f*A+d*U+p*j,o[1]=m*T+y*D+x*I,o[4]=m*w+y*N+x*z,o[7]=m*A+y*U+x*j,o[2]=v*T+S*D+M*I,o[5]=v*w+S*N+M*z,o[8]=v*A+S*U+M*j,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],f=e[4],d=e[5],p=e[6],m=e[7],y=e[8];return t*f*y-t*d*m-n*o*y+n*d*p+s*o*m-s*f*p}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],f=e[4],d=e[5],p=e[6],m=e[7],y=e[8],x=y*f-d*m,v=d*p-y*o,S=m*o-f*p,M=t*x+n*v+s*S;if(M===0)return this.set(0,0,0,0,0,0,0,0,0);const T=1/M;return e[0]=x*T,e[1]=(s*m-y*n)*T,e[2]=(d*n-s*f)*T,e[3]=v*T,e[4]=(y*t-s*p)*T,e[5]=(s*o-d*t)*T,e[6]=S*T,e[7]=(n*p-m*t)*T,e[8]=(f*t-n*o)*T,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,o,f,d){const p=Math.cos(o),m=Math.sin(o);return this.set(n*p,n*m,-n*(p*f+m*d)+f+e,-s*m,s*p,-s*(-m*f+p*d)+d+t,0,0,1),this}scale(e,t){return this.premultiply(r2.makeScale(e,t)),this}rotate(e){return this.premultiply(r2.makeRotation(-e)),this}translate(e,t){return this.premultiply(r2.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const r2=new en,W_=new en().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Z_=new en().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function OC(){const a={enabled:!0,workingColorSpace:kc,spaces:{},convert:function(s,o,f){return this.enabled===!1||o===f||!o||!f||(this.spaces[o].transfer===Gn&&(s.r=jl(s.r),s.g=jl(s.g),s.b=jl(s.b)),this.spaces[o].primaries!==this.spaces[f].primaries&&(s.applyMatrix3(this.spaces[o].toXYZ),s.applyMatrix3(this.spaces[f].fromXYZ)),this.spaces[f].transfer===Gn&&(s.r=rh(s.r),s.g=rh(s.g),s.b=rh(s.b))),s},workingToColorSpace:function(s,o){return this.convert(s,this.workingColorSpace,o)},colorSpaceToWorking:function(s,o){return this.convert(s,o,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Il?P0:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,o=this.workingColorSpace){return s.fromArray(this.spaces[o].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,o,f){return s.copy(this.spaces[o].toXYZ).multiply(this.spaces[f].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,o){return hh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(s,o)},toWorkingColorSpace:function(s,o){return hh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(s,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return a.define({[kc]:{primaries:e,whitePoint:n,transfer:P0,toXYZ:W_,fromXYZ:Z_,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:_a},outputColorSpaceConfig:{drawingBufferColorSpace:_a}},[_a]:{primaries:e,whitePoint:n,transfer:Gn,toXYZ:W_,fromXYZ:Z_,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:_a}}}),a}const wn=OC();function jl(a){return a<.04045?a*.0773993808:Math.pow(a*.9478672986+.0521327014,2.4)}function rh(a){return a<.0031308?a*12.92:1.055*Math.pow(a,.41666)-.055}let Ud;class fM{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ud===void 0&&(Ud=I0("canvas")),Ud.width=e.width,Ud.height=e.height;const s=Ud.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=Ud}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=I0("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),o=s.data;for(let f=0;f1),this.pmremVersion=0}get width(){return this.source.getSize(l2).x}get height(){return this.source.getSize(l2).y}get depth(){return this.source.getSize(l2).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){mt(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){mt(`Texture.setValues(): property '${t}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Nx)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case O0:e.x=e.x-Math.floor(e.x);break;case Aa:e.x=e.x<0?0:1;break;case U0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case O0:e.y=e.y-Math.floor(e.y);break;case Aa:e.y=e.y<0?0:1;break;case U0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ui.DEFAULT_IMAGE=null;ui.DEFAULT_MAPPING=Nx;ui.DEFAULT_ANISOTROPY=1;class un{constructor(e=0,t=0,n=0,s=1){un.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,o=this.w,f=e.elements;return this.x=f[0]*t+f[4]*n+f[8]*s+f[12]*o,this.y=f[1]*t+f[5]*n+f[9]*s+f[13]*o,this.z=f[2]*t+f[6]*n+f[10]*s+f[14]*o,this.w=f[3]*t+f[7]*n+f[11]*s+f[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,o;const p=e.elements,m=p[0],y=p[4],x=p[8],v=p[1],S=p[5],M=p[9],T=p[2],w=p[6],A=p[10];if(Math.abs(y-v)<.01&&Math.abs(x-T)<.01&&Math.abs(M-w)<.01){if(Math.abs(y+v)<.1&&Math.abs(x+T)<.1&&Math.abs(M+w)<.1&&Math.abs(m+S+A-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const N=(m+1)/2,U=(S+1)/2,I=(A+1)/2,z=(y+v)/4,j=(x+T)/4,q=(M+w)/4;return N>U&&N>I?N<.01?(n=0,s=.707106781,o=.707106781):(n=Math.sqrt(N),s=z/n,o=j/n):U>I?U<.01?(n=.707106781,s=0,o=.707106781):(s=Math.sqrt(U),n=z/s,o=q/s):I<.01?(n=.707106781,s=.707106781,o=0):(o=Math.sqrt(I),n=j/o,s=q/o),this.set(n,s,o,t),this}let D=Math.sqrt((w-M)*(w-M)+(x-T)*(x-T)+(v-y)*(v-y));return Math.abs(D)<.001&&(D=1),this.x=(w-M)/D,this.y=(x-T)/D,this.z=(v-y)/D,this.w=Math.acos((m+S+A-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this.z=Xt(this.z,e.z,t.z),this.w=Xt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this.z=Xt(this.z,e,t),this.w=Xt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Jb extends Zo{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ui,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new un(0,0,e,t),this.scissorTest=!1,this.viewport=new un(0,0,e,t);const s={width:e,height:t,depth:n.depth},o=new ui(s);this.textures=[];const f=n.count;for(let d=0;d1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Xr),Xr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(n0),Rg.subVectors(this.max,n0),Ld.subVectors(e.a,n0),zd.subVectors(e.b,n0),Pd.subVectors(e.c,n0),Dc.subVectors(zd,Ld),Nc.subVectors(Pd,zd),ku.subVectors(Ld,Pd);let t=[0,-Dc.z,Dc.y,0,-Nc.z,Nc.y,0,-ku.z,ku.y,Dc.z,0,-Dc.x,Nc.z,0,-Nc.x,ku.z,0,-ku.x,-Dc.y,Dc.x,0,-Nc.y,Nc.x,0,-ku.y,ku.x,0];return!c2(t,Ld,zd,Pd,Rg)||(t=[1,0,0,0,1,0,0,0,1],!c2(t,Ld,zd,Pd,Rg))?!1:(Dg.crossVectors(Dc,Nc),t=[Dg.x,Dg.y,Dg.z],c2(t,Ld,zd,Pd,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Xr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Xr).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Dl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Dl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Dl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Dl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Dl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Dl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Dl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Dl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Dl),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Dl=[new X,new X,new X,new X,new X,new X,new X,new X],Xr=new X,Cg=new Zi,Ld=new X,zd=new X,Pd=new X,Dc=new X,Nc=new X,ku=new X,n0=new X,Rg=new X,Dg=new X,Vu=new X;function c2(a,e,t,n,s){for(let o=0,f=a.length-3;o<=f;o+=3){Vu.fromArray(a,o);const d=s.x*Math.abs(Vu.x)+s.y*Math.abs(Vu.y)+s.z*Math.abs(Vu.z),p=e.dot(Vu),m=t.dot(Vu),y=n.dot(Vu);if(Math.max(-Math.max(p,m,y),Math.min(p,m,y))>d)return!1}return!0}const BC=new Zi,i0=new X,u2=new X;class Ki{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):BC.setFromPoints(e).getCenter(n);let s=0;for(let o=0,f=e.length;othis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;i0.subVectors(e,this.center);const t=i0.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(i0,s/n),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(u2.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(i0.copy(e.center).add(u2)),this.expandByPoint(i0.copy(e.center).sub(u2))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Nl=new X,f2=new X,Ng=new X,Oc=new X,d2=new X,Og=new X,h2=new X;class Sf{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Nl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Nl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Nl.copy(this.origin).addScaledVector(this.direction,t),Nl.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){f2.copy(e).add(t).multiplyScalar(.5),Ng.copy(t).sub(e).normalize(),Oc.copy(this.origin).sub(f2);const o=e.distanceTo(t)*.5,f=-this.direction.dot(Ng),d=Oc.dot(this.direction),p=-Oc.dot(Ng),m=Oc.lengthSq(),y=Math.abs(1-f*f);let x,v,S,M;if(y>0)if(x=f*p-d,v=f*d-p,M=o*y,x>=0)if(v>=-M)if(v<=M){const T=1/y;x*=T,v*=T,S=x*(x+f*v+2*d)+v*(f*x+v+2*p)+m}else v=o,x=Math.max(0,-(f*v+d)),S=-x*x+v*(v+2*p)+m;else v=-o,x=Math.max(0,-(f*v+d)),S=-x*x+v*(v+2*p)+m;else v<=-M?(x=Math.max(0,-(-f*o+d)),v=x>0?-o:Math.min(Math.max(-o,-p),o),S=-x*x+v*(v+2*p)+m):v<=M?(x=0,v=Math.min(Math.max(-o,-p),o),S=v*(v+2*p)+m):(x=Math.max(0,-(f*o+d)),v=x>0?o:Math.min(Math.max(-o,-p),o),S=-x*x+v*(v+2*p)+m);else v=f>0?-o:o,x=Math.max(0,-(f*v+d)),S=-x*x+v*(v+2*p)+m;return n&&n.copy(this.origin).addScaledVector(this.direction,x),s&&s.copy(f2).addScaledVector(Ng,v),S}intersectSphere(e,t){Nl.subVectors(e.center,this.origin);const n=Nl.dot(this.direction),s=Nl.dot(Nl)-n*n,o=e.radius*e.radius;if(s>o)return null;const f=Math.sqrt(o-s),d=n-f,p=n+f;return p<0?null:d<0?this.at(p,t):this.at(d,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,o,f,d,p;const m=1/this.direction.x,y=1/this.direction.y,x=1/this.direction.z,v=this.origin;return m>=0?(n=(e.min.x-v.x)*m,s=(e.max.x-v.x)*m):(n=(e.max.x-v.x)*m,s=(e.min.x-v.x)*m),y>=0?(o=(e.min.y-v.y)*y,f=(e.max.y-v.y)*y):(o=(e.max.y-v.y)*y,f=(e.min.y-v.y)*y),n>f||o>s||((o>n||isNaN(n))&&(n=o),(f=0?(d=(e.min.z-v.z)*x,p=(e.max.z-v.z)*x):(d=(e.max.z-v.z)*x,p=(e.min.z-v.z)*x),n>p||d>s)||((d>n||n!==n)&&(n=d),(p=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,Nl)!==null}intersectTriangle(e,t,n,s,o){d2.subVectors(t,e),Og.subVectors(n,e),h2.crossVectors(d2,Og);let f=this.direction.dot(h2),d;if(f>0){if(s)return null;d=1}else if(f<0)d=-1,f=-f;else return null;Oc.subVectors(this.origin,e);const p=d*this.direction.dot(Og.crossVectors(Oc,Og));if(p<0)return null;const m=d*this.direction.dot(d2.cross(Oc));if(m<0||p+m>f)return null;const y=-d*Oc.dot(h2);return y<0?null:this.at(y/f,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Gt{constructor(e,t,n,s,o,f,d,p,m,y,x,v,S,M,T,w){Gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,o,f,d,p,m,y,x,v,S,M,T,w)}set(e,t,n,s,o,f,d,p,m,y,x,v,S,M,T,w){const A=this.elements;return A[0]=e,A[4]=t,A[8]=n,A[12]=s,A[1]=o,A[5]=f,A[9]=d,A[13]=p,A[2]=m,A[6]=y,A[10]=x,A[14]=v,A[3]=S,A[7]=M,A[11]=T,A[15]=w,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Gt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/Bd.setFromMatrixColumn(e,0).length(),o=1/Bd.setFromMatrixColumn(e,1).length(),f=1/Bd.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*f,t[9]=n[9]*f,t[10]=n[10]*f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,o=e.z,f=Math.cos(n),d=Math.sin(n),p=Math.cos(s),m=Math.sin(s),y=Math.cos(o),x=Math.sin(o);if(e.order==="XYZ"){const v=f*y,S=f*x,M=d*y,T=d*x;t[0]=p*y,t[4]=-p*x,t[8]=m,t[1]=S+M*m,t[5]=v-T*m,t[9]=-d*p,t[2]=T-v*m,t[6]=M+S*m,t[10]=f*p}else if(e.order==="YXZ"){const v=p*y,S=p*x,M=m*y,T=m*x;t[0]=v+T*d,t[4]=M*d-S,t[8]=f*m,t[1]=f*x,t[5]=f*y,t[9]=-d,t[2]=S*d-M,t[6]=T+v*d,t[10]=f*p}else if(e.order==="ZXY"){const v=p*y,S=p*x,M=m*y,T=m*x;t[0]=v-T*d,t[4]=-f*x,t[8]=M+S*d,t[1]=S+M*d,t[5]=f*y,t[9]=T-v*d,t[2]=-f*m,t[6]=d,t[10]=f*p}else if(e.order==="ZYX"){const v=f*y,S=f*x,M=d*y,T=d*x;t[0]=p*y,t[4]=M*m-S,t[8]=v*m+T,t[1]=p*x,t[5]=T*m+v,t[9]=S*m-M,t[2]=-m,t[6]=d*p,t[10]=f*p}else if(e.order==="YZX"){const v=f*p,S=f*m,M=d*p,T=d*m;t[0]=p*y,t[4]=T-v*x,t[8]=M*x+S,t[1]=x,t[5]=f*y,t[9]=-d*y,t[2]=-m*y,t[6]=S*x+M,t[10]=v-T*x}else if(e.order==="XZY"){const v=f*p,S=f*m,M=d*p,T=d*m;t[0]=p*y,t[4]=-x,t[8]=m*y,t[1]=v*x+T,t[5]=f*y,t[9]=S*x-M,t[2]=M*x-S,t[6]=d*y,t[10]=T*x+v}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(IC,e,FC)}lookAt(e,t,n){const s=this.elements;return Gs.subVectors(e,t),Gs.lengthSq()===0&&(Gs.z=1),Gs.normalize(),Uc.crossVectors(n,Gs),Uc.lengthSq()===0&&(Math.abs(n.z)===1?Gs.x+=1e-4:Gs.z+=1e-4,Gs.normalize(),Uc.crossVectors(n,Gs)),Uc.normalize(),Ug.crossVectors(Gs,Uc),s[0]=Uc.x,s[4]=Ug.x,s[8]=Gs.x,s[1]=Uc.y,s[5]=Ug.y,s[9]=Gs.y,s[2]=Uc.z,s[6]=Ug.z,s[10]=Gs.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,o=this.elements,f=n[0],d=n[4],p=n[8],m=n[12],y=n[1],x=n[5],v=n[9],S=n[13],M=n[2],T=n[6],w=n[10],A=n[14],D=n[3],N=n[7],U=n[11],I=n[15],z=s[0],j=s[4],q=s[8],B=s[12],P=s[1],W=s[5],se=s[9],ae=s[13],ce=s[2],ue=s[6],V=s[10],$=s[14],J=s[3],he=s[7],ve=s[11],Y=s[15];return o[0]=f*z+d*P+p*ce+m*J,o[4]=f*j+d*W+p*ue+m*he,o[8]=f*q+d*se+p*V+m*ve,o[12]=f*B+d*ae+p*$+m*Y,o[1]=y*z+x*P+v*ce+S*J,o[5]=y*j+x*W+v*ue+S*he,o[9]=y*q+x*se+v*V+S*ve,o[13]=y*B+x*ae+v*$+S*Y,o[2]=M*z+T*P+w*ce+A*J,o[6]=M*j+T*W+w*ue+A*he,o[10]=M*q+T*se+w*V+A*ve,o[14]=M*B+T*ae+w*$+A*Y,o[3]=D*z+N*P+U*ce+I*J,o[7]=D*j+N*W+U*ue+I*he,o[11]=D*q+N*se+U*V+I*ve,o[15]=D*B+N*ae+U*$+I*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],o=e[12],f=e[1],d=e[5],p=e[9],m=e[13],y=e[2],x=e[6],v=e[10],S=e[14],M=e[3],T=e[7],w=e[11],A=e[15];return M*(+o*p*x-s*m*x-o*d*v+n*m*v+s*d*S-n*p*S)+T*(+t*p*S-t*m*v+o*f*v-s*f*S+s*m*y-o*p*y)+w*(+t*m*x-t*d*S-o*f*x+n*f*S+o*d*y-n*m*y)+A*(-s*d*y-t*p*x+t*d*v+s*f*x-n*f*v+n*p*y)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],f=e[4],d=e[5],p=e[6],m=e[7],y=e[8],x=e[9],v=e[10],S=e[11],M=e[12],T=e[13],w=e[14],A=e[15],D=x*w*m-T*v*m+T*p*S-d*w*S-x*p*A+d*v*A,N=M*v*m-y*w*m-M*p*S+f*w*S+y*p*A-f*v*A,U=y*T*m-M*x*m+M*d*S-f*T*S-y*d*A+f*x*A,I=M*x*p-y*T*p-M*d*v+f*T*v+y*d*w-f*x*w,z=t*D+n*N+s*U+o*I;if(z===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const j=1/z;return e[0]=D*j,e[1]=(T*v*o-x*w*o-T*s*S+n*w*S+x*s*A-n*v*A)*j,e[2]=(d*w*o-T*p*o+T*s*m-n*w*m-d*s*A+n*p*A)*j,e[3]=(x*p*o-d*v*o-x*s*m+n*v*m+d*s*S-n*p*S)*j,e[4]=N*j,e[5]=(y*w*o-M*v*o+M*s*S-t*w*S-y*s*A+t*v*A)*j,e[6]=(M*p*o-f*w*o-M*s*m+t*w*m+f*s*A-t*p*A)*j,e[7]=(f*v*o-y*p*o+y*s*m-t*v*m-f*s*S+t*p*S)*j,e[8]=U*j,e[9]=(M*x*o-y*T*o-M*n*S+t*T*S+y*n*A-t*x*A)*j,e[10]=(f*T*o-M*d*o+M*n*m-t*T*m-f*n*A+t*d*A)*j,e[11]=(y*d*o-f*x*o-y*n*m+t*x*m+f*n*S-t*d*S)*j,e[12]=I*j,e[13]=(y*T*s-M*x*s+M*n*v-t*T*v-y*n*w+t*x*w)*j,e[14]=(M*d*s-f*T*s-M*n*p+t*T*p+f*n*w-t*d*w)*j,e[15]=(f*x*s-y*d*s+y*n*p-t*x*p-f*n*v+t*d*v)*j,this}scale(e){const t=this.elements,n=e.x,s=e.y,o=e.z;return t[0]*=n,t[4]*=s,t[8]*=o,t[1]*=n,t[5]*=s,t[9]*=o,t[2]*=n,t[6]*=s,t[10]*=o,t[3]*=n,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),o=1-n,f=e.x,d=e.y,p=e.z,m=o*f,y=o*d;return this.set(m*f+n,m*d-s*p,m*p+s*d,0,m*d+s*p,y*d+n,y*p-s*f,0,m*p-s*d,y*p+s*f,o*p*p+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,o,f){return this.set(1,n,o,0,e,1,f,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,o=t._x,f=t._y,d=t._z,p=t._w,m=o+o,y=f+f,x=d+d,v=o*m,S=o*y,M=o*x,T=f*y,w=f*x,A=d*x,D=p*m,N=p*y,U=p*x,I=n.x,z=n.y,j=n.z;return s[0]=(1-(T+A))*I,s[1]=(S+U)*I,s[2]=(M-N)*I,s[3]=0,s[4]=(S-U)*z,s[5]=(1-(v+A))*z,s[6]=(w+D)*z,s[7]=0,s[8]=(M+N)*j,s[9]=(w-D)*j,s[10]=(1-(v+T))*j,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let o=Bd.set(s[0],s[1],s[2]).length();const f=Bd.set(s[4],s[5],s[6]).length(),d=Bd.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],qr.copy(this);const m=1/o,y=1/f,x=1/d;return qr.elements[0]*=m,qr.elements[1]*=m,qr.elements[2]*=m,qr.elements[4]*=y,qr.elements[5]*=y,qr.elements[6]*=y,qr.elements[8]*=x,qr.elements[9]*=x,qr.elements[10]*=x,t.setFromRotationMatrix(qr),n.x=o,n.y=f,n.z=d,this}makePerspective(e,t,n,s,o,f,d=Ws,p=!1){const m=this.elements,y=2*o/(t-e),x=2*o/(n-s),v=(t+e)/(t-e),S=(n+s)/(n-s);let M,T;if(p)M=o/(f-o),T=f*o/(f-o);else if(d===Ws)M=-(f+o)/(f-o),T=-2*f*o/(f-o);else if(d===dh)M=-f/(f-o),T=-f*o/(f-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return m[0]=y,m[4]=0,m[8]=v,m[12]=0,m[1]=0,m[5]=x,m[9]=S,m[13]=0,m[2]=0,m[6]=0,m[10]=M,m[14]=T,m[3]=0,m[7]=0,m[11]=-1,m[15]=0,this}makeOrthographic(e,t,n,s,o,f,d=Ws,p=!1){const m=this.elements,y=2/(t-e),x=2/(n-s),v=-(t+e)/(t-e),S=-(n+s)/(n-s);let M,T;if(p)M=1/(f-o),T=f/(f-o);else if(d===Ws)M=-2/(f-o),T=-(f+o)/(f-o);else if(d===dh)M=-1/(f-o),T=-o/(f-o);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return m[0]=y,m[4]=0,m[8]=0,m[12]=v,m[1]=0,m[5]=x,m[9]=0,m[13]=S,m[2]=0,m[6]=0,m[10]=M,m[14]=T,m[3]=0,m[7]=0,m[11]=0,m[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Bd=new X,qr=new Gt,IC=new X(0,0,0),FC=new X(1,1,1),Uc=new X,Ug=new X,Gs=new X,K_=new Gt,Q_=new ka;class ds{constructor(e=0,t=0,n=0,s=ds.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,o=s[0],f=s[4],d=s[8],p=s[1],m=s[5],y=s[9],x=s[2],v=s[6],S=s[10];switch(t){case"XYZ":this._y=Math.asin(Xt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-y,S),this._z=Math.atan2(-f,o)):(this._x=Math.atan2(v,m),this._z=0);break;case"YXZ":this._x=Math.asin(-Xt(y,-1,1)),Math.abs(y)<.9999999?(this._y=Math.atan2(d,S),this._z=Math.atan2(p,m)):(this._y=Math.atan2(-x,o),this._z=0);break;case"ZXY":this._x=Math.asin(Xt(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-x,S),this._z=Math.atan2(-f,m)):(this._y=0,this._z=Math.atan2(p,o));break;case"ZYX":this._y=Math.asin(-Xt(x,-1,1)),Math.abs(x)<.9999999?(this._x=Math.atan2(v,S),this._z=Math.atan2(p,o)):(this._x=0,this._z=Math.atan2(-f,m));break;case"YZX":this._z=Math.asin(Xt(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(-y,m),this._y=Math.atan2(-x,o)):(this._x=0,this._y=Math.atan2(d,S));break;case"XZY":this._z=Math.asin(-Xt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(v,m),this._y=Math.atan2(d,o)):(this._x=Math.atan2(-y,S),this._y=0);break;default:mt("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return K_.makeRotationFromQuaternion(e),this.setFromRotationMatrix(K_,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Q_.setFromEuler(this),this.setFromQuaternion(Q_,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ds.DEFAULT_ORDER="XYZ";class mh{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(d=>({...d})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function o(d,p){return d[p.uuid]===void 0&&(d[p.uuid]=p.toJSON(e)),p.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const p=d.shapes;if(Array.isArray(p))for(let m=0,y=p.length;m0){s.children=[];for(let d=0;d0){s.animations=[];for(let d=0;d0&&(n.geometries=d),p.length>0&&(n.materials=p),m.length>0&&(n.textures=m),y.length>0&&(n.images=y),x.length>0&&(n.shapes=x),v.length>0&&(n.skeletons=v),S.length>0&&(n.animations=S),M.length>0&&(n.nodes=M)}return n.object=s,n;function f(d){const p=[];for(const m in d){const y=d[m];delete y.metadata,p.push(y)}return p}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,n,s,o){Yr.subVectors(s,t),Ul.subVectors(n,t),m2.subVectors(e,t);const f=Yr.dot(Yr),d=Yr.dot(Ul),p=Yr.dot(m2),m=Ul.dot(Ul),y=Ul.dot(m2),x=f*m-d*d;if(x===0)return o.set(0,0,0),null;const v=1/x,S=(m*p-d*y)*v,M=(f*y-d*p)*v;return o.set(1-S-M,M,S)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Ll)===null?!1:Ll.x>=0&&Ll.y>=0&&Ll.x+Ll.y<=1}static getInterpolation(e,t,n,s,o,f,d,p){return this.getBarycoord(e,t,n,s,Ll)===null?(p.x=0,p.y=0,"z"in p&&(p.z=0),"w"in p&&(p.w=0),null):(p.setScalar(0),p.addScaledVector(o,Ll.x),p.addScaledVector(f,Ll.y),p.addScaledVector(d,Ll.z),p)}static getInterpolatedAttribute(e,t,n,s,o,f){return v2.setScalar(0),b2.setScalar(0),_2.setScalar(0),v2.fromBufferAttribute(e,t),b2.fromBufferAttribute(e,n),_2.fromBufferAttribute(e,s),f.setScalar(0),f.addScaledVector(v2,o.x),f.addScaledVector(b2,o.y),f.addScaledVector(_2,o.z),f}static isFrontFacing(e,t,n,s){return Yr.subVectors(n,t),Ul.subVectors(e,t),Yr.cross(Ul).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yr.subVectors(this.c,this.b),Ul.subVectors(this.a,this.b),Yr.cross(Ul).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Cs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Cs.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,o){return Cs.getInterpolation(e,this.a,this.b,this.c,t,n,s,o)}containsPoint(e){return Cs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Cs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,o=this.c;let f,d;jd.subVectors(s,n),Hd.subVectors(o,n),g2.subVectors(e,n);const p=jd.dot(g2),m=Hd.dot(g2);if(p<=0&&m<=0)return t.copy(n);y2.subVectors(e,s);const y=jd.dot(y2),x=Hd.dot(y2);if(y>=0&&x<=y)return t.copy(s);const v=p*x-y*m;if(v<=0&&p>=0&&y<=0)return f=p/(p-y),t.copy(n).addScaledVector(jd,f);x2.subVectors(e,o);const S=jd.dot(x2),M=Hd.dot(x2);if(M>=0&&S<=M)return t.copy(o);const T=S*m-p*M;if(T<=0&&m>=0&&M<=0)return d=m/(m-M),t.copy(n).addScaledVector(Hd,d);const w=y*M-S*x;if(w<=0&&x-y>=0&&S-M>=0)return i3.subVectors(o,s),d=(x-y)/(x-y+(S-M)),t.copy(s).addScaledVector(i3,d);const A=1/(w+T+v);return f=T*A,d=v*A,t.copy(n).addScaledVector(jd,f).addScaledVector(Hd,d)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const dM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Lc={h:0,s:0,l:0},zg={h:0,s:0,l:0};function S2(a,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?a+(e-a)*6*t:t<1/2?e:t<2/3?a+(e-a)*6*(2/3-t):a}class gt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=_a){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wn.colorSpaceToWorking(this,t),this}setRGB(e,t,n,s=wn.workingColorSpace){return this.r=e,this.g=t,this.b=n,wn.colorSpaceToWorking(this,s),this}setHSL(e,t,n,s=wn.workingColorSpace){if(e=Qb(e,1),t=Xt(t,0,1),n=Xt(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,f=2*n-o;this.r=S2(f,o,e+1/3),this.g=S2(f,o,e),this.b=S2(f,o,e-1/3)}return wn.colorSpaceToWorking(this,s),this}setStyle(e,t=_a){function n(o){o!==void 0&&parseFloat(o)<1&&mt("Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const f=s[1],d=s[2];switch(f){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:mt("Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],f=o.length;if(f===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(f===6)return this.setHex(parseInt(o,16),t);mt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=_a){const n=dM[e.toLowerCase()];return n!==void 0?this.setHex(n,t):mt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=jl(e.r),this.g=jl(e.g),this.b=jl(e.b),this}copyLinearToSRGB(e){return this.r=rh(e.r),this.g=rh(e.g),this.b=rh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_a){return wn.workingToColorSpace(Fa.copy(this),e),Math.round(Xt(Fa.r*255,0,255))*65536+Math.round(Xt(Fa.g*255,0,255))*256+Math.round(Xt(Fa.b*255,0,255))}getHexString(e=_a){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=wn.workingColorSpace){wn.workingToColorSpace(Fa.copy(this),t);const n=Fa.r,s=Fa.g,o=Fa.b,f=Math.max(n,s,o),d=Math.min(n,s,o);let p,m;const y=(d+f)/2;if(d===f)p=0,m=0;else{const x=f-d;switch(m=y<=.5?x/(f+d):x/(2-f-d),f){case n:p=(s-o)/x+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){mt(`Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){mt(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==df&&(n.blending=this.blending),this.side!==Hl&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Ly&&(n.blendSrc=this.blendSrc),this.blendDst!==zy&&(n.blendDst=this.blendDst),this.blendEquation!==Ic&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==yf&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vb&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==rf&&(n.stencilFail=this.stencilFail),this.stencilZFail!==rf&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==rf&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(o){const f=[];for(const d in o){const p=o[d];delete p.metadata,f.push(p)}return f}if(t){const o=s(e.textures),f=s(e.images);o.length>0&&(n.textures=o),f.length>0&&(n.images=f)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let o=0;o!==s;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class qc extends Va{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.combine=Z0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fl=XC();function XC(){const a=new ArrayBuffer(4),e=new Float32Array(a),t=new Uint32Array(a),n=new Uint32Array(512),s=new Uint32Array(512);for(let p=0;p<256;++p){const m=p-127;m<-27?(n[p]=0,n[p|256]=32768,s[p]=24,s[p|256]=24):m<-14?(n[p]=1024>>-m-14,n[p|256]=1024>>-m-14|32768,s[p]=-m-1,s[p|256]=-m-1):m<=15?(n[p]=m+15<<10,n[p|256]=m+15<<10|32768,s[p]=13,s[p|256]=13):m<128?(n[p]=31744,n[p|256]=64512,s[p]=24,s[p|256]=24):(n[p]=31744,n[p|256]=64512,s[p]=13,s[p|256]=13)}const o=new Uint32Array(2048),f=new Uint32Array(64),d=new Uint32Array(64);for(let p=1;p<1024;++p){let m=p<<13,y=0;for(;(m&8388608)===0;)m<<=1,y-=8388608;m&=-8388609,y+=947912704,o[p]=m|y}for(let p=1024;p<2048;++p)o[p]=939524096+(p-1024<<13);for(let p=1;p<31;++p)f[p]=p<<23;f[31]=1199570944,f[32]=2147483648;for(let p=33;p<63;++p)f[p]=2147483648+(p-32<<23);f[63]=3347054592;for(let p=1;p<64;++p)p!==32&&(d[p]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:o,exponentTable:f,offsetTable:d}}function ws(a){Math.abs(a)>65504&&mt("DataUtils.toHalfFloat(): Value out of range."),a=Xt(a,-65504,65504),Fl.floatView[0]=a;const e=Fl.uint32View[0],t=e>>23&511;return Fl.baseTable[t]+((e&8388607)>>Fl.shiftTable[t])}function g0(a){const e=a>>10;return Fl.uint32View[0]=Fl.mantissaTable[Fl.offsetTable[e]+(a&1023)]+Fl.exponentTable[e],Fl.floatView[0]}class qC{static toHalfFloat(e){return ws(e)}static fromHalfFloat(e){return g0(e)}}const Hi=new X,Pg=new ze;let YC=0;class jn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:YC++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=B0,this.updateRanges=[],this.gpuType=Rs,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,o=this.itemSize;st.count&&mt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Yt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n0&&(e.userData=this.userData),this.parameters!==void 0){const p=this.parameters;for(const m in p)p[m]!==void 0&&(e[m]=p[m]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const p in n){const m=n[p];e.data.attributes[p]=m.toJSON(e.data)}const s={};let o=!1;for(const p in this.morphAttributes){const m=this.morphAttributes[p],y=[];for(let x=0,v=m.length;x0&&(s[p]=y,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));const d=this.boundingSphere;return d!==null&&(e.data.boundingSphere=d.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const m in s){const y=s[m];this.setAttribute(m,y.clone(t))}const o=e.morphAttributes;for(const m in o){const y=[],x=o[m];for(let v=0,S=x.length;v0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,f=s.length;o(e.far-e.near)**2))&&(a3.copy(o).invert(),Gu.copy(e.ray).applyMatrix4(a3),!(n.boundingBox!==null&&Gu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Gu)))}_computeIntersections(e,t,n){let s;const o=this.geometry,f=this.material,d=o.index,p=o.attributes.position,m=o.attributes.uv,y=o.attributes.uv1,x=o.attributes.normal,v=o.groups,S=o.drawRange;if(d!==null)if(Array.isArray(f))for(let M=0,T=v.length;Mt.far?null:{distance:m,point:kg.clone(),object:a}}function Vg(a,e,t,n,s,o,f,d,p,m){a.getVertexPosition(d,Ig),a.getVertexPosition(p,Fg),a.getVertexPosition(m,jg);const y=t4(a,e,t,n,Ig,Fg,jg,r3);if(y){const x=new X;Cs.getBarycoord(r3,Ig,Fg,jg,x),s&&(y.uv=Cs.getInterpolatedAttribute(s,d,p,m,x,new ze)),o&&(y.uv1=Cs.getInterpolatedAttribute(o,d,p,m,x,new ze)),f&&(y.normal=Cs.getInterpolatedAttribute(f,d,p,m,x,new X),y.normal.dot(n.direction)>0&&y.normal.multiplyScalar(-1));const v={a:d,b:p,c:m,normal:new X,materialIndex:0};Cs.getNormal(Ig,Fg,jg,v.normal),y.face=v,y.barycoord=x}return y}class Af extends tn{constructor(e=1,t=1,n=1,s=1,o=1,f=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:o,depthSegments:f};const d=this;s=Math.floor(s),o=Math.floor(o),f=Math.floor(f);const p=[],m=[],y=[],x=[];let v=0,S=0;M("z","y","x",-1,-1,n,t,e,f,o,0),M("z","y","x",1,-1,n,t,-e,f,o,1),M("x","z","y",1,1,e,n,t,s,f,2),M("x","z","y",1,-1,e,n,-t,s,f,3),M("x","y","z",1,-1,e,t,n,s,o,4),M("x","y","z",-1,-1,e,t,-n,s,o,5),this.setIndex(p),this.setAttribute("position",new At(m,3)),this.setAttribute("normal",new At(y,3)),this.setAttribute("uv",new At(x,2));function M(T,w,A,D,N,U,I,z,j,q,B){const P=U/j,W=I/q,se=U/2,ae=I/2,ce=z/2,ue=j+1,V=q+1;let $=0,J=0;const he=new X;for(let ve=0;ve0?1:-1,y.push(he.x,he.y,he.z),x.push(oe/j),x.push(1-ve/q),$+=1}}for(let ve=0;ve0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class kx extends Rn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Gt,this.projectionMatrix=new Gt,this.projectionMatrixInverse=new Gt,this.coordinateSystem=Ws,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const zc=new X,o3=new ze,l3=new ze;class xi extends kx{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ph*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(pf*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ph*2*Math.atan(Math.tan(pf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){zc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(zc.x,zc.y).multiplyScalar(-e/zc.z),zc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(zc.x,zc.y).multiplyScalar(-e/zc.z)}getViewSize(e,t){return this.getViewBounds(e,o3,l3),t.subVectors(l3,o3)}setViewOffset(e,t,n,s,o,f){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=o,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(pf*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,o=-.5*s;const f=this.view;if(this.view!==null&&this.view.enabled){const p=f.fullWidth,m=f.fullHeight;o+=f.offsetX*s/p,t-=f.offsetY*n/m,s*=f.width/p,n*=f.height/m}const d=this.filmOffset;d!==0&&(o+=e*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Vd=-90,Gd=1;class pM extends Rn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new xi(Vd,Gd,e,t);s.layers=this.layers,this.add(s);const o=new xi(Vd,Gd,e,t);o.layers=this.layers,this.add(o);const f=new xi(Vd,Gd,e,t);f.layers=this.layers,this.add(f);const d=new xi(Vd,Gd,e,t);d.layers=this.layers,this.add(d);const p=new xi(Vd,Gd,e,t);p.layers=this.layers,this.add(p);const m=new xi(Vd,Gd,e,t);m.layers=this.layers,this.add(m)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,o,f,d,p]=t;for(const m of t)this.remove(m);if(e===Ws)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),f.up.set(0,0,1),f.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),p.up.set(0,1,0),p.lookAt(0,0,-1);else if(e===dh)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),f.up.set(0,0,-1),f.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),p.up.set(0,-1,0),p.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const m of t)this.add(m),m.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,f,d,p,m,y]=this.children,x=e.getRenderTarget(),v=e.getActiveCubeFace(),S=e.getActiveMipmapLevel(),M=e.xr.enabled;e.xr.enabled=!1;const T=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,o),e.setRenderTarget(n,1,s),e.render(t,f),e.setRenderTarget(n,2,s),e.render(t,d),e.setRenderTarget(n,3,s),e.render(t,p),e.setRenderTarget(n,4,s),e.render(t,m),n.texture.generateMipmaps=T,e.setRenderTarget(n,5,s),e.render(t,y),e.setRenderTarget(x,v,S),e.xr.enabled=M,n.texture.needsPMREMUpdate=!0}}class J0 extends ui{constructor(e=[],t=kl,n,s,o,f,d,p,m,y){super(e,t,n,s,o,f,d,p,m,y),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class mM extends Wo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new J0(s),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Af(5,5,5),o=new hs({name:"CubemapFromEquirect",uniforms:gh(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ma,blending:Go});o.uniforms.tEquirect.value=t;const f=new Li(s,o),d=t.minFilter;return t.minFilter===ko&&(t.minFilter=Ui),new pM(1,10,this).update(e,f),t.minFilter=d,f.geometry.dispose(),f.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const o=e.getRenderTarget();for(let f=0;f<6;f++)e.setRenderTarget(this,f),e.clear(t,n,s);e.setRenderTarget(o)}}class sh extends Rn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const s4={type:"move"};class Dy{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new sh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new sh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new sh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let s=null,o=null,f=null;const d=this._targetRay,p=this._grip,m=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(m&&e.hand){f=!0;for(const T of e.hand.values()){const w=t.getJointPose(T,n),A=this._getHandJoint(m,T);w!==null&&(A.matrix.fromArray(w.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,A.jointRadius=w.radius),A.visible=w!==null}const y=m.joints["index-finger-tip"],x=m.joints["thumb-tip"],v=y.position.distanceTo(x.position),S=.02,M=.005;m.inputState.pinching&&v>S+M?(m.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!m.inputState.pinching&&v<=S-M&&(m.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else p!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(p.matrix.fromArray(o.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,o.linearVelocity?(p.hasLinearVelocity=!0,p.linearVelocity.copy(o.linearVelocity)):p.hasLinearVelocity=!1,o.angularVelocity?(p.hasAngularVelocity=!0,p.angularVelocity.copy(o.angularVelocity)):p.hasAngularVelocity=!1));d!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&o!==null&&(s=o),s!==null&&(d.matrix.fromArray(s.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,s.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(s.linearVelocity)):d.hasLinearVelocity=!1,s.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(s.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(s4)))}return d!==null&&(d.visible=s!==null),p!==null&&(p.visible=o!==null),m!==null&&(m.visible=f!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new sh;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Vx{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new gt(e),this.density=t}clone(){return new Vx(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Gx{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new gt(e),this.near=t,this.far=n}clone(){return new Gx(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class t1 extends Rn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ds,this.environmentIntensity=1,this.environmentRotation=new ds,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Xx{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=B0,this.updateRanges=[],this.version=0,this.uuid=Ks()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,o=this.stride;se.far||t.push({distance:p,point:r0.clone(),uv:Cs.getInterpolation(r0,Gg,l0,Xg,c3,E2,u3,new ze),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function qg(a,e,t,n,s,o){Wd.subVectors(a,t).addScalar(.5).multiply(n),s!==void 0?(o0.x=o*Wd.x-s*Wd.y,o0.y=s*Wd.x+o*Wd.y):o0.copy(Wd),a.copy(e),a.x+=o0.x,a.y+=o0.y,a.applyMatrix4(gM)}const Yg=new X,f3=new X;class xM extends Rn{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,s=t.length;n0){let n,s;for(n=1,s=t.length;n0){Yg.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Yg);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Yg.setFromMatrixPosition(e.matrixWorld),f3.setFromMatrixPosition(this.matrixWorld);const n=Yg.distanceTo(f3)/e.zoom;t[0].object.visible=!0;let s,o;for(s=1,o=t.length;s=f)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(n,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||u4.getNormalMatrix(e),s=this.coplanarPoint(C2).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Xu=new Ki,f4=new ze(.5,.5),Kg=new X;class Ah{constructor(e=new Bl,t=new Bl,n=new Bl,s=new Bl,o=new Bl,f=new Bl){this.planes=[e,t,n,s,o,f]}set(e,t,n,s,o,f){const d=this.planes;return d[0].copy(e),d[1].copy(t),d[2].copy(n),d[3].copy(s),d[4].copy(o),d[5].copy(f),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Ws,n=!1){const s=this.planes,o=e.elements,f=o[0],d=o[1],p=o[2],m=o[3],y=o[4],x=o[5],v=o[6],S=o[7],M=o[8],T=o[9],w=o[10],A=o[11],D=o[12],N=o[13],U=o[14],I=o[15];if(s[0].setComponents(m-f,S-y,A-M,I-D).normalize(),s[1].setComponents(m+f,S+y,A+M,I+D).normalize(),s[2].setComponents(m+d,S+x,A+T,I+N).normalize(),s[3].setComponents(m-d,S-x,A-T,I-N).normalize(),n)s[4].setComponents(p,v,w,U).normalize(),s[5].setComponents(m-p,S-v,A-w,I-U).normalize();else if(s[4].setComponents(m-p,S-v,A-w,I-U).normalize(),t===Ws)s[5].setComponents(m+p,S+v,A+w,I+U).normalize();else if(t===dh)s[5].setComponents(p,v,w,U).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Xu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Xu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Xu)}intersectsSprite(e){Xu.center.set(0,0,0);const t=f4.distanceTo(e.center);return Xu.radius=.7071067811865476+t,Xu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Xu)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)0?e.max.x:e.min.x,Kg.y=s.normal.y>0?e.max.y:e.min.y,Kg.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Kg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Po=new Gt,Bo=new Ah;class Yx{constructor(){this.coordinateSystem=Ws}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n=o.length&&o.push({start:-1,count:-1,z:-1,index:-1});const d=o[this.index];f.push(d),this.index++,d.start=e,d.count=t,d.z=n,d.index=s}reset(){this.list.length=0,this.index=0}}const Es=new Gt,m4=new gt(1,1,1),b3=new Ah,g4=new Yx,Qg=new Zi,qu=new Ki,f0=new X,_3=new X,y4=new X,D2=new p4,ja=new Li,Jg=[];function x4(a,e,t=0){const n=e.itemSize;if(a.isInterleavedBufferAttribute||a.array.constructor!==e.array.constructor){const s=a.count;for(let o=0;o65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new jn(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const s=e.getAttribute(n),o=t.getAttribute(n);if(s.itemSize!==o.itemSize||s.normalized!==o.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zi);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,s=t.length;n=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(R2),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=n):(s=this._instanceInfo.length,this._instanceInfo.push(n));const o=this._matricesTexture;Es.identity().toArray(o.image.data,s*16),o.needsUpdate=!0;const f=this._colorsTexture;return f&&(m4.toArray(f.image.data,s*4),f.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},o=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const f=e.getIndex();if(f!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=n===-1?f.count:n),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let p;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(R2),p=this._availableGeometryIds.shift(),o[p]=s):(p=this._geometryCount,this._geometryCount++,o.push(s)),this.setGeometryAt(p,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,p}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,s=n.getIndex()!==null,o=n.getIndex(),f=t.getIndex(),d=this._geometryInfo[e];if(s&&f.count>d.reservedIndexCount||t.attributes.position.count>d.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const p=d.vertexStart,m=d.reservedVertexCount;d.vertexCount=t.getAttribute("position").count;for(const y in n.attributes){const x=t.getAttribute(y),v=n.getAttribute(y);x4(x,v,p);const S=x.itemSize;for(let M=x.count,T=m;M=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let s=0,o=n.length;sd).sort((f,d)=>n[f].vertexStart-n[d].vertexStart),o=this.geometry;for(let f=0,d=n.length;f=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const o=new Zi,f=n.index,d=n.attributes.position;for(let p=s.start,m=s.start+s.count;p=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const o=new Ki;this.getBoundingBoxAt(e,Qg),Qg.getCenter(o.center);const f=n.index,d=n.attributes.position;let p=0;for(let m=s.start,y=s.start+s.count;md.active);if(Math.max(...n.map(d=>d.vertexStart+d.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(p=>p.indexStart+p.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const o=this.geometry;o.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new tn,this._initializeGeometry(o));const f=this.geometry;o.index&&Yu(o.index.array,f.index.array);for(const d in o.attributes)Yu(o.attributes[d].array,f.attributes[d].array)}raycast(e,t){const n=this._instanceInfo,s=this._geometryInfo,o=this.matrixWorld,f=this.geometry;ja.material=this.material,ja.geometry.index=f.index,ja.geometry.attributes=f.attributes,ja.geometry.boundingBox===null&&(ja.geometry.boundingBox=new Zi),ja.geometry.boundingSphere===null&&(ja.geometry.boundingSphere=new Ki);for(let d=0,p=n.length;d({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,s,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const f=s.getIndex(),d=f===null?1:f.array.BYTES_PER_ELEMENT,p=this._instanceInfo,m=this._multiDrawStarts,y=this._multiDrawCounts,x=this._geometryInfo,v=this.perObjectFrustumCulled,S=this._indirectTexture,M=S.image.data,T=n.isArrayCamera?g4:b3;v&&!n.isArrayCamera&&(Es.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),b3.setFromProjectionMatrix(Es,n.coordinateSystem,n.reversedDepth));let w=0;if(this.sortObjects){Es.copy(this.matrixWorld).invert(),f0.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Es),_3.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Es);for(let N=0,U=p.length;N0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,f=s.length;on)return;N2.applyMatrix4(a.matrixWorld);const m=e.ray.origin.distanceTo(N2);if(!(me.far))return{distance:m,point:A3.clone().applyMatrix4(a.matrixWorld),index:f,face:null,faceIndex:null,barycoord:null,object:a}}const M3=new X,E3=new X;class Ko extends Gc{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,o=t.count;s0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,f=s.length;os.far)return;o.push({distance:m,distanceToRay:Math.sqrt(d),point:p,index:e,face:null,faceIndex:null,barycoord:null,object:f})}}class SM extends ui{constructor(e,t,n,s,o=Ui,f=Ui,d,p,m){super(e,t,n,s,o,f,d,p,m),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const y=this;function x(){y.needsUpdate=!0,y._requestVideoFrameCallbackId=e.requestVideoFrameCallback(x)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(x))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class v4 extends SM{constructor(e,t,n,s,o,f,d,p){super({},e,t,n,s,o,f,d,p),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class b4 extends ui{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ea,this.minFilter=Ea,this.generateMipmaps=!1,this.needsUpdate=!0}}class Zx extends ui{constructor(e,t,n,s,o,f,d,p,m,y,x,v){super(null,f,d,p,m,y,s,o,x,v),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class _4 extends Zx{constructor(e,t,n,s,o,f){super(e,t,n,o,f),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Aa,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class S4 extends Zx{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,kl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class A4 extends ui{constructor(e,t,n,s,o,f,d,p,m){super(e,t,n,s,o,f,d,p,m),this.isCanvasTexture=!0,this.needsUpdate=!0}}class r1 extends ui{constructor(e,t,n=Vl,s,o,f,d=Ea,p=Ea,m,y=uh,x=1){if(y!==uh&&y!==fh)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const v={width:e,height:t,depth:x};super(v,s,o,f,d,p,y,n,m),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Fc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class o1 extends ui{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Kx extends tn{constructor(e=1,t=1,n=4,s=8,o=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:s,heightSegments:o},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),s=Math.max(3,Math.floor(s)),o=Math.max(1,Math.floor(o));const f=[],d=[],p=[],m=[],y=t/2,x=Math.PI/2*e,v=t,S=2*x+v,M=n*2+o,T=s+1,w=new X,A=new X;for(let D=0;D<=M;D++){let N=0,U=0,I=0,z=0;if(D<=n){const B=D/n,P=B*Math.PI/2;U=-y-e*Math.cos(P),I=e*Math.sin(P),z=-e*Math.cos(P),N=B*x}else if(D<=n+o){const B=(D-n)/o;U=-y+B*t,I=e,z=0,N=x+B*v}else{const B=(D-n-o)/n,P=B*Math.PI/2;U=y+e*Math.sin(P),I=e*Math.cos(P),z=e*Math.sin(P),N=x+v+B*x}const j=Math.max(0,Math.min(1,N/S));let q=0;D===0?q=.5/s:D===M&&(q=-.5/s);for(let B=0;B<=s;B++){const P=B/s,W=P*Math.PI*2,se=Math.sin(W),ae=Math.cos(W);A.x=-I*ae,A.y=U,A.z=I*se,d.push(A.x,A.y,A.z),w.set(-I*ae,z,I*se),w.normalize(),p.push(w.x,w.y,w.z),m.push(P+q,j)}if(D>0){const B=(D-1)*T;for(let P=0;P0&&N(!0),t>0&&N(!1)),this.setIndex(y),this.setAttribute("position",new At(x,3)),this.setAttribute("normal",new At(v,3)),this.setAttribute("uv",new At(S,2));function D(){const U=new X,I=new X;let z=0;const j=(t-e)/n;for(let q=0;q<=o;q++){const B=[],P=q/o,W=P*(t-e)+e;for(let se=0;se<=s;se++){const ae=se/s,ce=ae*p+d,ue=Math.sin(ce),V=Math.cos(ce);I.x=W*ue,I.y=-P*n+w,I.z=W*V,x.push(I.x,I.y,I.z),U.set(ue,j,V).normalize(),v.push(U.x,U.y,U.z),S.push(ae,1-P),B.push(M++)}T.push(B)}for(let q=0;q0||B!==0)&&(y.push(P,W,ae),z+=3),(t>0||B!==o-1)&&(y.push(W,se,ae),z+=3)}m.addGroup(A,z,0),A+=z}function N(U){const I=M,z=new ze,j=new X;let q=0;const B=U===!0?e:t,P=U===!0?1:-1;for(let se=1;se<=s;se++)x.push(0,w*P,0),v.push(0,P,0),S.push(.5,.5),M++;const W=M;for(let se=0;se<=s;se++){const ce=se/s*p+d,ue=Math.cos(ce),V=Math.sin(ce);j.x=B*V,j.y=w*P,j.z=B*ue,x.push(j.x,j.y,j.z),v.push(0,P,0),z.x=ue*.5+.5,z.y=V*.5*P+.5,S.push(z.x,z.y),M++}for(let se=0;se.9&&j<.1&&(N<.2&&(f[D+0]+=1),U<.2&&(f[D+2]+=1),I<.2&&(f[D+4]+=1))}}function v(D){o.push(D.x,D.y,D.z)}function S(D,N){const U=D*3;N.x=e[U+0],N.y=e[U+1],N.z=e[U+2]}function M(){const D=new X,N=new X,U=new X,I=new X,z=new ze,j=new ze,q=new ze;for(let B=0,P=0;B0)p=s-1;else{p=s;break}if(s=p,n[s]===f)return s/(o-1);const y=n[s],v=n[s+1]-y,S=(f-y)/v;return(s+S)/(o-1)}getTangent(e,t){let s=e-1e-4,o=e+1e-4;s<0&&(s=0),o>1&&(o=1);const f=this.getPoint(s),d=this.getPoint(o),p=t||(f.isVector2?new ze:new X);return p.copy(d).sub(f).normalize(),p}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new X,s=[],o=[],f=[],d=new X,p=new Gt;for(let S=0;S<=e;S++){const M=S/e;s[S]=this.getTangentAt(M,new X)}o[0]=new X,f[0]=new X;let m=Number.MAX_VALUE;const y=Math.abs(s[0].x),x=Math.abs(s[0].y),v=Math.abs(s[0].z);y<=m&&(m=y,n.set(1,0,0)),x<=m&&(m=x,n.set(0,1,0)),v<=m&&n.set(0,0,1),d.crossVectors(s[0],n).normalize(),o[0].crossVectors(s[0],d),f[0].crossVectors(s[0],o[0]);for(let S=1;S<=e;S++){if(o[S]=o[S-1].clone(),f[S]=f[S-1].clone(),d.crossVectors(s[S-1],s[S]),d.length()>Number.EPSILON){d.normalize();const M=Math.acos(Xt(s[S-1].dot(s[S]),-1,1));o[S].applyMatrix4(p.makeRotationAxis(d,M))}f[S].crossVectors(s[S],o[S])}if(t===!0){let S=Math.acos(Xt(o[0].dot(o[e]),-1,1));S/=e,s[0].dot(d.crossVectors(o[0],o[e]))>0&&(S=-S);for(let M=1;M<=e;M++)o[M].applyMatrix4(p.makeRotationAxis(s[M],S*M)),f[M].crossVectors(s[M],o[M])}return{tangents:s,normals:o,binormals:f}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class $x extends to{constructor(e=0,t=0,n=1,s=1,o=0,f=Math.PI*2,d=!1,p=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=s,this.aStartAngle=o,this.aEndAngle=f,this.aClockwise=d,this.aRotation=p}getPoint(e,t=new ze){const n=t,s=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const f=Math.abs(o)s;)o-=s;o0?0:(Math.floor(Math.abs(d)/o)+1)*o:p===0&&d===o-1&&(d=o-2,p=1);let m,y;this.closed||d>0?m=s[(d-1)%o]:(ry.subVectors(s[0],s[1]).add(s[0]),m=ry);const x=s[d%o],v=s[(d+1)%o];if(this.closed||d+2s.length-2?s.length-1:f+1],x=s[f>s.length-3?s.length-1:f+2];return n.set(C3(d,p.x,m.x,y.x,x.x),C3(d,p.y,m.y,y.y,x.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const f=s[o]-n,d=this.curves[o],p=d.getLength(),m=p===0?0:1-f/p;return d.getPointAt(m,t)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,s=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const x=m.getPoint(0);x.equals(this.currentPoint)||this.lineTo(x.x,x.y)}this.curves.push(m);const y=m.getPoint(1);return this.currentPoint.copy(y),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mf extends _x{constructor(e){super(e),this.uuid=Ks(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,s=this.holes.length;n80*t){d=a[0],p=a[1];let y=d,x=p;for(let v=t;vy&&(y=S),M>x&&(x=M)}m=Math.max(y-d,x-p),m=m!==0?32767/m:0}return H0(o,f,t,d,p,m,0),f}function RM(a,e,t,n,s){let o;if(s===Y4(a,e,t,n)>0)for(let f=e;f=e;f-=n)o=R3(f/n|0,a[f],a[f+1],o);return o&&xh(o,o.next)&&(V0(o),o=o.next),o}function xf(a,e){if(!a)return a;e||(e=a);let t=a,n;do if(n=!1,!t.steiner&&(xh(t,t.next)||vi(t.prev,t,t.next)===0)){if(V0(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function H0(a,e,t,n,s,o,f){if(!a)return;!f&&o&&H4(a,n,s,o);let d=a;for(;a.prev!==a.next;){const p=a.prev,m=a.next;if(o?U4(a,n,s,o):O4(a)){e.push(p.i,a.i,m.i),V0(a),a=m.next,d=m.next;continue}if(a=m,a===d){f?f===1?(a=L4(xf(a),e),H0(a,e,t,n,s,o,2)):f===2&&z4(a,e,t,n,s,o):H0(xf(a),e,t,n,s,o,1);break}}}function O4(a){const e=a.prev,t=a,n=a.next;if(vi(e,t,n)>=0)return!1;const s=e.x,o=t.x,f=n.x,d=e.y,p=t.y,m=n.y,y=Math.min(s,o,f),x=Math.min(d,p,m),v=Math.max(s,o,f),S=Math.max(d,p,m);let M=n.next;for(;M!==e;){if(M.x>=y&&M.x<=v&&M.y>=x&&M.y<=S&&y0(s,d,o,p,f,m,M.x,M.y)&&vi(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function U4(a,e,t,n){const s=a.prev,o=a,f=a.next;if(vi(s,o,f)>=0)return!1;const d=s.x,p=o.x,m=f.x,y=s.y,x=o.y,v=f.y,S=Math.min(d,p,m),M=Math.min(y,x,v),T=Math.max(d,p,m),w=Math.max(y,x,v),A=Sb(S,M,e,t,n),D=Sb(T,w,e,t,n);let N=a.prevZ,U=a.nextZ;for(;N&&N.z>=A&&U&&U.z<=D;){if(N.x>=S&&N.x<=T&&N.y>=M&&N.y<=w&&N!==s&&N!==f&&y0(d,y,p,x,m,v,N.x,N.y)&&vi(N.prev,N,N.next)>=0||(N=N.prevZ,U.x>=S&&U.x<=T&&U.y>=M&&U.y<=w&&U!==s&&U!==f&&y0(d,y,p,x,m,v,U.x,U.y)&&vi(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;N&&N.z>=A;){if(N.x>=S&&N.x<=T&&N.y>=M&&N.y<=w&&N!==s&&N!==f&&y0(d,y,p,x,m,v,N.x,N.y)&&vi(N.prev,N,N.next)>=0)return!1;N=N.prevZ}for(;U&&U.z<=D;){if(U.x>=S&&U.x<=T&&U.y>=M&&U.y<=w&&U!==s&&U!==f&&y0(d,y,p,x,m,v,U.x,U.y)&&vi(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function L4(a,e){let t=a;do{const n=t.prev,s=t.next.next;!xh(n,s)&&NM(n,t,t.next,s)&&k0(n,s)&&k0(s,n)&&(e.push(n.i,t.i,s.i),V0(t),V0(t.next),t=a=s),t=t.next}while(t!==a);return xf(t)}function z4(a,e,t,n,s,o){let f=a;do{let d=f.next.next;for(;d!==f.prev;){if(f.i!==d.i&&G4(f,d)){let p=OM(f,d);f=xf(f,f.next),p=xf(p,p.next),H0(f,e,t,n,s,o,0),H0(p,e,t,n,s,o,0);return}d=d.next}f=f.next}while(f!==a)}function P4(a,e,t,n){const s=[];for(let o=0,f=e.length;o=t.next.y&&t.next.y!==t.y){const x=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(x<=n&&x>o&&(o=x,f=t.x=t.x&&t.x>=p&&n!==t.x&&DM(sf.x||t.x===f.x&&j4(f,t)))&&(f=t,y=x)}t=t.next}while(t!==d);return f}function j4(a,e){return vi(a.prev,a,e.prev)<0&&vi(e.next,a,a.next)<0}function H4(a,e,t,n){let s=a;do s.z===0&&(s.z=Sb(s.x,s.y,e,t,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==a);s.prevZ.nextZ=null,s.prevZ=null,k4(s)}function k4(a){let e,t=1;do{let n=a,s;a=null;let o=null;for(e=0;n;){e++;let f=n,d=0;for(let m=0;m0||p>0&&f;)d!==0&&(p===0||!f||n.z<=f.z)?(s=n,n=n.nextZ,d--):(s=f,f=f.nextZ,p--),o?o.nextZ=s:a=s,s.prevZ=o,o=s;n=f}o.nextZ=null,t*=2}while(e>1);return a}function Sb(a,e,t,n,s){return a=(a-t)*s|0,e=(e-n)*s|0,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,a|e<<1}function V4(a){let e=a,t=a;do(e.x=(a-f)*(o-d)&&(a-f)*(n-d)>=(t-f)*(e-d)&&(t-f)*(o-d)>=(s-f)*(n-d)}function y0(a,e,t,n,s,o,f,d){return!(a===f&&e===d)&&DM(a,e,t,n,s,o,f,d)}function G4(a,e){return a.next.i!==e.i&&a.prev.i!==e.i&&!X4(a,e)&&(k0(a,e)&&k0(e,a)&&q4(a,e)&&(vi(a.prev,a,e.prev)||vi(a,e.prev,e))||xh(a,e)&&vi(a.prev,a,a.next)>0&&vi(e.prev,e,e.next)>0)}function vi(a,e,t){return(e.y-a.y)*(t.x-e.x)-(e.x-a.x)*(t.y-e.y)}function xh(a,e){return a.x===e.x&&a.y===e.y}function NM(a,e,t,n){const s=ly(vi(a,e,t)),o=ly(vi(a,e,n)),f=ly(vi(t,n,a)),d=ly(vi(t,n,e));return!!(s!==o&&f!==d||s===0&&oy(a,t,e)||o===0&&oy(a,n,e)||f===0&&oy(t,a,n)||d===0&&oy(t,e,n))}function oy(a,e,t){return e.x<=Math.max(a.x,t.x)&&e.x>=Math.min(a.x,t.x)&&e.y<=Math.max(a.y,t.y)&&e.y>=Math.min(a.y,t.y)}function ly(a){return a>0?1:a<0?-1:0}function X4(a,e){let t=a;do{if(t.i!==a.i&&t.next.i!==a.i&&t.i!==e.i&&t.next.i!==e.i&&NM(t,t.next,a,e))return!0;t=t.next}while(t!==a);return!1}function k0(a,e){return vi(a.prev,a,a.next)<0?vi(a,e,a.next)>=0&&vi(a,a.prev,e)>=0:vi(a,e,a.prev)<0||vi(a,a.next,e)<0}function q4(a,e){let t=a,n=!1;const s=(a.x+e.x)/2,o=(a.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&s<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==a);return n}function OM(a,e){const t=Ab(a.i,a.x,a.y),n=Ab(e.i,e.x,e.y),s=a.next,o=e.prev;return a.next=e,e.prev=a,t.next=s,s.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function R3(a,e,t,n){const s=Ab(a,e,t);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function V0(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Ab(a,e,t){return{i:a,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Y4(a,e,t,n){let s=0;for(let o=e,f=t-n;o2&&a[e-1].equals(a[0])&&a.pop()}function N3(a,e){for(let t=0;tNumber.EPSILON){const Oe=Math.sqrt(F),Pe=Math.sqrt(ht*ht+K*K),Re=Z.x-nt/Oe,Mt=Z.y+ot/Oe,ct=ke.x-K/Pe,wt=ke.y+ht/Pe,_t=((ct-Re)*K-(wt-Mt)*ht)/(ot*K-nt*ht);Xe=Re+ot*_t-Ue.x,tt=Mt+nt*_t-Ue.y;const je=Xe*Xe+tt*tt;if(je<=2)return new ze(Xe,tt);qe=Math.sqrt(je/2)}else{let Oe=!1;ot>Number.EPSILON?ht>Number.EPSILON&&(Oe=!0):ot<-Number.EPSILON?ht<-Number.EPSILON&&(Oe=!0):Math.sign(nt)===Math.sign(K)&&(Oe=!0),Oe?(Xe=-nt,tt=ot,qe=Math.sqrt(F)):(Xe=ot,tt=nt,qe=Math.sqrt(F/2))}return new ze(Xe/qe,tt/qe)}const he=[];for(let Ue=0,Z=ue.length,ke=Z-1,Xe=Ue+1;Ue=0;Ue--){const Z=Ue/w,ke=S*Math.cos(Z*Math.PI/2),Xe=M*Math.sin(Z*Math.PI/2)+T;for(let tt=0,qe=ue.length;tt=0;){const Xe=ke;let tt=ke-1;tt<0&&(tt=Ue.length-1);for(let qe=0,ot=y+w*2;qe0)&&S.push(N,U,z),(A!==n-1||p0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PM extends Va{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xc,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.combine=Z0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class BM extends Va{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new gt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xc,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class IM extends Va{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xc,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class FM extends Va{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new gt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xc,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.combine=Z0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class g1 extends Va{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=$A,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class y1 extends Va{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class jM extends Va{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new gt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xc,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class HM extends ps{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function uf(a,e){return!a||a.constructor===e?a:typeof e.BYTES_PER_ELEMENT=="number"?new e(a):Array.prototype.slice.call(a)}function kM(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)}function VM(a){function e(s,o){return a[s]-a[o]}const t=a.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function Mb(a,e,t){const n=a.length,s=new a.constructor(n);for(let o=0,f=0;f!==n;++o){const d=t[o]*e;for(let p=0;p!==e;++p)s[f++]=a[d+p]}return s}function x1(a,e,t,n){let s=1,o=a[0];for(;o!==void 0&&o[n]===void 0;)o=a[s++];if(o===void 0)return;let f=o[n];if(f!==void 0)if(Array.isArray(f))do f=o[n],f!==void 0&&(e.push(o.time),t.push(...f)),o=a[s++];while(o!==void 0);else if(f.toArray!==void 0)do f=o[n],f!==void 0&&(e.push(o.time),f.toArray(t,t.length)),o=a[s++];while(o!==void 0);else do f=o[n],f!==void 0&&(e.push(o.time),t.push(f)),o=a[s++];while(o!==void 0)}function J4(a,e,t,n,s=30){const o=a.clone();o.name=e;const f=[];for(let p=0;p=n)){x.push(m.times[S]);for(let T=0;To.tracks[p].times[0]&&(d=o.tracks[p].times[0]);for(let p=0;p=d.times[M]){const A=M*x+y,D=A+x-y;T=d.values.slice(A,D)}else{const A=d.createInterpolant(),D=y,N=x-y;A.evaluate(o),T=A.resultBuffer.slice(D,N)}p==="quaternion"&&new ka().fromArray(T).normalize().conjugate().toArray(T);const w=m.times.length;for(let A=0;A=o)){const d=t[1];e=o)break t}f=n,n=0;break n}break e}for(;n>>1;et;)--f;if(++f,o!==0||f!==s){o>=f&&(f=Math.max(f,1),o=f-1);const d=this.getValueSize();this.times=n.slice(o,f),this.values=this.values.slice(o*d,f*d)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Yt("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,o=n.length;o===0&&(Yt("KeyframeTrack: Track is empty.",this),e=!1);let f=null;for(let d=0;d!==o;d++){const p=n[d];if(typeof p=="number"&&isNaN(p)){Yt("KeyframeTrack: Time is not a valid number.",this,d,p),e=!1;break}if(f!==null&&f>p){Yt("KeyframeTrack: Out of order keys.",this,d,p,f),e=!1;break}f=p}if(s!==void 0&&kM(s))for(let d=0,p=s.length;d!==p;++d){const m=s[d];if(isNaN(m)){Yt("KeyframeTrack: Value is not a valid number.",this,d,m),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===Ry,o=e.length-1;let f=1;for(let d=1;d0){e[f]=e[o];for(let d=o*n,p=f*n,m=0;m!==n;++m)t[p+m]=t[d+m];++f}return f!==e.length?(this.times=e.slice(0,f),this.values=t.slice(0,f*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}br.prototype.ValueTypeName="";br.prototype.TimeBufferType=Float32Array;br.prototype.ValueBufferType=Float32Array;br.prototype.DefaultInterpolation=yx;class Mf extends br{constructor(e,t,n){super(e,t,n)}}Mf.prototype.ValueTypeName="bool";Mf.prototype.ValueBufferType=Array;Mf.prototype.DefaultInterpolation=L0;Mf.prototype.InterpolantFactoryMethodLinear=void 0;Mf.prototype.InterpolantFactoryMethodSmooth=void 0;class b1 extends br{constructor(e,t,n,s){super(e,t,n,s)}}b1.prototype.ValueTypeName="color";class G0 extends br{constructor(e,t,n,s){super(e,t,n,s)}}G0.prototype.ValueTypeName="number";class qM extends im{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const o=this.resultBuffer,f=this.sampleValues,d=this.valueSize,p=(n-t)/(s-t);let m=e*d;for(let y=m+d;m!==y;m+=4)ka.slerpFlat(o,0,f,m-d,f,m,p);return o}}class am extends br{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new qM(this.times,this.values,this.getValueSize(),e)}}am.prototype.ValueTypeName="quaternion";am.prototype.InterpolantFactoryMethodSmooth=void 0;class Ef extends br{constructor(e,t,n){super(e,t,n)}}Ef.prototype.ValueTypeName="string";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=L0;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class X0 extends br{constructor(e,t,n,s){super(e,t,n,s)}}X0.prototype.ValueTypeName="vector";class q0{constructor(e="",t=-1,n=[],s=Fx){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=Ks(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let f=0,d=n.length;f!==d;++f)t.push(nR(n[f]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o.userData=JSON.parse(e.userData||"{}"),o}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let o=0,f=n.length;o!==f;++o)t.push(br.toJSON(n[o]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const o=t.length,f=[];for(let d=0;d1){const x=y[1];let v=s[x];v||(s[x]=v=[]),v.push(m)}}const f=[];for(const d in s)f.push(this.CreateFromMorphTargetSequence(d,s[d],t,n));return f}static parseAnimation(e,t){if(mt("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Yt("AnimationClip: No animation in JSONLoader data."),null;const n=function(x,v,S,M,T){if(S.length!==0){const w=[],A=[];x1(S,w,A,M),w.length!==0&&T.push(new x(v,w,A))}},s=[],o=e.name||"default",f=e.fps||30,d=e.blendMode;let p=e.length||-1;const m=e.hierarchy||[];for(let x=0;x{t&&t(o),this.manager.itemEnd(e)},0),o;if(zl[e]!==void 0){zl[e].push({onLoad:t,onProgress:n,onError:s});return}zl[e]=[],zl[e].push({onLoad:t,onProgress:n,onError:s});const f=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),d=this.mimeType,p=this.responseType;fetch(f).then(m=>{if(m.status===200||m.status===0){if(m.status===0&&mt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||m.body===void 0||m.body.getReader===void 0)return m;const y=zl[e],x=m.body.getReader(),v=m.headers.get("X-File-Size")||m.headers.get("Content-Length"),S=v?parseInt(v):0,M=S!==0;let T=0;const w=new ReadableStream({start(A){D();function D(){x.read().then(({done:N,value:U})=>{if(N)A.close();else{T+=U.byteLength;const I=new ProgressEvent("progress",{lengthComputable:M,loaded:T,total:S});for(let z=0,j=y.length;z{A.error(N)})}}});return new Response(w)}else throw new iR(`fetch for "${m.url}" responded with ${m.status}: ${m.statusText}`,m)}).then(m=>{switch(p){case"arraybuffer":return m.arrayBuffer();case"blob":return m.blob();case"document":return m.text().then(y=>new DOMParser().parseFromString(y,d));case"json":return m.json();default:if(d==="")return m.text();{const x=/charset="?([^;"\s]*)"?/i.exec(d),v=x&&x[1]?x[1].toLowerCase():void 0,S=new TextDecoder(v);return m.arrayBuffer().then(M=>S.decode(M))}}}).then(m=>{Vo.add(`file:${e}`,m);const y=zl[e];delete zl[e];for(let x=0,v=y.length;x{const y=zl[e];if(y===void 0)throw this.manager.itemError(e),m;delete zl[e];for(let x=0,v=y.length;x{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class aR extends Ds{constructor(e){super(e)}load(e,t,n,s){const o=this,f=new Gl(this.manager);f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(d){try{t(o.parse(JSON.parse(d)))}catch(p){s?s(p):Yt(p),o.manager.itemError(e)}},n,s)}parse(e){const t=[];for(let n=0;n0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const f=e.uniforms[o];switch(s.uniforms[o]={},f.type){case"t":s.uniforms[o].value=n(f.value);break;case"c":s.uniforms[o].value=new gt().setHex(f.value);break;case"v2":s.uniforms[o].value=new ze().fromArray(f.value);break;case"v3":s.uniforms[o].value=new X().fromArray(f.value);break;case"v4":s.uniforms[o].value=new un().fromArray(f.value);break;case"m3":s.uniforms[o].value=new en().fromArray(f.value);break;case"m4":s.uniforms[o].value=new Gt().fromArray(f.value);break;default:s.uniforms[o].value=f.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)s.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=n(e.map)),e.matcap!==void 0&&(s.matcap=n(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),s.normalScale=new ze().fromArray(o)}return e.displacementMap!==void 0&&(s.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=n(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new ze().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=n(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return cv.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:UM,SpriteMaterial:n1,RawShaderMaterial:LM,ShaderMaterial:hs,PointsMaterial:Wx,MeshPhysicalMaterial:zM,MeshStandardMaterial:m1,MeshPhongMaterial:PM,MeshToonMaterial:BM,MeshNormalMaterial:IM,MeshLambertMaterial:FM,MeshDepthMaterial:g1,MeshDistanceMaterial:y1,MeshBasicMaterial:qc,MeshMatcapMaterial:jM,LineDashedMaterial:HM,LineBasicMaterial:ps,Material:Va};return new t[e]}}class Eb{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class A1 extends tn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class nE extends Ds{constructor(e){super(e)}load(e,t,n,s){const o=this,f=new Gl(o.manager);f.setPath(o.path),f.setRequestHeader(o.requestHeader),f.setWithCredentials(o.withCredentials),f.load(e,function(d){try{t(o.parse(JSON.parse(d)))}catch(p){s?s(p):Yt(p),o.manager.itemError(e)}},n,s)}parse(e){const t={},n={};function s(S,M){if(t[M]!==void 0)return t[M];const w=S.interleavedBuffers[M],A=o(S,w.buffer),D=ah(w.type,A),N=new Xx(D,w.stride);return N.uuid=w.uuid,t[M]=N,N}function o(S,M){if(n[M]!==void 0)return n[M];const w=S.arrayBuffers[M],A=new Uint32Array(w).buffer;return n[M]=A,A}const f=e.isInstancedBufferGeometry?new A1:new tn,d=e.data.index;if(d!==void 0){const S=ah(d.type,d.array);f.setIndex(new jn(S,1))}const p=e.data.attributes;for(const S in p){const M=p[S];let T;if(M.isInterleavedBufferAttribute){const w=s(e.data,M.data);T=new Zs(w,M.itemSize,M.offset,M.normalized)}else{const w=ah(M.type,M.array),A=M.isInstancedBufferAttribute?yh:jn;T=new A(w,M.itemSize,M.normalized)}M.name!==void 0&&(T.name=M.name),M.usage!==void 0&&T.setUsage(M.usage),f.setAttribute(S,T)}const m=e.data.morphAttributes;if(m)for(const S in m){const M=m[S],T=[];for(let w=0,A=M.length;w0){const p=new _1(t);o=new Y0(p),o.setCrossOrigin(this.crossOrigin);for(let m=0,y=e.length;m0){s=new Y0(this.manager),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f{let w=null,A=null;return T.boundingBox!==void 0&&(w=new Zi().fromJSON(T.boundingBox)),T.boundingSphere!==void 0&&(A=new Ki().fromJSON(T.boundingSphere)),{...T,boundingBox:w,boundingSphere:A}}),f._instanceInfo=e.instanceInfo,f._availableInstanceIds=e._availableInstanceIds,f._availableGeometryIds=e._availableGeometryIds,f._nextIndexStart=e.nextIndexStart,f._nextVertexStart=e.nextVertexStart,f._geometryCount=e.geometryCount,f._maxInstanceCount=e.maxInstanceCount,f._maxVertexCount=e.maxVertexCount,f._maxIndexCount=e.maxIndexCount,f._geometryInitialized=e.geometryInitialized,f._matricesTexture=m(e.matricesTexture.uuid),f._indirectTexture=m(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(f._colorsTexture=m(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(f.boundingSphere=new Ki().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(f.boundingBox=new Zi().fromJSON(e.boundingBox));break;case"LOD":f=new xM;break;case"Line":f=new Gc(d(e.geometry),p(e.material));break;case"LineLoop":f=new bM(d(e.geometry),p(e.material));break;case"LineSegments":f=new Ko(d(e.geometry),p(e.material));break;case"PointCloud":case"Points":f=new _M(d(e.geometry),p(e.material));break;case"Sprite":f=new yM(p(e.material));break;case"Group":f=new sh;break;case"Bone":f=new a1;break;default:f=new Rn}if(f.uuid=e.uuid,e.name!==void 0&&(f.name=e.name),e.matrix!==void 0?(f.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(f.matrixAutoUpdate=e.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(e.position!==void 0&&f.position.fromArray(e.position),e.rotation!==void 0&&f.rotation.fromArray(e.rotation),e.quaternion!==void 0&&f.quaternion.fromArray(e.quaternion),e.scale!==void 0&&f.scale.fromArray(e.scale)),e.up!==void 0&&f.up.fromArray(e.up),e.castShadow!==void 0&&(f.castShadow=e.castShadow),e.receiveShadow!==void 0&&(f.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(f.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(f.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(f.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(f.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&f.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(f.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(f.visible=e.visible),e.frustumCulled!==void 0&&(f.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(f.renderOrder=e.renderOrder),e.userData!==void 0&&(f.userData=e.userData),e.layers!==void 0&&(f.layers.mask=e.layers),e.children!==void 0){const v=e.children;for(let S=0;S"u"&&mt("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&mt("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,f=Vo.get(`image-bitmap:${e}`);if(f!==void 0){if(o.manager.itemStart(e),f.then){f.then(m=>{if(I2.has(f)===!0)s&&s(I2.get(f)),o.manager.itemError(e),o.manager.itemEnd(e);else return t&&t(m),o.manager.itemEnd(e),m});return}return setTimeout(function(){t&&t(f),o.manager.itemEnd(e)},0),f}const d={};d.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",d.headers=this.requestHeader,d.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const p=fetch(e,d).then(function(m){return m.blob()}).then(function(m){return createImageBitmap(m,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(m){return Vo.add(`image-bitmap:${e}`,m),t&&t(m),o.manager.itemEnd(e),m}).catch(function(m){s&&s(m),I2.set(p,m),Vo.remove(`image-bitmap:${e}`),o.manager.itemError(e),o.manager.itemEnd(e)});Vo.add(`image-bitmap:${e}`,p),o.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let cy;class M1{static getContext(){return cy===void 0&&(cy=new(window.AudioContext||window.webkitAudioContext)),cy}static setContext(e){cy=e}}class pR extends Ds{constructor(e){super(e)}load(e,t,n,s){const o=this,f=new Gl(this.manager);f.setResponseType("arraybuffer"),f.setPath(this.path),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(p){try{const m=p.slice(0);M1.getContext().decodeAudioData(m,function(x){t(x)}).catch(d)}catch(m){d(m)}},n,s);function d(p){s?s(p):Yt(p),o.manager.itemError(e)}}}const F3=new Gt,j3=new Gt,Wu=new Gt;class mR{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new xi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new xi,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Wu.copy(e.projectionMatrix);const s=t.eyeSep/2,o=s*t.near/t.focus,f=t.near*Math.tan(pf*t.fov*.5)/t.zoom;let d,p;j3.elements[12]=-s,F3.elements[12]=s,d=-f*t.aspect+o,p=f*t.aspect+o,Wu.elements[0]=2*t.near/(p-d),Wu.elements[8]=(p+d)/(p-d),this.cameraL.projectionMatrix.copy(Wu),d=-f*t.aspect-o,p=f*t.aspect-o,Wu.elements[0]=2*t.near/(p-d),Wu.elements[8]=(p+d)/(p-d),this.cameraR.projectionMatrix.copy(Wu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(j3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(F3)}}class iE extends xi{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class E1{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const Zu=new X,F2=new ka,gR=new X,Ku=new X,Qu=new X;class yR extends Rn{constructor(){super(),this.type="AudioListener",this.context=M1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new E1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Zu,F2,gR),Ku.set(0,0,-1).applyQuaternion(F2),Qu.set(0,1,0).applyQuaternion(F2),t.positionX){const n=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Zu.x,n),t.positionY.linearRampToValueAtTime(Zu.y,n),t.positionZ.linearRampToValueAtTime(Zu.z,n),t.forwardX.linearRampToValueAtTime(Ku.x,n),t.forwardY.linearRampToValueAtTime(Ku.y,n),t.forwardZ.linearRampToValueAtTime(Ku.z,n),t.upX.linearRampToValueAtTime(Qu.x,n),t.upY.linearRampToValueAtTime(Qu.y,n),t.upZ.linearRampToValueAtTime(Qu.z,n)}else t.setPosition(Zu.x,Zu.y,Zu.z),t.setOrientation(Ku.x,Ku.y,Ku.z,Qu.x,Qu.y,Qu.z)}}class aE extends Rn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){mt("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){mt("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){mt("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){mt("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let p=t,m=t+t;p!==m;++p)if(n[p]!==n[p+t]){d.setValue(n,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let o=n,f=s;o!==f;++o)t[o]=t[s+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let f=0;f!==o;++f)e[t+f]=e[n+f]}_slerp(e,t,n,s){ka.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,o){const f=this._workIndex*o;ka.multiplyQuaternionsFlat(e,f,e,t,e,n),ka.slerpFlat(e,t,e,t,e,f,s)}_lerp(e,t,n,s,o){const f=1-s;for(let d=0;d!==o;++d){const p=t+d;e[p]=e[p]*f+e[n+d]*s}}_lerpAdditive(e,t,n,s,o){for(let f=0;f!==o;++f){const d=t+f;e[d]=e[d]+e[n+f]*s}}}const w1="\\[\\]\\.:\\/",_R=new RegExp("["+w1+"]","g"),T1="[^"+w1+"]",SR="[^"+w1.replace("\\.","")+"]",AR=/((?:WC+[\/:])*)/.source.replace("WC",T1),MR=/(WCOD+)?/.source.replace("WCOD",SR),ER=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",T1),wR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",T1),TR=new RegExp("^"+AR+MR+ER+wR+"$"),CR=["material","materials","bones","map"];class RR{constructor(e,t,n){const s=n||Cn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=n.length;s!==o;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Cn{constructor(e,t,n){this.path=t,this.parsedPath=n||Cn.parseTrackName(t),this.node=Cn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Cn.Composite(e,t,n):new Cn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(_R,"")}static parseTrackName(e){const t=TR.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=n.nodeName.substring(s+1);CR.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let f=0;f=o){const x=o++,v=e[x];t[v.uuid]=y,e[y]=v,t[m]=x,e[x]=p;for(let S=0,M=s;S!==M;++S){const T=n[S],w=T[x],A=T[y];T[y]=w,T[x]=A}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,s=n.length;let o=this.nCachedObjects_,f=e.length;for(let d=0,p=arguments.length;d!==p;++d){const m=arguments[d],y=m.uuid,x=t[y];if(x!==void 0)if(delete t[y],x0&&(t[S.uuid]=x),e[x]=S,e.pop();for(let M=0,T=s;M!==T;++M){const w=n[M];w[x]=w[v],w.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let s=n[e];const o=this._bindings;if(s!==void 0)return o[s];const f=this._paths,d=this._parsedPaths,p=this._objects,m=p.length,y=this.nCachedObjects_,x=new Array(m);s=o.length,n[e]=s,f.push(e),d.push(t),o.push(x);for(let v=y,S=p.length;v!==S;++v){const M=p[v];x[v]=new Cn(M,e,t)}return x}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const s=this._paths,o=this._parsedPaths,f=this._bindings,d=f.length-1,p=f[d],m=e[d];t[m]=n,f[n]=p,f.pop(),o[n]=o[d],o.pop(),s[n]=s[d],s.pop()}}}class rE{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;const o=t.tracks,f=o.length,d=new Array(f),p={endingStart:lf,endingEnd:lf};for(let m=0;m!==f;++m){const y=o[m].createInterpolant(null);d[m]=y,y.settings=p}this._interpolantSettings=p,this._interpolants=d,this._propertyBindings=new Array(f),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=QA,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const s=this._clip.duration,o=e._clip.duration,f=o/s,d=s/o;e.warp(1,f,t),this.warp(d,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const s=this._mixer,o=s.time,f=this.timeScale;let d=this._timeScaleInterpolant;d===null&&(d=s._lendControlInterpolant(),this._timeScaleInterpolant=d);const p=d.parameterPositions,m=d.sampleValues;return p[0]=o,p[1]=o+n,m[0]=e/f,m[1]=t/f,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const p=(e-o)*n;p<0||n===0?t=0:(this._startTime=null,t=n*p)}t*=this._updateTimeScale(e);const f=this._updateTime(t),d=this._updateWeight(e);if(d>0){const p=this._interpolants,m=this._propertyBindings;switch(this.blendMode){case Zb:for(let y=0,x=p.length;y!==x;++y)p[y].evaluate(f),m[y].accumulateAdditive(d);break;case Fx:default:for(let y=0,x=p.length;y!==x;++y)p[y].evaluate(f),m[y].accumulate(s,d)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let s=this.time+e,o=this._loopCount;const f=n===JA;if(e===0)return o===-1?s:f&&(o&1)===1?t-s:s;if(n===KA){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,f)):this._setEndings(this.repetitions===0,!0,f)),s>=t||s<0){const d=Math.floor(s/t);s-=t*d,o+=Math.abs(d);const p=this.repetitions-o;if(p<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(p===1){const m=e<0;this._setEndings(m,!m,f)}else this._setEndings(!1,!1,f);this._loopCount=o,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d})}}else this.time=s;if(f&&(o&1)===1)return t-s}return s}_setEndings(e,t,n){const s=this._interpolantSettings;n?(s.endingStart=cf,s.endingEnd=cf):(e?s.endingStart=this.zeroSlopeAtStart?cf:lf:s.endingStart=z0,t?s.endingEnd=this.zeroSlopeAtEnd?cf:lf:s.endingEnd=z0)}_scheduleFading(e,t,n){const s=this._mixer,o=s.time;let f=this._weightInterpolant;f===null&&(f=s._lendControlInterpolant(),this._weightInterpolant=f);const d=f.parameterPositions,p=f.sampleValues;return d[0]=o,p[0]=t,d[1]=o+e,p[1]=n,this}}const NR=new Float32Array(1);class OR extends Zo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,s=e._clip.tracks,o=s.length,f=e._propertyBindings,d=e._interpolants,p=n.uuid,m=this._bindingsByRootAndName;let y=m[p];y===void 0&&(y={},m[p]=y);for(let x=0;x!==o;++x){const v=s[x],S=v.name;let M=y[S];if(M!==void 0)++M.referenceCount,f[x]=M;else{if(M=f[x],M!==void 0){M._cacheIndex===null&&(++M.referenceCount,this._addInactiveBinding(M,p,S));continue}const T=t&&t._propertyBindings[x].binding.parsedPath;M=new sE(Cn.create(n,S,T),v.ValueTypeName,v.getValueSize()),++M.referenceCount,this._addInactiveBinding(M,p,S),f[x]=M}d[x].resultBuffer=M.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,s=e._clip.uuid,o=this._actionsByClip[s];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,s,n)}const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const o=t[n];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const o=t[n];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,s=this.time+=e,o=Math.sign(e),f=this._accuIndex^=1;for(let m=0;m!==n;++m)t[m]._update(s,e,o,f);const d=this._bindings,p=this._nActiveBindings;for(let m=0;m!==p;++m)d[m].apply(f);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,G3).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const X3=new X,uy=new X,Qd=new X,Jd=new X,j2=new X,HR=new X,kR=new X;class lE{constructor(e=new X,t=new X){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){X3.subVectors(e,this.start),uy.subVectors(this.end,this.start);const n=uy.dot(uy);let o=uy.dot(X3)/n;return t&&(o=Xt(o,0,1)),o}closestPointToPoint(e,t,n){const s=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(s).add(this.start)}distanceSqToLine3(e,t=HR,n=kR){const s=10000000000000001e-32;let o,f;const d=this.start,p=e.start,m=this.end,y=e.end;Qd.subVectors(m,d),Jd.subVectors(y,p),j2.subVectors(d,p);const x=Qd.dot(Qd),v=Jd.dot(Jd),S=Jd.dot(j2);if(x<=s&&v<=s)return t.copy(d),n.copy(p),t.sub(n),t.dot(t);if(x<=s)o=0,f=S/v,f=Xt(f,0,1);else{const M=Qd.dot(j2);if(v<=s)f=0,o=Xt(-M/x,0,1);else{const T=Qd.dot(Jd),w=x*v-T*T;w!==0?o=Xt((T*S-M*v)/w,0,1):o=0,f=(T*o+S)/v,f<0?(f=0,o=Xt(-M/x,0,1)):f>1&&(f=1,o=Xt((T-M)/x,0,1))}}return t.copy(d).add(Qd.multiplyScalar(o)),n.copy(p).add(Jd.multiplyScalar(f)),t.sub(n),t.dot(t)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const q3=new X;class VR extends Rn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new tn,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let f=0,d=1,p=32;f1)for(let x=0;x.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Q3.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Q3,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class n5 extends Ko{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new tn;s.setAttribute("position",new At(t,3)),s.setAttribute("color",new At(n,3));const o=new ps({vertexColors:!0,toneMapped:!1});super(s,o),this.type="AxesHelper"}setColors(e,t,n){const s=new gt,o=this.geometry.attributes.color.array;return s.set(e),s.toArray(o,0),s.toArray(o,3),s.set(t),s.toArray(o,6),s.toArray(o,9),s.set(n),s.toArray(o,12),s.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class i5{constructor(){this.type="ShapePath",this.color=new gt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new _x,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,s){return this.currentPath.quadraticCurveTo(e,t,n,s),this}bezierCurveTo(e,t,n,s,o,f){return this.currentPath.bezierCurveTo(e,t,n,s,o,f),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(A){const D=[];for(let N=0,U=A.length;NNumber.EPSILON){if(P<0&&(j=D[z],B=-B,q=D[I],P=-P),A.yq.y)continue;if(A.y===j.y){if(A.x===j.x)return!0}else{const W=P*(A.x-j.x)-B*(A.y-j.y);if(W===0)return!0;if(W<0)continue;U=!U}}else{if(A.y!==j.y)continue;if(q.x<=A.x&&A.x<=j.x||j.x<=A.x&&A.x<=q.x)return!0}}return U}const s=Jr.isClockWise,o=this.subPaths;if(o.length===0)return[];let f,d,p;const m=[];if(o.length===1)return d=o[0],p=new mf,p.curves=d.curves,m.push(p),m;let y=!s(o[0].getPoints());y=e?!y:y;const x=[],v=[];let S=[],M=0,T;v[M]=void 0,S[M]=[];for(let A=0,D=o.length;A1){let A=!1,D=0;for(let N=0,U=v.length;N0&&A===!1&&(S=x)}let w;for(let A=0,D=v.length;Ae?(a.repeat.x=1,a.repeat.y=t/e,a.offset.x=0,a.offset.y=(1-a.repeat.y)/2):(a.repeat.x=e/t,a.repeat.y=1,a.offset.x=(1-a.repeat.x)/2,a.offset.y=0),a}function r5(a,e){const t=a.image&&a.image.width?a.image.width/a.image.height:1;return t>e?(a.repeat.x=e/t,a.repeat.y=1,a.offset.x=(1-a.repeat.x)/2,a.offset.y=0):(a.repeat.x=1,a.repeat.y=t/e,a.offset.x=0,a.offset.y=(1-a.repeat.y)/2),a}function o5(a){return a.repeat.x=1,a.repeat.y=1,a.offset.x=0,a.offset.y=0,a}function Tb(a,e,t,n){const s=l5(n);switch(t){case Yb:return a*e;case zx:return a*e/s.components*s.byteLength;case K0:return a*e/s.components*s.byteLength;case Px:return a*e*2/s.components*s.byteLength;case Bx:return a*e*2/s.components*s.byteLength;case Wb:return a*e*3/s.components*s.byteLength;case Ha:return a*e*4/s.components*s.byteLength;case Ix:return a*e*4/s.components*s.byteLength;case _0:case S0:return Math.floor((a+3)/4)*Math.floor((e+3)/4)*8;case A0:case M0:return Math.floor((a+3)/4)*Math.floor((e+3)/4)*16;case Gy:case qy:return Math.max(a,16)*Math.max(e,8)/4;case Vy:case Xy:return Math.max(a,8)*Math.max(e,8)/2;case Yy:case Wy:return Math.floor((a+3)/4)*Math.floor((e+3)/4)*8;case Zy:return Math.floor((a+3)/4)*Math.floor((e+3)/4)*16;case Ky:return Math.floor((a+3)/4)*Math.floor((e+3)/4)*16;case Qy:return Math.floor((a+4)/5)*Math.floor((e+3)/4)*16;case Jy:return Math.floor((a+4)/5)*Math.floor((e+4)/5)*16;case $y:return Math.floor((a+5)/6)*Math.floor((e+4)/5)*16;case ex:return Math.floor((a+5)/6)*Math.floor((e+5)/6)*16;case tx:return Math.floor((a+7)/8)*Math.floor((e+4)/5)*16;case nx:return Math.floor((a+7)/8)*Math.floor((e+5)/6)*16;case ix:return Math.floor((a+7)/8)*Math.floor((e+7)/8)*16;case ax:return Math.floor((a+9)/10)*Math.floor((e+4)/5)*16;case sx:return Math.floor((a+9)/10)*Math.floor((e+5)/6)*16;case rx:return Math.floor((a+9)/10)*Math.floor((e+7)/8)*16;case ox:return Math.floor((a+9)/10)*Math.floor((e+9)/10)*16;case lx:return Math.floor((a+11)/12)*Math.floor((e+9)/10)*16;case cx:return Math.floor((a+11)/12)*Math.floor((e+11)/12)*16;case ux:case fx:case dx:return Math.ceil(a/4)*Math.ceil(e/4)*16;case hx:case px:return Math.ceil(a/4)*Math.ceil(e/4)*8;case mx:case gx:return Math.ceil(a/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function l5(a){switch(a){case xr:case Vb:return{byteLength:1,components:1};case lh:case Gb:case _f:return{byteLength:2,components:1};case Ux:case Lx:return{byteLength:2,components:4};case Vl:case Ox:case Rs:return{byteLength:4,components:1};case Xb:case qb:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${a}.`)}class c5{static contain(e,t){return s5(e,t)}static cover(e,t){return r5(e,t)}static fill(e){return o5(e)}static getByteLength(e,t,n,s){return Tb(e,t,n,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_h}}));typeof window<"u"&&(window.__THREE__?mt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_h);function uE(){let a=null,e=!1,t=null,n=null;function s(o,f){t(o,f),n=a.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(n=a.requestAnimationFrame(s),e=!0)},stop:function(){a.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){a=o}}}function u5(a){const e=new WeakMap;function t(d,p){const m=d.array,y=d.usage,x=m.byteLength,v=a.createBuffer();a.bindBuffer(p,v),a.bufferData(p,m,y),d.onUploadCallback();let S;if(m instanceof Float32Array)S=a.FLOAT;else if(typeof Float16Array<"u"&&m instanceof Float16Array)S=a.HALF_FLOAT;else if(m instanceof Uint16Array)d.isFloat16BufferAttribute?S=a.HALF_FLOAT:S=a.UNSIGNED_SHORT;else if(m instanceof Int16Array)S=a.SHORT;else if(m instanceof Uint32Array)S=a.UNSIGNED_INT;else if(m instanceof Int32Array)S=a.INT;else if(m instanceof Int8Array)S=a.BYTE;else if(m instanceof Uint8Array)S=a.UNSIGNED_BYTE;else if(m instanceof Uint8ClampedArray)S=a.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+m);return{buffer:v,type:S,bytesPerElement:m.BYTES_PER_ELEMENT,version:d.version,size:x}}function n(d,p,m){const y=p.array,x=p.updateRanges;if(a.bindBuffer(m,d),x.length===0)a.bufferSubData(m,0,y);else{x.sort((S,M)=>S.start-M.start);let v=0;for(let S=1;S 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,T5=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,C5=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,R5=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,D5=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,N5=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,O5=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,U5=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,L5=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,z5=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,P5=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,B5=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,I5=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,F5=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,j5=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,H5="gl_FragColor = linearToOutputTexel( gl_FragColor );",k5=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,V5=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,G5=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif +#endif`,X5=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,q5=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Y5=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,W5=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Z5=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,K5=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Q5=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,J5=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,$5=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,eD=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,tD=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,nD=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,iD=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,aD=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,sD=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,rD=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,oD=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lD=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,cD=`uniform sampler2D dfgLUT; +struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 uv = vec2( roughness, dotNV ); + return texture2D( dfgLUT, uv ).rg; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness ); + vec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness ); + vec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y; + vec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y; + float Ess_V = dfgV.x + dfgV.y; + float Ess_L = dfgL.x + dfgL.y; + float Ems_V = 1.0 - Ess_V; + float Ems_L = 1.0 - Ess_L; + vec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619; + vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON ); + float compensationFactor = Ems_V * Ems_L; + vec3 multiScatter = Fms * compensationFactor; + return singleScatter + multiScatter; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,uD=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,fD=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,dD=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,hD=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,pD=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,mD=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,gD=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,yD=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,xD=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,vD=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,bD=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,_D=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,SD=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,AD=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,MD=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,ED=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,wD=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,TD=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,CD=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,RD=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,DD=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,ND=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,OD=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,UD=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,LD=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,zD=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,PD=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,BD=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,ID=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,FD=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,jD=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,HD=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,kD=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,VD=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,GD=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,XD=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,qD=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); + #ifdef USE_REVERSED_DEPTH_BUFFER + return step( depth, compare ); + #else + return step( compare, depth ); + #endif + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow( sampler2D shadow, vec2 uv, float compare ) { + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( distribution.x, compare ); + #else + float hard_shadow = step( compare, distribution.x ); + #endif + if ( hard_shadow != 1.0 ) { + float distance = compare - distribution.x; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,YD=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,WD=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,ZD=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,KD=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,QD=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,JD=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,$D=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,eN=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,tN=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,nN=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,iN=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,aN=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,sN=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,rN=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,oN=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,lN=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,cN=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const uN=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,fN=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,dN=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,hN=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,pN=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,mN=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,gN=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,yN=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,xN=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,vN=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,bN=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,_N=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,SN=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,AN=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,MN=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,EN=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,wN=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,TN=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,CN=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,RN=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,DN=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,NN=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,ON=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,UN=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,LN=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,zN=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,PN=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,BN=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,IN=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,FN=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,jN=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,HN=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,kN=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,VN=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,on={alphahash_fragment:f5,alphahash_pars_fragment:d5,alphamap_fragment:h5,alphamap_pars_fragment:p5,alphatest_fragment:m5,alphatest_pars_fragment:g5,aomap_fragment:y5,aomap_pars_fragment:x5,batching_pars_vertex:v5,batching_vertex:b5,begin_vertex:_5,beginnormal_vertex:S5,bsdfs:A5,iridescence_fragment:M5,bumpmap_pars_fragment:E5,clipping_planes_fragment:w5,clipping_planes_pars_fragment:T5,clipping_planes_pars_vertex:C5,clipping_planes_vertex:R5,color_fragment:D5,color_pars_fragment:N5,color_pars_vertex:O5,color_vertex:U5,common:L5,cube_uv_reflection_fragment:z5,defaultnormal_vertex:P5,displacementmap_pars_vertex:B5,displacementmap_vertex:I5,emissivemap_fragment:F5,emissivemap_pars_fragment:j5,colorspace_fragment:H5,colorspace_pars_fragment:k5,envmap_fragment:V5,envmap_common_pars_fragment:G5,envmap_pars_fragment:X5,envmap_pars_vertex:q5,envmap_physical_pars_fragment:iD,envmap_vertex:Y5,fog_vertex:W5,fog_pars_vertex:Z5,fog_fragment:K5,fog_pars_fragment:Q5,gradientmap_pars_fragment:J5,lightmap_pars_fragment:$5,lights_lambert_fragment:eD,lights_lambert_pars_fragment:tD,lights_pars_begin:nD,lights_toon_fragment:aD,lights_toon_pars_fragment:sD,lights_phong_fragment:rD,lights_phong_pars_fragment:oD,lights_physical_fragment:lD,lights_physical_pars_fragment:cD,lights_fragment_begin:uD,lights_fragment_maps:fD,lights_fragment_end:dD,logdepthbuf_fragment:hD,logdepthbuf_pars_fragment:pD,logdepthbuf_pars_vertex:mD,logdepthbuf_vertex:gD,map_fragment:yD,map_pars_fragment:xD,map_particle_fragment:vD,map_particle_pars_fragment:bD,metalnessmap_fragment:_D,metalnessmap_pars_fragment:SD,morphinstance_vertex:AD,morphcolor_vertex:MD,morphnormal_vertex:ED,morphtarget_pars_vertex:wD,morphtarget_vertex:TD,normal_fragment_begin:CD,normal_fragment_maps:RD,normal_pars_fragment:DD,normal_pars_vertex:ND,normal_vertex:OD,normalmap_pars_fragment:UD,clearcoat_normal_fragment_begin:LD,clearcoat_normal_fragment_maps:zD,clearcoat_pars_fragment:PD,iridescence_pars_fragment:BD,opaque_fragment:ID,packing:FD,premultiplied_alpha_fragment:jD,project_vertex:HD,dithering_fragment:kD,dithering_pars_fragment:VD,roughnessmap_fragment:GD,roughnessmap_pars_fragment:XD,shadowmap_pars_fragment:qD,shadowmap_pars_vertex:YD,shadowmap_vertex:WD,shadowmask_pars_fragment:ZD,skinbase_vertex:KD,skinning_pars_vertex:QD,skinning_vertex:JD,skinnormal_vertex:$D,specularmap_fragment:eN,specularmap_pars_fragment:tN,tonemapping_fragment:nN,tonemapping_pars_fragment:iN,transmission_fragment:aN,transmission_pars_fragment:sN,uv_pars_fragment:rN,uv_pars_vertex:oN,uv_vertex:lN,worldpos_vertex:cN,background_vert:uN,background_frag:fN,backgroundCube_vert:dN,backgroundCube_frag:hN,cube_vert:pN,cube_frag:mN,depth_vert:gN,depth_frag:yN,distanceRGBA_vert:xN,distanceRGBA_frag:vN,equirect_vert:bN,equirect_frag:_N,linedashed_vert:SN,linedashed_frag:AN,meshbasic_vert:MN,meshbasic_frag:EN,meshlambert_vert:wN,meshlambert_frag:TN,meshmatcap_vert:CN,meshmatcap_frag:RN,meshnormal_vert:DN,meshnormal_frag:NN,meshphong_vert:ON,meshphong_frag:UN,meshphysical_vert:LN,meshphysical_frag:zN,meshtoon_vert:PN,meshtoon_frag:BN,points_vert:IN,points_frag:FN,shadow_vert:jN,shadow_frag:HN,sprite_vert:kN,sprite_frag:VN},dt={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new en},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new en}},envmap:{envMap:{value:null},envMapRotation:{value:new en},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new en}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new en}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new en},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new en},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new en},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new en}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new en}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new en}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0},uvTransform:{value:new en}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new en},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0}}},Kr={basic:{uniforms:cs([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:on.meshbasic_vert,fragmentShader:on.meshbasic_frag},lambert:{uniforms:cs([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:on.meshlambert_vert,fragmentShader:on.meshlambert_frag},phong:{uniforms:cs([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:on.meshphong_vert,fragmentShader:on.meshphong_frag},standard:{uniforms:cs([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:on.meshphysical_vert,fragmentShader:on.meshphysical_frag},toon:{uniforms:cs([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new gt(0)}}]),vertexShader:on.meshtoon_vert,fragmentShader:on.meshtoon_frag},matcap:{uniforms:cs([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:on.meshmatcap_vert,fragmentShader:on.meshmatcap_frag},points:{uniforms:cs([dt.points,dt.fog]),vertexShader:on.points_vert,fragmentShader:on.points_frag},dashed:{uniforms:cs([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:on.linedashed_vert,fragmentShader:on.linedashed_frag},depth:{uniforms:cs([dt.common,dt.displacementmap]),vertexShader:on.depth_vert,fragmentShader:on.depth_frag},normal:{uniforms:cs([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:on.meshnormal_vert,fragmentShader:on.meshnormal_frag},sprite:{uniforms:cs([dt.sprite,dt.fog]),vertexShader:on.sprite_vert,fragmentShader:on.sprite_frag},background:{uniforms:{uvTransform:{value:new en},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:on.background_vert,fragmentShader:on.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new en}},vertexShader:on.backgroundCube_vert,fragmentShader:on.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:on.cube_vert,fragmentShader:on.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:on.equirect_vert,fragmentShader:on.equirect_frag},distanceRGBA:{uniforms:cs([dt.common,dt.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:on.distanceRGBA_vert,fragmentShader:on.distanceRGBA_frag},shadow:{uniforms:cs([dt.lights,dt.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:on.shadow_vert,fragmentShader:on.shadow_frag}};Kr.physical={uniforms:cs([Kr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new en},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new en},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new en},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new en},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new en},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new en},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new en},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new en},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new en},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new en},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new en},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new en}}]),vertexShader:on.meshphysical_vert,fragmentShader:on.meshphysical_frag};const gy={r:0,b:0,g:0},ef=new ds,GN=new Gt;function XN(a,e,t,n,s,o,f){const d=new gt(0);let p=o===!0?0:1,m,y,x=null,v=0,S=null;function M(N){let U=N.isScene===!0?N.background:null;return U&&U.isTexture&&(U=(N.backgroundBlurriness>0?t:e).get(U)),U}function T(N){let U=!1;const I=M(N);I===null?A(d,p):I&&I.isColor&&(A(I,1),U=!0);const z=a.xr.getEnvironmentBlendMode();z==="additive"?n.buffers.color.setClear(0,0,0,1,f):z==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,f),(a.autoClear||U)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil))}function w(N,U){const I=M(U);I&&(I.isCubeTexture||I.mapping===Sh)?(y===void 0&&(y=new Li(new Af(1,1,1),new hs({name:"BackgroundCubeMaterial",uniforms:gh(Kr.backgroundCube.uniforms),vertexShader:Kr.backgroundCube.vertexShader,fragmentShader:Kr.backgroundCube.fragmentShader,side:Ma,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),y.geometry.deleteAttribute("normal"),y.geometry.deleteAttribute("uv"),y.onBeforeRender=function(z,j,q){this.matrixWorld.copyPosition(q.matrixWorld)},Object.defineProperty(y.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(y)),ef.copy(U.backgroundRotation),ef.x*=-1,ef.y*=-1,ef.z*=-1,I.isCubeTexture&&I.isRenderTargetTexture===!1&&(ef.y*=-1,ef.z*=-1),y.material.uniforms.envMap.value=I,y.material.uniforms.flipEnvMap.value=I.isCubeTexture&&I.isRenderTargetTexture===!1?-1:1,y.material.uniforms.backgroundBlurriness.value=U.backgroundBlurriness,y.material.uniforms.backgroundIntensity.value=U.backgroundIntensity,y.material.uniforms.backgroundRotation.value.setFromMatrix4(GN.makeRotationFromEuler(ef)),y.material.toneMapped=wn.getTransfer(I.colorSpace)!==Gn,(x!==I||v!==I.version||S!==a.toneMapping)&&(y.material.needsUpdate=!0,x=I,v=I.version,S=a.toneMapping),y.layers.enableAll(),N.unshift(y,y.geometry,y.material,0,0,null)):I&&I.isTexture&&(m===void 0&&(m=new Li(new Mh(2,2),new hs({name:"BackgroundMaterial",uniforms:gh(Kr.background.uniforms),vertexShader:Kr.background.vertexShader,fragmentShader:Kr.background.fragmentShader,side:Hl,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=I,m.material.uniforms.backgroundIntensity.value=U.backgroundIntensity,m.material.toneMapped=wn.getTransfer(I.colorSpace)!==Gn,I.matrixAutoUpdate===!0&&I.updateMatrix(),m.material.uniforms.uvTransform.value.copy(I.matrix),(x!==I||v!==I.version||S!==a.toneMapping)&&(m.material.needsUpdate=!0,x=I,v=I.version,S=a.toneMapping),m.layers.enableAll(),N.unshift(m,m.geometry,m.material,0,0,null))}function A(N,U){N.getRGB(gy,hM(a)),n.buffers.color.setClear(gy.r,gy.g,gy.b,U,f)}function D(){y!==void 0&&(y.geometry.dispose(),y.material.dispose(),y=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return d},setClearColor:function(N,U=1){d.set(N),p=U,A(d,p)},getClearAlpha:function(){return p},setClearAlpha:function(N){p=N,A(d,p)},render:T,addToRenderList:w,dispose:D}}function qN(a,e){const t=a.getParameter(a.MAX_VERTEX_ATTRIBS),n={},s=v(null);let o=s,f=!1;function d(P,W,se,ae,ce){let ue=!1;const V=x(ae,se,W);o!==V&&(o=V,m(o.object)),ue=S(P,ae,se,ce),ue&&M(P,ae,se,ce),ce!==null&&e.update(ce,a.ELEMENT_ARRAY_BUFFER),(ue||f)&&(f=!1,U(P,W,se,ae),ce!==null&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,e.get(ce).buffer))}function p(){return a.createVertexArray()}function m(P){return a.bindVertexArray(P)}function y(P){return a.deleteVertexArray(P)}function x(P,W,se){const ae=se.wireframe===!0;let ce=n[P.id];ce===void 0&&(ce={},n[P.id]=ce);let ue=ce[W.id];ue===void 0&&(ue={},ce[W.id]=ue);let V=ue[ae];return V===void 0&&(V=v(p()),ue[ae]=V),V}function v(P){const W=[],se=[],ae=[];for(let ce=0;ce=0){const ve=ce[J];let Y=ue[J];if(Y===void 0&&(J==="instanceMatrix"&&P.instanceMatrix&&(Y=P.instanceMatrix),J==="instanceColor"&&P.instanceColor&&(Y=P.instanceColor)),ve===void 0||ve.attribute!==Y||Y&&ve.data!==Y.data)return!0;V++}return o.attributesNum!==V||o.index!==ae}function M(P,W,se,ae){const ce={},ue=W.attributes;let V=0;const $=se.getAttributes();for(const J in $)if($[J].location>=0){let ve=ue[J];ve===void 0&&(J==="instanceMatrix"&&P.instanceMatrix&&(ve=P.instanceMatrix),J==="instanceColor"&&P.instanceColor&&(ve=P.instanceColor));const Y={};Y.attribute=ve,ve&&ve.data&&(Y.data=ve.data),ce[J]=Y,V++}o.attributes=ce,o.attributesNum=V,o.index=ae}function T(){const P=o.newAttributes;for(let W=0,se=P.length;W=0){let he=ce[$];if(he===void 0&&($==="instanceMatrix"&&P.instanceMatrix&&(he=P.instanceMatrix),$==="instanceColor"&&P.instanceColor&&(he=P.instanceColor)),he!==void 0){const ve=he.normalized,Y=he.itemSize,oe=e.get(he);if(oe===void 0)continue;const Te=oe.buffer,Ne=oe.type,Qe=oe.bytesPerElement,le=Ne===a.INT||Ne===a.UNSIGNED_INT||he.gpuType===Ox;if(he.isInterleavedBufferAttribute){const xe=he.data,Ge=xe.stride,et=he.offset;if(xe.isInstancedInterleavedBuffer){for(let at=0;at0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0)return"highp";j="mediump"}return j==="mediump"&&a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let m=t.precision!==void 0?t.precision:"highp";const y=p(m);y!==m&&(mt("WebGLRenderer:",m,"not supported, using",y,"instead."),m=y);const x=t.logarithmicDepthBuffer===!0,v=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),S=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),M=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),T=a.getParameter(a.MAX_TEXTURE_SIZE),w=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),A=a.getParameter(a.MAX_VERTEX_ATTRIBS),D=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),N=a.getParameter(a.MAX_VARYING_VECTORS),U=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),I=M>0,z=a.getParameter(a.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:p,textureFormatReadable:f,textureTypeReadable:d,precision:m,logarithmicDepthBuffer:x,reversedDepthBuffer:v,maxTextures:S,maxVertexTextures:M,maxTextureSize:T,maxCubemapSize:w,maxAttributes:A,maxVertexUniforms:D,maxVaryings:N,maxFragmentUniforms:U,vertexTextures:I,maxSamples:z}}function ZN(a){const e=this;let t=null,n=0,s=!1,o=!1;const f=new Bl,d=new en,p={value:null,needsUpdate:!1};this.uniform=p,this.numPlanes=0,this.numIntersection=0,this.init=function(x,v){const S=x.length!==0||v||n!==0||s;return s=v,n=x.length,S},this.beginShadows=function(){o=!0,y(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(x,v){t=y(x,v,0)},this.setState=function(x,v,S){const M=x.clippingPlanes,T=x.clipIntersection,w=x.clipShadows,A=a.get(x);if(!s||M===null||M.length===0||o&&!w)o?y(null):m();else{const D=o?0:n,N=D*4;let U=A.clippingState||null;p.value=U,U=y(M,v,N,S);for(let I=0;I!==N;++I)U[I]=t[I];A.clippingState=U,this.numIntersection=T?this.numPlanes:0,this.numPlanes+=D}};function m(){p.value!==t&&(p.value=t,p.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function y(x,v,S,M){const T=x!==null?x.length:0;let w=null;if(T!==0){if(w=p.value,M!==!0||w===null){const A=S+T*4,D=v.matrixWorldInverse;d.getNormalMatrix(D),(w===null||w.length0){const m=new mM(p.height);return m.fromEquirectangularTexture(a,f),e.set(f,m),f.addEventListener("dispose",s),t(m.texture,f.mapping)}else return null}}return f}function s(f){const d=f.target;d.removeEventListener("dispose",s);const p=e.get(d);p!==void 0&&(e.delete(d),p.dispose())}function o(){e=new WeakMap}return{get:n,dispose:o}}const jc=4,J3=[.125,.215,.35,.446,.526,.582],of=20,QN=256,p0=new qo,$3=new gt;let V2=null,G2=0,X2=0,q2=!1;const JN=new X;class Cb{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,s=100,o={}){const{size:f=256,position:d=JN}=o;V2=this._renderer.getRenderTarget(),G2=this._renderer.getActiveCubeFace(),X2=this._renderer.getActiveMipmapLevel(),q2=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(f);const p=this._allocateTargets();return p.depthBuffer=!0,this._sceneToCubeUV(e,n,s,p,d),t>0&&this._blur(p,0,0,t),this._applyPMREM(p),this._cleanup(p),p}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=nS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=tS(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?I:0,I,I),x.setRenderTarget(s),A&&x.render(T,p),x.render(e,p)}x.toneMapping=S,x.autoClear=v,e.background=D}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===kl||e.mapping===Hc;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=nS()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=tS());const o=s?this._cubemapMaterial:this._equirectMaterial,f=this._lodMeshes[0];f.material=o;const d=o.uniforms;d.envMap.value=e;const p=this._cubeSize;$d(t,0,0,3*p,2*p),n.setRenderTarget(t),n.render(f,p0)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodMeshes.length;for(let o=1;oM-jc?n-M+jc:0),A=4*(this._cubeSize-T);p.envMap.value=e.texture,p.roughness.value=S,p.mipInt.value=M-t,$d(o,w,A,3*T,2*T),s.setRenderTarget(o),s.render(d,p0),p.envMap.value=o.texture,p.roughness.value=0,p.mipInt.value=M-n,$d(e,w,A,3*T,2*T),s.setRenderTarget(e),s.render(d,p0)}_blur(e,t,n,s,o){const f=this._pingPongRenderTarget;this._halfBlur(e,f,t,n,s,"latitudinal",o),this._halfBlur(f,e,n,n,s,"longitudinal",o)}_halfBlur(e,t,n,s,o,f,d){const p=this._renderer,m=this._blurMaterial;f!=="latitudinal"&&f!=="longitudinal"&&Yt("blur direction must be either latitudinal or longitudinal!");const y=3,x=this._lodMeshes[s];x.material=m;const v=m.uniforms,S=this._sizeLods[n]-1,M=isFinite(o)?Math.PI/(2*S):2*Math.PI/(2*of-1),T=o/M,w=isFinite(o)?1+Math.floor(y*T):of;w>of&&mt(`sigmaRadians, ${o}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${of}`);const A=[];let D=0;for(let j=0;jN-jc?s-N+jc:0),z=4*(this._cubeSize-U);$d(t,I,z,3*U,2*U),p.setRenderTarget(t),p.render(x,p0)}}function $N(a){const e=[],t=[],n=[];let s=a;const o=a-jc+1+J3.length;for(let f=0;fa-jc?p=J3[f-a+jc-1]:f===0&&(p=0),t.push(p);const m=1/(d-2),y=-m,x=1+m,v=[y,y,x,y,x,x,y,y,x,x,y,x],S=6,M=6,T=3,w=2,A=1,D=new Float32Array(T*M*S),N=new Float32Array(w*M*S),U=new Float32Array(A*M*S);for(let z=0;z2?0:-1,B=[j,q,0,j+2/3,q,0,j+2/3,q+1,0,j,q,0,j+2/3,q+1,0,j,q+1,0];D.set(B,T*M*z),N.set(v,w*M*z);const P=[z,z,z,z,z,z];U.set(P,A*M*z)}const I=new tn;I.setAttribute("position",new jn(D,T)),I.setAttribute("uv",new jn(N,w)),I.setAttribute("faceIndex",new jn(U,A)),n.push(new Li(I,null)),s>jc&&s--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function eS(a,e,t){const n=new Wo(a,e,t);return n.texture.mapping=Sh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function $d(a,e,t,n,s){a.viewport.set(e,t,n,s),a.scissor.set(e,t,n,s)}function e6(a,e,t){return new hs({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:QN,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:fv(),fragmentShader:` + + precision highp float; + precision highp int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform float roughness; + uniform float mipInt; + + #define ENVMAP_TYPE_CUBE_UV + #include + + #define PI 3.14159265359 + + // Van der Corput radical inverse + float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 + } + + // Hammersley sequence + vec2 hammersley(uint i, uint N) { + return vec2(float(i) / float(N), radicalInverse_VdC(i)); + } + + // GGX VNDF importance sampling (Eric Heitz 2018) + // "Sampling the GGX Distribution of Visible Normals" + // https://jcgt.org/published/0007/04/01/ + vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { + float alpha = roughness * roughness; + + // Section 3.2: Transform view direction to hemisphere configuration + vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); + + // Section 4.1: Orthonormal basis + float lensq = Vh.x * Vh.x + Vh.y * Vh.y; + vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); + vec3 T2 = cross(Vh, T1); + + // Section 4.2: Parameterization of projected area + float r = sqrt(Xi.x); + float phi = 2.0 * PI * Xi.y; + float t1 = r * cos(phi); + float t2 = r * sin(phi); + float s = 0.5 * (1.0 + Vh.z); + t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; + + // Section 4.3: Reprojection onto hemisphere + vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; + + // Section 3.4: Transform back to ellipsoid configuration + return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); + } + + void main() { + vec3 N = normalize(vOutputDirection); + vec3 V = N; // Assume view direction equals normal for pre-filtering + + vec3 prefilteredColor = vec3(0.0); + float totalWeight = 0.0; + + // For very low roughness, just sample the environment directly + if (roughness < 0.001) { + gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); + return; + } + + // Tangent space basis for VNDF sampling + vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + + for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { + vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); + + // For PMREM, V = N, so in tangent space V is always (0, 0, 1) + vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); + + // Transform H back to world space + vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); + vec3 L = normalize(2.0 * dot(V, H) * H - V); + + float NdotL = max(dot(N, L), 0.0); + + if(NdotL > 0.0) { + // Sample environment at fixed mip level + // VNDF importance sampling handles the distribution filtering + vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); + + // Weight by NdotL for the split-sum approximation + // VNDF PDF naturally accounts for the visible microfacet distribution + prefilteredColor += sampleColor * NdotL; + totalWeight += NdotL; + } + } + + if (totalWeight > 0.0) { + prefilteredColor = prefilteredColor / totalWeight; + } + + gl_FragColor = vec4(prefilteredColor, 1.0); + } + `,blending:Go,depthTest:!1,depthWrite:!1})}function t6(a,e,t){const n=new Float32Array(of),s=new X(0,1,0);return new hs({name:"SphericalGaussianBlur",defines:{n:of,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:fv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Go,depthTest:!1,depthWrite:!1})}function tS(){return new hs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:fv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Go,depthTest:!1,depthWrite:!1})}function nS(){return new hs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:fv(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Go,depthTest:!1,depthWrite:!1})}function fv(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function n6(a){let e=new WeakMap,t=null;function n(d){if(d&&d.isTexture){const p=d.mapping,m=p===D0||p===N0,y=p===kl||p===Hc;if(m||y){let x=e.get(d);const v=x!==void 0?x.texture.pmremVersion:0;if(d.isRenderTargetTexture&&d.pmremVersion!==v)return t===null&&(t=new Cb(a)),x=m?t.fromEquirectangular(d,x):t.fromCubemap(d,x),x.texture.pmremVersion=d.pmremVersion,e.set(d,x),x.texture;if(x!==void 0)return x.texture;{const S=d.image;return m&&S&&S.height>0||y&&S&&s(S)?(t===null&&(t=new Cb(a)),x=m?t.fromEquirectangular(d):t.fromCubemap(d),x.texture.pmremVersion=d.pmremVersion,e.set(d,x),d.addEventListener("dispose",o),x.texture):null}}}return d}function s(d){let p=0;const m=6;for(let y=0;ye.maxTextureSize&&(I=Math.ceil(U/e.maxTextureSize),U=e.maxTextureSize);const z=new Float32Array(U*I*4*x),j=new jx(z,U,I,x);j.type=Rs,j.needsUpdate=!0;const q=N*4;for(let P=0;P0)return a;const s=e*t;let o=aS[s];if(o===void 0&&(o=new Float32Array(s),aS[s]=o),e!==0){n.toArray(o,0);for(let f=1,d=0;f!==e;++f)d+=t,a[f].toArray(o,d)}return o}function Qi(a,e){if(a.length!==e.length)return!1;for(let t=0,n=a.length;t":" "} ${d}: ${t[f]}`)}return n.join(` +`)}const fS=new en;function nO(a){wn._getMatrix(fS,wn.workingColorSpace,a);const e=`mat3( ${fS.elements.map(t=>t.toFixed(4))} )`;switch(wn.getTransfer(a)){case P0:return[e,"LinearTransferOETF"];case Gn:return[e,"sRGBTransferOETF"];default:return mt("WebGLProgram: Unsupported color space: ",a),[e,"LinearTransferOETF"]}}function dS(a,e,t){const n=a.getShaderParameter(e,a.COMPILE_STATUS),o=(a.getShaderInfoLog(e)||"").trim();if(n&&o==="")return"";const f=/ERROR: 0:(\d+)/.exec(o);if(f){const d=parseInt(f[1]);return t.toUpperCase()+` + +`+o+` + +`+tO(a.getShaderSource(e),d)}else return o}function iO(a,e){const t=nO(e);return[`vec4 ${a}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function aO(a,e){let t;switch(e){case VA:t="Linear";break;case GA:t="Reinhard";break;case XA:t="Cineon";break;case Hb:t="ACESFilmic";break;case YA:t="AgX";break;case WA:t="Neutral";break;case qA:t="Custom";break;default:mt("WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+a+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const yy=new X;function sO(){wn.getLuminanceCoefficients(yy);const a=yy.x.toFixed(4),e=yy.y.toFixed(4),t=yy.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${a}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function rO(a){return[a.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",a.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(x0).join(` +`)}function oO(a){const e=[];for(const t in a){const n=a[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` +`)}function lO(a,e){const t={},n=a.getProgramParameter(e,a.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Rb(a){return a.replace(cO,fO)}const uO=new Map;function fO(a,e){let t=on[e];if(t===void 0){const n=uO.get(e);if(n!==void 0)t=on[n],mt('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Rb(t)}const dO=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function mS(a){return a.replace(dO,hO)}function hO(a,e,t,n){let s="";for(let o=parseInt(e);o0&&(w+=` +`),A=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(x0).join(` +`),A.length>0&&(A+=` +`)):(w=[gS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+y:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+p:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(x0).join(` +`),A=[gS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+m:"",t.envMap?"#define "+y:"",t.envMap?"#define "+x:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+p:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Xo?"#define TONE_MAPPING":"",t.toneMapping!==Xo?on.tonemapping_pars_fragment:"",t.toneMapping!==Xo?aO("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",on.colorspace_pars_fragment,iO("linearToOutputTexel",t.outputColorSpace),sO(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(x0).join(` +`)),f=Rb(f),f=hS(f,t),f=pS(f,t),d=Rb(d),d=hS(d,t),d=pS(d,t),f=mS(f),d=mS(d),t.isRawShaderMaterial!==!0&&(D=`#version 300 es +`,w=[S,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+w,A=["#define varying in",t.glslVersion===bb?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===bb?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+A);const N=D+w+f,U=D+A+d,I=uS(s,s.VERTEX_SHADER,N),z=uS(s,s.FRAGMENT_SHADER,U);s.attachShader(T,I),s.attachShader(T,z),t.index0AttributeName!==void 0?s.bindAttribLocation(T,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(T,0,"position"),s.linkProgram(T);function j(W){if(a.debug.checkShaderErrors){const se=s.getProgramInfoLog(T)||"",ae=s.getShaderInfoLog(I)||"",ce=s.getShaderInfoLog(z)||"",ue=se.trim(),V=ae.trim(),$=ce.trim();let J=!0,he=!0;if(s.getProgramParameter(T,s.LINK_STATUS)===!1)if(J=!1,typeof a.debug.onShaderError=="function")a.debug.onShaderError(s,T,I,z);else{const ve=dS(s,I,"vertex"),Y=dS(s,z,"fragment");Yt("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(T,s.VALIDATE_STATUS)+` + +Material Name: `+W.name+` +Material Type: `+W.type+` + +Program Info Log: `+ue+` +`+ve+` +`+Y)}else ue!==""?mt("WebGLProgram: Program Info Log:",ue):(V===""||$==="")&&(he=!1);he&&(W.diagnostics={runnable:J,programLog:ue,vertexShader:{log:V,prefix:w},fragmentShader:{log:$,prefix:A}})}s.deleteShader(I),s.deleteShader(z),q=new Ny(s,T),B=lO(s,T)}let q;this.getUniforms=function(){return q===void 0&&j(this),q};let B;this.getAttributes=function(){return B===void 0&&j(this),B};let P=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=s.getProgramParameter(T,$6)),P},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(T),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=eO++,this.cacheKey=e,this.usedTimes=1,this.program=T,this.vertexShader=I,this.fragmentShader=z,this}let bO=0;class _O{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),o=this._getShaderStage(n),f=this._getShaderCacheForMaterial(e);return f.has(s)===!1&&(f.add(s),s.usedTimes++),f.has(o)===!1&&(f.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new SO(e),t.set(e,n)),n}}class SO{constructor(e){this.id=bO++,this.code=e,this.usedTimes=0}}function AO(a,e,t,n,s,o,f){const d=new mh,p=new _O,m=new Set,y=[],x=s.logarithmicDepthBuffer,v=s.vertexTextures;let S=s.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function T(B){return m.add(B),B===0?"uv":`uv${B}`}function w(B,P,W,se,ae){const ce=se.fog,ue=ae.geometry,V=B.isMeshStandardMaterial?se.environment:null,$=(B.isMeshStandardMaterial?t:e).get(B.envMap||V),J=$&&$.mapping===Sh?$.image.height:null,he=M[B.type];B.precision!==null&&(S=s.getMaxPrecision(B.precision),S!==B.precision&&mt("WebGLProgram.getParameters:",B.precision,"not supported, using",S,"instead."));const ve=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,Y=ve!==void 0?ve.length:0;let oe=0;ue.morphAttributes.position!==void 0&&(oe=1),ue.morphAttributes.normal!==void 0&&(oe=2),ue.morphAttributes.color!==void 0&&(oe=3);let Te,Ne,Qe,le;if(he){const Qt=Kr[he];Te=Qt.vertexShader,Ne=Qt.fragmentShader}else Te=B.vertexShader,Ne=B.fragmentShader,p.update(B),Qe=p.getVertexShaderID(B),le=p.getFragmentShaderID(B);const xe=a.getRenderTarget(),Ge=a.state.buffers.depth.getReversed(),et=ae.isInstancedMesh===!0,at=ae.isBatchedMesh===!0,lt=!!B.map,Rt=!!B.matcap,yt=!!$,Ue=!!B.aoMap,Z=!!B.lightMap,ke=!!B.bumpMap,Xe=!!B.normalMap,tt=!!B.displacementMap,qe=!!B.emissiveMap,ot=!!B.metalnessMap,nt=!!B.roughnessMap,ht=B.anisotropy>0,K=B.clearcoat>0,F=B.dispersion>0,ye=B.iridescence>0,Oe=B.sheen>0,Pe=B.transmission>0,Re=ht&&!!B.anisotropyMap,Mt=K&&!!B.clearcoatMap,ct=K&&!!B.clearcoatNormalMap,wt=K&&!!B.clearcoatRoughnessMap,_t=ye&&!!B.iridescenceMap,je=ye&&!!B.iridescenceThicknessMap,Ye=Oe&&!!B.sheenColorMap,St=Oe&&!!B.sheenRoughnessMap,te=!!B.specularMap,Ae=!!B.specularColorMap,Ze=!!B.specularIntensityMap,ee=Pe&&!!B.transmissionMap,Ke=Pe&&!!B.thicknessMap,Je=!!B.gradientMap,it=!!B.alphaMap,We=B.alphaTest>0,Ie=!!B.alphaHash,ft=!!B.extensions;let Tt=Xo;B.toneMapped&&(xe===null||xe.isXRRenderTarget===!0)&&(Tt=a.toneMapping);const ln={shaderID:he,shaderType:B.type,shaderName:B.name,vertexShader:Te,fragmentShader:Ne,defines:B.defines,customVertexShaderID:Qe,customFragmentShaderID:le,isRawShaderMaterial:B.isRawShaderMaterial===!0,glslVersion:B.glslVersion,precision:S,batching:at,batchingColor:at&&ae._colorsTexture!==null,instancing:et,instancingColor:et&&ae.instanceColor!==null,instancingMorph:et&&ae.morphTexture!==null,supportsVertexTextures:v,outputColorSpace:xe===null?a.outputColorSpace:xe.isXRRenderTarget===!0?xe.texture.colorSpace:kc,alphaToCoverage:!!B.alphaToCoverage,map:lt,matcap:Rt,envMap:yt,envMapMode:yt&&$.mapping,envMapCubeUVHeight:J,aoMap:Ue,lightMap:Z,bumpMap:ke,normalMap:Xe,displacementMap:v&&tt,emissiveMap:qe,normalMapObjectSpace:Xe&&B.normalMapType===tM,normalMapTangentSpace:Xe&&B.normalMapType===Xc,metalnessMap:ot,roughnessMap:nt,anisotropy:ht,anisotropyMap:Re,clearcoat:K,clearcoatMap:Mt,clearcoatNormalMap:ct,clearcoatRoughnessMap:wt,dispersion:F,iridescence:ye,iridescenceMap:_t,iridescenceThicknessMap:je,sheen:Oe,sheenColorMap:Ye,sheenRoughnessMap:St,specularMap:te,specularColorMap:Ae,specularIntensityMap:Ze,transmission:Pe,transmissionMap:ee,thicknessMap:Ke,gradientMap:Je,opaque:B.transparent===!1&&B.blending===df&&B.alphaToCoverage===!1,alphaMap:it,alphaTest:We,alphaHash:Ie,combine:B.combine,mapUv:lt&&T(B.map.channel),aoMapUv:Ue&&T(B.aoMap.channel),lightMapUv:Z&&T(B.lightMap.channel),bumpMapUv:ke&&T(B.bumpMap.channel),normalMapUv:Xe&&T(B.normalMap.channel),displacementMapUv:tt&&T(B.displacementMap.channel),emissiveMapUv:qe&&T(B.emissiveMap.channel),metalnessMapUv:ot&&T(B.metalnessMap.channel),roughnessMapUv:nt&&T(B.roughnessMap.channel),anisotropyMapUv:Re&&T(B.anisotropyMap.channel),clearcoatMapUv:Mt&&T(B.clearcoatMap.channel),clearcoatNormalMapUv:ct&&T(B.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:wt&&T(B.clearcoatRoughnessMap.channel),iridescenceMapUv:_t&&T(B.iridescenceMap.channel),iridescenceThicknessMapUv:je&&T(B.iridescenceThicknessMap.channel),sheenColorMapUv:Ye&&T(B.sheenColorMap.channel),sheenRoughnessMapUv:St&&T(B.sheenRoughnessMap.channel),specularMapUv:te&&T(B.specularMap.channel),specularColorMapUv:Ae&&T(B.specularColorMap.channel),specularIntensityMapUv:Ze&&T(B.specularIntensityMap.channel),transmissionMapUv:ee&&T(B.transmissionMap.channel),thicknessMapUv:Ke&&T(B.thicknessMap.channel),alphaMapUv:it&&T(B.alphaMap.channel),vertexTangents:!!ue.attributes.tangent&&(Xe||ht),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,pointsUvs:ae.isPoints===!0&&!!ue.attributes.uv&&(lt||it),fog:!!ce,useFog:B.fog===!0,fogExp2:!!ce&&ce.isFogExp2,flatShading:B.flatShading===!0&&B.wireframe===!1,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:x,reversedDepthBuffer:Ge,skinning:ae.isSkinnedMesh===!0,morphTargets:ue.morphAttributes.position!==void 0,morphNormals:ue.morphAttributes.normal!==void 0,morphColors:ue.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:oe,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:f.numPlanes,numClipIntersection:f.numIntersection,dithering:B.dithering,shadowMapEnabled:a.shadowMap.enabled&&W.length>0,shadowMapType:a.shadowMap.type,toneMapping:Tt,decodeVideoTexture:lt&&B.map.isVideoTexture===!0&&wn.getTransfer(B.map.colorSpace)===Gn,decodeVideoTextureEmissive:qe&&B.emissiveMap.isVideoTexture===!0&&wn.getTransfer(B.emissiveMap.colorSpace)===Gn,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===Qr,flipSided:B.side===Ma,useDepthPacking:B.depthPacking>=0,depthPacking:B.depthPacking||0,index0AttributeName:B.index0AttributeName,extensionClipCullDistance:ft&&B.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ft&&B.extensions.multiDraw===!0||at)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return ln.vertexUv1s=m.has(1),ln.vertexUv2s=m.has(2),ln.vertexUv3s=m.has(3),m.clear(),ln}function A(B){const P=[];if(B.shaderID?P.push(B.shaderID):(P.push(B.customVertexShaderID),P.push(B.customFragmentShaderID)),B.defines!==void 0)for(const W in B.defines)P.push(W),P.push(B.defines[W]);return B.isRawShaderMaterial===!1&&(D(P,B),N(P,B),P.push(a.outputColorSpace)),P.push(B.customProgramCacheKey),P.join()}function D(B,P){B.push(P.precision),B.push(P.outputColorSpace),B.push(P.envMapMode),B.push(P.envMapCubeUVHeight),B.push(P.mapUv),B.push(P.alphaMapUv),B.push(P.lightMapUv),B.push(P.aoMapUv),B.push(P.bumpMapUv),B.push(P.normalMapUv),B.push(P.displacementMapUv),B.push(P.emissiveMapUv),B.push(P.metalnessMapUv),B.push(P.roughnessMapUv),B.push(P.anisotropyMapUv),B.push(P.clearcoatMapUv),B.push(P.clearcoatNormalMapUv),B.push(P.clearcoatRoughnessMapUv),B.push(P.iridescenceMapUv),B.push(P.iridescenceThicknessMapUv),B.push(P.sheenColorMapUv),B.push(P.sheenRoughnessMapUv),B.push(P.specularMapUv),B.push(P.specularColorMapUv),B.push(P.specularIntensityMapUv),B.push(P.transmissionMapUv),B.push(P.thicknessMapUv),B.push(P.combine),B.push(P.fogExp2),B.push(P.sizeAttenuation),B.push(P.morphTargetsCount),B.push(P.morphAttributeCount),B.push(P.numDirLights),B.push(P.numPointLights),B.push(P.numSpotLights),B.push(P.numSpotLightMaps),B.push(P.numHemiLights),B.push(P.numRectAreaLights),B.push(P.numDirLightShadows),B.push(P.numPointLightShadows),B.push(P.numSpotLightShadows),B.push(P.numSpotLightShadowsWithMaps),B.push(P.numLightProbes),B.push(P.shadowMapType),B.push(P.toneMapping),B.push(P.numClippingPlanes),B.push(P.numClipIntersection),B.push(P.depthPacking)}function N(B,P){d.disableAll(),P.supportsVertexTextures&&d.enable(0),P.instancing&&d.enable(1),P.instancingColor&&d.enable(2),P.instancingMorph&&d.enable(3),P.matcap&&d.enable(4),P.envMap&&d.enable(5),P.normalMapObjectSpace&&d.enable(6),P.normalMapTangentSpace&&d.enable(7),P.clearcoat&&d.enable(8),P.iridescence&&d.enable(9),P.alphaTest&&d.enable(10),P.vertexColors&&d.enable(11),P.vertexAlphas&&d.enable(12),P.vertexUv1s&&d.enable(13),P.vertexUv2s&&d.enable(14),P.vertexUv3s&&d.enable(15),P.vertexTangents&&d.enable(16),P.anisotropy&&d.enable(17),P.alphaHash&&d.enable(18),P.batching&&d.enable(19),P.dispersion&&d.enable(20),P.batchingColor&&d.enable(21),P.gradientMap&&d.enable(22),B.push(d.mask),d.disableAll(),P.fog&&d.enable(0),P.useFog&&d.enable(1),P.flatShading&&d.enable(2),P.logarithmicDepthBuffer&&d.enable(3),P.reversedDepthBuffer&&d.enable(4),P.skinning&&d.enable(5),P.morphTargets&&d.enable(6),P.morphNormals&&d.enable(7),P.morphColors&&d.enable(8),P.premultipliedAlpha&&d.enable(9),P.shadowMapEnabled&&d.enable(10),P.doubleSided&&d.enable(11),P.flipSided&&d.enable(12),P.useDepthPacking&&d.enable(13),P.dithering&&d.enable(14),P.transmission&&d.enable(15),P.sheen&&d.enable(16),P.opaque&&d.enable(17),P.pointsUvs&&d.enable(18),P.decodeVideoTexture&&d.enable(19),P.decodeVideoTextureEmissive&&d.enable(20),P.alphaToCoverage&&d.enable(21),B.push(d.mask)}function U(B){const P=M[B.type];let W;if(P){const se=Kr[P];W=j0.clone(se.uniforms)}else W=B.uniforms;return W}function I(B,P){let W;for(let se=0,ae=y.length;se0?n.push(A):S.transparent===!0?s.push(A):t.push(A)}function p(x,v,S,M,T,w){const A=f(x,v,S,M,T,w);S.transmission>0?n.unshift(A):S.transparent===!0?s.unshift(A):t.unshift(A)}function m(x,v){t.length>1&&t.sort(x||EO),n.length>1&&n.sort(v||yS),s.length>1&&s.sort(v||yS)}function y(){for(let x=e,v=a.length;x=o.length?(f=new xS,o.push(f)):f=o[s],f}function t(){a=new WeakMap}return{get:e,dispose:t}}function TO(){const a={};return{get:function(e){if(a[e.id]!==void 0)return a[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new gt};break;case"SpotLight":t={position:new X,direction:new X,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new X,halfWidth:new X,halfHeight:new X};break}return a[e.id]=t,t}}}function CO(){const a={};return{get:function(e){if(a[e.id]!==void 0)return a[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return a[e.id]=t,t}}}let RO=0;function DO(a,e){return(e.castShadow?2:0)-(a.castShadow?2:0)+(e.map?1:0)-(a.map?1:0)}function NO(a){const e=new TO,t=CO(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let m=0;m<9;m++)n.probe.push(new X);const s=new X,o=new Gt,f=new Gt;function d(m){let y=0,x=0,v=0;for(let B=0;B<9;B++)n.probe[B].set(0,0,0);let S=0,M=0,T=0,w=0,A=0,D=0,N=0,U=0,I=0,z=0,j=0;m.sort(DO);for(let B=0,P=m.length;B0&&(a.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=dt.LTC_FLOAT_1,n.rectAreaLTC2=dt.LTC_FLOAT_2):(n.rectAreaLTC1=dt.LTC_HALF_1,n.rectAreaLTC2=dt.LTC_HALF_2)),n.ambient[0]=y,n.ambient[1]=x,n.ambient[2]=v;const q=n.hash;(q.directionalLength!==S||q.pointLength!==M||q.spotLength!==T||q.rectAreaLength!==w||q.hemiLength!==A||q.numDirectionalShadows!==D||q.numPointShadows!==N||q.numSpotShadows!==U||q.numSpotMaps!==I||q.numLightProbes!==j)&&(n.directional.length=S,n.spot.length=T,n.rectArea.length=w,n.point.length=M,n.hemi.length=A,n.directionalShadow.length=D,n.directionalShadowMap.length=D,n.pointShadow.length=N,n.pointShadowMap.length=N,n.spotShadow.length=U,n.spotShadowMap.length=U,n.directionalShadowMatrix.length=D,n.pointShadowMatrix.length=N,n.spotLightMatrix.length=U+I-z,n.spotLightMap.length=I,n.numSpotLightShadowsWithMaps=z,n.numLightProbes=j,q.directionalLength=S,q.pointLength=M,q.spotLength=T,q.rectAreaLength=w,q.hemiLength=A,q.numDirectionalShadows=D,q.numPointShadows=N,q.numSpotShadows=U,q.numSpotMaps=I,q.numLightProbes=j,n.version=RO++)}function p(m,y){let x=0,v=0,S=0,M=0,T=0;const w=y.matrixWorldInverse;for(let A=0,D=m.length;A=f.length?(d=new vS(a),f.push(d)):d=f[o],d}function n(){e=new WeakMap}return{get:t,dispose:n}}const UO=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,LO=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function zO(a,e,t){let n=new Ah;const s=new ze,o=new ze,f=new un,d=new g1({depthPacking:eM}),p=new y1,m={},y=t.maxTextureSize,x={[Hl]:Ma,[Ma]:Hl,[Qr]:Qr},v=new hs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:UO,fragmentShader:LO}),S=v.clone();S.defines.HORIZONTAL_PASS=1;const M=new tn;M.setAttribute("position",new jn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const T=new Li(M,v),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dx;let A=this.type;this.render=function(z,j,q){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||z.length===0)return;const B=a.getRenderTarget(),P=a.getActiveCubeFace(),W=a.getActiveMipmapLevel(),se=a.state;se.setBlending(Go),se.buffers.depth.getReversed()===!0?se.buffers.color.setClear(0,0,0,0):se.buffers.color.setClear(1,1,1,1),se.buffers.depth.setTest(!0),se.setScissorTest(!1);const ae=A!==Zr&&this.type===Zr,ce=A===Zr&&this.type!==Zr;for(let ue=0,V=z.length;uey||s.y>y)&&(s.x>y&&(o.x=Math.floor(y/he.x),s.x=o.x*he.x,J.mapSize.x=o.x),s.y>y&&(o.y=Math.floor(y/he.y),s.y=o.y*he.y,J.mapSize.y=o.y)),J.map===null||ae===!0||ce===!0){const Y=this.type!==Zr?{minFilter:Ea,magFilter:Ea}:{};J.map!==null&&J.map.dispose(),J.map=new Wo(s.x,s.y,Y),J.map.texture.name=$.name+".shadowMap",J.camera.updateProjectionMatrix()}a.setRenderTarget(J.map),a.clear();const ve=J.getViewportCount();for(let Y=0;Y0||j.map&&j.alphaTest>0||j.alphaToCoverage===!0){const se=P.uuid,ae=j.uuid;let ce=m[se];ce===void 0&&(ce={},m[se]=ce);let ue=ce[ae];ue===void 0&&(ue=P.clone(),ce[ae]=ue,j.addEventListener("dispose",I)),P=ue}if(P.visible=j.visible,P.wireframe=j.wireframe,B===Zr?P.side=j.shadowSide!==null?j.shadowSide:j.side:P.side=j.shadowSide!==null?j.shadowSide:x[j.side],P.alphaMap=j.alphaMap,P.alphaTest=j.alphaToCoverage===!0?.5:j.alphaTest,P.map=j.map,P.clipShadows=j.clipShadows,P.clippingPlanes=j.clippingPlanes,P.clipIntersection=j.clipIntersection,P.displacementMap=j.displacementMap,P.displacementScale=j.displacementScale,P.displacementBias=j.displacementBias,P.wireframeLinewidth=j.wireframeLinewidth,P.linewidth=j.linewidth,q.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const se=a.properties.get(P);se.light=q}return P}function U(z,j,q,B,P){if(z.visible===!1)return;if(z.layers.test(j.layers)&&(z.isMesh||z.isLine||z.isPoints)&&(z.castShadow||z.receiveShadow&&P===Zr)&&(!z.frustumCulled||n.intersectsObject(z))){z.modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,z.matrixWorld);const ae=e.update(z),ce=z.material;if(Array.isArray(ce)){const ue=ae.groups;for(let V=0,$=ue.length;V<$;V++){const J=ue[V],he=ce[J.materialIndex];if(he&&he.visible){const ve=N(z,he,B,P);z.onBeforeShadow(a,z,j,q,ae,ve,J),a.renderBufferDirect(q,null,ae,ve,z,J),z.onAfterShadow(a,z,j,q,ae,ve,J)}}}else if(ce.visible){const ue=N(z,ce,B,P);z.onBeforeShadow(a,z,j,q,ae,ue,null),a.renderBufferDirect(q,null,ae,ue,z,null),z.onAfterShadow(a,z,j,q,ae,ue,null)}}const se=z.children;for(let ae=0,ce=se.length;ae=1):J.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),V=$>=2);let he=null,ve={};const Y=a.getParameter(a.SCISSOR_BOX),oe=a.getParameter(a.VIEWPORT),Te=new un().fromArray(Y),Ne=new un().fromArray(oe);function Qe(ee,Ke,Je,it){const We=new Uint8Array(4),Ie=a.createTexture();a.bindTexture(ee,Ie),a.texParameteri(ee,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(ee,a.TEXTURE_MAG_FILTER,a.NEAREST);for(let ft=0;ft"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new ze,y=new WeakMap;let x;const v=new WeakMap;let S=!1;try{S=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function M(K,F){return S?new OffscreenCanvas(K,F):I0("canvas")}function T(K,F,ye){let Oe=1;const Pe=ht(K);if((Pe.width>ye||Pe.height>ye)&&(Oe=ye/Math.max(Pe.width,Pe.height)),Oe<1)if(typeof HTMLImageElement<"u"&&K instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&K instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&K instanceof ImageBitmap||typeof VideoFrame<"u"&&K instanceof VideoFrame){const Re=Math.floor(Oe*Pe.width),Mt=Math.floor(Oe*Pe.height);x===void 0&&(x=M(Re,Mt));const ct=F?M(Re,Mt):x;return ct.width=Re,ct.height=Mt,ct.getContext("2d").drawImage(K,0,0,Re,Mt),mt("WebGLRenderer: Texture has been resized from ("+Pe.width+"x"+Pe.height+") to ("+Re+"x"+Mt+")."),ct}else return"data"in K&&mt("WebGLRenderer: Image in DataTexture is too big ("+Pe.width+"x"+Pe.height+")."),K;return K}function w(K){return K.generateMipmaps}function A(K){a.generateMipmap(K)}function D(K){return K.isWebGLCubeRenderTarget?a.TEXTURE_CUBE_MAP:K.isWebGL3DRenderTarget?a.TEXTURE_3D:K.isWebGLArrayRenderTarget||K.isCompressedArrayTexture?a.TEXTURE_2D_ARRAY:a.TEXTURE_2D}function N(K,F,ye,Oe,Pe=!1){if(K!==null){if(a[K]!==void 0)return a[K];mt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+K+"'")}let Re=F;if(F===a.RED&&(ye===a.FLOAT&&(Re=a.R32F),ye===a.HALF_FLOAT&&(Re=a.R16F),ye===a.UNSIGNED_BYTE&&(Re=a.R8)),F===a.RED_INTEGER&&(ye===a.UNSIGNED_BYTE&&(Re=a.R8UI),ye===a.UNSIGNED_SHORT&&(Re=a.R16UI),ye===a.UNSIGNED_INT&&(Re=a.R32UI),ye===a.BYTE&&(Re=a.R8I),ye===a.SHORT&&(Re=a.R16I),ye===a.INT&&(Re=a.R32I)),F===a.RG&&(ye===a.FLOAT&&(Re=a.RG32F),ye===a.HALF_FLOAT&&(Re=a.RG16F),ye===a.UNSIGNED_BYTE&&(Re=a.RG8)),F===a.RG_INTEGER&&(ye===a.UNSIGNED_BYTE&&(Re=a.RG8UI),ye===a.UNSIGNED_SHORT&&(Re=a.RG16UI),ye===a.UNSIGNED_INT&&(Re=a.RG32UI),ye===a.BYTE&&(Re=a.RG8I),ye===a.SHORT&&(Re=a.RG16I),ye===a.INT&&(Re=a.RG32I)),F===a.RGB_INTEGER&&(ye===a.UNSIGNED_BYTE&&(Re=a.RGB8UI),ye===a.UNSIGNED_SHORT&&(Re=a.RGB16UI),ye===a.UNSIGNED_INT&&(Re=a.RGB32UI),ye===a.BYTE&&(Re=a.RGB8I),ye===a.SHORT&&(Re=a.RGB16I),ye===a.INT&&(Re=a.RGB32I)),F===a.RGBA_INTEGER&&(ye===a.UNSIGNED_BYTE&&(Re=a.RGBA8UI),ye===a.UNSIGNED_SHORT&&(Re=a.RGBA16UI),ye===a.UNSIGNED_INT&&(Re=a.RGBA32UI),ye===a.BYTE&&(Re=a.RGBA8I),ye===a.SHORT&&(Re=a.RGBA16I),ye===a.INT&&(Re=a.RGBA32I)),F===a.RGB&&(ye===a.UNSIGNED_INT_5_9_9_9_REV&&(Re=a.RGB9_E5),ye===a.UNSIGNED_INT_10F_11F_11F_REV&&(Re=a.R11F_G11F_B10F)),F===a.RGBA){const Mt=Pe?P0:wn.getTransfer(Oe);ye===a.FLOAT&&(Re=a.RGBA32F),ye===a.HALF_FLOAT&&(Re=a.RGBA16F),ye===a.UNSIGNED_BYTE&&(Re=Mt===Gn?a.SRGB8_ALPHA8:a.RGBA8),ye===a.UNSIGNED_SHORT_4_4_4_4&&(Re=a.RGBA4),ye===a.UNSIGNED_SHORT_5_5_5_1&&(Re=a.RGB5_A1)}return(Re===a.R16F||Re===a.R32F||Re===a.RG16F||Re===a.RG32F||Re===a.RGBA16F||Re===a.RGBA32F)&&e.get("EXT_color_buffer_float"),Re}function U(K,F){let ye;return K?F===null||F===Vl||F===ch?ye=a.DEPTH24_STENCIL8:F===Rs?ye=a.DEPTH32F_STENCIL8:F===lh&&(ye=a.DEPTH24_STENCIL8,mt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):F===null||F===Vl||F===ch?ye=a.DEPTH_COMPONENT24:F===Rs?ye=a.DEPTH_COMPONENT32F:F===lh&&(ye=a.DEPTH_COMPONENT16),ye}function I(K,F){return w(K)===!0||K.isFramebufferTexture&&K.minFilter!==Ea&&K.minFilter!==Ui?Math.log2(Math.max(F.width,F.height))+1:K.mipmaps!==void 0&&K.mipmaps.length>0?K.mipmaps.length:K.isCompressedTexture&&Array.isArray(K.image)?F.mipmaps.length:1}function z(K){const F=K.target;F.removeEventListener("dispose",z),q(F),F.isVideoTexture&&y.delete(F)}function j(K){const F=K.target;F.removeEventListener("dispose",j),P(F)}function q(K){const F=n.get(K);if(F.__webglInit===void 0)return;const ye=K.source,Oe=v.get(ye);if(Oe){const Pe=Oe[F.__cacheKey];Pe.usedTimes--,Pe.usedTimes===0&&B(K),Object.keys(Oe).length===0&&v.delete(ye)}n.remove(K)}function B(K){const F=n.get(K);a.deleteTexture(F.__webglTexture);const ye=K.source,Oe=v.get(ye);delete Oe[F.__cacheKey],f.memory.textures--}function P(K){const F=n.get(K);if(K.depthTexture&&(K.depthTexture.dispose(),n.remove(K.depthTexture)),K.isWebGLCubeRenderTarget)for(let Oe=0;Oe<6;Oe++){if(Array.isArray(F.__webglFramebuffer[Oe]))for(let Pe=0;Pe=s.maxTextures&&mt("WebGLTextures: Trying to use "+K+" texture units while this GPU supports only "+s.maxTextures),W+=1,K}function ce(K){const F=[];return F.push(K.wrapS),F.push(K.wrapT),F.push(K.wrapR||0),F.push(K.magFilter),F.push(K.minFilter),F.push(K.anisotropy),F.push(K.internalFormat),F.push(K.format),F.push(K.type),F.push(K.generateMipmaps),F.push(K.premultiplyAlpha),F.push(K.flipY),F.push(K.unpackAlignment),F.push(K.colorSpace),F.join()}function ue(K,F){const ye=n.get(K);if(K.isVideoTexture&&ot(K),K.isRenderTargetTexture===!1&&K.isExternalTexture!==!0&&K.version>0&&ye.__version!==K.version){const Oe=K.image;if(Oe===null)mt("WebGLRenderer: Texture marked for update but no image data found.");else if(Oe.complete===!1)mt("WebGLRenderer: Texture marked for update but image is incomplete");else{le(ye,K,F);return}}else K.isExternalTexture&&(ye.__webglTexture=K.sourceTexture?K.sourceTexture:null);t.bindTexture(a.TEXTURE_2D,ye.__webglTexture,a.TEXTURE0+F)}function V(K,F){const ye=n.get(K);if(K.isRenderTargetTexture===!1&&K.version>0&&ye.__version!==K.version){le(ye,K,F);return}else K.isExternalTexture&&(ye.__webglTexture=K.sourceTexture?K.sourceTexture:null);t.bindTexture(a.TEXTURE_2D_ARRAY,ye.__webglTexture,a.TEXTURE0+F)}function $(K,F){const ye=n.get(K);if(K.isRenderTargetTexture===!1&&K.version>0&&ye.__version!==K.version){le(ye,K,F);return}t.bindTexture(a.TEXTURE_3D,ye.__webglTexture,a.TEXTURE0+F)}function J(K,F){const ye=n.get(K);if(K.version>0&&ye.__version!==K.version){xe(ye,K,F);return}t.bindTexture(a.TEXTURE_CUBE_MAP,ye.__webglTexture,a.TEXTURE0+F)}const he={[O0]:a.REPEAT,[Aa]:a.CLAMP_TO_EDGE,[U0]:a.MIRRORED_REPEAT},ve={[Ea]:a.NEAREST,[kb]:a.NEAREST_MIPMAP_NEAREST,[ih]:a.NEAREST_MIPMAP_LINEAR,[Ui]:a.LINEAR,[b0]:a.LINEAR_MIPMAP_NEAREST,[ko]:a.LINEAR_MIPMAP_LINEAR},Y={[nM]:a.NEVER,[lM]:a.ALWAYS,[iM]:a.LESS,[Kb]:a.LEQUAL,[aM]:a.EQUAL,[oM]:a.GEQUAL,[sM]:a.GREATER,[rM]:a.NOTEQUAL};function oe(K,F){if(F.type===Rs&&e.has("OES_texture_float_linear")===!1&&(F.magFilter===Ui||F.magFilter===b0||F.magFilter===ih||F.magFilter===ko||F.minFilter===Ui||F.minFilter===b0||F.minFilter===ih||F.minFilter===ko)&&mt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),a.texParameteri(K,a.TEXTURE_WRAP_S,he[F.wrapS]),a.texParameteri(K,a.TEXTURE_WRAP_T,he[F.wrapT]),(K===a.TEXTURE_3D||K===a.TEXTURE_2D_ARRAY)&&a.texParameteri(K,a.TEXTURE_WRAP_R,he[F.wrapR]),a.texParameteri(K,a.TEXTURE_MAG_FILTER,ve[F.magFilter]),a.texParameteri(K,a.TEXTURE_MIN_FILTER,ve[F.minFilter]),F.compareFunction&&(a.texParameteri(K,a.TEXTURE_COMPARE_MODE,a.COMPARE_REF_TO_TEXTURE),a.texParameteri(K,a.TEXTURE_COMPARE_FUNC,Y[F.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(F.magFilter===Ea||F.minFilter!==ih&&F.minFilter!==ko||F.type===Rs&&e.has("OES_texture_float_linear")===!1)return;if(F.anisotropy>1||n.get(F).__currentAnisotropy){const ye=e.get("EXT_texture_filter_anisotropic");a.texParameterf(K,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(F.anisotropy,s.getMaxAnisotropy())),n.get(F).__currentAnisotropy=F.anisotropy}}}function Te(K,F){let ye=!1;K.__webglInit===void 0&&(K.__webglInit=!0,F.addEventListener("dispose",z));const Oe=F.source;let Pe=v.get(Oe);Pe===void 0&&(Pe={},v.set(Oe,Pe));const Re=ce(F);if(Re!==K.__cacheKey){Pe[Re]===void 0&&(Pe[Re]={texture:a.createTexture(),usedTimes:0},f.memory.textures++,ye=!0),Pe[Re].usedTimes++;const Mt=Pe[K.__cacheKey];Mt!==void 0&&(Pe[K.__cacheKey].usedTimes--,Mt.usedTimes===0&&B(F)),K.__cacheKey=Re,K.__webglTexture=Pe[Re].texture}return ye}function Ne(K,F,ye){return Math.floor(Math.floor(K/ye)/F)}function Qe(K,F,ye,Oe){const Re=K.updateRanges;if(Re.length===0)t.texSubImage2D(a.TEXTURE_2D,0,0,0,F.width,F.height,ye,Oe,F.data);else{Re.sort((je,Ye)=>je.start-Ye.start);let Mt=0;for(let je=1;je0){ee&&Ke&&t.texStorage2D(a.TEXTURE_2D,it,te,Ze[0].width,Ze[0].height);for(let We=0,Ie=Ze.length;We0){const ft=Tb(Ae.width,Ae.height,F.format,F.type);for(const Tt of F.layerUpdates){const ln=Ae.data.subarray(Tt*ft/Ae.data.BYTES_PER_ELEMENT,(Tt+1)*ft/Ae.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,We,0,0,Tt,Ae.width,Ae.height,1,Ye,ln)}F.clearLayerUpdates()}else t.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,We,0,0,0,Ae.width,Ae.height,je.depth,Ye,Ae.data)}else t.compressedTexImage3D(a.TEXTURE_2D_ARRAY,We,te,Ae.width,Ae.height,je.depth,0,Ae.data,0,0);else mt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ee?Je&&t.texSubImage3D(a.TEXTURE_2D_ARRAY,We,0,0,0,Ae.width,Ae.height,je.depth,Ye,St,Ae.data):t.texImage3D(a.TEXTURE_2D_ARRAY,We,te,Ae.width,Ae.height,je.depth,0,Ye,St,Ae.data)}else{ee&&Ke&&t.texStorage2D(a.TEXTURE_2D,it,te,Ze[0].width,Ze[0].height);for(let We=0,Ie=Ze.length;We0){const We=Tb(je.width,je.height,F.format,F.type);for(const Ie of F.layerUpdates){const ft=je.data.subarray(Ie*We/je.data.BYTES_PER_ELEMENT,(Ie+1)*We/je.data.BYTES_PER_ELEMENT);t.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,Ie,je.width,je.height,1,Ye,St,ft)}F.clearLayerUpdates()}else t.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,0,je.width,je.height,je.depth,Ye,St,je.data)}else t.texImage3D(a.TEXTURE_2D_ARRAY,0,te,je.width,je.height,je.depth,0,Ye,St,je.data);else if(F.isData3DTexture)ee?(Ke&&t.texStorage3D(a.TEXTURE_3D,it,te,je.width,je.height,je.depth),Je&&t.texSubImage3D(a.TEXTURE_3D,0,0,0,0,je.width,je.height,je.depth,Ye,St,je.data)):t.texImage3D(a.TEXTURE_3D,0,te,je.width,je.height,je.depth,0,Ye,St,je.data);else if(F.isFramebufferTexture){if(Ke)if(ee)t.texStorage2D(a.TEXTURE_2D,it,te,je.width,je.height);else{let We=je.width,Ie=je.height;for(let ft=0;ft>=1,Ie>>=1}}else if(Ze.length>0){if(ee&&Ke){const We=ht(Ze[0]);t.texStorage2D(a.TEXTURE_2D,it,te,We.width,We.height)}for(let We=0,Ie=Ze.length;We0&&it++;const Ie=ht(Ye[0]);t.texStorage2D(a.TEXTURE_CUBE_MAP,it,Ze,Ie.width,Ie.height)}for(let Ie=0;Ie<6;Ie++)if(je){ee?Je&&t.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0,0,0,Ye[Ie].width,Ye[Ie].height,te,Ae,Ye[Ie].data):t.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0,Ze,Ye[Ie].width,Ye[Ie].height,0,te,Ae,Ye[Ie].data);for(let ft=0;ft>Re),St=Math.max(1,F.height>>Re);Pe===a.TEXTURE_3D||Pe===a.TEXTURE_2D_ARRAY?t.texImage3D(Pe,Re,wt,Ye,St,F.depth,0,Mt,ct,null):t.texImage2D(Pe,Re,wt,Ye,St,0,Mt,ct,null)}t.bindFramebuffer(a.FRAMEBUFFER,K),qe(F)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,Oe,Pe,je.__webglTexture,0,tt(F)):(Pe===a.TEXTURE_2D||Pe>=a.TEXTURE_CUBE_MAP_POSITIVE_X&&Pe<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&a.framebufferTexture2D(a.FRAMEBUFFER,Oe,Pe,je.__webglTexture,Re),t.bindFramebuffer(a.FRAMEBUFFER,null)}function et(K,F,ye){if(a.bindRenderbuffer(a.RENDERBUFFER,K),F.depthBuffer){const Oe=F.depthTexture,Pe=Oe&&Oe.isDepthTexture?Oe.type:null,Re=U(F.stencilBuffer,Pe),Mt=F.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,ct=tt(F);qe(F)?d.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,ct,Re,F.width,F.height):ye?a.renderbufferStorageMultisample(a.RENDERBUFFER,ct,Re,F.width,F.height):a.renderbufferStorage(a.RENDERBUFFER,Re,F.width,F.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,Mt,a.RENDERBUFFER,K)}else{const Oe=F.textures;for(let Pe=0;Pe{delete F.__boundDepthTexture,delete F.__depthDisposeCallback,Oe.removeEventListener("dispose",Pe)};Oe.addEventListener("dispose",Pe),F.__depthDisposeCallback=Pe}F.__boundDepthTexture=Oe}if(K.depthTexture&&!F.__autoAllocateDepthBuffer){if(ye)throw new Error("target.depthTexture not supported in Cube render targets");const Oe=K.texture.mipmaps;Oe&&Oe.length>0?at(F.__webglFramebuffer[0],K):at(F.__webglFramebuffer,K)}else if(ye){F.__webglDepthbuffer=[];for(let Oe=0;Oe<6;Oe++)if(t.bindFramebuffer(a.FRAMEBUFFER,F.__webglFramebuffer[Oe]),F.__webglDepthbuffer[Oe]===void 0)F.__webglDepthbuffer[Oe]=a.createRenderbuffer(),et(F.__webglDepthbuffer[Oe],K,!1);else{const Pe=K.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,Re=F.__webglDepthbuffer[Oe];a.bindRenderbuffer(a.RENDERBUFFER,Re),a.framebufferRenderbuffer(a.FRAMEBUFFER,Pe,a.RENDERBUFFER,Re)}}else{const Oe=K.texture.mipmaps;if(Oe&&Oe.length>0?t.bindFramebuffer(a.FRAMEBUFFER,F.__webglFramebuffer[0]):t.bindFramebuffer(a.FRAMEBUFFER,F.__webglFramebuffer),F.__webglDepthbuffer===void 0)F.__webglDepthbuffer=a.createRenderbuffer(),et(F.__webglDepthbuffer,K,!1);else{const Pe=K.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,Re=F.__webglDepthbuffer;a.bindRenderbuffer(a.RENDERBUFFER,Re),a.framebufferRenderbuffer(a.FRAMEBUFFER,Pe,a.RENDERBUFFER,Re)}}t.bindFramebuffer(a.FRAMEBUFFER,null)}function Rt(K,F,ye){const Oe=n.get(K);F!==void 0&&Ge(Oe.__webglFramebuffer,K,K.texture,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,0),ye!==void 0&<(K)}function yt(K){const F=K.texture,ye=n.get(K),Oe=n.get(F);K.addEventListener("dispose",j);const Pe=K.textures,Re=K.isWebGLCubeRenderTarget===!0,Mt=Pe.length>1;if(Mt||(Oe.__webglTexture===void 0&&(Oe.__webglTexture=a.createTexture()),Oe.__version=F.version,f.memory.textures++),Re){ye.__webglFramebuffer=[];for(let ct=0;ct<6;ct++)if(F.mipmaps&&F.mipmaps.length>0){ye.__webglFramebuffer[ct]=[];for(let wt=0;wt0){ye.__webglFramebuffer=[];for(let ct=0;ct0&&qe(K)===!1){ye.__webglMultisampledFramebuffer=a.createFramebuffer(),ye.__webglColorRenderbuffer=[],t.bindFramebuffer(a.FRAMEBUFFER,ye.__webglMultisampledFramebuffer);for(let ct=0;ct0)for(let wt=0;wt0)for(let wt=0;wt0){if(qe(K)===!1){const F=K.textures,ye=K.width,Oe=K.height;let Pe=a.COLOR_BUFFER_BIT;const Re=K.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,Mt=n.get(K),ct=F.length>1;if(ct)for(let _t=0;_t0?t.bindFramebuffer(a.DRAW_FRAMEBUFFER,Mt.__webglFramebuffer[0]):t.bindFramebuffer(a.DRAW_FRAMEBUFFER,Mt.__webglFramebuffer);for(let _t=0;_t0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&F.__useRenderToTexture!==!1}function ot(K){const F=f.render.frame;y.get(K)!==F&&(y.set(K,F),K.update())}function nt(K,F){const ye=K.colorSpace,Oe=K.format,Pe=K.type;return K.isCompressedTexture===!0||K.isVideoTexture===!0||ye!==kc&&ye!==Il&&(wn.getTransfer(ye)===Gn?(Oe!==Ha||Pe!==xr)&&mt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Yt("WebGLTextures: Unsupported texture color space:",ye)),F}function ht(K){return typeof HTMLImageElement<"u"&&K instanceof HTMLImageElement?(m.width=K.naturalWidth||K.width,m.height=K.naturalHeight||K.height):typeof VideoFrame<"u"&&K instanceof VideoFrame?(m.width=K.displayWidth,m.height=K.displayHeight):(m.width=K.width,m.height=K.height),m}this.allocateTextureUnit=ae,this.resetTextureUnits=se,this.setTexture2D=ue,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=J,this.rebindTextures=Rt,this.setupRenderTarget=yt,this.updateRenderTargetMipmap=Ue,this.updateMultisampleRenderTarget=Xe,this.setupDepthRenderbuffer=lt,this.setupFrameBufferTexture=Ge,this.useMultisampledRTT=qe}function mE(a,e){function t(n,s=Il){let o;const f=wn.getTransfer(s);if(n===xr)return a.UNSIGNED_BYTE;if(n===Ux)return a.UNSIGNED_SHORT_4_4_4_4;if(n===Lx)return a.UNSIGNED_SHORT_5_5_5_1;if(n===Xb)return a.UNSIGNED_INT_5_9_9_9_REV;if(n===qb)return a.UNSIGNED_INT_10F_11F_11F_REV;if(n===Vb)return a.BYTE;if(n===Gb)return a.SHORT;if(n===lh)return a.UNSIGNED_SHORT;if(n===Ox)return a.INT;if(n===Vl)return a.UNSIGNED_INT;if(n===Rs)return a.FLOAT;if(n===_f)return a.HALF_FLOAT;if(n===Yb)return a.ALPHA;if(n===Wb)return a.RGB;if(n===Ha)return a.RGBA;if(n===uh)return a.DEPTH_COMPONENT;if(n===fh)return a.DEPTH_STENCIL;if(n===zx)return a.RED;if(n===K0)return a.RED_INTEGER;if(n===Px)return a.RG;if(n===Bx)return a.RG_INTEGER;if(n===Ix)return a.RGBA_INTEGER;if(n===_0||n===S0||n===A0||n===M0)if(f===Gn)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===_0)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===S0)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===A0)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===M0)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===_0)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===S0)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===A0)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===M0)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Vy||n===Gy||n===Xy||n===qy)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===Vy)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Gy)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Xy)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===qy)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Yy||n===Wy||n===Zy)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===Yy||n===Wy)return f===Gn?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Zy)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Ky||n===Qy||n===Jy||n===$y||n===ex||n===tx||n===nx||n===ix||n===ax||n===sx||n===rx||n===ox||n===lx||n===cx)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===Ky)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Qy)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jy)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===$y)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ex)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===tx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===nx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ix)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ax)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===sx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===rx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ox)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===lx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===cx)return f===Gn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===ux||n===fx||n===dx)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===ux)return f===Gn?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===fx)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===dx)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===hx||n===px||n===mx||n===gx)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===hx)return o.COMPRESSED_RED_RGTC1_EXT;if(n===px)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===mx)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===gx)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ch?a.UNSIGNED_INT_24_8:a[n]!==void 0?a[n]:null}return{convert:t}}const FO=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,jO=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class HO{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new o1(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new hs({vertexShader:FO,fragmentShader:jO,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Li(new Mh(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class kO extends Zo{constructor(e,t){super();const n=this;let s=null,o=1,f=null,d="local-floor",p=1,m=null,y=null,x=null,v=null,S=null,M=null;const T=typeof XRWebGLBinding<"u",w=new HO,A={},D=t.getContextAttributes();let N=null,U=null;const I=[],z=[],j=new ze;let q=null;const B=new xi;B.viewport=new un;const P=new xi;P.viewport=new un;const W=[B,P],se=new iE;let ae=null,ce=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let xe=I[le];return xe===void 0&&(xe=new Dy,I[le]=xe),xe.getTargetRaySpace()},this.getControllerGrip=function(le){let xe=I[le];return xe===void 0&&(xe=new Dy,I[le]=xe),xe.getGripSpace()},this.getHand=function(le){let xe=I[le];return xe===void 0&&(xe=new Dy,I[le]=xe),xe.getHandSpace()};function ue(le){const xe=z.indexOf(le.inputSource);if(xe===-1)return;const Ge=I[xe];Ge!==void 0&&(Ge.update(le.inputSource,le.frame,m||f),Ge.dispatchEvent({type:le.type,data:le.inputSource}))}function V(){s.removeEventListener("select",ue),s.removeEventListener("selectstart",ue),s.removeEventListener("selectend",ue),s.removeEventListener("squeeze",ue),s.removeEventListener("squeezestart",ue),s.removeEventListener("squeezeend",ue),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",$);for(let le=0;le=0&&(z[et]=null,I[et].disconnect(Ge))}for(let xe=0;xe=z.length){z.push(Ge),et=lt;break}else if(z[lt]===null){z[lt]=Ge,et=lt;break}if(et===-1)break}const at=I[et];at&&at.connect(Ge)}}const J=new X,he=new X;function ve(le,xe,Ge){J.setFromMatrixPosition(xe.matrixWorld),he.setFromMatrixPosition(Ge.matrixWorld);const et=J.distanceTo(he),at=xe.projectionMatrix.elements,lt=Ge.projectionMatrix.elements,Rt=at[14]/(at[10]-1),yt=at[14]/(at[10]+1),Ue=(at[9]+1)/at[5],Z=(at[9]-1)/at[5],ke=(at[8]-1)/at[0],Xe=(lt[8]+1)/lt[0],tt=Rt*ke,qe=Rt*Xe,ot=et/(-ke+Xe),nt=ot*-ke;if(xe.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(nt),le.translateZ(ot),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert(),at[10]===-1)le.projectionMatrix.copy(xe.projectionMatrix),le.projectionMatrixInverse.copy(xe.projectionMatrixInverse);else{const ht=Rt+ot,K=yt+ot,F=tt-nt,ye=qe+(et-nt),Oe=Ue*yt/K*ht,Pe=Z*yt/K*ht;le.projectionMatrix.makePerspective(F,ye,Oe,Pe,ht,K),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}}function Y(le,xe){xe===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(xe.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(s===null)return;let xe=le.near,Ge=le.far;w.texture!==null&&(w.depthNear>0&&(xe=w.depthNear),w.depthFar>0&&(Ge=w.depthFar)),se.near=P.near=B.near=xe,se.far=P.far=B.far=Ge,(ae!==se.near||ce!==se.far)&&(s.updateRenderState({depthNear:se.near,depthFar:se.far}),ae=se.near,ce=se.far),se.layers.mask=le.layers.mask|6,B.layers.mask=se.layers.mask&3,P.layers.mask=se.layers.mask&5;const et=le.parent,at=se.cameras;Y(se,et);for(let lt=0;lt0&&(w.alphaTest.value=A.alphaTest);const D=e.get(A),N=D.envMap,U=D.envMapRotation;N&&(w.envMap.value=N,tf.copy(U),tf.x*=-1,tf.y*=-1,tf.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(tf.y*=-1,tf.z*=-1),w.envMapRotation.value.setFromMatrix4(VO.makeRotationFromEuler(tf)),w.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=A.reflectivity,w.ior.value=A.ior,w.refractionRatio.value=A.refractionRatio),A.lightMap&&(w.lightMap.value=A.lightMap,w.lightMapIntensity.value=A.lightMapIntensity,t(A.lightMap,w.lightMapTransform)),A.aoMap&&(w.aoMap.value=A.aoMap,w.aoMapIntensity.value=A.aoMapIntensity,t(A.aoMap,w.aoMapTransform))}function f(w,A){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,A.map&&(w.map.value=A.map,t(A.map,w.mapTransform))}function d(w,A){w.dashSize.value=A.dashSize,w.totalSize.value=A.dashSize+A.gapSize,w.scale.value=A.scale}function p(w,A,D,N){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,w.size.value=A.size*D,w.scale.value=N*.5,A.map&&(w.map.value=A.map,t(A.map,w.uvTransform)),A.alphaMap&&(w.alphaMap.value=A.alphaMap,t(A.alphaMap,w.alphaMapTransform)),A.alphaTest>0&&(w.alphaTest.value=A.alphaTest)}function m(w,A){w.diffuse.value.copy(A.color),w.opacity.value=A.opacity,w.rotation.value=A.rotation,A.map&&(w.map.value=A.map,t(A.map,w.mapTransform)),A.alphaMap&&(w.alphaMap.value=A.alphaMap,t(A.alphaMap,w.alphaMapTransform)),A.alphaTest>0&&(w.alphaTest.value=A.alphaTest)}function y(w,A){w.specular.value.copy(A.specular),w.shininess.value=Math.max(A.shininess,1e-4)}function x(w,A){A.gradientMap&&(w.gradientMap.value=A.gradientMap)}function v(w,A){w.metalness.value=A.metalness,A.metalnessMap&&(w.metalnessMap.value=A.metalnessMap,t(A.metalnessMap,w.metalnessMapTransform)),w.roughness.value=A.roughness,A.roughnessMap&&(w.roughnessMap.value=A.roughnessMap,t(A.roughnessMap,w.roughnessMapTransform)),A.envMap&&(w.envMapIntensity.value=A.envMapIntensity)}function S(w,A,D){w.ior.value=A.ior,A.sheen>0&&(w.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),w.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(w.sheenColorMap.value=A.sheenColorMap,t(A.sheenColorMap,w.sheenColorMapTransform)),A.sheenRoughnessMap&&(w.sheenRoughnessMap.value=A.sheenRoughnessMap,t(A.sheenRoughnessMap,w.sheenRoughnessMapTransform))),A.clearcoat>0&&(w.clearcoat.value=A.clearcoat,w.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(w.clearcoatMap.value=A.clearcoatMap,t(A.clearcoatMap,w.clearcoatMapTransform)),A.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap,t(A.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),A.clearcoatNormalMap&&(w.clearcoatNormalMap.value=A.clearcoatNormalMap,t(A.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),A.side===Ma&&w.clearcoatNormalScale.value.negate())),A.dispersion>0&&(w.dispersion.value=A.dispersion),A.iridescence>0&&(w.iridescence.value=A.iridescence,w.iridescenceIOR.value=A.iridescenceIOR,w.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(w.iridescenceMap.value=A.iridescenceMap,t(A.iridescenceMap,w.iridescenceMapTransform)),A.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=A.iridescenceThicknessMap,t(A.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),A.transmission>0&&(w.transmission.value=A.transmission,w.transmissionSamplerMap.value=D.texture,w.transmissionSamplerSize.value.set(D.width,D.height),A.transmissionMap&&(w.transmissionMap.value=A.transmissionMap,t(A.transmissionMap,w.transmissionMapTransform)),w.thickness.value=A.thickness,A.thicknessMap&&(w.thicknessMap.value=A.thicknessMap,t(A.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=A.attenuationDistance,w.attenuationColor.value.copy(A.attenuationColor)),A.anisotropy>0&&(w.anisotropyVector.value.set(A.anisotropy*Math.cos(A.anisotropyRotation),A.anisotropy*Math.sin(A.anisotropyRotation)),A.anisotropyMap&&(w.anisotropyMap.value=A.anisotropyMap,t(A.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=A.specularIntensity,w.specularColor.value.copy(A.specularColor),A.specularColorMap&&(w.specularColorMap.value=A.specularColorMap,t(A.specularColorMap,w.specularColorMapTransform)),A.specularIntensityMap&&(w.specularIntensityMap.value=A.specularIntensityMap,t(A.specularIntensityMap,w.specularIntensityMapTransform))}function M(w,A){A.matcap&&(w.matcap.value=A.matcap)}function T(w,A){const D=e.get(A).light;w.referencePosition.value.setFromMatrixPosition(D.matrixWorld),w.nearDistance.value=D.shadow.camera.near,w.farDistance.value=D.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function XO(a,e,t,n){let s={},o={},f=[];const d=a.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS);function p(D,N){const U=N.program;n.uniformBlockBinding(D,U)}function m(D,N){let U=s[D.id];U===void 0&&(M(D),U=y(D),s[D.id]=U,D.addEventListener("dispose",w));const I=N.program;n.updateUBOMapping(D,I);const z=e.render.frame;o[D.id]!==z&&(v(D),o[D.id]=z)}function y(D){const N=x();D.__bindingPointIndex=N;const U=a.createBuffer(),I=D.__size,z=D.usage;return a.bindBuffer(a.UNIFORM_BUFFER,U),a.bufferData(a.UNIFORM_BUFFER,I,z),a.bindBuffer(a.UNIFORM_BUFFER,null),a.bindBufferBase(a.UNIFORM_BUFFER,N,U),U}function x(){for(let D=0;D0&&(U+=I-z),D.__size=U,D.__cache={},this}function T(D){const N={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(N.boundary=4,N.storage=4):D.isVector2?(N.boundary=8,N.storage=8):D.isVector3||D.isColor?(N.boundary=16,N.storage=12):D.isVector4?(N.boundary=16,N.storage=16):D.isMatrix3?(N.boundary=48,N.storage=48):D.isMatrix4?(N.boundary=64,N.storage=64):D.isTexture?mt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):mt("WebGLRenderer: Unsupported uniform value type.",D),N}function w(D){const N=D.target;N.removeEventListener("dispose",w);const U=f.indexOf(N.__bindingPointIndex);f.splice(U,1),a.deleteBuffer(s[N.id]),delete s[N.id],delete o[N.id]}function A(){for(const D in s)a.deleteBuffer(s[D]);f=[],s={},o={}}return{bind:p,update:m,dispose:A}}const qO=new Uint16Array([11481,15204,11534,15171,11808,15015,12385,14843,12894,14716,13396,14600,13693,14483,13976,14366,14237,14171,14405,13961,14511,13770,14605,13598,14687,13444,14760,13305,14822,13066,14876,12857,14923,12675,14963,12517,14997,12379,15025,12230,15049,12023,15070,11843,15086,11687,15100,11551,15111,11433,15120,11330,15127,11217,15132,11060,15135,10922,15138,10801,15139,10695,15139,10600,13012,14923,13020,14917,13064,14886,13176,14800,13349,14666,13513,14526,13724,14398,13960,14230,14200,14020,14383,13827,14488,13651,14583,13491,14667,13348,14740,13132,14803,12908,14856,12713,14901,12542,14938,12394,14968,12241,14992,12017,15010,11822,15024,11654,15034,11507,15041,11380,15044,11269,15044,11081,15042,10913,15037,10764,15031,10635,15023,10520,15014,10419,15003,10330,13657,14676,13658,14673,13670,14660,13698,14622,13750,14547,13834,14442,13956,14317,14112,14093,14291,13889,14407,13704,14499,13538,14586,13389,14664,13201,14733,12966,14792,12758,14842,12577,14882,12418,14915,12272,14940,12033,14959,11826,14972,11646,14980,11490,14983,11355,14983,11212,14979,11008,14971,10830,14961,10675,14950,10540,14936,10420,14923,10315,14909,10204,14894,10041,14089,14460,14090,14459,14096,14452,14112,14431,14141,14388,14186,14305,14252,14130,14341,13941,14399,13756,14467,13585,14539,13430,14610,13272,14677,13026,14737,12808,14790,12617,14833,12449,14869,12303,14896,12065,14916,11845,14929,11655,14937,11490,14939,11347,14936,11184,14930,10970,14921,10783,14912,10621,14900,10480,14885,10356,14867,10247,14848,10062,14827,9894,14805,9745,14400,14208,14400,14206,14402,14198,14406,14174,14415,14122,14427,14035,14444,13913,14469,13767,14504,13613,14548,13463,14598,13324,14651,13082,14704,12858,14752,12658,14795,12483,14831,12330,14860,12106,14881,11875,14895,11675,14903,11501,14905,11351,14903,11178,14900,10953,14892,10757,14880,10589,14865,10442,14847,10313,14827,10162,14805,9965,14782,9792,14757,9642,14731,9507,14562,13883,14562,13883,14563,13877,14566,13862,14570,13830,14576,13773,14584,13689,14595,13582,14613,13461,14637,13336,14668,13120,14704,12897,14741,12695,14776,12516,14808,12358,14835,12150,14856,11910,14870,11701,14878,11519,14882,11361,14884,11187,14880,10951,14871,10748,14858,10572,14842,10418,14823,10286,14801,10099,14777,9897,14751,9722,14725,9567,14696,9430,14666,9309,14702,13604,14702,13604,14702,13600,14703,13591,14705,13570,14707,13533,14709,13477,14712,13400,14718,13305,14727,13106,14743,12907,14762,12716,14784,12539,14807,12380,14827,12190,14844,11943,14855,11727,14863,11539,14870,11376,14871,11204,14868,10960,14858,10748,14845,10565,14829,10406,14809,10269,14786,10058,14761,9852,14734,9671,14705,9512,14674,9374,14641,9253,14608,9076,14821,13366,14821,13365,14821,13364,14821,13358,14821,13344,14821,13320,14819,13252,14817,13145,14815,13011,14814,12858,14817,12698,14823,12539,14832,12389,14841,12214,14850,11968,14856,11750,14861,11558,14866,11390,14867,11226,14862,10972,14853,10754,14840,10565,14823,10401,14803,10259,14780,10032,14754,9820,14725,9635,14694,9473,14661,9333,14627,9203,14593,8988,14557,8798,14923,13014,14922,13014,14922,13012,14922,13004,14920,12987,14919,12957,14915,12907,14909,12834,14902,12738,14894,12623,14888,12498,14883,12370,14880,12203,14878,11970,14875,11759,14873,11569,14874,11401,14872,11243,14865,10986,14855,10762,14842,10568,14825,10401,14804,10255,14781,10017,14754,9799,14725,9611,14692,9445,14658,9301,14623,9139,14587,8920,14548,8729,14509,8562,15008,12672,15008,12672,15008,12671,15007,12667,15005,12656,15001,12637,14997,12605,14989,12556,14978,12490,14966,12407,14953,12313,14940,12136,14927,11934,14914,11742,14903,11563,14896,11401,14889,11247,14879,10992,14866,10767,14851,10570,14833,10400,14812,10252,14789,10007,14761,9784,14731,9592,14698,9424,14663,9279,14627,9088,14588,8868,14548,8676,14508,8508,14467,8360,15080,12386,15080,12386,15079,12385,15078,12383,15076,12378,15072,12367,15066,12347,15057,12315,15045,12253,15030,12138,15012,11998,14993,11845,14972,11685,14951,11530,14935,11383,14920,11228,14904,10981,14887,10762,14870,10567,14850,10397,14827,10248,14803,9997,14774,9771,14743,9578,14710,9407,14674,9259,14637,9048,14596,8826,14555,8632,14514,8464,14471,8317,14427,8182,15139,12008,15139,12008,15138,12008,15137,12007,15135,12003,15130,11990,15124,11969,15115,11929,15102,11872,15086,11794,15064,11693,15041,11581,15013,11459,14987,11336,14966,11170,14944,10944,14921,10738,14898,10552,14875,10387,14850,10239,14824,9983,14794,9758,14762,9563,14728,9392,14692,9244,14653,9014,14611,8791,14569,8597,14526,8427,14481,8281,14436,8110,14391,7885,15188,11617,15188,11617,15187,11617,15186,11618,15183,11617,15179,11612,15173,11601,15163,11581,15150,11546,15133,11495,15110,11427,15083,11346,15051,11246,15024,11057,14996,10868,14967,10687,14938,10517,14911,10362,14882,10206,14853,9956,14821,9737,14787,9543,14752,9375,14715,9228,14675,8980,14632,8760,14589,8565,14544,8395,14498,8248,14451,8049,14404,7824,14357,7630,15228,11298,15228,11298,15227,11299,15226,11301,15223,11303,15219,11302,15213,11299,15204,11290,15191,11271,15174,11217,15150,11129,15119,11015,15087,10886,15057,10744,15024,10599,14990,10455,14957,10318,14924,10143,14891,9911,14856,9701,14820,9516,14782,9352,14744,9200,14703,8946,14659,8725,14615,8533,14568,8366,14521,8220,14472,7992,14423,7770,14374,7578,14315,7408,15260,10819,15260,10819,15259,10822,15258,10826,15256,10832,15251,10836,15246,10841,15237,10838,15225,10821,15207,10788,15183,10734,15151,10660,15120,10571,15087,10469,15049,10359,15012,10249,14974,10041,14937,9837,14900,9647,14860,9475,14820,9320,14779,9147,14736,8902,14691,8688,14646,8499,14598,8335,14549,8189,14499,7940,14448,7720,14397,7529,14347,7363,14256,7218,15285,10410,15285,10411,15285,10413,15284,10418,15282,10425,15278,10434,15272,10442,15264,10449,15252,10445,15235,10433,15210,10403,15179,10358,15149,10301,15113,10218,15073,10059,15033,9894,14991,9726,14951,9565,14909,9413,14865,9273,14822,9073,14777,8845,14730,8641,14682,8459,14633,8300,14583,8129,14531,7883,14479,7670,14426,7482,14373,7321,14305,7176,14201,6939,15305,9939,15305,9940,15305,9945,15304,9955,15302,9967,15298,9989,15293,10010,15286,10033,15274,10044,15258,10045,15233,10022,15205,9975,15174,9903,15136,9808,15095,9697,15053,9578,15009,9451,14965,9327,14918,9198,14871,8973,14825,8766,14775,8579,14725,8408,14675,8259,14622,8058,14569,7821,14515,7615,14460,7435,14405,7276,14350,7108,14256,6866,14149,6653,15321,9444,15321,9445,15321,9448,15320,9458,15317,9470,15314,9490,15310,9515,15302,9540,15292,9562,15276,9579,15251,9577,15226,9559,15195,9519,15156,9463,15116,9389,15071,9304,15025,9208,14978,9023,14927,8838,14878,8661,14827,8496,14774,8344,14722,8206,14667,7973,14612,7749,14556,7555,14499,7382,14443,7229,14385,7025,14322,6791,14210,6588,14100,6409,15333,8920,15333,8921,15332,8927,15332,8943,15329,8965,15326,9002,15322,9048,15316,9106,15307,9162,15291,9204,15267,9221,15244,9221,15212,9196,15175,9134,15133,9043,15088,8930,15040,8801,14990,8665,14938,8526,14886,8391,14830,8261,14775,8087,14719,7866,14661,7664,14603,7482,14544,7322,14485,7178,14426,6936,14367,6713,14281,6517,14166,6348,14054,6198,15341,8360,15341,8361,15341,8366,15341,8379,15339,8399,15336,8431,15332,8473,15326,8527,15318,8585,15302,8632,15281,8670,15258,8690,15227,8690,15191,8664,15149,8612,15104,8543,15055,8456,15001,8360,14948,8259,14892,8122,14834,7923,14776,7734,14716,7558,14656,7397,14595,7250,14534,7070,14472,6835,14410,6628,14350,6443,14243,6283,14125,6135,14010,5889,15348,7715,15348,7717,15348,7725,15347,7745,15345,7780,15343,7836,15339,7905,15334,8e3,15326,8103,15310,8193,15293,8239,15270,8270,15240,8287,15204,8283,15163,8260,15118,8223,15067,8143,15014,8014,14958,7873,14899,7723,14839,7573,14778,7430,14715,7293,14652,7164,14588,6931,14524,6720,14460,6531,14396,6362,14330,6210,14207,6015,14086,5781,13969,5576,15352,7114,15352,7116,15352,7128,15352,7159,15350,7195,15348,7237,15345,7299,15340,7374,15332,7457,15317,7544,15301,7633,15280,7703,15251,7754,15216,7775,15176,7767,15131,7733,15079,7670,15026,7588,14967,7492,14906,7387,14844,7278,14779,7171,14714,6965,14648,6770,14581,6587,14515,6420,14448,6269,14382,6123,14299,5881,14172,5665,14049,5477,13929,5310,15355,6329,15355,6330,15355,6339,15355,6362,15353,6410,15351,6472,15349,6572,15344,6688,15337,6835,15323,6985,15309,7142,15287,7220,15260,7277,15226,7310,15188,7326,15142,7318,15090,7285,15036,7239,14976,7177,14914,7045,14849,6892,14782,6736,14714,6581,14645,6433,14576,6293,14506,6164,14438,5946,14369,5733,14270,5540,14140,5369,14014,5216,13892,5043,15357,5483,15357,5484,15357,5496,15357,5528,15356,5597,15354,5692,15351,5835,15347,6011,15339,6195,15328,6317,15314,6446,15293,6566,15268,6668,15235,6746,15197,6796,15152,6811,15101,6790,15046,6748,14985,6673,14921,6583,14854,6479,14785,6371,14714,6259,14643,6149,14571,5946,14499,5750,14428,5567,14358,5401,14242,5250,14109,5111,13980,4870,13856,4657,15359,4555,15359,4557,15358,4573,15358,4633,15357,4715,15355,4841,15353,5061,15349,5216,15342,5391,15331,5577,15318,5770,15299,5967,15274,6150,15243,6223,15206,6280,15161,6310,15111,6317,15055,6300,14994,6262,14928,6208,14860,6141,14788,5994,14715,5838,14641,5684,14566,5529,14492,5384,14418,5247,14346,5121,14216,4892,14079,4682,13948,4496,13822,4330,15359,3498,15359,3501,15359,3520,15359,3598,15358,3719,15356,3860,15355,4137,15351,4305,15344,4563,15334,4809,15321,5116,15303,5273,15280,5418,15250,5547,15214,5653,15170,5722,15120,5761,15064,5763,15002,5733,14935,5673,14865,5597,14792,5504,14716,5400,14640,5294,14563,5185,14486,5041,14410,4841,14335,4655,14191,4482,14051,4325,13918,4183,13790,4012,15360,2282,15360,2285,15360,2306,15360,2401,15359,2547,15357,2748,15355,3103,15352,3349,15345,3675,15336,4020,15324,4272,15307,4496,15285,4716,15255,4908,15220,5086,15178,5170,15128,5214,15072,5234,15010,5231,14943,5206,14871,5166,14796,5102,14718,4971,14639,4833,14559,4687,14480,4541,14402,4401,14315,4268,14167,4142,14025,3958,13888,3747,13759,3556,15360,923,15360,925,15360,946,15360,1052,15359,1214,15357,1494,15356,1892,15352,2274,15346,2663,15338,3099,15326,3393,15309,3679,15288,3980,15260,4183,15226,4325,15185,4437,15136,4517,15080,4570,15018,4591,14950,4581,14877,4545,14800,4485,14720,4411,14638,4325,14556,4231,14475,4136,14395,3988,14297,3803,14145,3628,13999,3465,13861,3314,13729,3177,15360,263,15360,264,15360,272,15360,325,15359,407,15358,548,15356,780,15352,1144,15347,1580,15339,2099,15328,2425,15312,2795,15292,3133,15264,3329,15232,3517,15191,3689,15143,3819,15088,3923,15025,3978,14956,3999,14882,3979,14804,3931,14722,3855,14639,3756,14554,3645,14470,3529,14388,3409,14279,3289,14124,3173,13975,3055,13834,2848,13701,2658,15360,49,15360,49,15360,52,15360,75,15359,111,15358,201,15356,283,15353,519,15348,726,15340,1045,15329,1415,15314,1795,15295,2173,15269,2410,15237,2649,15197,2866,15150,3054,15095,3140,15032,3196,14963,3228,14888,3236,14808,3224,14725,3191,14639,3146,14553,3088,14466,2976,14382,2836,14262,2692,14103,2549,13952,2409,13808,2278,13674,2154,15360,4,15360,4,15360,4,15360,13,15359,33,15358,59,15357,112,15353,199,15348,302,15341,456,15331,628,15316,827,15297,1082,15272,1332,15241,1601,15202,1851,15156,2069,15101,2172,15039,2256,14970,2314,14894,2348,14813,2358,14728,2344,14640,2311,14551,2263,14463,2203,14376,2133,14247,2059,14084,1915,13930,1761,13784,1609,13648,1464,15360,0,15360,0,15360,0,15360,3,15359,18,15358,26,15357,53,15354,80,15348,97,15341,165,15332,238,15318,326,15299,427,15275,529,15245,654,15207,771,15161,885,15108,994,15046,1089,14976,1170,14900,1229,14817,1266,14731,1284,14641,1282,14550,1260,14460,1223,14370,1174,14232,1116,14066,1050,13909,981,13761,910,13623,839]);let Pl=null;function YO(){return Pl===null&&(Pl=new $r(qO,32,32,Px,_f),Pl.minFilter=Ui,Pl.magFilter=Ui,Pl.wrapS=Aa,Pl.wrapT=Aa,Pl.generateMipmaps=!1,Pl.needsUpdate=!0),Pl}class gE{constructor(e={}){const{canvas:t=uM(),context:n=null,depth:s=!0,stencil:o=!1,alpha:f=!1,antialias:d=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:m=!1,powerPreference:y="default",failIfMajorPerformanceCaveat:x=!1,reversedDepthBuffer:v=!1}=e;this.isWebGLRenderer=!0;let S;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");S=n.getContextAttributes().alpha}else S=f;const M=new Set([Ix,Bx,K0]),T=new Set([xr,Vl,lh,ch,Ux,Lx]),w=new Uint32Array(4),A=new Int32Array(4);let D=null,N=null;const U=[],I=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Xo,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const z=this;let j=!1;this._outputColorSpace=_a;let q=0,B=0,P=null,W=-1,se=null;const ae=new un,ce=new un;let ue=null;const V=new gt(0);let $=0,J=t.width,he=t.height,ve=1,Y=null,oe=null;const Te=new un(0,0,J,he),Ne=new un(0,0,J,he);let Qe=!1;const le=new Ah;let xe=!1,Ge=!1;const et=new Gt,at=new X,lt=new un,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let yt=!1;function Ue(){return P===null?ve:1}let Z=n;function ke(H,fe){return t.getContext(H,fe)}try{const H={alpha:!0,depth:s,stencil:o,antialias:d,premultipliedAlpha:p,preserveDrawingBuffer:m,powerPreference:y,failIfMajorPerformanceCaveat:x};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${_h}`),t.addEventListener("webglcontextlost",We,!1),t.addEventListener("webglcontextrestored",Ie,!1),t.addEventListener("webglcontextcreationerror",ft,!1),Z===null){const fe="webgl2";if(Z=ke(fe,H),Z===null)throw ke(fe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(H){throw H("WebGLRenderer: "+H.message),H}let Xe,tt,qe,ot,nt,ht,K,F,ye,Oe,Pe,Re,Mt,ct,wt,_t,je,Ye,St,te,Ae,Ze,ee,Ke;function Je(){Xe=new i6(Z),Xe.init(),Ze=new mE(Z,Xe),tt=new WN(Z,Xe,e,Ze),qe=new BO(Z,Xe),tt.reversedDepthBuffer&&v&&qe.buffers.depth.setReversed(!0),ot=new r6(Z),nt=new MO,ht=new IO(Z,Xe,qe,nt,tt,Ze,ot),K=new KN(z),F=new n6(z),ye=new u5(Z),ee=new qN(Z,ye),Oe=new a6(Z,ye,ot,ee),Pe=new l6(Z,Oe,ye,ot),St=new o6(Z,tt,ht),_t=new ZN(nt),Re=new AO(z,K,F,Xe,tt,ee,_t),Mt=new GO(z,nt),ct=new wO,wt=new OO(Xe),Ye=new XN(z,K,F,qe,Pe,S,p),je=new zO(z,Pe,tt),Ke=new XO(Z,ot,tt,qe),te=new YN(Z,Xe,ot),Ae=new s6(Z,Xe,ot),ot.programs=Re.programs,z.capabilities=tt,z.extensions=Xe,z.properties=nt,z.renderLists=ct,z.shadowMap=je,z.state=qe,z.info=ot}Je();const it=new kO(z,Z);this.xr=it,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){const H=Xe.get("WEBGL_lose_context");H&&H.loseContext()},this.forceContextRestore=function(){const H=Xe.get("WEBGL_lose_context");H&&H.restoreContext()},this.getPixelRatio=function(){return ve},this.setPixelRatio=function(H){H!==void 0&&(ve=H,this.setSize(J,he,!1))},this.getSize=function(H){return H.set(J,he)},this.setSize=function(H,fe,Ee=!0){if(it.isPresenting){mt("WebGLRenderer: Can't change size while VR device is presenting.");return}J=H,he=fe,t.width=Math.floor(H*ve),t.height=Math.floor(fe*ve),Ee===!0&&(t.style.width=H+"px",t.style.height=fe+"px"),this.setViewport(0,0,H,fe)},this.getDrawingBufferSize=function(H){return H.set(J*ve,he*ve).floor()},this.setDrawingBufferSize=function(H,fe,Ee){J=H,he=fe,ve=Ee,t.width=Math.floor(H*Ee),t.height=Math.floor(fe*Ee),this.setViewport(0,0,H,fe)},this.getCurrentViewport=function(H){return H.copy(ae)},this.getViewport=function(H){return H.copy(Te)},this.setViewport=function(H,fe,Ee,be){H.isVector4?Te.set(H.x,H.y,H.z,H.w):Te.set(H,fe,Ee,be),qe.viewport(ae.copy(Te).multiplyScalar(ve).round())},this.getScissor=function(H){return H.copy(Ne)},this.setScissor=function(H,fe,Ee,be){H.isVector4?Ne.set(H.x,H.y,H.z,H.w):Ne.set(H,fe,Ee,be),qe.scissor(ce.copy(Ne).multiplyScalar(ve).round())},this.getScissorTest=function(){return Qe},this.setScissorTest=function(H){qe.setScissorTest(Qe=H)},this.setOpaqueSort=function(H){Y=H},this.setTransparentSort=function(H){oe=H},this.getClearColor=function(H){return H.copy(Ye.getClearColor())},this.setClearColor=function(){Ye.setClearColor(...arguments)},this.getClearAlpha=function(){return Ye.getClearAlpha()},this.setClearAlpha=function(){Ye.setClearAlpha(...arguments)},this.clear=function(H=!0,fe=!0,Ee=!0){let be=0;if(H){let de=!1;if(P!==null){const st=P.texture.format;de=M.has(st)}if(de){const st=P.texture.type,ut=T.has(st),vt=Ye.getClearColor(),bt=Ye.getClearAlpha(),zt=vt.r,Bt=vt.g,Nt=vt.b;ut?(w[0]=zt,w[1]=Bt,w[2]=Nt,w[3]=bt,Z.clearBufferuiv(Z.COLOR,0,w)):(A[0]=zt,A[1]=Bt,A[2]=Nt,A[3]=bt,Z.clearBufferiv(Z.COLOR,0,A))}else be|=Z.COLOR_BUFFER_BIT}fe&&(be|=Z.DEPTH_BUFFER_BIT),Ee&&(be|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(be)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",We,!1),t.removeEventListener("webglcontextrestored",Ie,!1),t.removeEventListener("webglcontextcreationerror",ft,!1),Ye.dispose(),ct.dispose(),wt.dispose(),nt.dispose(),K.dispose(),F.dispose(),Pe.dispose(),ee.dispose(),Ke.dispose(),Re.dispose(),it.dispose(),it.removeEventListener("sessionstart",Qo),it.removeEventListener("sessionend",Jo),zi.stop()};function We(H){H.preventDefault(),F0("WebGLRenderer: Context Lost."),j=!0}function Ie(){F0("WebGLRenderer: Context Restored."),j=!1;const H=ot.autoReset,fe=je.enabled,Ee=je.autoUpdate,be=je.needsUpdate,de=je.type;Je(),ot.autoReset=H,je.enabled=fe,je.autoUpdate=Ee,je.needsUpdate=be,je.type=de}function ft(H){Yt("WebGLRenderer: A WebGL context could not be created. Reason: ",H.statusMessage)}function Tt(H){const fe=H.target;fe.removeEventListener("dispose",Tt),ln(fe)}function ln(H){Qt(H),nt.remove(H)}function Qt(H){const fe=nt.get(H).programs;fe!==void 0&&(fe.forEach(function(Ee){Re.releaseProgram(Ee)}),H.isShaderMaterial&&Re.releaseShaderCache(H))}this.renderBufferDirect=function(H,fe,Ee,be,de,st){fe===null&&(fe=Rt);const ut=de.isMesh&&de.matrixWorld.determinant()<0,vt=Tf(H,fe,Ee,be,de);qe.setMaterial(be,ut);let bt=Ee.index,zt=1;if(be.wireframe===!0){if(bt=Oe.getWireframeAttribute(Ee),bt===void 0)return;zt=2}const Bt=Ee.drawRange,Nt=Ee.attributes.position;let Zt=Bt.start*zt,yn=(Bt.start+Bt.count)*zt;st!==null&&(Zt=Math.max(Zt,st.start*zt),yn=Math.min(yn,(st.start+st.count)*zt)),bt!==null?(Zt=Math.max(Zt,0),yn=Math.min(yn,bt.count)):Nt!=null&&(Zt=Math.max(Zt,0),yn=Math.min(yn,Nt.count));const xn=yn-Zt;if(xn<0||xn===1/0)return;ee.setup(de,be,vt,Ee,bt);let fn,Dn=te;if(bt!==null&&(fn=ye.get(bt),Dn=Ae,Dn.setIndex(fn)),de.isMesh)be.wireframe===!0?(qe.setLineWidth(be.wireframeLinewidth*Ue()),Dn.setMode(Z.LINES)):Dn.setMode(Z.TRIANGLES);else if(de.isLine){let Lt=be.linewidth;Lt===void 0&&(Lt=1),qe.setLineWidth(Lt*Ue()),de.isLineSegments?Dn.setMode(Z.LINES):de.isLineLoop?Dn.setMode(Z.LINE_LOOP):Dn.setMode(Z.LINE_STRIP)}else de.isPoints?Dn.setMode(Z.POINTS):de.isSprite&&Dn.setMode(Z.TRIANGLES);if(de.isBatchedMesh)if(de._multiDrawInstances!==null)hh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Dn.renderMultiDrawInstances(de._multiDrawStarts,de._multiDrawCounts,de._multiDrawCount,de._multiDrawInstances);else if(Xe.get("WEBGL_multi_draw"))Dn.renderMultiDraw(de._multiDrawStarts,de._multiDrawCounts,de._multiDrawCount);else{const Lt=de._multiDrawStarts,Bn=de._multiDrawCounts,dn=de._multiDrawCount,bi=bt?ye.get(bt).bytesPerElement:1,Sr=nt.get(be).currentProgram.getUniforms();for(let Hn=0;Hn{function st(){if(be.forEach(function(ut){nt.get(ut).currentProgram.isReady()&&be.delete(ut)}),be.size===0){de(H);return}setTimeout(st,10)}Xe.get("KHR_parallel_shader_compile")!==null?st():setTimeout(st,10)})};let Ei=null;function Kc(H){Ei&&Ei(H)}function Qo(){zi.stop()}function Jo(){zi.start()}const zi=new uE;zi.setAnimationLoop(Kc),typeof self<"u"&&zi.setContext(self),this.setAnimationLoop=function(H){Ei=H,it.setAnimationLoop(H),H===null?zi.stop():zi.start()},it.addEventListener("sessionstart",Qo),it.addEventListener("sessionend",Jo),this.render=function(H,fe){if(fe!==void 0&&fe.isCamera!==!0){Yt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(j===!0)return;if(H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),it.enabled===!0&&it.isPresenting===!0&&(it.cameraAutoUpdate===!0&&it.updateCamera(fe),fe=it.getCamera()),H.isScene===!0&&H.onBeforeRender(z,H,fe,P),N=wt.get(H,I.length),N.init(fe),I.push(N),et.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),le.setFromProjectionMatrix(et,Ws,fe.reversedDepth),Ge=this.localClippingEnabled,xe=_t.init(this.clippingPlanes,Ge),D=ct.get(H,U.length),D.init(),U.push(D),it.enabled===!0&&it.isPresenting===!0){const st=z.xr.getDepthSensingMesh();st!==null&&no(st,fe,-1/0,z.sortObjects)}no(H,fe,0,z.sortObjects),D.finish(),z.sortObjects===!0&&D.sort(Y,oe),yt=it.enabled===!1||it.isPresenting===!1||it.hasDepthSensing()===!1,yt&&Ye.addToRenderList(D,H),this.info.render.frame++,xe===!0&&_t.beginShadows();const Ee=N.state.shadowsArray;je.render(Ee,H,fe),xe===!0&&_t.endShadows(),this.info.autoReset===!0&&this.info.reset();const be=D.opaque,de=D.transmissive;if(N.setupLights(),fe.isArrayCamera){const st=fe.cameras;if(de.length>0)for(let ut=0,vt=st.length;ut0&&Ga(be,de,H,fe),yt&&Ye.render(H),ms(D,H,fe);P!==null&&B===0&&(ht.updateMultisampleRenderTarget(P),ht.updateRenderTargetMipmap(P)),H.isScene===!0&&H.onAfterRender(z,H,fe),ee.resetDefaultState(),W=-1,se=null,I.pop(),I.length>0?(N=I[I.length-1],xe===!0&&_t.setGlobalState(z.clippingPlanes,N.state.camera)):N=null,U.pop(),U.length>0?D=U[U.length-1]:D=null};function no(H,fe,Ee,be){if(H.visible===!1)return;if(H.layers.test(fe.layers)){if(H.isGroup)Ee=H.renderOrder;else if(H.isLOD)H.autoUpdate===!0&&H.update(fe);else if(H.isLight)N.pushLight(H),H.castShadow&&N.pushShadow(H);else if(H.isSprite){if(!H.frustumCulled||le.intersectsSprite(H)){be&<.setFromMatrixPosition(H.matrixWorld).applyMatrix4(et);const ut=Pe.update(H),vt=H.material;vt.visible&&D.push(H,ut,vt,Ee,lt.z,null)}}else if((H.isMesh||H.isLine||H.isPoints)&&(!H.frustumCulled||le.intersectsObject(H))){const ut=Pe.update(H),vt=H.material;if(be&&(H.boundingSphere!==void 0?(H.boundingSphere===null&&H.computeBoundingSphere(),lt.copy(H.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),lt.copy(ut.boundingSphere.center)),lt.applyMatrix4(H.matrixWorld).applyMatrix4(et)),Array.isArray(vt)){const bt=ut.groups;for(let zt=0,Bt=bt.length;zt0&&$i(de,fe,Ee),st.length>0&&$i(st,fe,Ee),ut.length>0&&$i(ut,fe,Ee),qe.buffers.depth.setTest(!0),qe.buffers.depth.setMask(!0),qe.buffers.color.setMask(!0),qe.setPolygonOffset(!1)}function Ga(H,fe,Ee,be){if((Ee.isScene===!0?Ee.overrideMaterial:null)!==null)return;N.state.transmissionRenderTarget[be.id]===void 0&&(N.state.transmissionRenderTarget[be.id]=new Wo(1,1,{generateMipmaps:!0,type:Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float")?_f:xr,minFilter:ko,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wn.workingColorSpace}));const st=N.state.transmissionRenderTarget[be.id],ut=be.viewport||ae;st.setSize(ut.z*z.transmissionResolutionScale,ut.w*z.transmissionResolutionScale);const vt=z.getRenderTarget(),bt=z.getActiveCubeFace(),zt=z.getActiveMipmapLevel();z.setRenderTarget(st),z.getClearColor(V),$=z.getClearAlpha(),$<1&&z.setClearColor(16777215,.5),z.clear(),yt&&Ye.render(Ee);const Bt=z.toneMapping;z.toneMapping=Xo;const Nt=be.viewport;if(be.viewport!==void 0&&(be.viewport=void 0),N.setupLightsView(be),xe===!0&&_t.setGlobalState(z.clippingPlanes,be),$i(H,Ee,be),ht.updateMultisampleRenderTarget(st),ht.updateRenderTargetMipmap(st),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let Zt=!1;for(let yn=0,xn=fe.length;yn0),Nt=!!Ee.morphAttributes.position,Zt=!!Ee.morphAttributes.normal,yn=!!Ee.morphAttributes.color;let xn=Xo;be.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(xn=z.toneMapping);const fn=Ee.morphAttributes.position||Ee.morphAttributes.normal||Ee.morphAttributes.color,Dn=fn!==void 0?fn.length:0,Lt=nt.get(be),Bn=N.state.lights;if(xe===!0&&(Ge===!0||H!==se)){const Ci=H===se&&be.id===W;_t.setState(be,H,Ci)}let dn=!1;be.version===Lt.__version?(Lt.needsLights&&Lt.lightsStateVersion!==Bn.state.version||Lt.outputColorSpace!==vt||de.isBatchedMesh&&Lt.batching===!1||!de.isBatchedMesh&&Lt.batching===!0||de.isBatchedMesh&&Lt.batchingColor===!0&&de.colorTexture===null||de.isBatchedMesh&&Lt.batchingColor===!1&&de.colorTexture!==null||de.isInstancedMesh&&Lt.instancing===!1||!de.isInstancedMesh&&Lt.instancing===!0||de.isSkinnedMesh&&Lt.skinning===!1||!de.isSkinnedMesh&&Lt.skinning===!0||de.isInstancedMesh&&Lt.instancingColor===!0&&de.instanceColor===null||de.isInstancedMesh&&Lt.instancingColor===!1&&de.instanceColor!==null||de.isInstancedMesh&&Lt.instancingMorph===!0&&de.morphTexture===null||de.isInstancedMesh&&Lt.instancingMorph===!1&&de.morphTexture!==null||Lt.envMap!==bt||be.fog===!0&&Lt.fog!==st||Lt.numClippingPlanes!==void 0&&(Lt.numClippingPlanes!==_t.numPlanes||Lt.numIntersection!==_t.numIntersection)||Lt.vertexAlphas!==zt||Lt.vertexTangents!==Bt||Lt.morphTargets!==Nt||Lt.morphNormals!==Zt||Lt.morphColors!==yn||Lt.toneMapping!==xn||Lt.morphTargetsCount!==Dn)&&(dn=!0):(dn=!0,Lt.__version=be.version);let bi=Lt.currentProgram;dn===!0&&(bi=fi(be,fe,de));let Sr=!1,Hn=!1,Qs=!1;const kn=bi.getUniforms(),wi=Lt.uniforms;if(qe.useProgram(bi.program)&&(Sr=!0,Hn=!0,Qs=!0),be.id!==W&&(W=be.id,Hn=!0),Sr||se!==H){qe.buffers.depth.getReversed()&&H.reversedDepth!==!0&&(H._reversedDepth=!0,H.updateProjectionMatrix()),kn.setValue(Z,"projectionMatrix",H.projectionMatrix),kn.setValue(Z,"viewMatrix",H.matrixWorldInverse);const ni=kn.map.cameraPosition;ni!==void 0&&ni.setValue(Z,at.setFromMatrixPosition(H.matrixWorld)),tt.logarithmicDepthBuffer&&kn.setValue(Z,"logDepthBufFC",2/(Math.log(H.far+1)/Math.LN2)),(be.isMeshPhongMaterial||be.isMeshToonMaterial||be.isMeshLambertMaterial||be.isMeshBasicMaterial||be.isMeshStandardMaterial||be.isShaderMaterial)&&kn.setValue(Z,"isOrthographic",H.isOrthographicCamera===!0),se!==H&&(se=H,Hn=!0,Qs=!0)}if(de.isSkinnedMesh){kn.setOptional(Z,de,"bindMatrix"),kn.setOptional(Z,de,"bindMatrixInverse");const Ci=de.skeleton;Ci&&(Ci.boneTexture===null&&Ci.computeBoneTexture(),kn.setValue(Z,"boneTexture",Ci.boneTexture,ht))}de.isBatchedMesh&&(kn.setOptional(Z,de,"batchingTexture"),kn.setValue(Z,"batchingTexture",de._matricesTexture,ht),kn.setOptional(Z,de,"batchingIdTexture"),kn.setValue(Z,"batchingIdTexture",de._indirectTexture,ht),kn.setOptional(Z,de,"batchingColorTexture"),de._colorsTexture!==null&&kn.setValue(Z,"batchingColorTexture",de._colorsTexture,ht));const Ti=Ee.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&St.update(de,Ee,bi),(Hn||Lt.receiveShadow!==de.receiveShadow)&&(Lt.receiveShadow=de.receiveShadow,kn.setValue(Z,"receiveShadow",de.receiveShadow)),be.isMeshGouraudMaterial&&be.envMap!==null&&(wi.envMap.value=bt,wi.flipEnvMap.value=bt.isCubeTexture&&bt.isRenderTargetTexture===!1?-1:1),be.isMeshStandardMaterial&&be.envMap===null&&fe.environment!==null&&(wi.envMapIntensity.value=fe.environmentIntensity),wi.dfgLUT!==void 0&&(wi.dfgLUT.value=YO()),Hn&&(kn.setValue(Z,"toneMappingExposure",z.toneMappingExposure),Lt.needsLights&&Rh(wi,Qs),st&&be.fog===!0&&Mt.refreshFogUniforms(wi,st),Mt.refreshMaterialUniforms(wi,be,ve,he,N.state.transmissionRenderTarget[H.id]),Ny.upload(Z,Ns(Lt),wi,ht)),be.isShaderMaterial&&be.uniformsNeedUpdate===!0&&(Ny.upload(Z,Ns(Lt),wi,ht),be.uniformsNeedUpdate=!1),be.isSpriteMaterial&&kn.setValue(Z,"center",de.center),kn.setValue(Z,"modelViewMatrix",de.modelViewMatrix),kn.setValue(Z,"normalMatrix",de.normalMatrix),kn.setValue(Z,"modelMatrix",de.matrixWorld),be.isShaderMaterial||be.isRawShaderMaterial){const Ci=be.uniformsGroups;for(let ni=0,Os=Ci.length;ni0&&ht.useMultisampledRTT(H)===!1?de=nt.get(H).__webglMultisampledFramebuffer:Array.isArray(Bt)?de=Bt[Ee]:de=Bt,ae.copy(H.viewport),ce.copy(H.scissor),ue=H.scissorTest}else ae.copy(Te).multiplyScalar(ve).floor(),ce.copy(Ne).multiplyScalar(ve).floor(),ue=Qe;if(Ee!==0&&(de=_r),qe.bindFramebuffer(Z.FRAMEBUFFER,de)&&be&&qe.drawBuffers(H,de),qe.viewport(ae),qe.scissor(ce),qe.setScissorTest(ue),st){const bt=nt.get(H.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+fe,bt.__webglTexture,Ee)}else if(ut){const bt=fe;for(let zt=0;zt=0&&fe<=H.width-be&&Ee>=0&&Ee<=H.height-de&&(H.textures.length>1&&Z.readBuffer(Z.COLOR_ATTACHMENT0+vt),Z.readPixels(fe,Ee,be,de,Ze.convert(Bt),Ze.convert(Nt),st))}finally{const zt=P!==null?nt.get(P).__webglFramebuffer:null;qe.bindFramebuffer(Z.FRAMEBUFFER,zt)}}},this.readRenderTargetPixelsAsync=async function(H,fe,Ee,be,de,st,ut,vt=0){if(!(H&&H.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let bt=nt.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&ut!==void 0&&(bt=bt[ut]),bt)if(fe>=0&&fe<=H.width-be&&Ee>=0&&Ee<=H.height-de){qe.bindFramebuffer(Z.FRAMEBUFFER,bt);const zt=H.textures[vt],Bt=zt.format,Nt=zt.type;if(!tt.textureFormatReadable(Bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!tt.textureTypeReadable(Nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Zt=Z.createBuffer();Z.bindBuffer(Z.PIXEL_PACK_BUFFER,Zt),Z.bufferData(Z.PIXEL_PACK_BUFFER,st.byteLength,Z.STREAM_READ),H.textures.length>1&&Z.readBuffer(Z.COLOR_ATTACHMENT0+vt),Z.readPixels(fe,Ee,be,de,Ze.convert(Bt),Ze.convert(Nt),0);const yn=P!==null?nt.get(P).__webglFramebuffer:null;qe.bindFramebuffer(Z.FRAMEBUFFER,yn);const xn=Z.fenceSync(Z.SYNC_GPU_COMMANDS_COMPLETE,0);return Z.flush(),await mC(Z,xn,4),Z.bindBuffer(Z.PIXEL_PACK_BUFFER,Zt),Z.getBufferSubData(Z.PIXEL_PACK_BUFFER,0,st),Z.deleteBuffer(Zt),Z.deleteSync(xn),st}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(H,fe=null,Ee=0){const be=Math.pow(2,-Ee),de=Math.floor(H.image.width*be),st=Math.floor(H.image.height*be),ut=fe!==null?fe.x:0,vt=fe!==null?fe.y:0;ht.setTexture2D(H,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,Ee,0,0,ut,vt,de,st),qe.unbindTexture()};const el=Z.createFramebuffer(),di=Z.createFramebuffer();this.copyTextureToTexture=function(H,fe,Ee=null,be=null,de=0,st=null){st===null&&(de!==0?(hh("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),st=de,de=0):st=0);let ut,vt,bt,zt,Bt,Nt,Zt,yn,xn;const fn=H.isCompressedTexture?H.mipmaps[st]:H.image;if(Ee!==null)ut=Ee.max.x-Ee.min.x,vt=Ee.max.y-Ee.min.y,bt=Ee.isBox3?Ee.max.z-Ee.min.z:1,zt=Ee.min.x,Bt=Ee.min.y,Nt=Ee.isBox3?Ee.min.z:0;else{const Ti=Math.pow(2,-de);ut=Math.floor(fn.width*Ti),vt=Math.floor(fn.height*Ti),H.isDataArrayTexture?bt=fn.depth:H.isData3DTexture?bt=Math.floor(fn.depth*Ti):bt=1,zt=0,Bt=0,Nt=0}be!==null?(Zt=be.x,yn=be.y,xn=be.z):(Zt=0,yn=0,xn=0);const Dn=Ze.convert(fe.format),Lt=Ze.convert(fe.type);let Bn;fe.isData3DTexture?(ht.setTexture3D(fe,0),Bn=Z.TEXTURE_3D):fe.isDataArrayTexture||fe.isCompressedArrayTexture?(ht.setTexture2DArray(fe,0),Bn=Z.TEXTURE_2D_ARRAY):(ht.setTexture2D(fe,0),Bn=Z.TEXTURE_2D),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,fe.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,fe.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,fe.unpackAlignment);const dn=Z.getParameter(Z.UNPACK_ROW_LENGTH),bi=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),Sr=Z.getParameter(Z.UNPACK_SKIP_PIXELS),Hn=Z.getParameter(Z.UNPACK_SKIP_ROWS),Qs=Z.getParameter(Z.UNPACK_SKIP_IMAGES);Z.pixelStorei(Z.UNPACK_ROW_LENGTH,fn.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,fn.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,zt),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,Bt),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,Nt);const kn=H.isDataArrayTexture||H.isData3DTexture,wi=fe.isDataArrayTexture||fe.isData3DTexture;if(H.isDepthTexture){const Ti=nt.get(H),Ci=nt.get(fe),ni=nt.get(Ti.__renderTarget),Os=nt.get(Ci.__renderTarget);qe.bindFramebuffer(Z.READ_FRAMEBUFFER,ni.__webglFramebuffer),qe.bindFramebuffer(Z.DRAW_FRAMEBUFFER,Os.__webglFramebuffer);for(let gs=0;gs"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Q2.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:y,Q2}var _S;function yE(){return _S||(_S=1,K2.exports=ZO()),K2.exports}var SS;function KO(){if(SS)return Z2;SS=1;var a=bh(),e=yE();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,o=a.useRef,f=a.useEffect,d=a.useMemo,p=a.useDebugValue;return Z2.useSyncExternalStoreWithSelector=function(m,y,x,v,S){var M=o(null);if(M.current===null){var T={hasValue:!1,value:null};M.current=T}else T=M.current;M=d(function(){function A(z){if(!D){if(D=!0,N=z,z=v(z),S!==void 0&&T.hasValue){var j=T.value;if(S(j,z))return U=j}return U=z}if(j=U,n(N,z))return j;var q=v(z);return S!==void 0&&S(j,q)?(N=z,j):(N=z,U=q)}var D=!1,N,U,I=x===void 0?null:x;return[function(){return A(y())},I===null?void 0:function(){return A(I())}]},[y,x,v,S]);var w=s(m,M[0],M[1]);return f(function(){T.hasValue=!0,T.value=w},[w]),p(w),w},Z2}var AS;function QO(){return AS||(AS=1,W2.exports=KO()),W2.exports}var JO=QO();const $O=jb(JO),MS=a=>{let e;const t=new Set,n=(m,y)=>{const x=typeof m=="function"?m(e):m;if(!Object.is(x,e)){const v=e;e=y??(typeof x!="object"||x===null)?x:Object.assign({},e,x),t.forEach(S=>S(e,v))}},s=()=>e,d={setState:n,getState:s,getInitialState:()=>p,subscribe:m=>(t.add(m),()=>t.delete(m))},p=e=a(n,s,d);return d},e8=(a=>a?MS(a):MS),{useSyncExternalStoreWithSelector:t8}=$O,n8=a=>a;function i8(a,e=n8,t){const n=t8(a.subscribe,a.getState,a.getInitialState,e,t);return mA.useDebugValue(n),n}const ES=(a,e)=>{const t=e8(a),n=(s,o=e)=>i8(t,s,o);return Object.assign(n,t),n},a8=((a,e)=>a?ES(a,e):ES),s8=a=>typeof a=="object"&&typeof a.then=="function",ff=[];function xE(a,e,t=(n,s)=>n===s){if(a===e)return!0;if(!a||!e)return!1;const n=a.length;if(e.length!==n)return!1;for(let s=0;s0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,n.lifespan)),o.response;if(!t)throw o.promise}const s={keys:e,equal:n.equal,remove:()=>{const o=ff.indexOf(s);o!==-1&&ff.splice(o,1)},promise:(s8(a)?a:a(...e)).then(o=>{s.response=o,n.lifespan&&n.lifespan>0&&(s.timeout=setTimeout(s.remove,n.lifespan))}).catch(o=>s.error=o)};if(ff.push(s),!t)throw s.promise}const r8=(a,e,t)=>vE(a,e,!1,t),o8=(a,e,t)=>void vE(a,e,!0,t),l8=a=>{if(a===void 0||a.length===0)ff.splice(0,ff.length);else{const e=ff.find(t=>xE(a,t.keys,t.equal));e&&e.remove()}};var J2={exports:{}},$2={exports:{}},eb={exports:{}},tb={};var wS;function c8(){return wS||(wS=1,(function(a){function e(V,$){var J=V.length;V.push($);e:for(;0>>1,ve=V[he];if(0>>1;hes(Te,J))Nes(Qe,Te)?(V[he]=Qe,V[Ne]=J,he=Ne):(V[he]=Te,V[oe]=J,he=oe);else if(Nes(Qe,J))V[he]=Qe,V[Ne]=J,he=Ne;else break e}}return $}function s(V,$){var J=V.sortIndex-$.sortIndex;return J!==0?J:V.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;a.unstable_now=function(){return o.now()}}else{var f=Date,d=f.now();a.unstable_now=function(){return f.now()-d}}var p=[],m=[],y=1,x=null,v=3,S=!1,M=!1,T=!1,w=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function N(V){for(var $=t(m);$!==null;){if($.callback===null)n(m);else if($.startTime<=V)n(m),$.sortIndex=$.expirationTime,e(p,$);else break;$=t(m)}}function U(V){if(T=!1,N(V),!M)if(t(p)!==null)M=!0,ce();else{var $=t(m);$!==null&&ue(U,$.startTime-V)}}var I=!1,z=-1,j=5,q=-1;function B(){return!(a.unstable_now()-qV&&B());){var he=x.callback;if(typeof he=="function"){x.callback=null,v=x.priorityLevel;var ve=he(x.expirationTime<=V);if(V=a.unstable_now(),typeof ve=="function"){x.callback=ve,N(V),$=!0;break t}x===t(p)&&n(p),N(V)}else n(p);x=t(p)}if(x!==null)$=!0;else{var Y=t(m);Y!==null&&ue(U,Y.startTime-V),$=!1}}break e}finally{x=null,v=J,S=!1}$=void 0}}finally{$?W():I=!1}}}var W;if(typeof D=="function")W=function(){D(P)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ae=se.port2;se.port1.onmessage=P,W=function(){ae.postMessage(null)}}else W=function(){w(P,0)};function ce(){I||(I=!0,W())}function ue(V,$){z=w(function(){V(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(V){V.callback=null},a.unstable_continueExecution=function(){M||S||(M=!0,ce())},a.unstable_forceFrameRate=function(V){0>V||125he?(V.sortIndex=J,e(m,V),t(p)===null&&V===t(m)&&(T?(A(z),z=-1):T=!0,ue(U,J-he))):(V.sortIndex=ve,e(p,V),M||S||(M=!0,ce())),V},a.unstable_shouldYield=B,a.unstable_wrapCallback=function(V){var $=v;return function(){var J=v;v=$;try{return V.apply(this,arguments)}finally{v=J}}}})(tb)),tb}var TS;function bE(){return TS||(TS=1,eb.exports=c8()),eb.exports}var CS;function u8(){return CS||(CS=1,(function(a){a.exports=function(e){function t(l,c,g,_){return new tp(l,c,g,_)}function n(){}function s(l){var c="https://react.dev/errors/"+l;if(1)":-1C||ge[_]!==Be[C]){var rt=` +`+ge[_].replace(" at new "," at ");return l.displayName&&rt.includes("")&&(rt=rt.replace("",l.displayName)),rt}while(1<=_&&0<=C);break}}}finally{Ao=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?d(g):""}function m(l){switch(l.tag){case 26:case 27:case 5:return d(l.type);case 16:return d("Lazy");case 13:return d("Suspense");case 19:return d("SuspenseList");case 0:case 15:return l=p(l.type,!1),l;case 11:return l=p(l.type.render,!1),l;case 1:return l=p(l.type,!0),l;default:return""}}function y(l){try{var c="";do c+=m(l),l=l.return;while(l);return c}catch(g){return` +Error generating stack: `+g.message+` +`+g.stack}}function x(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function v(l){if(x(l)!==l)throw Error(s(188))}function S(l){var c=l.alternate;if(!c){if(c=x(l),c===null)throw Error(s(188));return c!==l?null:l}for(var g=l,_=c;;){var C=g.return;if(C===null)break;var O=C.alternate;if(O===null){if(_=C.return,_!==null){g=_;continue}break}if(C.child===O.child){for(O=C.child;O;){if(O===g)return v(C),l;if(O===_)return v(C),c;O=O.sibling}throw Error(s(188))}if(g.return!==_.return)g=C,_=O;else{for(var G=!1,ne=C.child;ne;){if(ne===g){G=!0,g=C,_=O;break}if(ne===_){G=!0,_=C,g=O;break}ne=ne.sibling}if(!G){for(ne=O.child;ne;){if(ne===g){G=!0,g=O,_=C;break}if(ne===_){G=!0,_=O,g=C;break}ne=ne.sibling}if(!G)throw Error(s(189))}}if(g.alternate!==_)throw Error(s(190))}if(g.tag!==3)throw Error(s(188));return g.stateNode.current===g?l:c}function M(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=M(l),c!==null)return c;l=l.sibling}return null}function T(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(c=T(l),c!==null))return c;l=l.sibling}return null}function w(l){return{current:l}}function A(l){0>Pr||(l.current=Tu[Pr],Tu[Pr]=null,Pr--)}function D(l,c){Pr++,Tu[Pr]=l.current,l.current=c}function N(l){return l>>>=0,l===0?32:31-(Cu(l)/ng|0)|0}function U(l){var c=l&42;if(c!==0)return c;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function I(l,c){var g=l.pendingLanes;if(g===0)return 0;var _=0,C=l.suspendedLanes,O=l.pingedLanes,G=l.warmLanes;l=l.finishedLanes!==0;var ne=g&134217727;return ne!==0?(g=ne&~C,g!==0?_=U(g):(O&=ne,O!==0?_=U(O):l||(G=ne&~G,G!==0&&(_=U(G))))):(ne=g&~C,ne!==0?_=U(ne):O!==0?_=U(O):l||(G=g&~G,G!==0&&(_=U(G)))),_===0?0:c!==0&&c!==_&&(c&C)===0&&(C=_&-_,G=c&-c,C>=G||C===32&&(G&4194176)!==0)?c:_}function z(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function j(l,c){switch(l){case 1:case 2:case 4:case 8:return c+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function q(){var l=dc;return dc<<=1,(dc&4194176)===0&&(dc=128),l}function B(){var l=Ru;return Ru<<=1,(Ru&62914560)===0&&(Ru=4194304),l}function P(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function W(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function se(l,c,g,_,C,O){var G=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var ne=l.entanglements,ge=l.expirationTimes,Be=l.hiddenUpdates;for(g=G&~g;0>=G,C-=G,ur=1<<32-Da(c)+C|g<Mn?(Ni=Vt,Vt=null):Ni=Vt.sibling;var En=xt(Me,Vt,Ce[Mn],$e);if(En===null){Vt===null&&(Vt=Ni);break}l&&Vt&&En.alternate===null&&c(Me,Vt),pe=O(En,pe,Mn),qn===null?Dt=En:qn.sibling=En,qn=En,Vt=Ni}if(Mn===Ce.length)return g(Me,Vt),Sn&&ve(Me,Mn),Dt;if(Vt===null){for(;MnMn?(Ni=Vt,Vt=null):Ni=Vt.sibling;var Gr=xt(Me,Vt,En.value,$e);if(Gr===null){Vt===null&&(Vt=Ni);break}l&&Vt&&Gr.alternate===null&&c(Me,Vt),pe=O(Gr,pe,Mn),qn===null?Dt=Gr:qn.sibling=Gr,qn=Gr,Vt=Ni}if(En.done)return g(Me,Vt),Sn&&ve(Me,Mn),Dt;if(Vt===null){for(;!En.done;Mn++,En=Ce.next())En=pt(Me,En.value,$e),En!==null&&(pe=O(En,pe,Mn),qn===null?Dt=En:qn.sibling=En,qn=En);return Sn&&ve(Me,Mn),Dt}for(Vt=_(Vt);!En.done;Mn++,En=Ce.next())En=qt(Vt,Me,Mn,En.value,$e),En!==null&&(l&&En.alternate!==null&&Vt.delete(En.key===null?Mn:En.key),pe=O(En,pe,Mn),qn===null?Dt=En:qn.sibling=En,qn=En);return l&&Vt.forEach(function(Td){return c(Me,Td)}),Sn&&ve(Me,Mn),Dt}function Tl(Me,pe,Ce,$e){if(typeof Ce=="object"&&Ce!==null&&Ce.type===oc&&Ce.key===null&&(Ce=Ce.props.children),typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case Or:e:{for(var Dt=Ce.key;pe!==null;){if(pe.key===Dt){if(Dt=Ce.type,Dt===oc){if(pe.tag===7){g(Me,pe.sibling),$e=C(pe,Ce.props.children),$e.return=Me,Me=$e;break e}}else if(pe.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===Bs&&$n(Dt)===pe.type){g(Me,pe.sibling),$e=C(pe,Ce.props),ln($e,Ce),$e.return=Me,Me=$e;break e}g(Me,pe);break}else c(Me,pe);pe=pe.sibling}Ce.type===oc?($e=Nr(Ce.props.children,Me.mode,$e,Ce.key),$e.return=Me,Me=$e):($e=ys(Ce.type,Ce.key,Ce.props,null,Me.mode,$e),ln($e,Ce),$e.return=Me,Me=$e)}return G(Me);case Ps:e:{for(Dt=Ce.key;pe!==null;){if(pe.key===Dt)if(pe.tag===4&&pe.stateNode.containerInfo===Ce.containerInfo&&pe.stateNode.implementation===Ce.implementation){g(Me,pe.sibling),$e=C(pe,Ce.children||[]),$e.return=Me,Me=$e;break e}else{g(Me,pe);break}else c(Me,pe);pe=pe.sibling}$e=rc(Ce,Me.mode,$e),$e.return=Me,Me=$e}return G(Me);case Bs:return Dt=Ce._init,Ce=Dt(Ce._payload),Tl(Me,pe,Ce,$e)}if(Mo(Ce))return Pa(Me,pe,Ce,$e);if(o(Ce)){if(Dt=o(Ce),typeof Dt!="function")throw Error(s(150));return Ce=Dt.call(Ce),Hu(Me,pe,Ce,$e)}if(typeof Ce.then=="function")return Tl(Me,pe,Tt(Ce),$e);if(Ce.$$typeof===sr)return Tl(Me,pe,lu(Me,Ce),$e);Qt(Me,Ce)}return typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint"?(Ce=""+Ce,pe!==null&&pe.tag===6?(g(Me,pe.sibling),$e=C(pe,Ce),$e.return=Me,Me=$e):(g(Me,pe),$e=bo(Ce,Me.mode,$e),$e.return=Me,Me=$e),G(Me)):g(Me,pe)}return function(Me,pe,Ce,$e){try{_s=0;var Dt=Tl(Me,pe,Ce,$e);return fr=null,Dt}catch(Vt){if(Vt===Pn)throw Vt;var qn=t(29,Vt,null,Me.mode);return qn.lanes=$e,qn.return=Me,qn}finally{}}}function Kc(l,c){l=Hs,D(ns,l),D(dr,c),Hs=l|c.baseLanes}function Qo(){D(ns,Hs),D(dr,dr.current)}function Jo(){Hs=ns.current,A(dr),A(ns)}function zi(l){var c=l.alternate;D(Si,Si.current&1),D(is,l),Ss===null&&(c===null||dr.current!==null||c.memoizedState!==null)&&(Ss=l)}function no(l){if(l.tag===22){if(D(Si,Si.current),D(is,l),Ss===null){var c=l.alternate;c!==null&&c.memoizedState!==null&&(Ss=l)}}else ms()}function ms(){D(Si,Si.current),D(is,is.current)}function Ga(l){A(is),Ss===l&&(Ss=null),A(Si)}function $i(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||cd(g)||wu(g)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function nn(){throw Error(s(321))}function fi(l,c){if(c===null)return!1;for(var g=0;gO?O:8);var G=It.T,ne={};It.T=ne,Of(l,!1,c,g);try{var ge=C(),Be=It.S;if(Be!==null&&Be(ne,ge),ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var rt=ct(ge,_);so(l,c,rt,da(l))}else so(l,c,_,da(l))}catch(pt){so(l,c,{then:function(){},status:"rejected",reason:pt},da())}finally{aa(O),It.T=G}}function Oh(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:Ra,baseState:Ra,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:de,lastRenderedState:Ra},next:null};var g={};return c.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:de,lastRenderedState:g},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function nl(){return Vi(kt)}function $s(){return H().memoizedState}function Df(){return H().memoizedState}function tu(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var g=da();l=je(g);var _=Ye(c,l,g);_!==null&&(na(_,c,g),St(_,c,g)),c={cache:Bf()},l.payload=c;return}c=c.return}}function ao(l,c,g){var _=da();g={lane:_,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null},il(l)?nu(c,g):(g=ke(l,c,g,_),g!==null&&(na(g,l,_),Uh(g,c,_)))}function Nf(l,c,g){var _=da();so(l,c,g,_)}function so(l,c,g,_){var C={lane:_,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null};if(il(l))nu(c,C);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=c.lastRenderedReducer,O!==null))try{var G=c.lastRenderedState,ne=O(G,g);if(C.hasEagerState=!0,C.eagerState=ne,Qa(ne,G))return Z(l,c,C,0),cn===null&&Ue(),!1}catch{}finally{}if(g=ke(l,c,C,_),g!==null)return na(g,l,_),Uh(g,c,_),!0}return!1}function Of(l,c,g,_){if(_={lane:2,revertLane:Pe(),action:_,hasEagerState:!1,eagerState:null,next:null},il(l)){if(c)throw Error(s(479))}else c=ke(l,g,_,2),c!==null&&na(c,l,2)}function il(l){var c=l.alternate;return l===Jt||c!==null&&c===Jt}function nu(l,c){Jn=As=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function Uh(l,c,g){if((g&4194176)!==0){var _=c.lanes;_&=l.pendingLanes,g|=_,c.lanes=g,ce(l,g)}}function ea(l,c,g,_){c=l.memoizedState,g=g(_,c),g=g==null?c:hl({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}function ro(l,c,g,_,C,O,G){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(_,O,G):c.prototype&&c.prototype.isPureReactComponent?!Je(g,_)||!Je(C,O):!0}function iu(l,c,g,_){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,_),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,_),c.state!==l&&_d.enqueueReplaceState(c,c.state,null)}function Us(l,c){var g=c;if("ref"in c){g={};for(var _ in c)_!=="ref"&&(g[_]=c[_])}if(l=l.defaultProps){g===c&&(g=hl({},g));for(var C in l)g[C]===void 0&&(g[C]=l[C])}return g}function Uf(l,c){try{var g=l.onUncaughtError;g(c.value,{componentStack:c.stack})}catch(_){setTimeout(function(){throw _})}}function Lf(l,c,g){try{var _=l.onCaughtError;_(g.value,{componentStack:g.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function au(l,c,g){return g=je(g),g.tag=3,g.payload={element:null},g.callback=function(){Uf(l,c)},g}function ql(l){return l=je(l),l.tag=3,l}function su(l,c,g,_){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var O=_.value;l.payload=function(){return C(O)},l.callback=function(){Lf(c,g,_)}}var G=g.stateNode;G!==null&&typeof G.componentDidCatch=="function"&&(l.callback=function(){Lf(c,g,_),typeof C!="function"&&(os===null?os=new Set([this]):os.add(this));var ne=_.stack;this.componentDidCatch(_.value,{componentStack:ne!==null?ne:""})})}function fm(l,c,g,_,C){if(g.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){if(c=g.alternate,c!==null&&al(c,g,C,!0),g=is.current,g!==null){switch(g.tag){case 13:return Ss===null?Ca():g.alternate===null&&bn===0&&(bn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,_===vd?g.flags|=16384:(c=g.updateQueue,c===null?g.updateQueue=new Set([_]):c.add(_),Qf(l,_,C)),!1;case 22:return g.flags|=65536,_===vd?g.flags|=16384:(c=g.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([_])},g.updateQueue=c):(g=c.retryQueue,g===null?c.retryQueue=new Set([_]):g.add(_)),Qf(l,_,C)),!1}throw Error(s(435,g.tag))}return Qf(l,_,C),Ca(),!1}if(Sn)return c=is.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=C,_!==Lu&&(l=Error(s(422),{cause:_}),yt(he(l,g)))):(_!==Lu&&(c=Error(s(423),{cause:_}),yt(he(c,g))),l=l.current.alternate,l.flags|=65536,C&=-C,l.lanes|=C,_=he(_,g),C=au(l.stateNode,_,C),te(l,C),bn!==4&&(bn=2)),!1;var O=Error(s(520),{cause:_});if(O=he(O,g),_c===null?_c=[O]:_c.push(O),bn!==4&&(bn=2),c===null)return!0;_=he(_,g),g=c;do{switch(g.tag){case 3:return g.flags|=65536,l=C&-C,g.lanes|=l,l=au(g.stateNode,_,l),te(g,l),!1;case 1:if(c=g.type,O=g.stateNode,(g.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(os===null||!os.has(O))))return g.flags|=65536,C&=-C,g.lanes|=C,C=ql(C),su(C,l,g,_),te(g,C),!1}g=g.return}while(g!==null);return!1}function ki(l,c,g,_){c.child=l===null?kp(c,null,g,_):No(c,l.child,g,_)}function dm(l,c,g,_,C){g=g.render;var O=c.ref;if("ref"in _){var G={};for(var ne in _)ne!=="ref"&&(G[ne]=_[ne])}else G=_;return sl(c),_=Ns(l,c,g,G,O,C),ne=Xl(),l!==null&&!mi?(_r(l,c,C),Ar(l,c,C)):(Sn&&ne&&oe(c),c.flags|=1,ki(l,c,_,C),c.child)}function hm(l,c,g,_,C){if(l===null){var O=g.type;return typeof O=="function"&&!Rr(O)&&O.defaultProps===void 0&&g.compare===null?(c.tag=15,c.type=O,zf(l,c,O,_,C)):(l=ys(g.type,null,_,c,c.mode,C),l.ref=c.ref,l.return=c,c.child=l)}if(O=l.child,!jh(l,C)){var G=O.memoizedProps;if(g=g.compare,g=g!==null?g:Je,g(G,_)&&l.ref===c.ref)return Ar(l,c,C)}return c.flags|=1,l=ia(O,_),l.ref=c.ref,l.return=c,c.child=l}function zf(l,c,g,_,C){if(l!==null){var O=l.memoizedProps;if(Je(O,_)&&l.ref===c.ref)if(mi=!1,c.pendingProps=_=O,jh(l,C))(l.flags&131072)!==0&&(mi=!0);else return c.lanes=l.lanes,Ar(l,c,C)}return Lh(l,c,g,_,C)}function pm(l,c,g){var _=c.pendingProps,C=_.children,O=(c.stateNode._pendingVisibility&2)!==0,G=l!==null?l.memoizedState:null;if(ru(l,c),_.mode==="hidden"||O){if((c.flags&128)!==0){if(_=G!==null?G.baseLanes|g:g,l!==null){for(C=c.child=l.child,O=0;C!==null;)O=O|C.lanes|C.childLanes,C=C.sibling;c.childLanes=O&~_}else c.childLanes=0,c.child=null;return mm(l,c,_,g)}if((g&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&If(c,G!==null?G.cachePool:null),G!==null?Kc(c,G):Qo(),no(c);else return c.lanes=c.childLanes=536870912,mm(l,c,G!==null?G.baseLanes|g:g,g)}else G!==null?(If(c,G.cachePool),Kc(c,G),ms(),c.memoizedState=null):(l!==null&&If(c,null),Qo(),ms());return ki(l,c,C,g),c.child}function mm(l,c,g,_){var C=co();return C=C===null?null:{parent:or?Nn._currentValue:Nn._currentValue2,pool:C},c.memoizedState={baseLanes:g,cachePool:C},l!==null&&If(c,null),Qo(),no(c),l!==null&&al(l,c,_,!0),null}function ru(l,c){var g=c.ref;if(g===null)l!==null&&l.ref!==null&&(c.flags|=2097664);else{if(typeof g!="function"&&typeof g!="object")throw Error(s(284));(l===null||l.ref!==g)&&(c.flags|=2097664)}}function Lh(l,c,g,_,C){return sl(c),g=Ns(l,c,g,_,void 0,C),_=Xl(),l!==null&&!mi?(_r(l,c,C),Ar(l,c,C)):(Sn&&_&&oe(c),c.flags|=1,ki(l,c,g,C),c.child)}function gm(l,c,g,_,C,O){return sl(c),c.updateQueue=null,g=Tf(c,_,g,C),$o(l),_=Xl(),l!==null&&!mi?(_r(l,c,O),Ar(l,c,O)):(Sn&&_&&oe(c),c.flags|=1,ki(l,c,g,O),c.child)}function zh(l,c,g,_,C){if(sl(c),c.stateNode===null){var O=xl,G=g.contextType;typeof G=="object"&&G!==null&&(O=Vi(G)),O=new g(_,O),c.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=_d,c.stateNode=O,O._reactInternals=c,O=c.stateNode,O.props=_,O.state=c.memoizedState,O.refs={},wt(c),G=g.contextType,O.context=typeof G=="object"&&G!==null?Vi(G):xl,O.state=c.memoizedState,G=g.getDerivedStateFromProps,typeof G=="function"&&(ea(c,g,G,_),O.state=c.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(G=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),G!==O.state&&_d.enqueueReplaceState(O,O.state,null),Ze(c,_,O,C),Ae(),O.state=c.memoizedState),typeof O.componentDidMount=="function"&&(c.flags|=4194308),_=!0}else if(l===null){O=c.stateNode;var ne=c.memoizedProps,ge=Us(g,ne);O.props=ge;var Be=O.context,rt=g.contextType;G=xl,typeof rt=="object"&&rt!==null&&(G=Vi(rt));var pt=g.getDerivedStateFromProps;rt=typeof pt=="function"||typeof O.getSnapshotBeforeUpdate=="function",ne=c.pendingProps!==ne,rt||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(ne||Be!==G)&&iu(c,O,_,G),Br=!1;var xt=c.memoizedState;O.state=xt,Ze(c,_,O,C),Ae(),Be=c.memoizedState,ne||xt!==Be||Br?(typeof pt=="function"&&(ea(c,g,pt,_),Be=c.memoizedState),(ge=Br||ro(c,g,ge,_,xt,Be,G))?(rt||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=_,c.memoizedState=Be),O.props=_,O.state=Be,O.context=G,_=ge):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),_=!1)}else{O=c.stateNode,_t(l,c),G=c.memoizedProps,rt=Us(g,G),O.props=rt,pt=c.pendingProps,xt=O.context,Be=g.contextType,ge=xl,typeof Be=="object"&&Be!==null&&(ge=Vi(Be)),ne=g.getDerivedStateFromProps,(Be=typeof ne=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(G!==pt||xt!==ge)&&iu(c,O,_,ge),Br=!1,xt=c.memoizedState,O.state=xt,Ze(c,_,O,C),Ae();var qt=c.memoizedState;G!==pt||xt!==qt||Br||l!==null&&l.dependencies!==null&&lo(l.dependencies)?(typeof ne=="function"&&(ea(c,g,ne,_),qt=c.memoizedState),(rt=Br||ro(c,g,rt,_,xt,qt,ge)||l!==null&&l.dependencies!==null&&lo(l.dependencies))?(Be||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(_,qt,ge),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(_,qt,ge)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||G===l.memoizedProps&&xt===l.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||G===l.memoizedProps&&xt===l.memoizedState||(c.flags|=1024),c.memoizedProps=_,c.memoizedState=qt),O.props=_,O.state=qt,O.context=ge,_=rt):(typeof O.componentDidUpdate!="function"||G===l.memoizedProps&&xt===l.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||G===l.memoizedProps&&xt===l.memoizedState||(c.flags|=1024),_=!1)}return O=_,ru(l,c),_=(c.flags&128)!==0,O||_?(O=c.stateNode,g=_&&typeof g.getDerivedStateFromError!="function"?null:O.render(),c.flags|=1,l!==null&&_?(c.child=No(c,l.child,null,C),c.child=No(c,null,g,C)):ki(l,c,g,C),c.memoizedState=O.state,l=c.child):l=Ar(l,c,C),l}function ym(l,c,g,_){return Rt(),c.flags|=256,ki(l,c,g,_),c.child}function Ph(l){return{baseLanes:l,cachePool:Sm()}}function Bh(l,c,g){return l=l!==null?l.childLanes&~g:0,c&&(l|=za),l}function xm(l,c,g){var _=c.pendingProps,C=!1,O=(c.flags&128)!==0,G;if((G=O)||(G=l!==null&&l.memoizedState===null?!1:(Si.current&2)!==0),G&&(C=!0,c.flags&=-129),G=(c.flags&32)!==0,c.flags&=-33,l===null){if(Sn){if(C?zi(c):ms(),Sn){var ne=Wi,ge;(ge=ne)&&(ne=Ym(ne,bs),ne!==null?(c.memoizedState={dehydrated:ne,treeContext:Is!==null?{id:ur,overflow:vs}:null,retryLane:536870912},ge=t(18,null,null,0),ge.stateNode=ne,ge.return=c,c.child=ge,sa=c,Wi=null,ge=!0):ge=!1),ge||Ge(c)}if(ne=c.memoizedState,ne!==null&&(ne=ne.dehydrated,ne!==null))return wu(ne)?c.lanes=16:c.lanes=536870912,null;Ga(c)}return ne=_.children,_=_.fallback,C?(ms(),C=c.mode,ne=Ih({mode:"hidden",children:ne},C),_=Nr(_,C,g,null),ne.return=c,_.return=c,ne.sibling=_,c.child=ne,C=c.child,C.memoizedState=Ph(g),C.childLanes=Bh(l,G,g),c.memoizedState=oa,_):(zi(c),ou(c,ne))}if(ge=l.memoizedState,ge!==null&&(ne=ge.dehydrated,ne!==null)){if(O)c.flags&256?(zi(c),c.flags&=-257,c=Fh(l,c,g)):c.memoizedState!==null?(ms(),c.child=l.child,c.flags|=128,c=null):(ms(),C=_.fallback,ne=c.mode,_=Ih({mode:"visible",children:_.children},ne),C=Nr(C,ne,g,null),C.flags|=2,_.return=c,C.return=c,_.sibling=C,c.child=_,No(c,l.child,null,g),_=c.child,_.memoizedState=Ph(g),_.childLanes=Bh(l,G,g),c.memoizedState=oa,c=C);else if(zi(c),wu(ne))G=jm(ne).digest,_=Error(s(419)),_.stack="",_.digest=G,yt({value:_,source:null,stack:null}),c=Fh(l,c,g);else if(mi||al(l,c,g,!1),G=(g&l.childLanes)!==0,mi||G){if(G=cn,G!==null){if(_=g&-g,(_&42)!==0)_=1;else switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=64;break;case 268435456:_=134217728;break;default:_=0}if(_=(_&(G.suspendedLanes|g))!==0?0:_,_!==0&&_!==ge.retryLane)throw ge.retryLane=_,Xe(l,_),na(G,l,_),lg}cd(ne)||Ca(),c=Fh(l,c,g)}else cd(ne)?(c.flags|=128,c.child=l.child,c=fl.bind(null,l),bv(ne,c),c=null):(l=ge.treeContext,ha&&(Wi=Gm(ne),sa=c,Sn=!0,es=null,bs=!1,l!==null&&(Ja[$a++]=ur,Ja[$a++]=vs,Ja[$a++]=Is,ur=l.id,vs=l.overflow,Is=c)),c=ou(c,_.children),c.flags|=4096);return c}return C?(ms(),C=_.fallback,ne=c.mode,ge=l.child,O=ge.sibling,_=ia(ge,{mode:"hidden",children:_.children}),_.subtreeFlags=ge.subtreeFlags&31457280,O!==null?C=ia(O,C):(C=Nr(C,ne,g,null),C.flags|=2),C.return=c,_.return=c,_.sibling=C,c.child=_,_=C,C=c.child,ne=l.child.memoizedState,ne===null?ne=Ph(g):(ge=ne.cachePool,ge!==null?(O=or?Nn._currentValue:Nn._currentValue2,ge=ge.parent!==O?{parent:O,pool:O}:ge):ge=Sm(),ne={baseLanes:ne.baseLanes|g,cachePool:ge}),C.memoizedState=ne,C.childLanes=Bh(l,G,g),c.memoizedState=oa,_):(zi(c),g=l.child,l=g.sibling,g=ia(g,{mode:"visible",children:_.children}),g.return=c,g.sibling=null,l!==null&&(G=c.deletions,G===null?(c.deletions=[l],c.flags|=16):G.push(l)),c.child=g,c.memoizedState=null,g)}function ou(l,c){return c=Ih({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function Ih(l,c){return Jf(l,c,0,null)}function Fh(l,c,g){return No(c,l.child,null,g),l=ou(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function vm(l,c,g){l.lanes|=c;var _=l.alternate;_!==null&&(_.lanes|=c),Hh(l.return,c,g)}function Pf(l,c,g,_,C){var O=l.memoizedState;O===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:_,tail:g,tailMode:C}:(O.isBackwards=c,O.rendering=null,O.renderingStartTime=0,O.last=_,O.tail=g,O.tailMode=C)}function bm(l,c,g){var _=c.pendingProps,C=_.revealOrder,O=_.tail;if(ki(l,c,_.children,g),_=Si.current,(_&2)!==0)_=_&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&vm(l,g,c);else if(l.tag===19)vm(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}switch(D(Si,_),C){case"forwards":for(g=c.child,C=null;g!==null;)l=g.alternate,l!==null&&$i(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=c.child,c.child=null):(C=g.sibling,g.sibling=null),Pf(c,!1,C,g,O);break;case"backwards":for(g=null,C=c.child,c.child=null;C!==null;){if(l=C.alternate,l!==null&&$i(l)===null){c.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}Pf(c,!0,g,null,O);break;case"together":Pf(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Ar(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),ss|=c.lanes,(g&c.childLanes)===0)if(l!==null){if(al(l,c,g,!1),(g&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(s(153));if(c.child!==null){for(l=c.child,g=ia(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=ia(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function jh(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&lo(l)))}function yv(l,c,g){switch(c.tag){case 3:Ne(c,c.stateNode.containerInfo),oo(c,Nn,l.memoizedState.cache),Rt();break;case 27:case 5:le(c);break;case 4:Ne(c,c.stateNode.containerInfo);break;case 10:oo(c,c.type,c.memoizedProps.value);break;case 13:var _=c.memoizedState;if(_!==null)return _.dehydrated!==null?(zi(c),c.flags|=128,null):(g&c.child.childLanes)!==0?xm(l,c,g):(zi(c),l=Ar(l,c,g),l!==null?l.sibling:null);zi(c);break;case 19:var C=(l.flags&128)!==0;if(_=(g&c.childLanes)!==0,_||(al(l,c,g,!1),_=(g&c.childLanes)!==0),C){if(_)return bm(l,c,g);c.flags|=128}if(C=c.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),D(Si,Si.current),_)break;return null;case 22:case 23:return c.lanes=0,pm(l,c,g);case 24:oo(c,Nn,l.memoizedState.cache)}return Ar(l,c,g)}function _m(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps)mi=!0;else{if(!jh(l,g)&&(c.flags&128)===0)return mi=!1,yv(l,c,g);mi=(l.flags&131072)!==0}else mi=!1,Sn&&(c.flags&1048576)!==0&&Y(c,Ou,c.index);switch(c.lanes=0,c.tag){case 16:e:{l=c.pendingProps;var _=c.elementType,C=_._init;if(_=C(_._payload),c.type=_,typeof _=="function")Rr(_)?(l=Us(_,l),c.tag=1,c=zh(null,c,_,l,g)):(c.tag=0,c=Lh(null,c,_,l,g));else{if(_!=null){if(C=_.$$typeof,C===lc){c.tag=11,c=dm(null,c,_,l,g);break e}else if(C===xu){c.tag=14,c=hm(null,c,_,l,g);break e}}throw c=f(_)||_,Error(s(306,c,""))}}return c;case 0:return Lh(l,c,c.type,c.pendingProps,g);case 1:return _=c.type,C=Us(_,c.pendingProps),zh(l,c,_,C,g);case 3:e:{if(Ne(c,c.stateNode.containerInfo),l===null)throw Error(s(387));var O=c.pendingProps;C=c.memoizedState,_=C.element,_t(l,c),Ze(c,O,null,g);var G=c.memoizedState;if(O=G.cache,oo(c,Nn,O),O!==C.cache&&kh(c,[Nn],g,!0),Ae(),O=G.element,ha&&C.isDehydrated)if(C={element:O,isDehydrated:!1,cache:G.cache},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){c=ym(l,c,O,g);break e}else if(O!==_){_=he(Error(s(424)),c),yt(_),c=ym(l,c,O,g);break e}else for(ha&&(Wi=Vm(c.stateNode.containerInfo),sa=c,Sn=!0,es=null,bs=!0),g=kp(c,null,O,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Rt(),O===_){c=Ar(l,c,g);break e}ki(l,c,O,g)}c=c.child}return c;case 26:if(Ka)return ru(l,c),l===null?(g=pd(c.type,null,c.pendingProps,null))?c.memoizedState=g:Sn||(c.stateNode=Sv(c.type,c.pendingProps,Fs.current,c)):c.memoizedState=pd(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:if(qi)return le(c),l===null&&qi&&Sn&&(_=c.stateNode=Ip(c.type,c.pendingProps,Fs.current,ji.current,!1),sa=c,bs=!0,Wi=ud(_)),_=c.pendingProps.children,l!==null||Sn?ki(l,c,_,g):c.child=No(c,null,_,g),ru(l,c),c.child;case 5:return l===null&&Sn&&(Jm(c.type,c.pendingProps,ji.current),(C=_=Wi)&&(_=Xm(_,c.type,c.pendingProps,bs),_!==null?(c.stateNode=_,sa=c,Wi=ud(_),bs=!1,C=!0):C=!1),C||Ge(c)),le(c),C=c.type,O=c.pendingProps,G=l!==null?l.memoizedProps:null,_=O.children,wo(C,O)?_=null:G!==null&&wo(C,G)&&(c.flags|=32),c.memoizedState!==null&&(C=Ns(l,c,Rh,null,null,g),or?kt._currentValue=C:kt._currentValue2=C),ru(l,c),ki(l,c,_,g),c.child;case 6:return l===null&&Sn&&($m(c.pendingProps,ji.current),(l=g=Wi)&&(g=qm(g,c.pendingProps,bs),g!==null?(c.stateNode=g,sa=c,Wi=null,l=!0):l=!1),l||Ge(c)),null;case 13:return xm(l,c,g);case 4:return Ne(c,c.stateNode.containerInfo),_=c.pendingProps,l===null?c.child=No(c,null,_,g):ki(l,c,_,g),c.child;case 11:return dm(l,c,c.type,c.pendingProps,g);case 7:return ki(l,c,c.pendingProps,g),c.child;case 8:return ki(l,c,c.pendingProps.children,g),c.child;case 12:return ki(l,c,c.pendingProps.children,g),c.child;case 10:return _=c.pendingProps,oo(c,c.type,_.value),ki(l,c,_.children,g),c.child;case 9:return C=c.type._context,_=c.pendingProps.children,sl(c),C=Vi(C),_=_(C),c.flags|=1,ki(l,c,_,g),c.child;case 14:return hm(l,c,c.type,c.pendingProps,g);case 15:return zf(l,c,c.type,c.pendingProps,g);case 19:return bm(l,c,g);case 22:return pm(l,c,g);case 24:return sl(c),_=Vi(Nn),l===null?(C=co(),C===null&&(C=cn,O=Bf(),C.pooledCache=O,O.refCount++,O!==null&&(C.pooledCacheLanes|=g),C=O),c.memoizedState={parent:_,cache:C},wt(c),oo(c,Nn,C)):((l.lanes&g)!==0&&(_t(l,c),Ze(c,null,null,g),Ae()),C=l.memoizedState,O=c.memoizedState,C.parent!==_?(C={parent:_,cache:_},c.memoizedState=C,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=C),oo(c,Nn,_)):(_=O.cache,oo(c,Nn,_),_!==C.cache&&kh(c,[Nn],g,!0))),ki(l,c,c.pendingProps.children,g),c.child;case 29:throw c.pendingProps}throw Error(s(156,c.tag))}function oo(l,c,g){or?(D(Ua,c._currentValue),c._currentValue=g):(D(Ua,c._currentValue2),c._currentValue2=g)}function Mr(l){var c=Ua.current;or?l._currentValue=c:l._currentValue2=c,A(Ua)}function Hh(l,c,g){for(;l!==null;){var _=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,_!==null&&(_.childLanes|=c)):_!==null&&(_.childLanes&c)!==c&&(_.childLanes|=c),l===g)break;l=l.return}}function kh(l,c,g,_){var C=l.child;for(C!==null&&(C.return=l);C!==null;){var O=C.dependencies;if(O!==null){var G=C.child;O=O.firstContext;e:for(;O!==null;){var ne=O;O=C;for(var ge=0;geti&&(c.flags|=128,_=!0,rl(C,!1),c.lanes=4194304)}else{if(!_)if(l=$i(O),l!==null){if(c.flags|=128,_=!0,l=l.updateQueue,c.updateQueue=l,cu(c,l),rl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!O.alternate&&!Sn)return Zn(c),null}else 2*Yi()-C.renderingStartTime>ti&&g!==536870912&&(c.flags|=128,_=!0,rl(C,!1),c.lanes=4194304);C.isBackwards?(O.sibling=c.child,c.child=O):(l=C.last,l!==null?l.sibling=O:c.child=O,C.last=O)}return C.tail!==null?(c=C.tail,C.rendering=c,C.tail=c.sibling,C.renderingStartTime=Yi(),c.sibling=null,l=Si.current,D(Si,_?l&1|2:l&1),c):(Zn(c),null);case 22:case 23:return Ga(c),Jo(),_=c.memoizedState!==null,l!==null?l.memoizedState!==null!==_&&(c.flags|=8192):_&&(c.flags|=8192),_?(g&536870912)!==0&&(c.flags&128)===0&&(Zn(c),c.subtreeFlags&6&&(c.flags|=8192)):Zn(c),g=c.updateQueue,g!==null&&cu(c,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),_=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(_=c.memoizedState.cachePool.pool),_!==g&&(c.flags|=2048),l!==null&&A(jr),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Mr(Nn),Zn(c),null;case 25:return null}throw Error(s(156,c.tag))}function Mm(l,c){switch(Te(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Mr(Nn),Qe(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return xe(c),null;case 13:if(Ga(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(s(340));Rt()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return A(Si),null;case 4:return Qe(),null;case 10:return Mr(c.type),null;case 22:case 23:return Ga(c),Jo(),l!==null&&A(jr),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return Mr(Nn),null;case 25:return null;default:return null}}function Yh(l,c){switch(Te(c),c.tag){case 3:Mr(Nn),Qe();break;case 26:case 27:case 5:xe(c);break;case 4:Qe();break;case 13:Ga(c);break;case 19:A(Si);break;case 10:Mr(c.type);break;case 22:case 23:Ga(c),Jo(),l!==null&&A(jr);break;case 24:Mr(Nn)}}function uu(l,c){try{var g=c.updateQueue,_=g!==null?g.lastEffect:null;if(_!==null){var C=_.next;g=C;do{if((g.tag&l)===l){_=void 0;var O=g.create,G=g.inst;_=O(),G.destroy=_}g=g.next}while(g!==C)}}catch(ne){hn(c,c.return,ne)}}function uo(l,c,g){try{var _=c.updateQueue,C=_!==null?_.lastEffect:null;if(C!==null){var O=C.next;_=O;do{if((_.tag&l)===l){var G=_.inst,ne=G.destroy;if(ne!==void 0){G.destroy=void 0,C=c;var ge=g;try{ne()}catch(Be){hn(C,ge,Be)}}}_=_.next}while(_!==O)}}catch(Be){hn(c,c.return,Be)}}function Em(l){var c=l.updateQueue;if(c!==null){var g=l.stateNode;try{Ke(c,g)}catch(_){hn(l,l.return,_)}}}function wm(l,c,g){g.props=Us(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(_){hn(l,c,_)}}function ol(l,c){try{var g=l.ref;if(g!==null){var _=l.stateNode;switch(l.tag){case 26:case 27:case 5:var C=cc(_);break;default:C=_}typeof g=="function"?l.refCleanup=g(C):g.current=C}}catch(O){hn(l,c,O)}}function Kn(l,c){var g=l.ref,_=l.refCleanup;if(g!==null)if(typeof _=="function")try{_()}catch(C){hn(l,c,C)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){hn(l,c,C)}else g.current=null}function Ql(l){var c=l.type,g=l.memoizedProps,_=l.stateNode;try{vv(_,c,g,l)}catch(C){hn(l,l.return,C)}}function Wh(l,c,g){try{xp(l.stateNode,l.type,g,c,l)}catch(_){hn(l,l.return,_)}}function Zh(l){return l.tag===5||l.tag===3||(Ka?l.tag===26:!1)||(qi?l.tag===27:!1)||l.tag===4}function jf(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Zh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&(!qi||l.tag!==27)&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Hf(l,c,g){var _=l.tag;if(_===5||_===6)l=l.stateNode,c?bp(g,l,c):Bm(g,l);else if(!(_===4||qi&&_===27)&&(l=l.child,l!==null))for(Hf(l,c,g),l=l.sibling;l!==null;)Hf(l,c,g),l=l.sibling}function Jl(l,c,g){var _=l.tag;if(_===5||_===6)l=l.stateNode,c?vp(g,l,c):yp(g,l);else if(!(_===4||qi&&_===27)&&(l=l.child,l!==null))for(Jl(l,c,g),l=l.sibling;l!==null;)Jl(l,c,g),l=l.sibling}function Tm(l,c,g){l=l.containerInfo;try{Mp(l,g)}catch(_){hn(c,c.return,_)}}function $l(l,c){for(Eo(l.containerInfo),li=c;li!==null;)if(l=li,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,li=c;else for(;li!==null;){l=li;var g=l.alternate;switch(c=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((c&1024)!==0&&g!==null){c=void 0;var _=l,C=g.memoizedProps;g=g.memoizedState;var O=_.stateNode;try{var G=Us(_.type,C,_.elementType===_.type);c=O.getSnapshotBeforeUpdate(G,g),O.__reactInternalSnapshotBeforeUpdate=c}catch(ne){hn(_,_.return,ne)}}break;case 3:(c&1024)!==0&&Xi&&od(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(s(163))}if(c=l.sibling,c!==null){c.return=l.return,li=c;break}li=l.return}return G=Sl,Sl=!1,G}function kf(l,c,g){var _=g.flags;switch(g.tag){case 0:case 11:case 15:er(l,g),_&4&&uu(5,g);break;case 1:if(er(l,g),_&4)if(l=g.stateNode,c===null)try{l.componentDidMount()}catch(ne){hn(g,g.return,ne)}else{var C=Us(g.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(C,c,l.__reactInternalSnapshotBeforeUpdate)}catch(ne){hn(g,g.return,ne)}}_&64&&Em(g),_&512&&ol(g,g.return);break;case 3:if(er(l,g),_&64&&(_=g.updateQueue,_!==null)){if(l=null,g.child!==null)switch(g.child.tag){case 27:case 5:l=cc(g.child.stateNode);break;case 1:l=g.child.stateNode}try{Ke(_,l)}catch(ne){hn(g,g.return,ne)}}break;case 26:if(Ka){er(l,g),_&512&&ol(g,g.return);break}case 27:case 5:er(l,g),c===null&&_&4&&Ql(g),_&512&&ol(g,g.return);break;case 12:er(l,g);break;case 13:er(l,g),_&4&&fo(l,g);break;case 22:if(C=g.memoizedState!==null||Di,!C){c=c!==null&&c.memoizedState!==null||ei;var O=Di,G=ei;Di=C,(ei=c)&&!G?po(l,g,(g.subtreeFlags&8772)!==0):er(l,g),Di=O,ei=G}_&512&&(g.memoizedProps.mode==="manual"?ol(g,g.return):Kn(g,g.return));break;default:er(l,g)}}function ec(l){var c=l.alternate;c!==null&&(l.alternate=null,ec(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&mp(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function qa(l,c,g){for(g=g.child;g!==null;)Vf(l,c,g),g=g.sibling}function Vf(l,c,g){if(Na&&typeof Na.onCommitFiberUnmount=="function")try{Na.onCommitFiberUnmount(pc,g)}catch{}switch(g.tag){case 26:if(Ka){ei||Kn(g,c),qa(l,c,g),g.memoizedState?Np(g.memoizedState):g.stateNode&&Lp(g.stateNode);break}case 27:if(qi){ei||Kn(g,c);var _=gi,C=La;gi=g.stateNode,qa(l,c,g),tg(g.stateNode),gi=_,La=C;break}case 5:ei||Kn(g,c);case 6:if(Xi){if(_=gi,C=La,gi=null,qa(l,c,g),gi=_,La=C,gi!==null)if(La)try{hi(gi,g.stateNode)}catch(O){hn(g,c,O)}else try{pa(gi,g.stateNode)}catch(O){hn(g,c,O)}}else qa(l,c,g);break;case 18:Xi&&gi!==null&&(La?Cp(gi,g.stateNode):Km(gi,g.stateNode));break;case 4:Xi?(_=gi,C=La,gi=g.stateNode.containerInfo,La=!0,qa(l,c,g),gi=_,La=C):(Wa&&Tm(g.stateNode,g,ld()),qa(l,c,g));break;case 0:case 11:case 14:case 15:ei||uo(2,g,c),ei||uo(4,g,c),qa(l,c,g);break;case 1:ei||(Kn(g,c),_=g.stateNode,typeof _.componentWillUnmount=="function"&&wm(g,c,_)),qa(l,c,g);break;case 21:qa(l,c,g);break;case 22:ei||Kn(g,c),ei=(_=ei)||g.memoizedState!==null,qa(l,c,g),ei=_;break;default:qa(l,c,g)}}function fo(l,c){if(ha&&c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{dd(l)}catch(g){hn(c,c.return,g)}}function tc(l){switch(l.tag){case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new bc),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new bc),c;default:throw Error(s(435,l.tag))}}function fu(l,c){var g=tc(l);c.forEach(function(_){var C=ep.bind(null,l,_);g.has(_)||(g.add(_),_.then(C,C))})}function ua(l,c){var g=c.deletions;if(g!==null)for(var _=0;_";case Md:return":has("+(xo(l)||"")+")";case Ed:return'[role="'+l.value+'"]';case On:return'"'+l.value+'"';case vn:return'[data-testname="'+l.value+'"]';default:throw Error(s(365))}}function Cm(l,c){var g=[];l=[l,0];for(var _=0;_g?32:g;g=It.T;var C=Ri();try{if(aa(_),It.T=null,Vr===null)var O=!1;else{_=El,El=null;var G=Vr,ne=Ml;if(Vr=null,Ml=0,(Ut&6)!==0)throw Error(s(331));var ge=Ut;if(Ut|=4,du(G.current),Xf(G,G.current,ne,_),Ut=ge,nt(0,!1),Na&&typeof Na.onPostCommitFiberRoot=="function")try{Na.onPostCommitFiberRoot(pc,G)}catch{}O=!0}return O}finally{aa(C),It.T=g,Cr(l,c)}}return!1}function Kf(l,c,g){c=he(g,c),c=au(l.stateNode,c,2),l=Ye(l,c,2),l!==null&&(W(l,2),ot(l))}function hn(l,c,g){if(l.tag===3)Kf(l,l,g);else for(;c!==null;){if(c.tag===3){Kf(c,l,g);break}else if(c.tag===1){var _=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(os===null||!os.has(_))){l=he(g,l),g=ql(2),_=Ye(c,g,2),_!==null&&(su(g,_,c,l),W(_,2),ot(_));break}}c=c.return}}function Qf(l,c,g){var _=l.pingCache;if(_===null){_=l.pingCache=new pn;var C=new Set;_.set(c,C)}else C=_.get(c),C===void 0&&(C=new Set,_.set(c,C));C.has(g)||(Hr=!0,C.add(g),l=Dm.bind(null,l,c,g),c.then(l,l))}function Dm(l,c,g){var _=l.pingCache;_!==null&&_.delete(c),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,cn===l&&(sn&g)===g&&(bn===4||bn===3&&(sn&62914560)===sn&&300>Yi()-pr?(Ut&2)===0&&zs(l,0):la|=g,kr===sn&&(kr=0)),ot(l)}function ul(l,c){c===0&&(c=B()),l=Xe(l,c),l!==null&&(W(l,c),ot(l))}function fl(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),ul(l,g)}function ep(l,c){var g=0;switch(l.tag){case 13:var _=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:_=l.stateNode;break;case 22:_=l.stateNode._retryCache;break;default:throw Error(s(314))}_!==null&&_.delete(c),ul(l,g)}function gu(l,c){return hc(l,c)}function tp(l,c,g,_){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rr(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ia(l,c){var g=l.alternate;return g===null?(g=t(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&31457280,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Dr(l,c){l.flags&=31457282;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,c=g.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function ys(l,c,g,_,C,O){var G=0;if(_=l,typeof l=="function")Rr(l)&&(G=1);else if(typeof l=="string")G=Ka&&qi?Rp(l,g,ji.current)?26:fc(l)?27:5:Ka?Rp(l,g,ji.current)?26:5:qi&&fc(l)?27:5;else e:switch(l){case oc:return Nr(g.children,C,O,c);case rp:G=8,C|=24;break;case op:return l=t(12,g,c,C|2),l.elementType=op,l.lanes=O,l;case $f:return l=t(13,g,c,C),l.elementType=$f,l.lanes=O,l;case So:return l=t(19,g,c,C),l.elementType=So,l.lanes=O,l;case vu:return Jf(g,C,O,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Um:case sr:G=10;break e;case _o:G=9;break e;case lc:G=11;break e;case xu:G=14;break e;case Bs:G=16,_=null;break e}G=29,g=Error(s(130,l===null?"null":typeof l,"")),_=null}return c=t(G,g,c,C),c.elementType=l,c.type=_,c.lanes=O,c}function Nr(l,c,g,_){return l=t(7,l,_,c),l.lanes=g,l}function Jf(l,c,g,_){l=t(22,l,_,c),l.elementType=vu,l.lanes=g;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var O=C._current;if(O===null)throw Error(s(456));if((C._pendingVisibility&2)===0){var G=Xe(O,2);G!==null&&(C._pendingVisibility|=2,na(G,O,2))}},attach:function(){var O=C._current;if(O===null)throw Error(s(456));if((C._pendingVisibility&2)!==0){var G=Xe(O,2);G!==null&&(C._pendingVisibility&=-3,na(G,O,2))}}};return l.stateNode=C,l}function bo(l,c,g){return l=t(6,l,null,c),l.lanes=g,l}function rc(l,c,g){return c=t(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function dl(l,c,g,_,C,O,G,ne){this.tag=1,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=gl,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=P(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P(0),this.hiddenUpdates=P(null),this.identifierPrefix=_,this.onUncaughtError=C,this.onCaughtError=O,this.onRecoverableError=G,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function Fi(l,c,g,_,C,O,G,ne,ge,Be,rt,pt){return l=new dl(l,c,g,G,ne,ge,Be,pt),c=1,O===!0&&(c|=24),O=t(3,null,null,c),l.current=O,O.stateNode=l,c=Bf(),c.refCount++,l.pooledCache=c,c.refCount++,O.memoizedState={element:_,isDehydrated:g,cache:c},wt(O),l}function yu(l){return l?(l=xl,l):xl}function np(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(s(188)):(l=Object.keys(l).join(","),Error(s(268,l)));return l=S(c),l=l!==null?M(l):null,l===null?null:cc(l.stateNode)}function Nm(l,c,g,_,C,O){C=yu(C),_.context===null?_.context=C:_.pendingContext=C,_=je(c),_.payload={element:g},O=O===void 0?null:O,O!==null&&(_.callback=O),g=Ye(l,_,c),g!==null&&(na(g,l,c),St(g,l,c))}function Om(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g=Be&&O>=pt&&C<=rt&&G<=xt){l.splice(c,1);break}else if(_!==Be||g.width!==ge.width||xtG){if(!(O!==pt||g.height!==ge.height||rt<_||Be>C)){Be>_&&(ge.width+=Be-_,ge.x=_),rtO&&(ge.height+=pt-O,ge.y=O),xtg&&(g=ne)),ne ")+` + +No matching component was found for: + `)+l.join(" > ")}return null},Ot.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return cc(l.child.stateNode);default:return l.child.stateNode}},Ot.injectIntoDevTools=function(){var l={bundleType:0,version:td,rendererPackageName:bu,currentDispatcherRef:It,findFiberByHostInstance:hp,reconcilerVersion:"19.0.0"};if(_u!==null&&(l.rendererConfig=_u),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{pc=c.inject(l),Na=c}catch{}l=!!c.checkDCE}}return l},Ot.isAlreadyRendering=function(){return!1},Ot.observeVisibleRects=function(l,c,g,_){if(!lr)throw Error(s(363));l=fa(l,c);var C=gp(l,g,_).disconnect;return{disconnect:function(){C()}}},Ot.shouldError=function(){return null},Ot.shouldSuspend=function(){return!1},Ot.startHostTransition=function(l,c,g,_){if(l.tag!==5)throw Error(s(476));var C=Oh(l).queue;Rf(l,C,c,Ra,g===null?n:function(){var O=Oh(l).next.queue;return so(l,O,{},da()),g(_)})},Ot.updateContainer=function(l,c,g,_){var C=c.current,O=da();return Nm(C,O,l,c,g,_),O},Ot.updateContainerSync=function(l,c,g,_){return c.tag===0&&Ii(),Nm(c.current,2,l,c,g,_),2},Ot},a.exports.default=a.exports,Object.defineProperty(a.exports,"__esModule",{value:!0})})($2)),$2.exports}var RS;function f8(){return RS||(RS=1,J2.exports=u8()),J2.exports}var d8=f8();const h8=jb(d8);var DS=bE();function R1(a,e,t){if(!a)return;if(t(a)===!0)return a;let n=e?a.return:a.child;for(;n;){const s=R1(n,e,t);if(s)return s;n=e?null:n.sibling}}function _E(a){try{return Object.defineProperties(a,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return a}}const D1=_E(Q.createContext(null));class SE extends Q.Component{render(){return Q.createElement(D1.Provider,{value:this._reactInternals},this.props.children)}}function AE(){const a=Q.useContext(D1);if(a===null)throw new Error("its-fine: useFiber must be called within a !");const e=Q.useId();return Q.useMemo(()=>{for(const t of[a,a?.alternate]){if(!t)continue;const n=R1(t,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(n)return n}},[a,e])}const p8=Symbol.for("react.context"),m8=a=>a!==null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===p8;function g8(){const a=AE(),[e]=Q.useState(()=>new Map);e.clear();let t=a;for(;t;){const n=t.type;m8(n)&&n!==D1&&!e.has(n)&&e.set(n,Q.use(_E(n))),t=t.return}return e}function y8(){const a=g8();return Q.useMemo(()=>Array.from(a.keys()).reduce((e,t)=>n=>Q.createElement(e,null,Q.createElement(t.Provider,{...n,value:a.get(t)})),e=>Q.createElement(SE,{...e})),[a])}function ME(a){let e=a.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const EE=a=>a&&a.isOrthographicCamera,x8=a=>a&&a.hasOwnProperty("current"),v8=a=>a!=null&&(typeof a=="string"||typeof a=="number"||a.isColor),sm=((a,e)=>typeof window<"u"&&(((a=window.document)==null?void 0:a.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Q.useLayoutEffect:Q.useEffect;function wE(a){const e=Q.useRef(a);return sm(()=>void(e.current=a),[a]),e}function b8(){const a=AE(),e=y8();return Q.useMemo(()=>({children:t})=>{const s=!!R1(a,!0,o=>o.type===Q.StrictMode)?Q.StrictMode:Q.Fragment;return R.jsx(s,{children:R.jsx(e,{children:t})})},[a,e])}function _8({set:a}){return sm(()=>(a(new Promise(()=>null)),()=>a(!1)),[a]),null}const S8=(a=>(a=class extends Q.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},a.getDerivedStateFromError=()=>({error:!0}),a))();function TE(a){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(a)?Math.min(Math.max(a[0],t),a[1]):a}function eh(a){var e;return(e=a.__r3f)==null?void 0:e.root.getState()}const ci={obj:a=>a===Object(a)&&!ci.arr(a)&&typeof a!="function",fun:a=>typeof a=="function",str:a=>typeof a=="string",num:a=>typeof a=="number",boo:a=>typeof a=="boolean",und:a=>a===void 0,nul:a=>a===null,arr:a=>Array.isArray(a),equ(a,e,{arrays:t="shallow",objects:n="reference",strict:s=!0}={}){if(typeof a!=typeof e||!!a!=!!e)return!1;if(ci.str(a)||ci.num(a)||ci.boo(a))return a===e;const o=ci.obj(a);if(o&&n==="reference")return a===e;const f=ci.arr(a);if(f&&t==="reference")return a===e;if((f||o)&&a===e)return!0;let d;for(d in a)if(!(d in e))return!1;if(o&&t==="shallow"&&n==="shallow"){for(d in s?e:a)if(!ci.equ(a[d],e[d],{strict:s,objects:"reference"}))return!1}else for(d in s?e:a)if(a[d]!==e[d])return!1;if(ci.und(d)){if(f&&a.length===0&&e.length===0||o&&Object.keys(a).length===0&&Object.keys(e).length===0)return!0;if(a!==e)return!1}return!0}};function A8(a){const e={nodes:{},materials:{},meshes:{}};return a&&a.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material),t.isMesh&&!e.meshes[t.name]&&(e.meshes[t.name]=t)}),e}function M8(a){a.type!=="Scene"&&(a.dispose==null||a.dispose());for(const e in a){const t=a[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const CE=["children","key","ref"];function E8(a){const e={};for(const t in a)CE.includes(t)||(e[t]=a[t]);return e}function Mx(a,e,t,n){const s=a;let o=s?.__r3f;return o||(o={root:e,type:t,parent:null,children:[],props:E8(n),object:s,eventCount:0,handlers:{},isHidden:!1},s&&(s.__r3f=o)),o}function W0(a,e){if(!e.includes("-"))return{root:a,key:e,target:a[e]};if(e in a)return{root:a,key:e,target:a[e]};let t=a;const n=e.split("-");for(const s of n){if(typeof t!="object"||t===null){if(t!==void 0){const o=n.slice(n.indexOf(s)).join("-");return{root:t,key:o,target:void 0}}return{root:a,key:e,target:void 0}}e=s,a=t,t=t[e]}return{root:a,key:e,target:t}}const NS=/-\d+$/;function Ex(a,e){if(ci.str(e.props.attach)){if(NS.test(e.props.attach)){const s=e.props.attach.replace(NS,""),{root:o,key:f}=W0(a.object,s);Array.isArray(o[f])||(o[f]=[])}const{root:t,key:n}=W0(a.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else ci.fun(e.props.attach)&&(e.previousAttach=e.props.attach(a.object,e.object))}function wx(a,e){if(ci.str(e.props.attach)){const{root:t,key:n}=W0(a.object,e.props.attach),s=e.previousAttach;s===void 0?delete t[n]:t[n]=s}else e.previousAttach==null||e.previousAttach(a.object,e.object);delete e.previousAttach}const Db=[...CE,"args","dispose","attach","object","onUpdate","dispose"],OS=new Map;function w8(a){let e=OS.get(a.constructor);try{e||(e=new a.constructor,OS.set(a.constructor,e))}catch{}return e}function T8(a,e){const t={};for(const n in e)if(!Db.includes(n)&&!ci.equ(e[n],a.props[n])){t[n]=e[n];for(const s in e)s.startsWith(`${n}-`)&&(t[s]=e[s])}for(const n in a.props){if(Db.includes(n)||e.hasOwnProperty(n))continue;const{root:s,key:o}=W0(a.object,n);if(s.constructor&&s.constructor.length===0){const f=w8(s);ci.und(f)||(t[o]=f[o])}else t[o]=0}return t}const C8=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],R8=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function jo(a,e){var t;const n=a.__r3f,s=n&&ME(n).getState(),o=n?.eventCount;for(const d in e){let p=e[d];if(Db.includes(d))continue;if(n&&R8.test(d)){typeof p=="function"?n.handlers[d]=p:delete n.handlers[d],n.eventCount=Object.keys(n.handlers).length;continue}if(p===void 0)continue;let{root:m,key:y,target:x}=W0(a,d);if(x===void 0&&(typeof m!="object"||m===null))throw Error(`R3F: Cannot set "${d}". Ensure it is an object before setting "${y}".`);if(x instanceof mh&&p instanceof mh)x.mask=p.mask;else if(x instanceof gt&&v8(p))x.set(p);else if(x!==null&&typeof x=="object"&&typeof x.set=="function"&&typeof x.copy=="function"&&p!=null&&p.constructor&&x.constructor===p.constructor)x.copy(p);else if(x!==null&&typeof x=="object"&&typeof x.set=="function"&&Array.isArray(p))typeof x.fromArray=="function"?x.fromArray(p):x.set(...p);else if(x!==null&&typeof x=="object"&&typeof x.set=="function"&&typeof p=="number")typeof x.setScalar=="function"?x.setScalar(p):x.set(p);else{var f;m[y]=p,s&&!s.linear&&C8.includes(y)&&(f=m[y])!=null&&f.isTexture&&m[y].format===Ha&&m[y].type===xr&&(m[y].colorSpace=_a)}}if(n!=null&&n.parent&&s!=null&&s.internal&&(t=n.object)!=null&&t.isObject3D&&o!==n.eventCount){const d=n.object,p=s.internal.interaction.indexOf(d);p>-1&&s.internal.interaction.splice(p,1),n.eventCount&&d.raycast!==null&&s.internal.interaction.push(d)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&wh(n),a}function wh(a){var e;if(!a.parent)return;a.props.onUpdate==null||a.props.onUpdate(a.object);const t=(e=a.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function D8(a,e){a.manual||(EE(a)?(a.left=e.width/-2,a.right=e.width/2,a.top=e.height/2,a.bottom=e.height/-2):a.aspect=e.width/e.height,a.updateProjectionMatrix())}const us=a=>a?.isObject3D;function xy(a){return(a.eventObject||a.object).uuid+"/"+a.index+a.instanceId}function RE(a,e,t,n){const s=t.get(e);s&&(t.delete(e),t.size===0&&(a.delete(n),s.target.releasePointerCapture(n)))}function N8(a,e){const{internal:t}=a.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,s)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((n,s)=>{RE(t.capturedMap,e,n,s)})}function O8(a){function e(p){const{internal:m}=a.getState(),y=p.offsetX-m.initialClick[0],x=p.offsetY-m.initialClick[1];return Math.round(Math.sqrt(y*y+x*x))}function t(p){return p.filter(m=>["Move","Over","Enter","Out","Leave"].some(y=>{var x;return(x=m.__r3f)==null?void 0:x.handlers["onPointer"+y]}))}function n(p,m){const y=a.getState(),x=new Set,v=[],S=m?m(y.internal.interaction):y.internal.interaction;for(let A=0;A{const N=eh(A.object),U=eh(D.object);return!N||!U?A.distance-D.distance:U.events.priority-N.events.priority||A.distance-D.distance}).filter(A=>{const D=xy(A);return x.has(D)?!1:(x.add(D),!0)});y.events.filter&&(T=y.events.filter(T,y));for(const A of T){let D=A.object;for(;D;){var w;(w=D.__r3f)!=null&&w.eventCount&&v.push({...A,eventObject:D}),D=D.parent}}if("pointerId"in p&&y.internal.capturedMap.has(p.pointerId))for(let A of y.internal.capturedMap.get(p.pointerId).values())x.has(xy(A.intersection))||v.push(A.intersection);return v}function s(p,m,y,x){if(p.length){const v={stopped:!1};for(const S of p){let M=eh(S.object);if(M||S.object.traverseAncestors(T=>{const w=eh(T);if(w)return M=w,!1}),M){const{raycaster:T,pointer:w,camera:A,internal:D}=M,N=new X(w.x,w.y,0).unproject(A),U=B=>{var P,W;return(P=(W=D.capturedMap.get(B))==null?void 0:W.has(S.eventObject))!=null?P:!1},I=B=>{const P={intersection:S,target:m.target};D.capturedMap.has(B)?D.capturedMap.get(B).set(S.eventObject,P):D.capturedMap.set(B,new Map([[S.eventObject,P]])),m.target.setPointerCapture(B)},z=B=>{const P=D.capturedMap.get(B);P&&RE(D.capturedMap,S.eventObject,P,B)};let j={};for(let B in m){let P=m[B];typeof P!="function"&&(j[B]=P)}let q={...S,...j,pointer:w,intersections:p,stopped:v.stopped,delta:y,unprojectedPoint:N,ray:T.ray,camera:A,stopPropagation(){const B="pointerId"in m&&D.capturedMap.get(m.pointerId);if((!B||B.has(S.eventObject))&&(q.stopped=v.stopped=!0,D.hovered.size&&Array.from(D.hovered.values()).find(P=>P.eventObject===S.eventObject))){const P=p.slice(0,p.indexOf(S));o([...P,S])}},target:{hasPointerCapture:U,setPointerCapture:I,releasePointerCapture:z},currentTarget:{hasPointerCapture:U,setPointerCapture:I,releasePointerCapture:z},nativeEvent:m};if(x(q),v.stopped===!0)break}}}return p}function o(p){const{internal:m}=a.getState();for(const y of m.hovered.values())if(!p.length||!p.find(x=>x.object===y.object&&x.index===y.index&&x.instanceId===y.instanceId)){const v=y.eventObject.__r3f;if(m.hovered.delete(xy(y)),v!=null&&v.eventCount){const S=v.handlers,M={...y,intersections:p};S.onPointerOut==null||S.onPointerOut(M),S.onPointerLeave==null||S.onPointerLeave(M)}}}function f(p,m){for(let y=0;yo([]);case"onLostPointerCapture":return m=>{const{internal:y}=a.getState();"pointerId"in m&&y.capturedMap.has(m.pointerId)&&requestAnimationFrame(()=>{y.capturedMap.has(m.pointerId)&&(y.capturedMap.delete(m.pointerId),o([]))})}}return function(y){const{onPointerMissed:x,internal:v}=a.getState();v.lastEvent.current=y;const S=p==="onPointerMove",M=p==="onClick"||p==="onContextMenu"||p==="onDoubleClick",w=n(y,S?t:void 0),A=M?e(y):0;p==="onPointerDown"&&(v.initialClick=[y.offsetX,y.offsetY],v.initialHits=w.map(N=>N.eventObject)),M&&!w.length&&A<=2&&(f(y,v.interaction),x&&x(y)),S&&o(w);function D(N){const U=N.eventObject,I=U.__r3f;if(!(I!=null&&I.eventCount))return;const z=I.handlers;if(S){if(z.onPointerOver||z.onPointerEnter||z.onPointerOut||z.onPointerLeave){const j=xy(N),q=v.hovered.get(j);q?q.stopped&&N.stopPropagation():(v.hovered.set(j,N),z.onPointerOver==null||z.onPointerOver(N),z.onPointerEnter==null||z.onPointerEnter(N))}z.onPointerMove==null||z.onPointerMove(N)}else{const j=z[p];j?(!M||v.initialHits.includes(U))&&(f(y,v.interaction.filter(q=>!v.initialHits.includes(q))),j(N)):M&&v.initialHits.includes(U)&&f(y,v.interaction.filter(q=>!v.initialHits.includes(q)))}}s(w,y,A,D)}}return{handlePointer:d}}const US=a=>!!(a!=null&&a.render),DE=Q.createContext(null),U8=(a,e)=>{const t=a8((d,p)=>{const m=new X,y=new X,x=new X;function v(A=p().camera,D=y,N=p().size){const{width:U,height:I,top:z,left:j}=N,q=U/I;D.isVector3?x.copy(D):x.set(...D);const B=A.getWorldPosition(m).distanceTo(x);if(EE(A))return{width:U/A.zoom,height:I/A.zoom,top:z,left:j,factor:1,distance:B,aspect:q};{const P=A.fov*Math.PI/180,W=2*Math.tan(P/2)*B,se=W*(U/I);return{width:se,height:W,top:z,left:j,factor:U/se,distance:B,aspect:q}}}let S;const M=A=>d(D=>({performance:{...D.performance,current:A}})),T=new ze;return{set:d,get:p,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(A=1)=>a(p(),A),advance:(A,D)=>e(A,D,p()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new E1,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=p();S&&clearTimeout(S),A.performance.current!==A.performance.min&&M(A.performance.min),S=setTimeout(()=>M(p().performance.max),A.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:v},setEvents:A=>d(D=>({...D,events:{...D.events,...A}})),setSize:(A,D,N=0,U=0)=>{const I=p().camera,z={width:A,height:D,top:N,left:U};d(j=>({size:z,viewport:{...j.viewport,...v(I,y,z)}}))},setDpr:A=>d(D=>{const N=TE(A);return{viewport:{...D.viewport,dpr:N,initialDpr:D.viewport.initialDpr||N}}}),setFrameloop:(A="always")=>{const D=p().clock;D.stop(),D.elapsedTime=0,A!=="never"&&(D.start(),D.elapsedTime=0),d(()=>({frameloop:A}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Q.createRef(),active:!1,frames:0,priority:0,subscribe:(A,D,N)=>{const U=p().internal;return U.priority=U.priority+(D>0?1:0),U.subscribers.push({ref:A,priority:D,store:N}),U.subscribers=U.subscribers.sort((I,z)=>I.priority-z.priority),()=>{const I=p().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(D>0?1:0),I.subscribers=I.subscribers.filter(z=>z.ref!==A))}}}}}),n=t.getState();let s=n.size,o=n.viewport.dpr,f=n.camera;return t.subscribe(()=>{const{camera:d,size:p,viewport:m,gl:y,set:x}=t.getState();if(p.width!==s.width||p.height!==s.height||m.dpr!==o){s=p,o=m.dpr,D8(d,p),m.dpr>0&&y.setPixelRatio(m.dpr);const v=typeof HTMLCanvasElement<"u"&&y.domElement instanceof HTMLCanvasElement;y.setSize(p.width,p.height,v)}d!==f&&(f=d,x(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(d)}})))}),t.subscribe(d=>a(d)),t};function NE(){const a=Q.useContext(DE);if(!a)throw new Error("R3F: Hooks can only be used within the Canvas component!");return a}function Ts(a=t=>t,e){return NE()(a,e)}function Th(a,e=0){const t=NE(),n=t.getState().internal.subscribe,s=wE(a);return sm(()=>n(s,e,t),[e,n,t]),null}const LS=new WeakMap,L8=a=>{var e;return typeof a=="function"&&(a==null||(e=a.prototype)==null?void 0:e.constructor)===a};function OE(a,e){return function(t,...n){let s;return L8(t)?(s=LS.get(t),s||(s=new t,LS.set(t,s))):s=t,a&&a(s),Promise.all(n.map(o=>new Promise((f,d)=>s.load(o,p=>{us(p?.scene)&&Object.assign(p,A8(p.scene)),f(p)},e,p=>d(new Error(`Could not load ${o}: ${p?.message}`))))))}}function Zc(a,e,t,n){const s=Array.isArray(e)?e:[e],o=r8(OE(t,n),[a,...s],{equal:ci.equ});return Array.isArray(e)?o:o[0]}Zc.preload=function(a,e,t){const n=Array.isArray(e)?e:[e];return o8(OE(t),[a,...n])};Zc.clear=function(a,e){const t=Array.isArray(e)?e:[e];return l8([a,...t])};function z8(a){const e=h8(a);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Q.version}),e}const UE=0,vh={},P8=/^three(?=[A-Z])/,hv=a=>`${a[0].toUpperCase()}${a.slice(1)}`;let B8=0;const I8=a=>typeof a=="function";function N1(a){if(I8(a)){const e=`${B8++}`;return vh[e]=a,e}else Object.assign(vh,a)}function LE(a,e){const t=hv(a),n=vh[t];if(a!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(a==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function F8(a,e,t){var n;return a=hv(a)in vh?a:a.replace(P8,""),LE(a,e),a==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,Mx(e.object,t,a,e)}function j8(a){if(!a.isHidden){var e;a.props.attach&&(e=a.parent)!=null&&e.object?wx(a.parent,a):us(a.object)&&(a.object.visible=!1),a.isHidden=!0,wh(a)}}function zE(a){if(a.isHidden){var e;a.props.attach&&(e=a.parent)!=null&&e.object?Ex(a.parent,a):us(a.object)&&a.props.visible!==!1&&(a.object.visible=!0),a.isHidden=!1,wh(a)}}function O1(a,e,t){const n=e.root.getState();if(!(!a.parent&&a.object!==n.scene)){if(!e.object){var s,o;const f=vh[hv(e.type)];e.object=(s=e.props.object)!=null?s:new f(...(o=e.props.args)!=null?o:[]),e.object.__r3f=e}if(jo(e.object,e.props),e.props.attach)Ex(a,e);else if(us(e.object)&&us(a.object)){const f=a.object.children.indexOf(t?.object);if(t&&f!==-1){const d=a.object.children.indexOf(e.object);if(d!==-1){a.object.children.splice(d,1);const p=d{try{a.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():DS.unstable_scheduleCallback(DS.unstable_IdlePriority,e)}}function Nb(a,e,t){if(!e)return;e.parent=null;const n=a.children.indexOf(e);n!==-1&&a.children.splice(n,1),e.props.attach?wx(a,e):us(e.object)&&us(a.object)&&(a.object.remove(e.object),N8(ME(e),e.object));const s=e.props.dispose!==null&&t!==!1;for(let o=e.children.length-1;o>=0;o--){const f=e.children[o];Nb(e,f,s)}e.children.length=0,delete e.object.__r3f,s&&e.type!=="primitive"&&e.object.type!=="Scene"&&PE(e.object),t===void 0&&wh(e)}function H8(a,e){for(const t of[a,a.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const Oy=[];function k8(){for(const[t]of Oy){const n=t.parent;if(n){t.props.attach?wx(n,t):us(t.object)&&us(n.object)&&n.object.remove(t.object);for(const s of t.children)s.props.attach?wx(t,s):us(s.object)&&us(t.object)&&t.object.remove(s.object)}t.isHidden&&zE(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&PE(t.object)}for(const[t,n,s]of Oy){t.props=n;const o=t.parent;if(o){var a,e;const f=vh[hv(t.type)];t.object=(a=t.props.object)!=null?a:new f(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,H8(s,t.object),jo(t.object,t.props),t.props.attach?Ex(o,t):us(t.object)&&us(o.object)&&o.object.add(t.object);for(const d of t.children)d.props.attach?Ex(t,d):us(d.object)&&us(t.object)&&t.object.add(d.object);wh(t)}}Oy.length=0}const ib=()=>{},PS={};let vy=UE;const V8=0,G8=4,Ob=z8({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:F8,removeChild:Nb,appendChild:nb,appendInitialChild:nb,insertBefore:zS,appendChildToContainer(a,e){const t=a.getState().scene.__r3f;!e||!t||nb(t,e)},removeChildFromContainer(a,e){const t=a.getState().scene.__r3f;!e||!t||Nb(t,e)},insertInContainerBefore(a,e,t){const n=a.getState().scene.__r3f;!e||!t||!n||zS(n,e,t)},getRootHostContext:()=>PS,getChildHostContext:()=>PS,commitUpdate(a,e,t,n,s){var o,f,d;LE(e,n);let p=!1;if((a.type==="primitive"&&t.object!==n.object||((o=n.args)==null?void 0:o.length)!==((f=t.args)==null?void 0:f.length)||(d=n.args)!=null&&d.some((y,x)=>{var v;return y!==((v=t.args)==null?void 0:v[x])}))&&(p=!0),p)Oy.push([a,{...n},s]);else{const y=T8(a,n);Object.keys(y).length&&(Object.assign(a.props,y),jo(a.object,y))}(s.sibling===null||(s.flags&G8)===V8)&&k8()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:a=>a?.object,prepareForCommit:()=>null,preparePortalMount:a=>Mx(a.getState().scene,a,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:j8,unhideInstance:zE,createTextInstance:ib,hideTextInstance:ib,unhideTextInstance:ib,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Q.createContext(null),setCurrentUpdatePriority(a){vy=a},getCurrentUpdatePriority(){return vy},resolveUpdatePriority(){var a;if(vy!==UE)return vy;switch(typeof window<"u"&&((a=window.event)==null?void 0:a.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Cy.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Cy.ContinuousEventPriority;default:return Cy.DefaultEventPriority}},resetFormInstance(){}}),vf=new Map,th={objects:"shallow",strict:!1};function X8(a,e){if(!e&&typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement&&a.parentElement){const{width:t,height:n,top:s,left:o}=a.parentElement.getBoundingClientRect();return{width:t,height:n,top:s,left:o}}else if(!e&&typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas)return{width:a.width,height:a.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function q8(a){const e=vf.get(a),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,o=n||U8(zb,IS),f=t||Ob.createContainer(o,Cy.ConcurrentRoot,null,!1,null,"",s,s,s,null);e||vf.set(a,{fiber:f,store:o});let d,p,m=!1,y=null;return{async configure(x={}){let v;y=new Promise(Y=>v=Y);let{gl:S,size:M,scene:T,events:w,onCreated:A,shadows:D=!1,linear:N=!1,flat:U=!1,legacy:I=!1,orthographic:z=!1,frameloop:j="always",dpr:q=[1,2],performance:B,raycaster:P,camera:W,onPointerMissed:se}=x,ae=o.getState(),ce=ae.gl;if(!ae.gl){const Y={canvas:a,powerPreference:"high-performance",antialias:!0,alpha:!0},oe=typeof S=="function"?await S(Y):S;US(oe)?ce=oe:ce=new gE({...Y,...S}),ae.set({gl:ce})}let ue=ae.raycaster;ue||ae.set({raycaster:ue=new oE});const{params:V,...$}=P||{};if(ci.equ($,ue,th)||jo(ue,{...$}),ci.equ(V,ue.params,th)||jo(ue,{params:{...ue.params,...V}}),!ae.camera||ae.camera===p&&!ci.equ(p,W,th)){p=W;const Y=W?.isCamera,oe=Y?W:z?new qo(0,0,0,0,.1,1e3):new xi(75,0,.1,1e3);Y||(oe.position.z=5,W&&(jo(oe,W),oe.manual||("aspect"in W||"left"in W||"right"in W||"bottom"in W||"top"in W)&&(oe.manual=!0,oe.updateProjectionMatrix())),!ae.camera&&!(W!=null&&W.rotation)&&oe.lookAt(0,0,0)),ae.set({camera:oe}),ue.camera=oe}if(!ae.scene){let Y;T!=null&&T.isScene?(Y=T,Mx(Y,o,"",{})):(Y=new t1,Mx(Y,o,"",{}),T&&jo(Y,T)),ae.set({scene:Y})}w&&!ae.events.handlers&&ae.set({events:w(o)});const J=X8(a,M);if(ci.equ(J,ae.size,th)||ae.setSize(J.width,J.height,J.top,J.left),q&&ae.viewport.dpr!==TE(q)&&ae.setDpr(q),ae.frameloop!==j&&ae.setFrameloop(j),ae.onPointerMissed||ae.set({onPointerMissed:se}),B&&!ci.equ(B,ae.performance,th)&&ae.set(Y=>({performance:{...Y.performance,...B}})),!ae.xr){var he;const Y=(Ne,Qe)=>{const le=o.getState();le.frameloop!=="never"&&IS(Ne,!0,le,Qe)},oe=()=>{const Ne=o.getState();Ne.gl.xr.enabled=Ne.gl.xr.isPresenting,Ne.gl.xr.setAnimationLoop(Ne.gl.xr.isPresenting?Y:null),Ne.gl.xr.isPresenting||zb(Ne)},Te={connect(){const Ne=o.getState().gl;Ne.xr.addEventListener("sessionstart",oe),Ne.xr.addEventListener("sessionend",oe)},disconnect(){const Ne=o.getState().gl;Ne.xr.removeEventListener("sessionstart",oe),Ne.xr.removeEventListener("sessionend",oe)}};typeof((he=ce.xr)==null?void 0:he.addEventListener)=="function"&&Te.connect(),ae.set({xr:Te})}if(ce.shadowMap){const Y=ce.shadowMap.enabled,oe=ce.shadowMap.type;if(ce.shadowMap.enabled=!!D,ci.boo(D))ce.shadowMap.type=v0;else if(ci.str(D)){var ve;const Te={basic:SA,percentage:Dx,soft:v0,variance:Zr};ce.shadowMap.type=(ve=Te[D])!=null?ve:v0}else ci.obj(D)&&Object.assign(ce.shadowMap,D);(Y!==ce.shadowMap.enabled||oe!==ce.shadowMap.type)&&(ce.shadowMap.needsUpdate=!0)}return wn.enabled=!I,m||(ce.outputColorSpace=N?kc:_a,ce.toneMapping=U?Xo:Hb),ae.legacy!==I&&ae.set(()=>({legacy:I})),ae.linear!==N&&ae.set(()=>({linear:N})),ae.flat!==U&&ae.set(()=>({flat:U})),S&&!ci.fun(S)&&!US(S)&&!ci.equ(S,ce,th)&&jo(ce,S),d=A,m=!0,v(),this},render(x){return!m&&!y&&this.configure(),y.then(()=>{Ob.updateContainer(R.jsx(Y8,{store:o,children:x,onCreated:d,rootElement:a}),f,null,()=>{})}),o},unmount(){BE(a)}}}function Y8({store:a,children:e,onCreated:t,rootElement:n}){return sm(()=>{const s=a.getState();s.set(o=>({internal:{...o.internal,active:!0}})),t&&t(s),a.getState().events.connected||s.events.connect==null||s.events.connect(n)},[]),R.jsx(DE.Provider,{value:a,children:e})}function BE(a,e){const t=vf.get(a),n=t?.fiber;if(n){const s=t?.store.getState();s&&(s.internal.active=!1),Ob.updateContainer(null,n,null,()=>{s&&setTimeout(()=>{try{var o,f,d,p;s.events.disconnect==null||s.events.disconnect(),(o=s.gl)==null||(f=o.renderLists)==null||f.dispose==null||f.dispose(),(d=s.gl)==null||d.forceContextLoss==null||d.forceContextLoss(),(p=s.gl)!=null&&p.xr&&s.xr.disconnect(),M8(s.scene),vf.delete(a)}catch{}},500)})}}const W8=new Set,Z8=new Set,K8=new Set;function ab(a,e){if(a.size)for(const{callback:t}of a.values())t(e)}function C0(a,e){switch(a){case"before":return ab(W8,e);case"after":return ab(Z8,e);case"tail":return ab(K8,e)}}let sb,rb;function Ub(a,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof a=="number"&&(n=a-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=a),sb=e.internal.subscribers;for(let s=0;s0)&&!((e=nh.gl.xr)!=null&&e.isPresenting)&&(ob+=Ub(a,nh))}if(Lb=!1,C0("after",a),ob===0)return C0("tail",a),Tx=!1,cancelAnimationFrame(BS)}function zb(a,e=1){var t;if(!a)return vf.forEach(n=>zb(n.store.getState(),e));(t=a.gl.xr)!=null&&t.isPresenting||!a.internal.active||a.frameloop==="never"||(e>1?a.internal.frames=Math.min(60,a.internal.frames+e):Lb?a.internal.frames=2:a.internal.frames=1,Tx||(Tx=!0,requestAnimationFrame(IE)))}function IS(a,e=!0,t,n){if(e&&C0("before",a),t)Ub(a,t,n);else for(const s of vf.values())Ub(a,s.store.getState());e&&C0("after",a)}const lb={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Q8(a){const{handlePointer:e}=O8(a);return{priority:1,enabled:!0,compute(t,n,s){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(lb).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:s}=a.getState();(t=s.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{const{set:n,events:s}=a.getState();if(s.disconnect==null||s.disconnect(),n(o=>({events:{...o.events,connected:t}})),s.handlers)for(const o in s.handlers){const f=s.handlers[o],[d,p]=lb[o];t.addEventListener(d,f,{passive:p})}},disconnect:()=>{const{set:t,events:n}=a.getState();if(n.connected){if(n.handlers)for(const s in n.handlers){const o=n.handlers[s],[f]=lb[s];n.connected.removeEventListener(f,o)}t(s=>({events:{...s.events,connected:void 0}}))}}}}function FS(a,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>a(...n),e)}}function J8({debounce:a,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const s=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,f]=Q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),d=Q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),p=a?typeof a=="number"?a:a.scroll:null,m=a?typeof a=="number"?a:a.resize:null,y=Q.useRef(!1);Q.useEffect(()=>(y.current=!0,()=>void(y.current=!1)));const[x,v,S]=Q.useMemo(()=>{const A=()=>{if(!d.current.element)return;const{left:D,top:N,width:U,height:I,bottom:z,right:j,x:q,y:B}=d.current.element.getBoundingClientRect(),P={left:D,top:N,width:U,height:I,bottom:z,right:j,x:q,y:B};d.current.element instanceof HTMLElement&&n&&(P.height=d.current.element.offsetHeight,P.width=d.current.element.offsetWidth),Object.freeze(P),y.current&&!nU(d.current.lastBounds,P)&&f(d.current.lastBounds=P)};return[A,m?FS(A,m):A,p?FS(A,p):A]},[f,n,p,m]);function M(){d.current.scrollContainers&&(d.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",S,!0)),d.current.scrollContainers=null),d.current.resizeObserver&&(d.current.resizeObserver.disconnect(),d.current.resizeObserver=null),d.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",d.current.orientationHandler))}function T(){d.current.element&&(d.current.resizeObserver=new s(S),d.current.resizeObserver.observe(d.current.element),e&&d.current.scrollContainers&&d.current.scrollContainers.forEach(A=>A.addEventListener("scroll",S,{capture:!0,passive:!0})),d.current.orientationHandler=()=>{S()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",d.current.orientationHandler))}const w=A=>{!A||A===d.current.element||(M(),d.current.element=A,d.current.scrollContainers=FE(A),T())};return eU(S,!!e),$8(v),Q.useEffect(()=>{M(),T()},[e,S,v]),Q.useEffect(()=>M,[]),[w,o,x]}function $8(a){Q.useEffect(()=>{const e=a;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[a])}function eU(a,e){Q.useEffect(()=>{if(e){const t=a;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[a,e])}function FE(a){const e=[];if(!a||a===document.body)return e;const{overflow:t,overflowX:n,overflowY:s}=window.getComputedStyle(a);return[t,n,s].some(o=>o==="auto"||o==="scroll")&&e.push(a),[...e,...FE(a.parentElement)]}const tU=["x","y","top","bottom","left","right","width","height"],nU=(a,e)=>tU.every(t=>a[t]===e[t]);function iU({ref:a,children:e,fallback:t,resize:n,style:s,gl:o,events:f=Q8,eventSource:d,eventPrefix:p,shadows:m,linear:y,flat:x,legacy:v,orthographic:S,frameloop:M,dpr:T,performance:w,raycaster:A,camera:D,scene:N,onPointerMissed:U,onCreated:I,...z}){Q.useMemo(()=>N1(WO),[]);const j=b8(),[q,B]=J8({scroll:!0,debounce:{scroll:50,resize:0},...n}),P=Q.useRef(null),W=Q.useRef(null);Q.useImperativeHandle(a,()=>P.current);const se=wE(U),[ae,ce]=Q.useState(!1),[ue,V]=Q.useState(!1);if(ae)throw ae;if(ue)throw ue;const $=Q.useRef(null);sm(()=>{const he=P.current;if(B.width>0&&B.height>0&&he){$.current||($.current=q8(he));async function ve(){await $.current.configure({gl:o,scene:N,events:f,shadows:m,linear:y,flat:x,legacy:v,orthographic:S,frameloop:M,dpr:T,performance:w,raycaster:A,camera:D,size:B,onPointerMissed:(...Y)=>se.current==null?void 0:se.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(d?x8(d)?d.current:d:W.current),p&&Y.setEvents({compute:(oe,Te)=>{const Ne=oe[p+"X"],Qe=oe[p+"Y"];Te.pointer.set(Ne/Te.size.width*2-1,-(Qe/Te.size.height)*2+1),Te.raycaster.setFromCamera(Te.pointer,Te.camera)}}),I?.(Y)}}),$.current.render(R.jsx(j,{children:R.jsx(S8,{set:V,children:R.jsx(Q.Suspense,{fallback:R.jsx(_8,{set:ce}),children:e??null})})}))}ve()}}),Q.useEffect(()=>{const he=P.current;if(he)return()=>BE(he)},[]);const J=d?"none":"auto";return R.jsx("div",{ref:W,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:J,...s},...z,children:R.jsx("div",{ref:q,style:{width:"100%",height:"100%"},children:R.jsx("canvas",{ref:P,style:{display:"block"},children:t})})})}function aU(a){return R.jsx(SE,{children:R.jsx(iU,{...a})})}const oh=({title:a,description:e,onActivate:t})=>R.jsxs("button",{type:"button",className:"info-item-button",onClick:t,children:[R.jsx("span",{className:"info-item-title",children:a}),e&&R.jsx("span",{className:"info-item-description",children:e})]}),sU="/assets/varunpfp-C0wT5bHB.jpg",rU="/assets/barnjam-Cpig6lJy.jpg";class rm{constructor(e=0,t="Network Error"){this.status=e,this.text=t}}const oU=()=>{if(!(typeof localStorage>"u"))return{get:a=>Promise.resolve(localStorage.getItem(a)),set:(a,e)=>Promise.resolve(localStorage.setItem(a,e)),remove:a=>Promise.resolve(localStorage.removeItem(a))}},Sa={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:oU()},U1=a=>a?typeof a=="string"?{publicKey:a}:a.toString()==="[object Object]"?a:{}:{},lU=(a,e="https://api.emailjs.com")=>{if(!a)return;const t=U1(a);Sa.publicKey=t.publicKey,Sa.blockHeadless=t.blockHeadless,Sa.storageProvider=t.storageProvider,Sa.blockList=t.blockList,Sa.limitRate=t.limitRate,Sa.origin=t.origin||e},jE=async(a,e,t={})=>{const n=await fetch(Sa.origin+a,{method:"POST",headers:t,body:e}),s=await n.text(),o=new rm(n.status,s);if(n.ok)return o;throw o},HE=(a,e,t)=>{if(!a||typeof a!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e||typeof e!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t||typeof t!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},cU=a=>{if(a&&a.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},kE=a=>a.webdriver||!a.languages||a.languages.length===0,VE=()=>new rm(451,"Unavailable For Headless Browser"),uU=(a,e)=>{if(!Array.isArray(a))throw"The BlockList list has to be an array";if(typeof e!="string")throw"The BlockList watchVariable has to be a string"},fU=a=>!a.list?.length||!a.watchVariable,dU=(a,e)=>a instanceof FormData?a.get(e):a[e],GE=(a,e)=>{if(fU(a))return!1;uU(a.list,a.watchVariable);const t=dU(e,a.watchVariable);return typeof t!="string"?!1:a.list.includes(t)},XE=()=>new rm(403,"Forbidden"),hU=(a,e)=>{if(typeof a!="number"||a<0)throw"The LimitRate throttle has to be a positive number";if(e&&typeof e!="string")throw"The LimitRate ID has to be a non-empty string"},pU=async(a,e,t)=>{const n=Number(await t.get(a)||0);return e-Date.now()+n},qE=async(a,e,t)=>{if(!e.throttle||!t)return!1;hU(e.throttle,e.id);const n=e.id||a;return await pU(n,e.throttle,t)>0?!0:(await t.set(n,Date.now().toString()),!1)},YE=()=>new rm(429,"Too Many Requests"),mU=async(a,e,t,n)=>{const s=U1(n),o=s.publicKey||Sa.publicKey,f=s.blockHeadless||Sa.blockHeadless,d=s.storageProvider||Sa.storageProvider,p={...Sa.blockList,...s.blockList},m={...Sa.limitRate,...s.limitRate};return f&&kE(navigator)?Promise.reject(VE()):(HE(o,a,e),cU(t),t&&GE(p,t)?Promise.reject(XE()):await qE(location.pathname,m,d)?Promise.reject(YE()):jE("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:o,service_id:a,template_id:e,template_params:t}),{"Content-type":"application/json"}))},gU=a=>{if(!a||a.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of the form"},yU=a=>typeof a=="string"?document.querySelector(a):a,xU=async(a,e,t,n)=>{const s=U1(n),o=s.publicKey||Sa.publicKey,f=s.blockHeadless||Sa.blockHeadless,d=Sa.storageProvider||s.storageProvider,p={...Sa.blockList,...s.blockList},m={...Sa.limitRate,...s.limitRate};if(f&&kE(navigator))return Promise.reject(VE());const y=yU(t);HE(o,a,e),gU(y);const x=new FormData(y);return GE(p,x)?Promise.reject(XE()):await qE(location.pathname,m,d)?Promise.reject(YE()):(x.append("lib_version","4.4.1"),x.append("service_id",a),x.append("template_id",e),x.append("user_id",o),jE("/api/v1.0/email/send-form",x))},vU={init:lU,send:mU,sendForm:xU,EmailJSResponseStatus:rm},bU=()=>{const[a,e]=Q.useState(""),[t,n]=Q.useState(""),[s,o]=Q.useState(""),[f]=Q.useState(()=>Math.floor(2+Math.random()*4)),[d]=Q.useState(()=>Math.floor(2+Math.random()*4)),[p,m]=Q.useState(""),y=parseInt(p,10)===f+d,[x,v]=Q.useState("idle"),[S,M]=Q.useState(""),T=async w=>{if(w.preventDefault(),!y){M("Please solve the puzzle before sending.");return}if(!s.trim()){M("Please enter a message.");return}v("sending"),M("");try{const A="service_xbnhbub",D="template_ot0l8v8",N="LDAjMUPUvIUiY3x7t",U={source:"varun.pro guestbook",name:a||"Guest",email:t||"",title:a||"Guest",message:s};await vU.send(A,D,U,N),v("success"),e(""),n(""),o(""),m("")}catch(A){console.error("EmailJS error:",A),v("error"),M("Something went wrong sending your message. Please try again later.")}};return R.jsx("article",{className:"detail-pane",children:R.jsxs("section",{className:"detail-pane-body guestbook-body",children:[R.jsx("p",{children:"If you liked anything you saw here, feel free to send me a message and get in touch!"}),R.jsxs("form",{className:"guestbook-form",onSubmit:T,children:[R.jsxs("label",{className:"guestbook-label",children:["Your Name",R.jsx("input",{type:"text",className:"guestbook-input",value:a,onChange:w=>e(w.target.value),placeholder:"Your name"})]}),R.jsxs("label",{className:"guestbook-label",children:["Your Email (optional)",R.jsx("input",{type:"email",className:"guestbook-input",value:t,onChange:w=>n(w.target.value),placeholder:"you@example.com"})]}),R.jsxs("label",{className:"guestbook-label",children:["Your Message",R.jsx("textarea",{className:"guestbook-textarea",rows:5,value:s,onChange:w=>o(w.target.value),placeholder:"Write something nice..."})]}),R.jsxs("label",{className:"guestbook-label",children:["Solve to verify you're human:",R.jsxs("div",{className:"guestbook-captcha-row",children:[f," + ",d," =",R.jsx("input",{type:"text",className:"guestbook-captcha-input",value:p,onChange:w=>m(w.target.value)})]})]}),R.jsx("button",{type:"submit",className:`guestbook-submit-button ${!y||x==="sending"?"disabled":"active"}`,disabled:!y||x==="sending",children:x==="sending"?"Sending...":"Send Message"}),x==="success"&&R.jsx("p",{className:"guestbook-success",children:"Thanks! Your message has been sent."}),S&&R.jsx("p",{className:"guestbook-warning",children:S})]})]})})},jS=()=>R.jsx(R.Fragment,{children:"Under Construction..."}),_U="/assets/day10_1-DlsEdUkL.jpg",SU=Object.freeze(Object.defineProperty({__proto__:null,default:_U},Symbol.toStringTag,{value:"Module"})),AU="/assets/day10_2-D2wZkA93.mp4",MU=Object.freeze(Object.defineProperty({__proto__:null,default:AU},Symbol.toStringTag,{value:"Module"})),EU="/assets/day10_3-CH_gXzTi.jpg",wU=Object.freeze(Object.defineProperty({__proto__:null,default:EU},Symbol.toStringTag,{value:"Module"})),TU="/assets/day10_4-C4-o0d_Z.jpg",CU=Object.freeze(Object.defineProperty({__proto__:null,default:TU},Symbol.toStringTag,{value:"Module"})),RU="/assets/day10_5-DCB34iWY.jpg",DU=Object.freeze(Object.defineProperty({__proto__:null,default:RU},Symbol.toStringTag,{value:"Module"})),NU="/assets/day1_1-CcHoYYXM.jpg",OU=Object.freeze(Object.defineProperty({__proto__:null,default:NU},Symbol.toStringTag,{value:"Module"})),UU="/assets/day1_2-BueBmuji.jpeg",LU=Object.freeze(Object.defineProperty({__proto__:null,default:UU},Symbol.toStringTag,{value:"Module"})),zU="/assets/day2_1-X58ToZyc.jpg",PU=Object.freeze(Object.defineProperty({__proto__:null,default:zU},Symbol.toStringTag,{value:"Module"})),BU="/assets/day3_1-DT4kGV30.jpg",IU=Object.freeze(Object.defineProperty({__proto__:null,default:BU},Symbol.toStringTag,{value:"Module"})),FU="/assets/day3_2-AImV-c_S.jpg",jU=Object.freeze(Object.defineProperty({__proto__:null,default:FU},Symbol.toStringTag,{value:"Module"})),HU="/assets/day3_3-C2_T6J7Q.jpg",kU=Object.freeze(Object.defineProperty({__proto__:null,default:HU},Symbol.toStringTag,{value:"Module"})),VU="/assets/day3_4-lU9hE16x.jpg",GU=Object.freeze(Object.defineProperty({__proto__:null,default:VU},Symbol.toStringTag,{value:"Module"})),XU="/assets/day4_1-BMDJnScs.jpeg",qU=Object.freeze(Object.defineProperty({__proto__:null,default:XU},Symbol.toStringTag,{value:"Module"})),YU="/assets/day4_2-CPN80mWs.jpeg",WU=Object.freeze(Object.defineProperty({__proto__:null,default:YU},Symbol.toStringTag,{value:"Module"})),ZU="/assets/day4_3-UHvuphef.jpg",KU=Object.freeze(Object.defineProperty({__proto__:null,default:ZU},Symbol.toStringTag,{value:"Module"})),QU="/assets/day4_4-B6KNMzYW.jpg",JU=Object.freeze(Object.defineProperty({__proto__:null,default:QU},Symbol.toStringTag,{value:"Module"})),$U="/assets/day4_5-Dtu12EHc.jpeg",eL=Object.freeze(Object.defineProperty({__proto__:null,default:$U},Symbol.toStringTag,{value:"Module"})),tL="/assets/day4_6-pOg3q0P7.mp4",nL=Object.freeze(Object.defineProperty({__proto__:null,default:tL},Symbol.toStringTag,{value:"Module"})),iL="/assets/day5_1-S-B17XIY.jpg",aL=Object.freeze(Object.defineProperty({__proto__:null,default:iL},Symbol.toStringTag,{value:"Module"})),sL="/assets/day5_2-DD9Gi_Yb.jpeg",rL=Object.freeze(Object.defineProperty({__proto__:null,default:sL},Symbol.toStringTag,{value:"Module"})),oL="/assets/day5_3-DXGbOsLP.jpeg",lL=Object.freeze(Object.defineProperty({__proto__:null,default:oL},Symbol.toStringTag,{value:"Module"})),cL="/assets/day5_4-C3qFgqE_.jpeg",uL=Object.freeze(Object.defineProperty({__proto__:null,default:cL},Symbol.toStringTag,{value:"Module"})),fL="/assets/day5_5-D-B0dw9-.mp4",dL=Object.freeze(Object.defineProperty({__proto__:null,default:fL},Symbol.toStringTag,{value:"Module"})),hL="/assets/day5_6-DK9HFYc9.webp",pL=Object.freeze(Object.defineProperty({__proto__:null,default:hL},Symbol.toStringTag,{value:"Module"})),mL="/assets/day6_1-COnGpWP_.jpg",gL=Object.freeze(Object.defineProperty({__proto__:null,default:mL},Symbol.toStringTag,{value:"Module"})),yL="/assets/day6_2-CYxWvVZH.jpg",xL=Object.freeze(Object.defineProperty({__proto__:null,default:yL},Symbol.toStringTag,{value:"Module"})),vL="/assets/day6_3-N_aoz-_7.jpg",bL=Object.freeze(Object.defineProperty({__proto__:null,default:vL},Symbol.toStringTag,{value:"Module"})),_L="/assets/day6_4-DtCsGGz7.jpg",SL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"})),AL="/assets/day6_5-ClvSf9Nq.jpg",ML=Object.freeze(Object.defineProperty({__proto__:null,default:AL},Symbol.toStringTag,{value:"Module"})),EL="/assets/day7_1-CktTIrP9.jpg",wL=Object.freeze(Object.defineProperty({__proto__:null,default:EL},Symbol.toStringTag,{value:"Module"})),TL="/assets/day7_2-CtbXSG-L.jpg",CL=Object.freeze(Object.defineProperty({__proto__:null,default:TL},Symbol.toStringTag,{value:"Module"})),RL="/assets/day7_3-CJqhRo7D.jpg",DL=Object.freeze(Object.defineProperty({__proto__:null,default:RL},Symbol.toStringTag,{value:"Module"})),NL="/assets/day7_4-phXPv4jw.jpg",OL=Object.freeze(Object.defineProperty({__proto__:null,default:NL},Symbol.toStringTag,{value:"Module"})),UL="/assets/day7_5-DI0QMciJ.jpg",LL=Object.freeze(Object.defineProperty({__proto__:null,default:UL},Symbol.toStringTag,{value:"Module"})),zL="/assets/day7_6-DNmv-DQl.jpg",PL=Object.freeze(Object.defineProperty({__proto__:null,default:zL},Symbol.toStringTag,{value:"Module"})),BL="/assets/day8_1-BfuJ1lKv.jpg",IL=Object.freeze(Object.defineProperty({__proto__:null,default:BL},Symbol.toStringTag,{value:"Module"})),FL="/assets/day8_10-B5vYD2kf.jpg",jL=Object.freeze(Object.defineProperty({__proto__:null,default:FL},Symbol.toStringTag,{value:"Module"})),HL="/assets/day8_11-CRIjEHpa.jpg",kL=Object.freeze(Object.defineProperty({__proto__:null,default:HL},Symbol.toStringTag,{value:"Module"})),VL="/assets/day8_2-TIFQZm8x.jpg",GL=Object.freeze(Object.defineProperty({__proto__:null,default:VL},Symbol.toStringTag,{value:"Module"})),XL="/assets/day8_3-C77oSQLF.jpg",qL=Object.freeze(Object.defineProperty({__proto__:null,default:XL},Symbol.toStringTag,{value:"Module"})),YL="/assets/day8_4-DH9uEuKU.jpg",WL=Object.freeze(Object.defineProperty({__proto__:null,default:YL},Symbol.toStringTag,{value:"Module"})),ZL="/assets/day8_5-BnAkoa2E.jpg",KL=Object.freeze(Object.defineProperty({__proto__:null,default:ZL},Symbol.toStringTag,{value:"Module"})),QL="/assets/day8_6-C9bzpPEg.jpg",JL=Object.freeze(Object.defineProperty({__proto__:null,default:QL},Symbol.toStringTag,{value:"Module"})),$L="/assets/day8_7-BgNfhhdM.jpg",ez=Object.freeze(Object.defineProperty({__proto__:null,default:$L},Symbol.toStringTag,{value:"Module"})),tz="/assets/day8_8-BxypN839.jpg",nz=Object.freeze(Object.defineProperty({__proto__:null,default:tz},Symbol.toStringTag,{value:"Module"})),iz="/assets/day8_9-DJH9MhTP.jpg",az=Object.freeze(Object.defineProperty({__proto__:null,default:iz},Symbol.toStringTag,{value:"Module"})),sz="/assets/day9_1-VAUzjW5d.jpg",rz=Object.freeze(Object.defineProperty({__proto__:null,default:sz},Symbol.toStringTag,{value:"Module"})),oz="/assets/day9_2-WI5WjawW.jpg",lz=Object.freeze(Object.defineProperty({__proto__:null,default:oz},Symbol.toStringTag,{value:"Module"})),cz="/assets/day9_3-Dg2pPm6_.jpg",uz=Object.freeze(Object.defineProperty({__proto__:null,default:cz},Symbol.toStringTag,{value:"Module"})),fz="/assets/fullmap-BNEEylDm.png",dz=Object.freeze(Object.defineProperty({__proto__:null,default:fz},Symbol.toStringTag,{value:"Module"})),HS=Object.assign({"../images/roadtrip/day10_1.jpg":SU,"../images/roadtrip/day10_2.mp4":MU,"../images/roadtrip/day10_3.jpg":wU,"../images/roadtrip/day10_4.jpg":CU,"../images/roadtrip/day10_5.jpg":DU,"../images/roadtrip/day1_1.jpg":OU,"../images/roadtrip/day1_2.jpeg":LU,"../images/roadtrip/day2_1.jpg":PU,"../images/roadtrip/day3_1.jpg":IU,"../images/roadtrip/day3_2.jpg":jU,"../images/roadtrip/day3_3.jpg":kU,"../images/roadtrip/day3_4.jpg":GU,"../images/roadtrip/day4_1.jpeg":qU,"../images/roadtrip/day4_2.jpeg":WU,"../images/roadtrip/day4_3.jpg":KU,"../images/roadtrip/day4_4.jpg":JU,"../images/roadtrip/day4_5.jpeg":eL,"../images/roadtrip/day4_6.mp4":nL,"../images/roadtrip/day5_1.jpg":aL,"../images/roadtrip/day5_2.jpeg":rL,"../images/roadtrip/day5_3.jpeg":lL,"../images/roadtrip/day5_4.jpeg":uL,"../images/roadtrip/day5_5.mp4":dL,"../images/roadtrip/day5_6.webp":pL,"../images/roadtrip/day6_1.jpg":gL,"../images/roadtrip/day6_2.jpg":xL,"../images/roadtrip/day6_3.jpg":bL,"../images/roadtrip/day6_4.jpg":SL,"../images/roadtrip/day6_5.jpg":ML,"../images/roadtrip/day7_1.jpg":wL,"../images/roadtrip/day7_2.jpg":CL,"../images/roadtrip/day7_3.jpg":DL,"../images/roadtrip/day7_4.jpg":OL,"../images/roadtrip/day7_5.jpg":LL,"../images/roadtrip/day7_6.jpg":PL,"../images/roadtrip/day8_1.jpg":IL,"../images/roadtrip/day8_10.jpg":jL,"../images/roadtrip/day8_11.jpg":kL,"../images/roadtrip/day8_2.jpg":GL,"../images/roadtrip/day8_3.jpg":qL,"../images/roadtrip/day8_4.jpg":WL,"../images/roadtrip/day8_5.jpg":KL,"../images/roadtrip/day8_6.jpg":JL,"../images/roadtrip/day8_7.jpg":ez,"../images/roadtrip/day8_8.jpg":nz,"../images/roadtrip/day8_9.jpg":az,"../images/roadtrip/day9_1.jpg":rz,"../images/roadtrip/day9_2.jpg":lz,"../images/roadtrip/day9_3.jpg":uz,"../images/roadtrip/fullmap.png":dz}),Ht={};for(const a in HS){const e=HS[a].default,t=a.split("/").pop();Ht[t]=e}const hz=[{id:0,body:({goTo:a})=>R.jsxs(R.Fragment,{children:[R.jsxs("p",{children:[R.jsx("b",{children:"Day 1: "}),R.jsx("button",{onClick:()=>a(1),className:"page-link",children:"September 26, 2020"}),R.jsx("br",{}),"Philadelphia PA"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 2: "}),R.jsx("button",{onClick:()=>a(2),className:"page-link",children:"September 27, 2020"}),R.jsx("br",{}),"Cave City KY"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 3: "}),R.jsx("button",{onClick:()=>a(3),className:"page-link",children:"September 28, 2020"}),R.jsx("br",{}),"Memphis TN, Hot Springs AK"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 4: "}),R.jsx("button",{onClick:()=>a(4),className:"page-link",children:"September 29, 2020"}),R.jsx("br",{}),"Hot Springs AK"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 5: "}),R.jsx("button",{onClick:()=>a(5),className:"page-link",children:"September 30, 2020"}),R.jsx("br",{}),"Dallas TX, Carlsbad NM"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 6: "}),R.jsx("button",{onClick:()=>a(6),className:"page-link",children:"October 1, 2020"}),R.jsx("br",{}),"Lincoln National Forest, White Sands National Park",R.jsx("br",{}),"Albuquerque NM"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 7: "}),R.jsx("button",{onClick:()=>a(7),className:"page-link",children:"October 2, 2020"}),R.jsx("br",{}),"Painted Desert / Petrified Forest National Park"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 8: "}),R.jsx("button",{onClick:()=>a(8),className:"page-link",children:"October 3, 2020"}),R.jsx("br",{}),"Moab UT, Canyonlands National Park / Island in the Sky"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 9: "}),R.jsx("button",{onClick:()=>a(9),className:"page-link",children:"October 4, 2020"}),R.jsx("br",{}),"Salt Lake City UT, Reno NV"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Day 10: "}),R.jsx("button",{onClick:()=>a(10),className:"page-link",children:"October 5, 2020"}),R.jsx("br",{}),"Lake Tahoe CA, Oakland CA"]}),R.jsx("hr",{}),R.jsxs("p",{children:[R.jsx("b",{children:"Final Thoughts: "}),R.jsx("button",{onClick:()=>a(11),className:"page-link",children:"Sometime Later"}),R.jsx("br",{}),"Boston MA"]})]})},{id:1,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"September 26, 2020"}),R.jsx("p",{children:"And we're off! My travelmates came by to pick me up just after noon, and our first stop was... my parent's house! Since our first major stop on the trip was Philly to see my brother, I couldn't possibly leave without bringing him some of mom's homecooked food. After chatting and getting some last minute travel tips from my parents, we left for real."}),R.jsx("p",{children:"It's a pretty normal drive, one I've done a number of times with my family already. In fact, the drive went even more smoothly than I had expected. For some reason, I was under the impression the drive to Philly would be around 6 hours, but in fact it's closer to 4.5. We just stopped once in New Haven, after which I took to the wheel to bring us the rest of the way to my brother's new place."}),R.jsx("img",{src:Ht["day1_1.jpg"],className:"blog-entry-image",title:"Me and bro after dinner"}),R.jsx("p",{children:"Upon reaching his apartment, I had to admit to the rest that I hadn't eaten yet. It must have been how late I stayed up the night before and just my general sense of excitement, but yeah - it occurred to me shortly before arriving that I was actually very hungry. Fortunately, my brother and I have made it a habit to get halal food cart every time I visit, and this time was no exception. After picking up our dinner, we continued walking around Philly to a spot called Cira Green. It's a nice little park on a roof with music, a large TV screen, spots for picnicking, and a good view of the streets below."}),R.jsx("p",{children:"After eating, it was time to vibe out back at the apartment. The thing about hanging out with a brother you don't get to see often - you don't even necessarily have to be doing anything in particular to enjoy the time together. We had some drinks, talked about our plans for the rest of our trip / his semester, watched some bad movies, and eventually slept after a fun night together."}),R.jsx("img",{src:Ht["day1_2.jpeg"],className:"blog-entry-image",title:"Me and bro vibing"}),R.jsx("p",{children:"Our first big stretch of driving was going to be the next day..."})]})},{id:2,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"September 27, 2020"}),R.jsx("p",{children:"Not too many pictures taken today. After all, it was a long 11.5 hour drive to Cave City, KY - most of which I spent in the back seat resting up for my turn. We drove through Columbus and Cincinnati, OH, where I eventually took night shift and got us to the motel in Kentucky. Definitely not as homey as my brother's place. However, we had officially passed through into Central Time!"}),R.jsx("img",{src:Ht["day2_1.jpg"],className:"blog-entry-image",title:"Cave City, KY"}),R.jsx("p",{children:"And honestly, that's about it. We called it a night as soon as we got there and prepared for a shorter, but still significant, drive the next day. Unfortunately for our Mammoth Cave plans, we found out that a large storm would be passing through the area. Not wanting to get stuck in the thunder, lightning, and poor driving conditions that would accompany it, we chose to just push on ahead. Funnily enough, that same storm ended up passing through MA and visited our friends and family back home."}),R.jsx("p",{children:"In the morning, our complimentary breakfast consisted of a granola bar, an apple, a cinnamon cake, and a bottle of water. Since the motel couldn't provide breakfast in their lobby, they were simply handing out lunchbags of assorted breakfast things. Not particularly excited about the foodstuffs they included, we decided that there's no reason to turn down free drinking water for a long trip, so we took our lunchbags and headed to get breakfast at a Cracker Barrel nearby."}),R.jsx("p",{children:"It was okay. The real highlight was seeing someone open carrying while paying for their breakfast. Wouldn't want to be anywhere near that man's bacon, that's for sure."})]})},{id:3,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"September 28, 2020"}),R.jsx("p",{children:"Now I know I cheated a little bit by including today's breakfast in yesterday's post, but that's just how uneventful yesterday was. Today, we have pictures again! Following breakfast, we began on our 4.5 hour drive down to Memphis, TN, a place known for Elvis, rock & roll, blues, and the lively Beale St."}),R.jsx("img",{src:Ht["day3_1.jpg"],className:"blog-entry-image",title:'"Lively" Beale St'}),R.jsx("p",{children:"Ah right, we're in a pandemic. While disappointing that the streets weren't full of people and the sound of music, it was a uniquely bizarre and special experience being one of just a handful of groups of people there. And lucky for us, the sound of music wasn't missing for long."}),R.jsx("p",{children:"In a little cutout next to King's Palace Cafe, there was a live band playing the blues to a small crowd of people - socially distanced at separate tables, of course. What a find this was! It made me realize just how long it had been since my last live show, which honestly I can't remember. It might have been Marc Rebillet at the Sinclair? I dunno."}),R.jsx("img",{src:Ht["day3_2.jpg"],className:"blog-entry-image",title:"King's Palace Cafe Patio"}),R.jsx("p",{children:"Seriously, I can't tell you just how awesome it was, to be able to just relax with a beer and listen to some live blues outdoors. On this unusually quiet street, there were still people trying to liven things up, and doing it as safely as they could. After a beer and a few jams, we decided it was time to head back to the car to continue the drive to Arkansas, making sure to tip the band as we left."}),R.jsx("p",{children:'On our way back to the car, we also found a little music shop. I bought my first vinyl (Radiohead - OK Computer OKNOTOK), and a couple of gifts for musician friends back home. It would be a couple of days before I realized, "Oh, yeah, I should get a record player, huh?" We also made sure to say bye to Elvis before leaving.'}),R.jsx("img",{src:Ht["day3_3.jpg"],className:"blog-entry-image",title:"The King"}),R.jsx("p",{children:"The drive to Hot Springs, AK would be another 3 hours from Memphis. It was evening/night shift, so my turn to drive now. It was a fairly quiet drive for the majority of it, elevating to hauntingly quiet as we reached closer to Hot Springs. For about 45 minutes off of the interstate, we just went down winding roads to get to our inn."}),R.jsx("img",{src:Ht["day3_4.jpg"],className:"blog-entry-image",title:"Hot Springs, AK"}),R.jsx("p",{children:"Once we arrived at our room, we decided it would be a good idea to stay here for two nights. We had just spent two very long days driving - why not stay and enjoy Hot Springs National Park and get a chance to sleep in for a night? Once suggested, it was heartily agreed upon by everyone, and so we hopped in bed, excited to not have to drive the next day."})]})},{id:4,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"September 29, 2020"}),R.jsx("p",{children:"Finally - rest day. Although, like any other day, we got into the car first thing in the morning, the key difference today would be the short 10 minute drive to Hot Springs downtown. A nice, quiet town with a lot of history, it was our first experience actually out and about in a new place. What a great idea to dodge the storm in Kentucky - the weather here was beautiful."}),R.jsx("img",{src:Ht["day4_1.jpeg"],className:"blog-entry-image",title:"Hot Springs on Tap"}),R.jsx("p",{children:"You can actually get drinking water straight from the hot springs that give the town its name. Full of minerals and just under boiling temp, something about it was extremely satisfying. Locals and visitors alike gathered around the literal watering hole to fill their jugs and cartons, and later on during our walk, we found another fountain sourced from a cool water spring."}),R.jsx("img",{src:Ht["day4_2.jpeg"],className:"blog-entry-image",title:"Inviting"}),R.jsx("img",{src:Ht["day4_3.jpg"],className:"blog-entry-image",title:"Still in business"}),R.jsx("p",{children:"At one time a popular vacation spot for American elite, Hot Springs AK is famous for its bathhouses. On Bathhouse Row, you can find a number of old buildings, some of which retain their architecture but have been repurposed into lodging or eateries, while a couple of others are still actively in business as bathhouses. Unfortunately for us, they only provide their bath and massage services from Thursday to Sunday, and it was Wednesday. Unlucky, but it's fine. This just means the massage after the trip will be that much better."}),R.jsx("p",{children:"We went up a short but steep trail to the Hot Springs Mountain Tower, where we got a nice 360 view of the surrounding area. Kind of reminded me of the view from Sugarloaf back in Sunderland MA. Funnily enough, there's another Sugarloaf here in Hot Springs. See if you can spot the rollercoaster/theme park among the trees in the first pic."}),R.jsx("img",{src:Ht["day4_4.jpg"],className:"blog-entry-image",title:"Hot Springs View"}),R.jsx("img",{src:Ht["day4_5.jpeg"],className:"blog-entry-image",title:"Hot Springs View"}),R.jsx("p",{children:"On our way back down from the observation tower, we actually caught a glimpse of some of the spring water pouring through cracks in the stones, creating a small pool. This was very nice, because of our incorrect initial assumption that a place called Hot Springs would have large outdoor hot springs. A consolation prize."}),R.jsx("video",{src:Ht["day4_6.mp4"],className:"blog-entry-image",controls:!0,muted:!1,loop:!0,autoPlay:!0}),R.jsx("p",{children:"After a great day of walking around town and some light hiking, we treated ourselves to some pizza and beer at the Grateful Head. The rest of the night would be fairly low-key, taking extra time to make sure all of our stuff was packed. The next day would be a significant bit of driving again - New Mexico to be the goal."})]})},{id:5,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"September 30, 2020"}),R.jsx("p",{children:"After a full day to ourselves, free from driving, we hit the road again with a renewed vigor. Before the trip, we had questions on how we would handle long stretches of driving, but after making it this far, we knew there was nothing to worry about. Our first stop today was Dallas, about 4.5 hours from Hot Springs and a good spot to stop for lunch. The hottest day yet, we finally hit 33 C (91 F) as we entered the Texas border."}),R.jsx("img",{src:Ht["day5_1.jpg"],className:"blog-entry-image",title:"Dallas, TX"}),R.jsx("p",{children:"Our stop for lunch was a place called Pepe & Mito's, a local Tex-Mex restaurant that did not disappoint. I would have taken a picture of my chimichanga, but I ate it too fast. We walked around for a little bit to take in the heat and the fact that we had made it down to Texas and were nearing the meat of our trip. Back in 2011 or 12, I had done the drive from MA to Fort Worth with another friend, so it was very cool how I could recognize some of the highways and scenery."}),R.jsx("p",{children:"The next leg of the trip was completely new for me, and it would be approximately 7 hours to Carlsbad, NM. This drive was one of the best of the trip - fields of wind turbines as far as the eye can see, an orange sunset in the distance, and barely any traffic. And the scenery was no less amazing once we hit nighttime, either, since all the wind turbines in the distance turned into little red flashing lights. At one point, the entire horizon became a dotted line of little warning lights blinking in sync with each other."}),R.jsx("p",{children:"When we got off the main interstate, it was rather surprising that this new single lane highway still had a speed limit of 75. Out here were fields of oil rigs and exhaust pipes that looked like massive candles, which could be seen flickering from miles away since there were no streetlights. As we passed into New Mexico, our scenery did not change at all. However, as we got closer to our destination, we passed through some small towns every so often. It was at the edge of one of these small towns that we found our night's lodging - Karbani Inn."}),R.jsx("img",{src:Ht["day5_2.jpeg"],className:"blog-entry-image",title:"Never judge a book"}),R.jsx("img",{src:Ht["day5_3.jpeg"],className:"blog-entry-image",title:"By its cover"}),R.jsx("p",{children:"What appeared to be a metal box in the middle of nowhere, was the genius that was Karbani Inn. A bunch of metal shipping containers repurposed with plumbing and electricity, it was honestly a very cozy accommodation. We spent the night planning our stops for the next few days, while drinking beers under a clear night sky. It wasn't too long before we were visited by a cute furry friend."}),R.jsx("img",{src:Ht["day5_4.jpeg"],className:"blog-entry-image",title:"Kitty"}),R.jsx("video",{src:Ht["day5_5.mp4"],className:"blog-entry-image",controls:!0,muted:!1,loop:!0,autoPlay:!0}),R.jsx("p",{children:"Initially surprised that we would run into what appeared to be a very well-fed stray, we found out later it was actually the owner's cat. Despite our offerings of chips, crackers, and pieces of fruit, he was focused on getting into one of the trash bins. Meowing non-stop, he finally made it to the McDonald's bag in the trash, only to find out it was empty. Perhaps too ashamed to accept our snacks after that, he left after a few more meows. Ultimately, we decided we would drive through Lincoln National Forest to get to White Sands National Park the next day."}),R.jsx("img",{src:Ht["day5_6.webp"],className:"blog-entry-image",title:"Karbani Inn"}),R.jsx("p",{children:"After a tasty breakfast burrito from the food cart near the Inn, we set off."})]})},{id:6,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"October 1, 2020"}),R.jsx("p",{children:" Happy October! "}),R.jsx("p",{children:"Despite waking up slightly late today, we still managed to make good time leaving Karbani Inn. We'd be driving through some winding mountain paths today, so we made sure to use our daylight hours well. Our first stop would be Cloudcroft, NM, a small village up in Lincoln National Forest where people like to ski and enjoy the mountain views."}),R.jsx("img",{src:Ht["day6_1.jpg"],className:"blog-entry-image",title:"Carlsbad, NM"}),R.jsx("p",{children:"Only 2.5 hours out of Carlsbad, the drive was beautiful. After driving through the flat terrain of Texas, it was wonderful to be back up in higher elevation. Since we wanted to spend most of our day at White Sands, we didn't stop to check out the town or the hiking spots around here, but we did go to one of the viewpoints up there. Sierra Blanca Viewpoint up in Cloudcroft gives a great view over to Sierra Blanca's peak, which is about 30 miles away."}),R.jsx("img",{src:Ht["day6_2.jpg"],className:"blog-entry-image",title:"Sierra Blanca Viewpoint"}),R.jsx("p",{children:"The drive back down the other side of Lincoln National Forest was a nice break for our little car, as it could be heard struggling up some of the steep grades earlier. The views of the mountainside and beyond were marvelous - while New England surely does have mountain views and hiking, the views down below are certainly not the same. Rather than the trees and hills we have at home, the sights below were sand and desert. The ride from Cloudcroft down to White Sands was just under an hour. Although we could see hints of the white sand as we approached the park entrance, we didn't quite grasp the scale of it until we got into the park itself."}),R.jsx("img",{src:Ht["day6_3.jpg"],className:"blog-entry-image",title:"White Sands National Park"}),R.jsx("img",{src:Ht["day6_4.jpg"],className:"blog-entry-image",title:"White Sand Dune"}),R.jsx("img",{src:Ht["day6_5.jpg"],className:"blog-entry-image",title:"Pure White Field of View"}),R.jsx("p",{children:"Needless to say, this park was one of the first awe-inspiring visits of the trip thus far. Never had I seen anything like this. The day was brutally hot, yet the white sand was cool to the touch. Visitors were sledding down the dunes, families were having picnics, and the general atmosphere here was magical. Depending where you got out of your car, the entire horizon would be white. And on a day like today, there was hardly a cloud in the sky. We spent a good few hours in the picnic area, snacking on fruit and crackers and thinking about where we wanted to go next."}),R.jsx("p",{children:"It was at this time we had our first communication breakdown. When we started to realize that it would simply not be possible to hit all of our planned spots in the remaining days of the trip, it became difficult deciding which places to cut and which to keep. An awkward silence lingered over our group as we slowly finished our snacks, and we eventually decided to put off the final decision until we reached Albuquerque. A decent midpoint between our remaining route options, Albuquerque was a reasonable place to stop for the night."}),R.jsx("p",{children:"The drive to Albuquerque was about 4 hours from White Sands, and fortunately for us, it was a full harvest moon tonight. Not only did we get a beautiful sunset, but shortly after, we got to witness the cresting of the moon along the mountain range on the horizon. It was enormous, and I only wish we were able to get a picture of it. Thankfully, this sight did raise our spirits a bit from earlier. After getting dinner at Cheba Hut Toasted Subs in Albuquerque, we called it for the night and decided to plan our day in the morning."})]})},{id:7,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"October 2, 2020"}),R.jsx("p",{children:"After some discussion in the morning, we eventually decided that the Petrified Forest was a stop we could not miss, although we would still have to skip the Grand Canyon and Zion National Park. Unfortunate, but it would was a necessary sacrifice to make good time on the rest of the trip. From Albuquerque, the trip would be about 3.5 hours along the historic Route 66, now I-40. The Petrified Forest is actually found within a larger landmark known as the Painted Desert. Aptly named, the layers of sand and stone had shades of blue/lavender, red/orange, grey, and likely more at other strata. Honestly, it's hard to put into words the beauty and wonder of this place, so I'll just let the pictures speak for themselves. Enjoy."}),R.jsx("img",{src:Ht["day7_1.jpg"],className:"blog-entry-image",title:"Painted Desert"}),R.jsx("img",{src:Ht["day7_2.jpg"],className:"blog-entry-image",title:"Petrified Logs"}),R.jsx("img",{src:Ht["day7_3.jpg"],className:"blog-entry-image",title:"Jeweled Tree Stump"}),R.jsx("img",{src:Ht["day7_4.jpg"],className:"blog-entry-image",title:"Coloured Stone"}),R.jsx("img",{src:Ht["day7_5.jpg"],className:"blog-entry-image",title:"Gem Logs"}),R.jsx("img",{src:Ht["day7_6.jpg"],className:"blog-entry-image",title:"Just look at that colour"}),R.jsx("p",{children:"I wish I had more to say about the Painted Desert / Petrified Forest, other than to go there if you ever have the chance. Despite the number of hours we spent there, there was still more we could have seen, but unfortunately we had to prepare to leave since the park was preparing to close soon. At the picnic area near the exit, we took some time to make noodles on our portable propane stove - it was quite the janky setup. But there's something special about the taste of roadside noodles made in a rush."}),R.jsx("p",{children:"Our next stop was Canyonlands in Utah, so we started our approximately 4 hour drive. This night gave us a bit of a scare, since we were struggling to find lodging. Every place we called was completely booked and meant that we would have to continue driving into the night. Finally, in Blanding, UT, we were able to secure the final two rooms at the Four Corners Inn. Up until now, I could safely that the Petrified Forest was my favourite stop of the trip. It wouldn't be long for something to rival it, though, since tomorrow we would be seeing Canyonlands."})]})},{id:8,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"October 3, 2020"}),R.jsx("p",{children:`Good morning, Utah! To be completely honest, I had no idea what was in store for the day. Of course, I've looked at pictures of popular parks and landscapes around the United States, but they had always existed as isolated spots in my brain. It wasn't until this trip that I actually understood the scale and how they connected. Utah is humongous, and everywhere you look there are mountains, whether near or in the distance. In our excitement to explore the Canyonlands, we didn't realize right away that our GPS target wasn't quite where we wanted to go (we just put in "Canyonlands" and went where it took us lol). No doubt, it was spectacular. Our altitude dropped significantly as we drove through these cliffs, but this was primarily a hiking and climbing area for people with serious gear. We drove around the south end of the park for a couple hours before circling back.`}),R.jsx("img",{src:Ht["day8_1.jpg"],className:"blog-entry-image",title:"Preparing to climb"}),R.jsx("p",{children:"On the way to Moab, we saw signs for Wilson Arch, a sandstone structure named after Joe Wilson, a pioneer who lived nearby. It was impossible to miss, and we decided it would be a fun stop to walk around and hike for a little bit."}),R.jsx("img",{src:Ht["day8_2.jpg"],className:"blog-entry-image",title:"Wilson Arch"}),R.jsx("img",{src:Ht["day8_3.jpg"],className:"blog-entry-image",title:"Base of Wilson Arch"}),R.jsx("img",{src:Ht["day8_4.jpg"],className:"blog-entry-image",title:"US Rte. 191"}),R.jsx("img",{src:Ht["day8_5.jpg"],className:"blog-entry-image",title:"US Rte. 191"}),R.jsx("p",{children:"There were a lot of families enjoying the simpler approaches, meanwhile other daredevils were belaying each other down from the top of the arch. We hiked up to the base of the arch and enjoyed the shade and the company of someone else's dog, looking out at the view. It was really cool how this was right along the highway, no official entrance, no line to get in, just nature. After spending about an hour up here, we continued on to Moab."}),R.jsx("p",{children:"Moab is a neat little town. In some ways, it reminded me a little bit of Northampton, MA. We stopped for food in town and to top up on some supplies, and also got some extra food to-go for dinner since we were still considering camping somewhere potentially. On the way to Island in the Sky, we also drove up to Arches National Park. However, once we saw the approach from down below, we decided it was not something the car would be able to handle. I think maybe we could have done it, but it will remain one of the trip's unanswered questions."}),R.jsx("img",{src:Ht["day8_6.jpg"],className:"blog-entry-image",title:"Finally a selfie"}),R.jsx("p",{children:"Hello from Island in the Sky. There aren't many selfies from this trip, so I hope you extra enjoy this one. The entire park exists on a large plateau from which you can view all of the surrounding area. Once you go through the park entrance, there are just miles of cliffside road. Serpentining through these roads was an exhilerating experience, as a lot of the curves had no guardrails. You simply had to control your vehicle's speed and turn carefully. Every so often, there were viewpoints to stop at, which we did. I even got to climb a few rocks for better views."}),R.jsx("img",{src:Ht["day8_7.jpg"],className:"blog-entry-image",title:"Another arch"}),R.jsx("img",{src:Ht["day8_8.jpg"],className:"blog-entry-image",title:"See that stack of rocks on the right?"}),R.jsx("img",{src:Ht["day8_9.jpg"],className:"blog-entry-image",title:"Here's the view from the top"}),R.jsx("img",{src:Ht["day8_10.jpg"],className:"blog-entry-image",title:"Giant alien footprint"}),R.jsx("p",{children:"After taking in the whole park, we reminded ourselves that we still needed to look into the possibility of camping somewhere, if that was still our plan. To no one's surprise, all of the camping spots within the park had been reserved. While there are some free campgrounds along highways, they are also first come first serve, meaning they are generally packed if you aren't there well before sundown. Our plan to camp would not pan out, so we chose to drive onward to Provo, UT - just south of Salt Lake City. On the way, we decided if we couldn't camp, we could at least have dinner outside as the sun set. And where better to do that than on the side of a single lane highway?"}),R.jsx("img",{src:Ht["day8_11.jpg"],className:"blog-entry-image",title:"Highway Dinner"}),R.jsx("p",{children:"After a quick meal, we drove on. Tomorrow, we'd be checking out the Salt Lake itself before taking on a huge drive over to Reno, NV. The end of the trip was closing in fast."})]})},{id:9,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"October 4, 2020"}),R.jsx("p",{children:`Before embarking on the long journey to Reno, we stopped at Penny Ann's Cafe for a hearty breakfast, and even had to pack our remaining pancakes to go. Afterwards, we went to the Great Salt Lake itself to check out the marina and the beach. Looking at reviews of the place, there was a common theme of "it's nice but it smells awful," and boy did it live up to that. Lots of the beach had dried up and large colonies of tiny flies carpeted the sand. Taking steps through the sand caused them all to disperse in sync, almost like dust in the wind. Check out my second selfie of the trip.`}),R.jsx("img",{src:Ht["day9_1.jpg"],className:"blog-entry-image",title:"Another selfie"}),R.jsx("p",{children:`As we returned to our car to head out, we started talking to an older couple that was cleaning their RV in the parking lot. We clearly looked like travelers, and they were amazed we were here from so far away. It was nice to talk to some local folks and drop the "us and them". Honestly, that's one of the biggest lessons from this trip. News and social media tend to feed us a lot of negativity, but there really are normal people everywhere. Hopefully we don't forget that.`}),R.jsx("p",{children:"Back in the car, we prepared for a long 8ish hour drive. Normally, I had been taking the evening/night shift for driving, but today I wanted to drive first. With the sun beating down through the driver side window, I got us about 4-5 hours through the trip in almost a single shot. The speed limit for a lot of this highway was 80 mph. Now don't tell anyone, but I miiiiight have hit 110 mph at one point. After the mountains in Utah, there was a large stretch of just pure desert. For miles and miles, nothing could be seen in the distance except for more road."}),R.jsx("p",{children:"Come nighttime, we made it to Reno, NV. We joked about wanting to go do some penny slots and $1 blackjack, but truthfully, we were way too tired to do anything like that. Instead, we found a nice spot for dinner with a lot of different options. I got myself an authentic and delicious thali at a place called... Thali. With one payment, I got free roti and rice refills with my amazing plate of food."}),R.jsx("img",{src:Ht["day9_2.jpg"],className:"blog-entry-image",title:"Cal-Neva"}),R.jsx("img",{src:Ht["day9_3.jpg"],className:"blog-entry-image",title:"Thali"}),R.jsx("p",{children:"After dinner, we called it for the night. Tomorrow would be our final day of exploration and adventure, so we wanted to be fully awake and ready."})]})},{id:10,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"October 5, 2020"}),R.jsx("p",{children:"From Reno, we headed out for Lake Tahoe. Right on the border of NV and CA, we would officially be passing into California today. We made plans to pick up breakfast from Ernie's Coffee Shop, a busy spot among all the other attractions in Tahoe and about an hour away. After arriving and picking up our food, we entered into the actual park areas, and sat down to eat along the water at Pope Beach. Honestly, I don't think I'll ever see water as clear as what you can find here at Lake Tahoe. Even as the light waves splashed up onto shore, the view of the bottom was completely clean and unobstructed."}),R.jsx("img",{src:Ht["day10_1.jpg"],className:"blog-entry-image",title:""}),R.jsx("video",{src:Ht["day10_2.mp4"],className:"blog-entry-image",controls:!0,muted:!1,loop:!0,autoPlay:!0}),R.jsx("p",{children:"We sat and enjoyed the water here for about an hour before cleaning up to go drive around the loop a bit more. Around the lake are many hiking and beach spots, so our plan was to drive clockwise for a bit, staying on the California side. Occasionally, we'd stop at viewpoints along the way, sometimes even trekking into the woods further just for fun. It was pretty busy up here for a Monday, at least to my untrained eye. Perhaps it should be even more busy here were it not for the pandemic. We passed a number of large houses built along the mountainside, likely priced at several millions. Something tells me those houses are worth every penny, considering the views here."}),R.jsx("img",{src:Ht["day10_3.jpg"],className:"blog-entry-image",title:"Lake Tahoe Views"}),R.jsx("img",{src:Ht["day10_4.jpg"],className:"blog-entry-image",title:"Lake Tahoe Views"}),R.jsx("p",{children:"We continued on to Meek's Bay, another beach, where we sat on the rocks for another half hour. It was a great relaxing experience, meditating there. Taking in all the sounds of this wonderful place, it was very calming and helped to round out and balance the exciting and hectic past few days. After we took it all in, we decided it was time to continue."}),R.jsx("p",{children:"The last leg of our trip would take us through the mountains, with lots of warning signs for the steep grades we'd have to endure. The car groaned as some points, but it was only a little bit farther now. At one point, we got stuck in traffic due to two completely independent accidents. One car with a few minor dents had pulled over on the side of the road, waiting for some sort of assistance. However, he was going to have to wait - further down the road was a massive accident involving an 18-wheeler. The front of this truck appeared to have exploded - metal pieces lay strewn all over the road and the parts of the truck that were still intact were charred and black. It took a while to make it past, but once we did, it was smooth sailing."}),R.jsx("p",{children:"Our trip finally came to a close 3.5 hours later, when we arrived in Oakland. We pulled in to our Airbnb and took a while to finally realize that the trip was over. It was honestly a bit sad, as the last few days had been some of the most spectacular of the trip. I was still riding the high of being able to see so much of the country I'd been waiting to see, and so it was tough to accept that I'd be heading home soon. But arriving here was not all bad! Tomorrow would be my free day here in the Bay Area, and so I'd made plans to borrow the car and see some other friends."}),R.jsx("p",{children:" Technically Day 11: "}),R.jsx("p",{children:"On my free day, I met with one of our family friends for lunch, and then met with two of my online friends for dinner. In between, I stopped by Presidio Park in San Francisco, hoping to get some sort of view of the Golden Gate Bridge. Unfortunately, it was an extremely foggy day, so all I could hear were the sounds of the ocean waves and occasional fog horns. Not a big deal - I'd already seen the Golden Gate Bridge a few times on previous trips, and the park had a certain charm of its own when shrouded in fog. I arrived back at the Airbnb in the middle of the night and went straight to bed. Tomorrow would be a day of no schedule, no driving, and relaxing only. Well, and packing for my flight the following day."}),R.jsx("img",{src:Ht["day10_5.jpg"],className:"blog-entry-image",title:"View of the Golden Gate from Presidio"})]})},{id:11,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"In Summary..."}),R.jsx("img",{src:Ht["fullmap.png"],className:"blog-entry-image",title:"Final Road Trip Map"}),R.jsx("p",{children:"And so that brings my trip to a close. After a short, bittersweet plane ride back to MA, I met up with my parents. The first thing I did upon arriving home was to take a shower, trying to keep whatever germs I'd brought from across the country to a minimum. We enjoyed a nice dinner together and I shared a lot of the pictures I shared with you all here."}),R.jsx("hr",{}),R.jsx("p",{children:"National Parks Visited:"}),R.jsxs("ul",{children:[R.jsx("li",{children:"Hot Springs National Park"}),R.jsx("li",{children:"White Sands National Park"}),R.jsx("li",{children:"Petrified Forest National Park (Painted Desert)"}),R.jsx("li",{children:"Canyonlands National Park (Island in the Sky)"})]}),R.jsx("hr",{}),R.jsx("p",{children:"Other Landmarks:"}),R.jsxs("ul",{children:[R.jsx("li",{children:"Beale Street, Memphis TN"}),R.jsx("li",{children:"Lincoln National Forest"}),R.jsx("li",{children:"Great Salt Lake"}),R.jsx("li",{children:"Tahoe National Forest"})]}),R.jsx("hr",{}),R.jsxs("p",{children:["So after a collective ",R.jsx("b",{children:"~70 hours"})," of driving, passing through",R.jsx("b",{children:" 15 states"}),", and approximately ",R.jsx("b",{children:"4.9k miles"})," traveled, I can now say that I've driven across the country. This is an experience I recommend to anyone and everyone, especially if you've only lived in a coastal city. The country is enormous and, though I'd seen pictures and read about them, these sights and landmarks always felt so distant until now. I will absolutely be doing a trip like this again, hopefully sooner rather than later, because who knows when such an opportunity will come by again. I'm eternally grateful to my friends for inviting me on this trip with them, as these are memories that I will have forever. I hope you've enjoyed my recollection of the trip, I've certainly enjoyed reliving it through blogging. Hope to have some more exciting stuff for you all soon."]})]})}],pz="/assets/PuzzleHighlight-D4mPfPxa.png",mz=Object.freeze(Object.defineProperty({__proto__:null,default:pz},Symbol.toStringTag,{value:"Module"})),gz="/assets/QuickDemo-D5eZnWuz.webm",yz=Object.freeze(Object.defineProperty({__proto__:null,default:gz},Symbol.toStringTag,{value:"Module"})),xz="/assets/UMLDiagram-COktgWIm.png",vz=Object.freeze(Object.defineProperty({__proto__:null,default:xz},Symbol.toStringTag,{value:"Module"})),kS=Object.assign({"../images/ue5color/PuzzleHighlight.png":mz,"../images/ue5color/QuickDemo.webm":yz,"../images/ue5color/UMLDiagram.png":vz}),Pb={};for(const a in kS){const e=kS[a].default,t=a.split("/").pop();Pb[t]=e}const bz=[{id:0,body:({goTo:a})=>R.jsxs(R.Fragment,{children:[R.jsx("p",{children:"In this blog series, I'd like to walk you through the development of my UE5 puzzle game prototype. Using Blueprints and some assets from the Epic Games Marketplace, I took a simple idea and turned it into a fully functional color puzzle. I'll give a high level overview of the structure and logic of the puzzle, as well as provide videos of the progress made during each iteration. At the end, I'll share my full walkthrough video so you can see all of the node graphs in full detail if you are intersted. Hope you enjoy!"}),R.jsx("hr",{}),R.jsxs("p",{children:["i."," ",R.jsx("button",{onClick:()=>a(1),className:"page-link",children:"Introduction"})]}),R.jsxs("p",{children:["ii."," ",R.jsx("button",{onClick:()=>a(2),className:"page-link",children:"Base Puzzle Logic"})]}),R.jsxs("p",{children:["iii."," ",R.jsx("button",{onClick:()=>a(3),className:"page-link",children:"Dynamic Material Instances"})]}),R.jsxs("p",{children:["iv."," ",R.jsx("button",{onClick:()=>a(4),className:"page-link",children:"Shader Design"})]}),R.jsxs("p",{children:["v."," ",R.jsx("button",{onClick:()=>a(5),className:"page-link",children:"Level Design"})]}),R.jsxs("p",{children:["vi."," ",R.jsx("button",{onClick:()=>a(6),className:"page-link",children:"Summary & Final Thoughts"})]})]})},{id:1,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"i. Introduction"}),R.jsx("img",{src:Pb["PuzzleHighlight.png"],className:"blog-entry-image",title:"UE5 Quinn standing next to completed puzzle"}),R.jsx("p",{children:"The rules of the game are simple: set the individual R, G, and B color channels so that they mix into the target color (chosen randomly). If the player's color is close enough (based on a tolerance we can set), the player succeeds."}),R.jsx("p",{children:"By keeping the basic rules and win condition of this puzzle brief and straightforward, I wanted to use this project as an opportunity to get hands-on with a variety of tools and features in Unreal Engine 5. Being somewhat new to the engine, but otherwise comfortable with graphics, I wanted to see how multiple Actors can communicate. Additionally, I hoped to create a visually pleasing shader/material to complement the puzzle scenario."}),R.jsx("p",{children:"Using Unreal Engine 5.3.2, I began with the basic third-person template with Quinn as my ThirdPersonCharacter. I created a new empty level and set up a few Input Actions: Z (Crank Down), X (Crank Up), and E (Interact). For now, I am using the default world lighting that Unreal provides and have given myself a large plane to stand on, which means I have an empty level that I can run around in as Quinn."}),R.jsx("p",{children:"To reach the image above, we'll take this in stages. Let's first get the basic game logic working!"})]})},{id:2,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"ii. Base Puzzle Logic"}),R.jsx("p",{children:"There are a few things our puzzle needs to do at minimum. We need to generate a random color when the level starts, we need to let the player control the three independent color channels, and we need to be checking if the combination of those color channels matches the random color we generated. Using Unreal's GameState Actor, we can achieve a lot of this!"}),R.jsx("p",{children:"I first created a Blueprint for an Actor called ColorPicker. This would be a generic Actor that holds a valve that can be spun by the player. As the parent Actor, it carries only rotation logic; but if we create three instances of it, then allow them to independently control three different GameState variables, we can keep our node graphs clean. Below is a clip of the generic ColorPicker responding to the Player when they are within the interaction range."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/PBWVvygjrjM?si=-Xq3kqtnWDVYVTvu",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"Next we have to set the GameState up with the variables we want to track. To keep it brief, we need to track six float values that are between 0.0 and 1.0. Three of them are static and determine the color the Player must create, and three of them are initialized to an abritrary value. By hooking up the Z and X keys to the independent ColorPickers, we can allow the Player to control those three values. In the clip below, notice the details pane and how the values are changing in accordance with the Player's input."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/l09F0-4wawo?si=1jRx6-g-Pv9aIksj",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"Next, let's actually use these GameState values to affect the scene! By creating a base material that defines a fluid aesthetic, we can then create Dynamic Material Instances so that the same liquid effect can be given different base colors."})]})},{id:3,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"iii. Dynamic Material Instances"}),R.jsx("p",{children:"Just like the Blueprints, I give a full breakdown of my final material effect in my walkthrough video, so I encourage you to check that out if interested. Essentially, I played around with various combinations of noise patterns to create an effect that looked like a liquid and wanted it to be interesting enough to work during this testing phase. By using Event Dispatchers, I was able to use the ColorPickers to inform the separate material instances to update their base color, which I had exposed as a Vector Parameter. Below you can see a clip of my three ColorPickers being used to update the colors of several materials."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/P3kN90Jq2sc?si=PaYtS6kIUrkjI9gN",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"After getting this communication in place, I was able to take some time to play with some different arrangements and meshes. Ultimately, I decided I wanted to have three falling streams of liquid mixing into a single pool. Below is a clip that shows the basic idea I am going for."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/vSsnTednDTc?si=xyyCjKhe0YW9FdWq",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"Now comes one of the super fun parts of the project - developing the shader!"})]})},{id:4,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"iv. Shader Design"}),R.jsx("p",{children:"After a couple of iterations, I stumbled on a visual style that stuck out to me. The clip below shows an early stage of the style I would proceed with."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/WY1sYFSQheA?si=x_Y7NqV9CLtVNpo0",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"Not only do we want the shader to mimic a fluid somewhat, we also want to sell the illusion of there being one continuous body of liquid. Here, I chose to add some color lerping near the bottoms of the falling streams, making the transition between meshes appear smoother. I also went with a world position offset effect to make the liquid appear as if it were bubbling, which added some activity to the liquid so it didn't appear flat. On top of that, I wanted to provide additional feedback in the form of a UI progress bar. This would give the player an even better idea of how close they were getting to the right answer. The below clips include a percentage in the bar, which I ultimately did not keep in the final."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/eiiWlyeAGVk?si=XcnjGFvtGn81f8A5",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/HSRYe9c7AYA?si=-jIOyRxC1GtnVEjW",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})})]})},{id:5,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"v. Level Design"}),R.jsx("p",{children:"With the shader effect coming together, I started to brainstorm a scene and environment that would complement it. The first that came to mind was an alchemist's lab or a sewer. Thanks to the rotating free assets in the Epic Games Marketplace, I was fortunate to have some set pieces and prefabs that fit this idea ready to use. I also found some free SFX for things like the sound of steam releasing or ambient water drops. With all of these elements, the level really started coming alive. See the clip below for the first demo in the new environment."}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:"https://www.youtube.com/embed/ujl7vWGiBJM?si=rbI1AOFB7KxBrPC9",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})}),R.jsx("p",{children:"In addition to some background props to help set the scene, I have also updated the ColorPickers to appear as pipes so that they are more convincing. Although I continued to tweak and adjust things past this point, it is safe to say we have achieved our original goals! Having connected all of these parts together in my first prototype, I am very happy with the progress I've made. In the next and final post, I'll do an overview of the project architecture, talk about some of the final tweaks I made, and share my final walkthrough video with you so you can see it all in detail. Thanks for reading!"})]})},{id:6,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"vi. Summary & Final Thoughts"}),R.jsx("p",{children:"To visualize the communication of parts, here is a sequence diagram of the running game loop. The classes in this diagram are the Blueprints, and the processes being run are functions or events found within them."}),R.jsx("img",{src:Pb["UMLDiagram.png"],className:"blog-entry-image",title:"UE5 Quinn standing next to completed puzzle"}),R.jsx("p",{children:"The diagram only contains the actions and events that are crucial to the game loop and resolution of the win condition; to see everything in detail, please watch the full walkthrough video. In it, I describe the project in its entirety and walk through every node graph."}),R.jsx("iframe",{src:"https://www.youtube.com/embed/bzhkDNROZVk?si=zPTG5mw4OIF9Jq5e",className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"}),R.jsx("p",{children:"Thanks for reading to the end! This project was a blast to work on, since it let me use a bunch of different parts of Unreal Engine that I hadn't explored before. Having set up character input, dynamic materials, and cross-actor communication in this project, I'm excited to play around in game engines and DCC software further. For now, I appreciate you following along and I hope you enjoyed!"})]})}],_z="/assets/post1_1-1v4xs0Uf.gif",Sz=Object.freeze(Object.defineProperty({__proto__:null,default:_z},Symbol.toStringTag,{value:"Module"})),Az="/assets/post1_2-C-e6baKN.gif",Mz=Object.freeze(Object.defineProperty({__proto__:null,default:Az},Symbol.toStringTag,{value:"Module"})),Ez="modulepreload",wz=function(a){return"/"+a},VS={},Tz=function(e,t,n){let s=Promise.resolve();if(t&&t.length>0){let p=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),d=f?.nonce||f?.getAttribute("nonce");s=p(t.map(m=>{if(m=wz(m),m in VS)return;VS[m]=!0;const y=m.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":Ez,y||(v.as="script"),v.crossOrigin="",v.href=m,d&&v.setAttribute("nonce",d),document.head.appendChild(v),y)return new Promise((S,M)=>{v.addEventListener("load",S),v.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(f){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=f,window.dispatchEvent(d),!d.defaultPrevented)throw f}return s.then(f=>{for(const d of f||[])d.status==="rejected"&&o(d.reason);return e().catch(o)})};function WE(a){var e,t,n="";if(typeof a=="string"||typeof a=="number")n+=a;else if(typeof a=="object")if(Array.isArray(a)){var s=a.length;for(e=0;ee in a?pv(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,Yo=(a,e)=>{for(var t in e||(e={}))L1.call(e,t)&&GS(a,t,e[t]);if(Cx)for(var t of Cx(e))QE.call(e,t)&&GS(a,t,e[t]);return a},mv=(a,e)=>Rz(a,Nz(e)),JE=(a,e)=>{var t={};for(var n in a)L1.call(a,n)&&e.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&Cx)for(var n of Cx(a))e.indexOf(n)<0&&QE.call(a,n)&&(t[n]=a[n]);return t},Uz=(a,e)=>function(){return e||(0,a[KE(a)[0]])((e={exports:{}}).exports,e),e.exports},Lz=(a,e)=>{for(var t in e)pv(a,t,{get:e[t],enumerable:!0})},zz=(a,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of KE(e))!L1.call(a,s)&&s!==t&&pv(a,s,{get:()=>e[s],enumerable:!(n=Dz(e,s))||n.enumerable});return a},Pz=(a,e,t)=>(t=a!=null?Cz(Oz(a)):{},zz(!a||!a.__esModule?pv(t,"default",{value:a,enumerable:!0}):t,a)),Bz=Uz({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(a,e){var t=(function(){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},f={util:{encode:function M(T){return T instanceof d?new d(T.type,M(T.content),T.alias):Array.isArray(T)?T.map(M):T.replace(/&/g,"&").replace(/"+D.content+""};function p(M,T,w,A){M.lastIndex=T;var D=M.exec(w);if(D&&A&&D[1]){var N=D[1].length;D.index+=N,D[0]=D[0].slice(N)}return D}function m(M,T,w,A,D,N){for(var U in w)if(!(!w.hasOwnProperty(U)||!w[U])){var I=w[U];I=Array.isArray(I)?I:[I];for(var z=0;z=N.reach);ue+=ce.value.length,ce=ce.next){var V=ce.value;if(T.length>M.length)return;if(!(V instanceof d)){var $=1,J;if(P){if(J=p(ae,ue,M,B),!J||J.index>=M.length)break;var oe=J.index,he=J.index+J[0].length,ve=ue;for(ve+=ce.value.length;oe>=ve;)ce=ce.next,ve+=ce.value.length;if(ve-=ce.value.length,ue=ve,ce.value instanceof d)continue;for(var Y=ce;Y!==T.tail&&(veN.reach&&(N.reach=le);var xe=ce.prev;Ne&&(xe=x(T,xe,Ne),ue+=Ne.length),v(T,xe,$);var Ge=new d(U,q?f.tokenize(Te,q):Te,W,Te);if(ce=x(T,xe,Ge),Qe&&x(T,ce,Qe),$>1){var et={cause:U+","+z,reach:le};m(M,T,w,ce.prev,ue,et),N&&et.reach>N.reach&&(N.reach=et.reach)}}}}}}function y(){var M={value:null,prev:null,next:null},T={value:null,prev:M,next:null};M.next=T,this.head=M,this.tail=T,this.length=0}function x(M,T,w){var A=T.next,D={value:w,prev:T,next:A};return T.next=D,A.prev=D,M.length++,D}function v(M,T,w){for(var A=T.next,D=0;D/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},He.languages.markup.tag.inside["attr-value"].inside.entity=He.languages.markup.entity,He.languages.markup.doctype.inside["internal-subset"].inside=He.languages.markup,He.hooks.add("wrap",function(a){a.type==="entity"&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(He.languages.markup.tag,"addInlined",{value:function(a,n){var t={},t=(t["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:He.languages[n]},t.cdata=/^$/i,{"included-cdata":{pattern://i,inside:t}}),n=(t["language-"+n]={pattern:/[\s\S]+/,inside:He.languages[n]},{});n[a]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:t},He.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(He.languages.markup.tag,"addAttribute",{value:function(a,e){He.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+a+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:He.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),He.languages.html=He.languages.markup,He.languages.mathml=He.languages.markup,He.languages.svg=He.languages.markup,He.languages.xml=He.languages.extend("markup",{}),He.languages.ssml=He.languages.xml,He.languages.atom=He.languages.xml,He.languages.rss=He.languages.xml,(function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},t=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,n="(?:[^\\\\-]|"+t.source+")",n=RegExp(n+"-"+n),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:n,inside:{escape:t,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:t}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:t,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},He.languages.javascript=He.languages.extend("clike",{"class-name":[He.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),He.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,He.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:He.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:He.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:He.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:He.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:He.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),He.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:He.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),He.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),He.languages.markup&&(He.languages.markup.tag.addInlined("script","javascript"),He.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),He.languages.js=He.languages.javascript,He.languages.actionscript=He.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),He.languages.actionscript["class-name"].alias="function",delete He.languages.actionscript.parameter,delete He.languages.actionscript["literal-property"],He.languages.markup&&He.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:He.languages.markup}}),(function(a){var e=/#(?!\{).+/,t={pattern:/#\{[^}]+\}/,alias:"variable"};a.languages.coffeescript=a.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:t}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),a.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:t}}}),a.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:a.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:t}}]}),a.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete a.languages.coffeescript["template-string"],a.languages.coffee=a.languages.coffeescript})(He),(function(a){var e=a.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(t,n){(t=typeof t=="string"?[t]:t).forEach(function(s){var o=function(x){x.inside||(x.inside={}),x.inside.rest=n},f="doc-comment";if(d=a.languages[s]){var d,p=d[f];if((p=p||(d=a.languages.insertBefore(s,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[f])instanceof RegExp&&(p=d[f]={pattern:p}),Array.isArray(p))for(var m=0,y=p.length;m|\+|~|\|\|/,punctuation:/[(),]/}},a.languages.css.atrule.inside["selector-function-argument"].inside=e,a.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),t={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};a.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|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|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:e,number:t,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:t})})(He),(function(a){var e=/[*&][^\s[\]{},]+/,t=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+t.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+t.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function f(d,p){p=(p||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return n}).replace(/<>/g,function(){return d});return RegExp(m,p)}a.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return n})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return n}).replace(/<>/g,function(){return"(?:"+s+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:f(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:f(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:f(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:f(o),lookbehind:!0,greedy:!0},number:{pattern:f(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:t,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},a.languages.yml=a.languages.yaml})(He),(function(a){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(m){return m=m.replace(//g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+m+")")}var n=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return n}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,f=(a.languages.markdown=a.languages.extend("markup",{}),a.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:a.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+o+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+o+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:a.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(n),alias:"important",inside:a.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(m){["url","bold","italic","strike","code-snippet"].forEach(function(y){m!==y&&(a.languages.markdown[m].inside.content.inside[y]=a.languages.markdown[y])})}),a.hooks.add("after-tokenize",function(m){m.language!=="markdown"&&m.language!=="md"||(function y(x){if(x&&typeof x!="string")for(var v=0,S=x.length;v",quot:'"'},p=String.fromCodePoint||String.fromCharCode;a.languages.md=a.languages.markdown})(He),He.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:He.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},He.hooks.add("after-tokenize",function(a){if(a.language==="graphql")for(var e=a.tokens.filter(function(M){return typeof M!="string"&&M.type!=="comment"&&M.type!=="scalar"}),t=0;t?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(a){var e=a.languages.javascript["template-string"],t=e.pattern.source,n=e.inside.interpolation,s=n.inside["interpolation-punctuation"],o=n.pattern.source;function f(x,v){if(a.languages[x])return{pattern:RegExp("((?:"+v+")\\s*)"+t),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:x}}}}function d(x,v,S){return x={code:x,grammar:v,language:S},a.hooks.run("before-tokenize",x),x.tokens=a.tokenize(x.code,x.grammar),a.hooks.run("after-tokenize",x),x.tokens}function p(x,v,S){var w=a.tokenize(x,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),M=0,T={},w=d(w.map(function(D){if(typeof D=="string")return D;for(var N,U,D=D.content;x.indexOf((U=M++,N="___"+S.toUpperCase()+"_"+U+"___"))!==-1;);return T[N]=D,N}).join(""),v,S),A=Object.keys(T);return M=0,(function D(N){for(var U=0;U=A.length)return;var I,z,j,q,B,P,W,se=N[U];typeof se=="string"||typeof se.content=="string"?(I=A[M],(W=(P=typeof se=="string"?se:se.content).indexOf(I))!==-1&&(++M,z=P.substring(0,W),B=T[I],j=void 0,(q={})["interpolation-punctuation"]=s,(q=a.tokenize(B,q)).length===3&&((j=[1,1]).push.apply(j,d(q[1],a.languages.javascript,"javascript")),q.splice.apply(q,j)),j=new a.Token("interpolation",q,n.alias,B),q=P.substring(W+I.length),B=[],z&&B.push(z),B.push(j),q&&(D(P=[q]),B.push.apply(B,P)),typeof se=="string"?(N.splice.apply(N,[U,1].concat(B)),U+=B.length-1):se.content=B)):(W=se.content,Array.isArray(W)?D(W):D([W]))}})(w),new a.Token(S,w,"language-"+S,x)}a.languages.javascript["template-string"]=[f("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),f("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),f("svg",/\bsvg/.source),f("markdown",/\b(?:markdown|md)/.source),f("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),f("sql",/\bsql/.source),e].filter(Boolean);var m={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function y(x){return typeof x=="string"?x:Array.isArray(x)?x.map(y).join(""):y(x.content)}a.hooks.add("after-tokenize",function(x){x.language in m&&(function v(S){for(var M=0,T=S.length;M]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),a.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete a.languages.typescript.parameter,delete a.languages.typescript["literal-property"];var e=a.languages.extend("typescript",{});delete e["class-name"],a.languages.typescript["class-name"].inside=e,a.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),a.languages.ts=a.languages.typescript})(He),(function(a){var e=a.languages.javascript,t=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,n="(@(?:arg|argument|param|property)\\s+(?:"+t+"\\s+)?)";a.languages.jsdoc=a.languages.extend("javadoclike",{parameter:{pattern:RegExp(n+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),a.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(n+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:e,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return t})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+t),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:a.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:e,alias:"language-javascript"}}}}),a.languages.javadoclike.addSupport("javascript",a.languages.jsdoc)})(He),(function(a){a.languages.flow=a.languages.extend("javascript",{}),a.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),a.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete a.languages.flow.parameter,a.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(a.languages.flow.keyword)||(a.languages.flow.keyword=[a.languages.flow.keyword]),a.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(He),He.languages.n4js=He.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),He.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),He.languages.n4jsd=He.languages.n4js,(function(a){function e(f,d){return RegExp(f.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),d)}a.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+a.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),a.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+a.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),a.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),a.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:a.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:a.languages.javascript}}),a.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),a.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),a.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var t=["function","function-variable","method","method-variable","property-access"],n=0;n*\.{3}(?:[^{}]|)*\})/.source;function o(p,m){return p=p.replace(//g,function(){return t}).replace(//g,function(){return n}).replace(//g,function(){return s}),RegExp(p,m)}s=o(s).source,a.languages.jsx=a.languages.extend("markup",e),a.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),a.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,a.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,a.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,a.languages.jsx.tag.inside.comment=e.comment,a.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:a.languages.jsx}},a.languages.jsx.tag),a.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:a.languages.jsx}}},a.languages.jsx.tag);function f(p){for(var m=[],y=0;y"&&m.push({tagName:d(x.content[0].content[1]),openedBraces:0}):0]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},He.languages.swift["string-literal"].forEach(function(a){a.inside.interpolation.inside=He.languages.swift}),(function(a){a.languages.kotlin=a.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete a.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:a.languages.kotlin}};a.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete a.languages.kotlin.string,a.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),a.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),a.languages.kt=a.languages.kotlin,a.languages.kts=a.languages.kotlin})(He),He.languages.c=He.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),He.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),He.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},He.languages.c.string],char:He.languages.c.char,comment:He.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:He.languages.c}}}}),He.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete He.languages.c.boolean,He.languages.objectivec=He.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete He.languages.objectivec["class-name"],He.languages.objc=He.languages.objectivec,He.languages.reason=He.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),He.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete He.languages.reason.function,(function(a){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,t=0;t<2;t++)e=e.replace(//g,function(){return e});e=e.replace(//g,function(){return/[^\s\S]/.source}),a.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},a.languages.rust["closure-params"].inside.rest=a.languages.rust,a.languages.rust.attribute.inside.string=a.languages.rust.string})(He),He.languages.go=He.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),He.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete He.languages.go["class-name"],(function(a){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return e.source});a.languages.cpp=a.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),a.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),a.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:a.languages.cpp}}}}),a.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),a.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:a.languages.extend("cpp",{})}}),a.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},a.languages.cpp["base-clause"])})(He),He.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},He.languages.python["string-interpolation"].inside.interpolation.inside.rest=He.languages.python,He.languages.py=He.languages.python,He.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},He.languages.webmanifest=He.languages.json;var $E={};Lz($E,{dracula:()=>Fz,duotoneDark:()=>Hz,duotoneLight:()=>Vz,github:()=>Xz,gruvboxMaterialDark:()=>b9,gruvboxMaterialLight:()=>S9,jettwaveDark:()=>d9,jettwaveLight:()=>p9,nightOwl:()=>Yz,nightOwlLight:()=>Zz,oceanicNext:()=>Qz,okaidia:()=>$z,oneDark:()=>g9,oneLight:()=>x9,palenight:()=>t9,shadesOfPurple:()=>i9,synthwave84:()=>s9,ultramin:()=>o9,vsDark:()=>ew,vsLight:()=>u9});var Iz={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},Fz=Iz,jz={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Hz=jz,kz={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Vz=kz,Gz={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Xz=Gz,qz={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Yz=qz,Wz={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Zz=Wz,qs={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},Kz={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:qs.keyword}},{types:["attr-value"],style:{color:qs.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:qs.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:qs.primitive}},{types:["boolean"],style:{color:qs.boolean}},{types:["tag"],style:{color:qs.tag}},{types:["string"],style:{color:qs.string}},{types:["punctuation"],style:{color:qs.string}},{types:["selector","char","builtin","inserted"],style:{color:qs.char}},{types:["function"],style:{color:qs.function}},{types:["operator","entity","url","variable"],style:{color:qs.variable}},{types:["keyword"],style:{color:qs.keyword}},{types:["atrule","class-name"],style:{color:qs.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Qz=Kz,Jz={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},$z=Jz,e9={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},t9=e9,n9={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},i9=n9,a9={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},s9=a9,r9={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},o9=r9,l9={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},ew=l9,c9={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},u9=c9,f9={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},d9=f9,h9={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},p9=h9,m9={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},g9=m9,y9={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},x9=y9,v9={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},b9=v9,_9={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},S9=_9,A9=a=>Q.useCallback(e=>{var t=e,{className:n,style:s,line:o}=t,f=JE(t,["className","style","line"]);const d=mv(Yo({},f),{className:ZE("token-line",n)});return typeof a=="object"&&"plain"in a&&(d.style=a.plain),typeof s=="object"&&(d.style=Yo(Yo({},d.style||{}),s)),d},[a]),M9=a=>{const e=Q.useCallback(({types:t,empty:n})=>{if(a!=null){{if(t.length===1&&t[0]==="plain")return n!=null?{display:"inline-block"}:void 0;if(t.length===1&&n!=null)return a[t[0]]}return Object.assign(n!=null?{display:"inline-block"}:{},...t.map(s=>a[s]))}},[a]);return Q.useCallback(t=>{var n=t,{token:s,className:o,style:f}=n,d=JE(n,["token","className","style"]);const p=mv(Yo({},d),{className:ZE("token",...s.types,o),children:s.content,style:e(s)});return f!=null&&(p.style=Yo(Yo({},p.style||{}),f)),p},[e])},E9=/\r\n|\r|\n/,XS=a=>{a.length===0?a.push({types:["plain"],content:` +`,empty:!0}):a.length===1&&a[0].content===""&&(a[0].content=` +`,a[0].empty=!0)},qS=(a,e)=>{const t=a.length;return t>0&&a[t-1]===e?a:a.concat(e)},w9=a=>{const e=[[]],t=[a],n=[0],s=[a.length];let o=0,f=0,d=[];const p=[d];for(;f>-1;){for(;(o=n[f]++)0?y:["plain"],m=v):(y=qS(y,v.type),v.alias&&(y=qS(y,v.alias)),m=v.content),typeof m!="string"){f++,e.push(y),t.push(m),n.push(0),s.push(m.length);continue}const S=m.split(E9),M=S.length;d.push({types:y,content:S[0]});for(let T=1;TQ.useMemo(()=>{if(t==null)return YS([e]);const s={code:e,grammar:t,language:n,tokens:[]};return a.hooks.run("before-tokenize",s),s.tokens=a.tokenize(e,t),a.hooks.run("after-tokenize",s),YS(s.tokens)},[e,t,n,a]),C9=(a,e)=>{const{plain:t}=a,n=a.styles.reduce((s,o)=>{const{languages:f,style:d}=o;return f&&!f.includes(e)||o.types.forEach(p=>{const m=Yo(Yo({},s[p]),d);s[p]=m}),s},{});return n.root=t,n.plain=mv(Yo({},t),{backgroundColor:void 0}),n},R9=C9,D9=({children:a,language:e,code:t,theme:n,prism:s})=>{const o=e.toLowerCase(),f=R9(n,o),d=A9(f),p=M9(f),m=s.languages[o],y=T9({prism:s,language:o,code:t,grammar:m});return a({tokens:y,className:`prism-code language-${o}`,style:f!=null?f.root:{},getLineProps:d,getTokenProps:p})},N9=a=>Q.createElement(D9,mv(Yo({},a),{prism:a.prism||He,theme:a.theme||ew,code:a.code,language:a.language}));typeof globalThis<"u"&&(globalThis.Prism=He);let cb=null;function O9(){return cb||(cb=Tz(()=>import("./prism-java-Civ-VhAW.js").then(a=>a.p),[])),cb}const Ys=({code:a,language:e=""})=>{const[t,n]=Q.useState(e!=="java");Q.useEffect(()=>{e==="java"?O9().then(()=>{n(!0)}):n(!0)},[e]);const[s,o]=Q.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return t?R.jsxs("div",{className:"code-block",children:[R.jsxs("div",{className:"code-block-header",children:[e&&R.jsx("span",{className:"code-block-lang",children:e}),R.jsx("button",{type:"button",className:"code-block-copy",onClick:f,children:s?"Copied":"Copy"})]}),R.jsx(N9,{code:a.trim(),language:e||"tsx",theme:$E.nightOwl,children:({className:d,style:p,tokens:m,getLineProps:y,getTokenProps:x})=>R.jsx("pre",{className:`code-block-pre ${d}`,style:p,children:m.map((v,S)=>R.jsx("div",{...y({line:v}),children:v.map((M,T)=>R.jsx("span",{...x({token:M})},T))},S))})})]}):R.jsxs("div",{className:"code-block",children:[R.jsxs("div",{className:"code-block-header",children:[e&&R.jsx("span",{className:"code-block-lang",children:e}),R.jsx("button",{type:"button",className:"code-block-copy",onClick:f,children:s?"Copied":"Copy"})]}),R.jsx("pre",{className:"code-block-pre",children:R.jsx("code",{children:a})})]})};new URL("/assets/post1_1-1v4xs0Uf.gif",import.meta.url).href;const WS=Object.assign({"../images/ue5hex/post1_1.gif":Sz,"../images/ue5hex/post1_2.gif":Mz}),Bb={};for(const a in WS){const e=WS[a].default,t=a.split("/").pop();Bb[t]=e}const U9=`#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "HexTile.generated.h" + +// allcaps methods are for interfacing UE5 + +// initialize as a subclass of Actor +UCLASS() +class TILETACTICS_API AHexTile : public AActor +{ + GENERATED_BODY() + +public: + AHexTile(); + + // lets you assign a mesh in the editor + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Hex Tile") + UStaticMeshComponent* MeshComponent; + + // setter method for the material + UFUNCTION(BlueprintCallable, Category = "Hex Tile") + void SetTileMaterial(UMaterialInterface* MyMaterial); + + // setter method for the mesh + UFUNCTION(BlueprintCallable, Category = "Hex Tile") + void SetTileMesh(UStaticMesh* NewMesh); + +// these are inherited from Actor +protected: + virtual void BeginPlay() override; + virtual void OnConstruction(const FTransform& Transform) override; +};`,L9=`#include "HexTile.h" + +// constructor +AHexTile::AHexTile() +{ + PrimaryActorTick.bCanEverTick = false; // disable tick for performance + + MeshComponent = CreateDefaultSubobject(TEXT("MeshComponent")); + RootComponent = MeshComponent; +} + +// called when simulation starts +void AHexTile::BeginPlay() +{ + Super::BeginPlay(); +} + +// called when actor spawns or is changed +void AHexTile::OnConstruction(const FTransform& Transform) +{ + Super::OnConstruction(Transform); +} + +// this sets the tile mesh to the given mesh +void AHexTile::SetTileMesh(UStaticMesh* NewMesh) +{ + if (NewMesh) + { + MeshComponent->SetStaticMesh(NewMesh); + } +} + +// this sets the tile material to the given material +void AHexTile::SetTileMaterial(UMaterialInterface* MyMaterial) +{ + if (MyMaterial) + { + MeshComponent->SetMaterial(0, MyMaterial); + } +}`,z9=`#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "HexTile.h" +#include "HexGridOrigin.generated.h" + +// custom rendering type +UENUM(BlueprintType) +enum class EHexGridMode : uint8 +{ + Tile UMETA(DisplayName = "Tile"), + Fill UMETA(DisplayName = "Fill") +}; + +UCLASS() +class TILETACTICS_API AHexGridOrigin : public AActor +{ + GENERATED_BODY() + +public: + AHexGridOrigin(); + + // set class of HexTile in editor + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + TSubclassOf HexTileClass; + + // set all materials that will be needed + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials") + UMaterialInterface *GrassMaterial; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials") + UMaterialInterface *StoneMaterial; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid Materials") + UMaterialInterface *SnowMaterial; + + // ... + // add any more material options here + + // set mesh that will be passed to HexTile + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Tile") + UStaticMesh *TileMesh; + + // grid properties + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + int32 GridWidth; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + int32 GridHeight; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + float GridSpacing; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid", meta = (Delta = "0.01")) + float NoiseStrength; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + int32 ZScaling; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hex Grid") + EHexGridMode GridMode; + + // array to keep track of spawned HexTile actors + UPROPERTY() + TArray SpawnedTiles; + + // buttons + UFUNCTION(BlueprintCallable, Category = "Hex Grid", CallInEditor) + void BuildGrid(); + + UFUNCTION(BlueprintCallable, Category = "Hex Grid", CallInEditor) + void ClearGrid(); + +protected: + virtual void BeginPlay() override; +};`,P9=`#include "HexGridOrigin.h" +#include "HexTile.h" +#include "Kismet/KismetMathLibrary.h" + +// constructor +AHexGridOrigin::AHexGridOrigin() +{ + // don't need per tick calcs + PrimaryActorTick.bCanEverTick = false; + + // initial grid settings + GridMode = EHexGridMode::Tile; + GridWidth = 5; + GridHeight = 5; + GridSpacing = 100.0f; + NoiseStrength = 0.1f; + ZScaling = 10; +} + +// when simulation starts +void AHexGridOrigin::BeginPlay() +{ + Super::BeginPlay(); + + BuildGrid(); +} + +// this does the whole thing +void AHexGridOrigin::BuildGrid() +{ + // clear previous tiles + for (AHexTile *Tile : SpawnedTiles) + { + if (Tile) + { + Tile->Destroy(); + } + } + SpawnedTiles.Empty(); + + // calculate X and Y spacing + float YSpacing = GridSpacing * 1.5f; + float XSpacing = FMath::Sqrt(3.0f) * GridSpacing; + + // set clamp ranges for noise and scaling + float MinNoiseValue = 0.1f; + float MaxNoiseValue = 1.0f; + float MinZScale = 0.1f; + + for (int32 y = 0; y < GridHeight; ++y) + { + for (int32 x = 0; x < GridWidth; ++x) + { + float XPos = x * XSpacing; + float YPos = y * YSpacing; + + // odd row offset + if (y % 2 != 0) + { + XPos += (XSpacing / 2.0f); + } + + // store the X and Y of the centerpoint, Z comes later + FVector CenterPoint(XPos, YPos, 0.0f); + + // get a noise value + float NoiseValue = FMath::PerlinNoise2D(FVector2D(CenterPoint.X, CenterPoint.Y) * NoiseStrength); + NoiseValue = FMath::Clamp(NoiseValue, MinNoiseValue, MaxNoiseValue); // clamp it + + float RoundedZ = UKismetMathLibrary::Round(NoiseValue * 20.0f) * 0.05f; // round it + if (HexTileClass) + { + AHexTile *NewTile = GetWorld()->SpawnActor(HexTileClass, CenterPoint, FRotator::ZeroRotator); + if (NewTile) + { + NewTile->SetTileMesh(TileMesh); + + // grid mode branches + if (GridMode == EHexGridMode::Tile) + { + // Tile Mode: set the tile's center at the Z point + CenterPoint.Z = RoundedZ * ZScaling; + NewTile->SetActorLocation(CenterPoint); + } + else if (GridMode == EHexGridMode::Fill) + { + // Fill Mode: scale the mesh up to the Z point + FVector NewScale = NewTile->GetActorScale3D(); + NewScale.Z = FMath::Max(RoundedZ * ZScaling, MinZScale); + NewTile->SetActorScale3D(NewScale); + } + + // use the Z height to determine material + UMaterialInterface *TileMaterial; + if (RoundedZ < 0.33f) // low thresh + { + TileMaterial = GrassMaterial; + } + else if (RoundedZ < 0.55f) // middle thresh + { + TileMaterial = StoneMaterial; + } + else // high + { + TileMaterial = SnowMaterial; + } + + NewTile->SetTileMaterial(TileMaterial); + SpawnedTiles.Add(NewTile); + } + } + } + } +} + +// destroys all actors +void AHexGridOrigin::ClearGrid() +{ + for (AHexTile *Tile : SpawnedTiles) + { + if (Tile) + { + Tile->Destroy(); + } + } + SpawnedTiles.Empty(); +}`,B9=[{id:0,body:({goTo:a})=>R.jsxs(R.Fragment,{children:[R.jsx("p",{children:"In this blog series, we will look at how to create procedural hexagonal tile grids in Unreal Engine 5. I'll do my best to explain what details I can, but will assume some basic familiarity with Unreal Engine and C++ (or any language, really). If you are more comfortable working with Blueprints in Unreal, you should still be able to follow along!"}),R.jsx("hr",{}),R.jsxs("p",{children:["i."," ",R.jsx("button",{onClick:()=>a(1),className:"page-link",children:"Introduction"})]}),R.jsxs("p",{children:["ii."," ",R.jsx("button",{onClick:()=>a(2),className:"page-link",children:"Classes & Grid Logic"})]}),R.jsxs("p",{children:["iii."," ",R.jsx("button",{onClick:()=>a(3),className:"page-link",children:"2D Perlin Noise with Materials"})]})]})},{id:1,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"i. Introduction"}),R.jsx("p",{children:"As someone new to Unreal but familiar with coding, I felt more of a pull towards C++ development over learning Blueprints. I've also been playing a lot of Civilization 5 and 6 around the time of writing this, and so I've had the picture of hexagon maps in my head and thought it'd be a good exercise to get some practice with the engine. I won't be getting into environment setup in this series, but do keep in mind that setting up Unreal Engine with your code editor of choice may take some time and troubleshooting. In my case, I am using Visual Studio Code and Unreal Engine 5.4.4. I also created my own regular hexagon tile in Blender and exported it for use in Unreal, which I recommend doing for full control of the tile, but I'm sure you can also find one online somewhere."}),R.jsxs("p",{children:["I'd also like to point you to two great resources that helped me. The first is"," ",R.jsx("a",{href:"https://youtu.be/vSevINGWtEc?si=CQhyLgH4GoAyXKfv&t=0",target:"_blank",children:"this video"})," ","from Gisli's game development channel. He creates a tool that generates a hexagonal grid using Blueprints and shows the whole process, and the higher level concepts are still relevant when working with C++. The other is"," ",R.jsx("a",{href:"https://www.redblobgames.com/grids/hexagons/",target:"_blank",children:"this blog post"})," ","from Red Blob Games. This is likely the best blog post around for understand how hex tiling works and the numerous ways you can set up coordinate systems with them (a bit overkill for this project but exciting to learn nonetheless)."]}),R.jsxs("p",{children:["The key takeaway: the dimensions of a regular hexagon make it so you cannot simply offset by a single width value to get proper tiling - with some trigonometry, you would find that you need to use"," ",R.jsx("i",{children:"sqrt(3)"})," somewhere depending on if you are using flat-top or pointy-top orientation. We'll be working with flat-top orientation here, but the formulae and logic can be easily repurposed to work with pointy-top."]}),R.jsx("p",{children:" Now, let's get into it!"})]})},{id:2,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"ii. Classes & Grid Logic"}),R.jsx("p",{children:"First, let's define a simple HexTile class. This class represents a single hexagonal tile, which we will provide with a mesh and material. By using C++ to expose these variables to Unreal Engine's editor, we can use Unreal's UI to find and assign these easily. To create the class, we need to define a HexTile.h and a HexTile.cpp. The first is a header file where we declare variables, functions, and expose things to the editor. The second is where we define the class logic. Let's take a look at both real quick:"}),R.jsx(Ys,{code:U9,language:"cpp"}),R.jsx(Ys,{code:L9,language:"cpp"}),R.jsx("p",{children:"The parts in all caps in the header file are UE functions for interfacing with the editor and determining what to expose, while the rest is basically boilerplate code. In the cpp file, we write the rest of our logic. With these set, we are able to use the UI of Unreal to control variables or function calls without needing to recompile the code. However, changing any core functionality or global constants will likely require a recompile or a refactor to expose it to the editor as well. Not necessarily impossible, but just something to think about."}),R.jsx("p",{children:"Next, we want to make an Actor that behaves as the grid origin or generator - something that does the math of positioning the tiles and then spawns them accordingly. We will give this Actor the ability to use the Tile's setter functions to change how to look as well. In fact, we can get pretty creative with what we expose to the editor here and come up with our own custom constants or variables. This is the part that can contain a lot of math, so let's do the fun part of showing the demo first 😏"}),R.jsx("img",{src:Bb["post1_1.gif"],className:"blog-entry-image",title:"Hex Grid Tiling Dynamic Height and Width"}),R.jsx("p",{children:"What you're seeing here is a hex grid with an adjustable width and height, which is then performing the act of spawning the tiles where needed. This is being done when a custom button is pressed, but you can also refactor this to happen every frame (and in turn, more expensive). The dark black floor material was just a stock material picked from the default asset library. We can call this Actor the HexGridOrigin, indicating that it is the (0, 0) coordinate of the 2D grid. Just like in the Tile class where we had to provide the mesh and material through the editor, we can provide these to the HexGridOrigin as well, which can then apply different textures based on rules we come up with. We'll look at noise and heights in the next one, where I'll share the full .h and .cpp code for the HexGridOrigin class."}),R.jsx("p",{children:"See you there!"})]})},{id:3,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"iii. Dynamic Material Instances"}),R.jsxs("p",{children:["To build off from the last post, let's give these tiles a height using"," ",R.jsx("a",{href:"https://en.wikipedia.org/wiki/Perlin_noise",target:"_blank",children:"Perlin noise"}),", and then use that to determine what material to apply. We'll also theorycraft some other variables we could introduce to add some spice to the map generation. First off, let me share the header and cpp files for the HexGridOrigin class. If you're just skimming through, you probably want to see the ",R.jsx("i",{children:"AHexGridOrigin::BuildGrid()"})," ","function in the .cpp file."]}),R.jsx(Ys,{code:z9,language:"cpp"}),R.jsx(Ys,{code:P9,language:"cpp"}),R.jsx("img",{src:Bb["post1_2.gif"],className:"blog-entry-image",title:"Hex Grid Tiling Dynamic Height and Width"}),"Beyond Perlin noise, we also added:",R.jsxs("ul",{children:[R.jsxs("li",{children:[R.jsx("i",{children:"GridMode"})," : toggle between Tile and Fill mode"]}),R.jsxs("li",{children:[R.jsx("i",{children:"GridSpacing"})," : adjusts the gap between tiles"]}),R.jsxs("li",{children:[R.jsx("i",{children:"NoiseStrength"})," : changes the visible noise pattern"]}),R.jsxs("li",{children:[R.jsx("i",{children:"ZScaling"})," : how strongly noise values get scaled to height"]})]}),"What else could we add for cool effects or generative patterns? In this demo, I created a HexGridOrigin Actor that spawns several Tile Actors so that I had individual control of each Tile when necessary, but is there a better way to achieve this? As one of my first projects in Unreal Engine, I've still got a lot to learn! Hope this was a fun read for you, and if you have any questions or suggestions, don't hesitate to get in touch.",R.jsx("p",{children:"Until next time!"})]})}],I9="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAIAAAAxBA+LAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAM4klEQVR4Xu3dTWxU5R4H4EsLZVo69IN+AGUINBRqBkilxSBaEoVqpoWCHySCBI24EBdIpBvCqguWkkZcGBeuiDGwdIUNJkhoINWVUeKKhAQ2TUBIKBBA77m4If/Ge3tFoD3neRaEwvTM+/4W7y/vnDPn/OtfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABTRH19/erVqzdu3Njb29vT09PxwKJFiwqFQmVlZfKCXC6X/NjS0lIsFleuXPncc891dXUtX768pqYmHgsApoUFCxYkndff37927drZs2evWLFi8+bNH3/88eeff37q1KmRkZGLD9y6deuPP/5I/vzzx+Tfk/9NXpO8Mnl98lsVFRVJI65ataqhoSG+BwBMNW1tbW+88cYLL7yQz+fXrVt38ODB4eHh8fHxP/6u5HeTIyTHSY42Z86cZcuWzZ8/P74rADxdyXYt2fyVSqXa2trkL8ePH79x40bstEeWHDM5cnL8pGWTzaIPTgF4+lpaWnbs2JFs1Lq6uo4ePTo2Nhbr6zFI3iV5rzVr1jQ2NtbV1cUxAcAT0NramlRgoVB49dVXT58+HcvqiUjet6enp76+3hlEAJ6cuXPn7t69e9GiRdu2bRsdHY3t9MQlY9i6dWttbe2f16ACwGPU19fX3d3d0dExMjISG+mpSsZTLBabm5vjiAHgH1EoFHbt2tXY2Dg0NHTv3r1YRFNAMqpkbDUPxNEDwKPo6enp7Ozs7++/cuVK7J8pJhlhqVRyEQ0A/4xZs2bt2bOnqanpyJEjsXOmsGS01dXV5eXlcT4AMHnNzc1vv/32kiVLzp8/H6tmykvGvGDBgqqqqjgrAJiMpUuX9vb2vvTSS9euXYslM00kI//zljRxbgDw361evbq7u3v79u23b9+O9TKtJOPfsmVLPp+PMwSAv5Lsojo6Oj788MP79+/HYpmGklm8//771dXVcZ4AMFGyF0xa8NChQ7FPprmBgQHnCwH4H5YuXdrd3b13795YI6nwzjvvuPsMAH+pqampr69v+/bt6fhEdKJkXqVSKZfLxZkDwKxZs3bu3Pnyyy9P96tj/rtkdl1dXWVlZXH+AGTce++9t3Tp0un7TYnJS+ZYX18f5w9AlvX09DQ3N0/Hb83/PefOnZs9e3ZMAYBsWrx4cVdX1/S6g9qjO3z4sC4E4D927drV398fiyID1q9fH7MAIGv6+voaGxun/jMlHodk1jaFAJmWz+e7u7uHhoZiRWTG4OCgJ1QAZNfu3bs7Ojqm5lN2n4xk7i0tLTEXALKgtbW1UCicPXs2lkPGfP/99zNnzozpAJB6O3fu3LZtW6yFTHr22WdjOgCkW0tLy+LFi0dHR2MnZNLIyIgzhQDZsmPHjldeeSUWQoa1t7fHjABIq3nz5i1btuz06dOxDTLs5MmTNoUAWbF169a1a9fGKsi8pqammBQAqVQqlY4ePRp7IPMGBgZiUgCkT1tbW11d3djYWOyBzEsy8ekoQPq9+eab2byz6GQ888wzMS8AUubFF188ceJEbAAeGBoainkBkCYLFy7M5/PXr1+PDcADSTIzZsyIqQGQGj09PevWrYvLPw9paGiIqQGQGv39/QcPHoxrPw/p7e2NqQGQGmvXrh0eHo5rPw85duxYTA2AdKivr6+qqhofH49rPw9J8nGaECCdOjo62tra4sLPBLlcLmYHQAps3Lhx8+bNcdVngkKhELMDIAVKpdKBAwfiqs8E3d3dMTsAUmDTpk1ffPFFXPWZYO/evTE7AFKgs7Pz1KlTcdVngk8//TRmB0AKFIvFH374Ia76TPD111/H7ABIgdbW1l9//TWu+kzw3XffxewASIH58+dfvnw5rvpM8NNPP8XsAEiBfD5/48aNuOozwdjYWMwOgBQoLy+/d+9eXPWZ4ObNmzE7AFKgurrajnAyLl68GLMDIAWam5udI5yMc+fOxewASIElS5a4anQyvvnmm5gdACnQ3t7ue4ST8eWXX8bsAEiBVatWubPMZAwODsbsAEiBrq4u9xqdjNdffz1mB0AKJEXo6ROTUSwWY3YApEB7e7vnEU5GXV1dzA6AFKipqfGE+skoLy+P2QGQDpWVlePj43Hh5yEXLlyIqQGQGsuXLx8eHo5rPw85cOBATA2A1Fi1atXBgwfj2s9DVq5cGVMDIDUaGhrWrVsX134eUlFREVMDIE3mzJlz/fr1uPzzwOjoaMwLgJRpa2s7ceJEbAAe2LFjR8wLgJRZsGBBf39/bAAeqK6ujnkBkD75fH5sbCyWQOadPHkyJgVAKq1YseLo0aOxBzJvw4YNMSkAUmnu3LmdnZ2xB7Lt5s2bM2fOjEkBkFaNjY2nT5+ObZBh+/btixkBkGJ1dXWbNm2KbZBVd+7cyeVyMSMA0m3evHmjo6OxEzLp0KFDMR0AUq+hoWHr1q2xE7Ln7t27c+bMiekAkAW1tbVnz56NzZAxzg4CZFdlZWWxWLx3714sh8y4dOlSWVlZzAWA7Ghubh4aGor9kBlr1qyJiQCQNTU1NVeuXIkVkQHHjx+PWQCQQUkRlkql2BJpd/Xq1crKypgFANlUV1f3ySefxK5Ir99//71YLMYUAMiyfD5//vz52BgptX///jh/ADKuvLx84cKF165di6WROsPDwzNmzIjzB4Cqqqrnn3/+9u3bsTpS5JdffqmoqIgzB4A/VVdXb9my5f79+7FAUuHy5ctuIgPA/5DP5/fs2RM7ZPr77bffGhoa4mwBYKJkXzgwMBCbZDq7fv16oVCI8wSAv1JVVfXuu++m4zPSy5cv2wsC8H+rrKwslUrT/dqZn3/+2XlBAP6mXC7X2dk5fb9TMTw87BpRAB5JWVlZfX39dPyu/f79+31fEIB/xuzZsw8fPhyrZqq6evWqO6gB8A+rqKhYv3791H9OxfHjx91NG4DHJdkaDg4OTs1n+V66dMnzBQF47GbOnNnS0nLmzJlYRE/P3bt3P/roo/Ly8jhWAHhMkjrs6OgYGRmJpfRk3blz59ChQ74gAcDTkWzC2tvbv/3221hQj9/4+Pi+fftyuVwcEwA8YUkdNjU1DQwMjI2Nxb56DE6ePLlhw4ZkSxrHAQBPV1lZWbJBHBoaunHjRqyvR/bjjz++9dZb1dXV8V0BYKqZMWNGQ0NDb2/vsWPHxsfHY6dN2oULFw4cOLBy5Uo3iAFgGsvlcoVCobu7+4MPPjhy5MhXX3115syZ8+fP37p1K2m7ixcvJj8ODw9/9tlng4ODr732WrFYrK2tdRUoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCF/BvApcL8emCdpAAAAABJRU5ErkJggg==",F9=Object.freeze(Object.defineProperty({__proto__:null,default:I9},Symbol.toStringTag,{value:"Module"})),j9="/assets/post1_2-kWKlVks6.gif",H9=Object.freeze(Object.defineProperty({__proto__:null,default:j9},Symbol.toStringTag,{value:"Module"})),k9="/assets/post1_3-CoM2yJ51.gif",V9=Object.freeze(Object.defineProperty({__proto__:null,default:k9},Symbol.toStringTag,{value:"Module"})),G9="/assets/post2_1-CsoDaNpx.gif",X9=Object.freeze(Object.defineProperty({__proto__:null,default:G9},Symbol.toStringTag,{value:"Module"})),q9="/assets/post2_2-DpsCAzZ-.gif",Y9=Object.freeze(Object.defineProperty({__proto__:null,default:q9},Symbol.toStringTag,{value:"Module"})),W9="/assets/post3_1-CaHNN6jh.gif",Z9=Object.freeze(Object.defineProperty({__proto__:null,default:W9},Symbol.toStringTag,{value:"Module"})),K9="/assets/post3_2-0Zz24XNs.gif",Q9=Object.freeze(Object.defineProperty({__proto__:null,default:K9},Symbol.toStringTag,{value:"Module"})),J9="/assets/post4_1-B1MZSVX9.gif",$9=Object.freeze(Object.defineProperty({__proto__:null,default:J9},Symbol.toStringTag,{value:"Module"})),e7="/assets/post4_2-DOy_BHSk.gif",t7=Object.freeze(Object.defineProperty({__proto__:null,default:e7},Symbol.toStringTag,{value:"Module"})),ZS=Object.assign({"../images/learnprocessing/post1_1.png":F9,"../images/learnprocessing/post1_2.gif":H9,"../images/learnprocessing/post1_3.gif":V9,"../images/learnprocessing/post2_1.gif":X9,"../images/learnprocessing/post2_2.gif":Y9,"../images/learnprocessing/post3_1.gif":Z9,"../images/learnprocessing/post3_2.gif":Q9,"../images/learnprocessing/post4_1.gif":$9,"../images/learnprocessing/post4_2.gif":t7}),Wr={};for(const a in ZS){const e=ZS[a].default,t=a.split("/").pop();Wr[t]=e}const n7=`// setup function +void setup() { + size(600, 600); + background(0); + ellipse(width/2, height/2, 100, 100); +} + +// render function +void draw() { + // what do we want to make happen? +}`,i7=`int x, y; +int speed = 5; + +// setup function +void setup() { + size(600, 600); + background(0); + x = width/2; + y = height/2; +} + +// render function +void draw() { + ellipse(x, y, 100, 100); + x += speed; + if (x >= width) { + x = 0; + } +}`,a7=`int x, y; +int speed = 5; + +// setup function +void setup() { + size(600, 600); + background(0); + x = width/2; + y = height/2; +} + +// render function +void draw() { + background(0); + ellipse(x, y, 100, 100); + x += speed; + if (x >= width) { + x = 0; + } +}`,s7=`float x, y; // starting position of the shape +float len = 10; // length of the shape +float speed = 5; // fall speed + +void setup() { + size(600, 480); + x = width/2; + y = 0; +} + +void draw() { + background(200); + strokeWeight(4); + stroke(0, 0, 200); + line(x, y, x, y+len); + y += speed; +}`,r7=`class Drop { + float x = random(width); // random horizontal position + float y = random(-500, -100); // random height, can be offscreen + float z = random(0, 20); // create sense of depth + float len = map(z, 0, 20, 10, 20); // length of Drop + float yspeed = map(z, 0, 20, 4, 10); // speed of Drop + + // fall & reset method + void fall() { + y = y + yspeed; + + if (y > height) { + y = random(-200, -100); + yspeed = map(z, 0, 20, 4, 10); + } + } + + // display method + void show() { + float thick = map(z, 0, 20, 1, 3); + strokeWeight(thick); + stroke(0, 0, 200); + line(x, y, x, y+len); + } +}`,o7=`// initialize array of 500 Drop objects +Drop[] drops = new Drop[500]; + +// setup function +void setup() { + size(600, 480); + + // loop through and create a new Drop for every index + for (int i = 0; i < drops.length; i++) { + drops[i] = new Drop(); + } +} + +// render function +void draw() { + background(200); + + // each frame, show and update the new location + for (int i = 0; i < drops.length; i++) { + drops[i].show(); + drops[i].fall(); + } +}`,l7=`// setup function +void setup() { + size(600, 600); + colorMode(HSB); // hue, saturation, brightness +} + +// render function +void draw() { + background(0); + float shift = map(frameCount%60, 0, 60, 0, 255); + + for (int r = 900; r > 0; r -= 20) { + strokeWeight(4); + stroke((r+shift)%255, 255, 255); + noFill(); + ellipse(width/2, height/2, r, r); + } + + // uncomment to export + // saveFrame("output/gif-"+nf(frameCount, 3)+".png"); + + // if (frameCount == 60) { + // exit(); + // } +}`,c7=`// setup function +void setup() { + size(600, 600); + colorMode(HSB); +} + +// render function +void draw() { + background(0); + float shift = map(frameCount%60, 0, 60, 0, 255); + + for (int r = 900; r > 0; r -= 20) { + strokeWeight(4); + stroke((r+shift)%255, 255, 255); + noFill(); + ellipse(width/2, height/2, r, r); + } + + for (int r = 10; r < 900; r += 20) { + strokeWeight(4); + stroke((r+255-shift)%255, 255, 255); + noFill(); + ellipse(width/2, height/2, r, r); + } + + // uncomment to export + // saveFrame("output/gif-"+nf(frameCount, 3)+".png"); + + // if (frameCount == 60) { + // exit(); + // } +}`,u7=`// setup function +void setup() { + size(800, 800, P3D); // use 3D renderer + colorMode(HSB); // hue, saturation, brightness +} + +// render function +void draw() { + background(0); + translate(width/2, height/2); // translate origin to center + + rotateX(radians(60)); // comment this line out for 2D top view + + noFill(); + strokeWeight(3); + + for (int i = 0; i < 55; i++) { + // define line color using frame count and circle position + float strokeCol = map(sin(radians(frameCount + i * 10)), -1, 1, 0, 255); + stroke(strokeCol, 255, 255); + + // beginShape & endShape for custom shapes + beginShape(); + for (int j = 0; j < 360; j += 5) { + int rad = i * 5; + float x = rad * cos(radians(j)); + float y = rad * sin(radians(j)); + float z = sin(radians(frameCount + i * 10)) * 200; + vertex(x, y, z); + } + endShape(CLOSE); + } +}`,f7=[{id:0,body:({goTo:a})=>R.jsxs(R.Fragment,{children:[R.jsxs("p",{children:[`Processing is an incredible application, allowing users to create amazing visuals in both 2D and 3D with just some knowledge of Java. In this blog series, I will be documenting my learning journey, both to "think aloud" as well as to share the cool things I make. If you'd like to follow along and learn with me, go ahead and`," ",R.jsx("a",{href:"https://processing.org/download",target:"_blank",children:"download"})," ","Processing on your machine."]}),R.jsx("hr",{}),R.jsxs("p",{children:["i."," ",R.jsx("button",{onClick:()=>a(1),className:"page-link",children:"Introduction"})]}),R.jsxs("p",{children:["ii."," ",R.jsx("button",{onClick:()=>a(2),className:"page-link",children:"Getting Started"})]}),R.jsxs("p",{children:["iii."," ",R.jsx("button",{onClick:()=>a(3),className:"page-link",children:"Using Classes"})]}),R.jsxs("p",{children:["iv."," ",R.jsx("button",{onClick:()=>a(4),className:"page-link",children:"Controlled Looping"})]}),R.jsxs("p",{children:["v."," ",R.jsx("button",{onClick:()=>a(5),className:"page-link",children:"Dipping Into 3D"})]})]})},{id:1,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"i. Introduction"}),R.jsxs("p",{children:["Before I begin, let me also shout out two amazing resources I've been using to learn. It's always good to read the docs - and Processing has pretty high quality ones - but this journey has been made so much more fun thanks to"," ",R.jsx("a",{href:"https://twitter.com/shiffman",target:"_blank",children:"Daniel Shiffman"})," ","and his channel"," ",R.jsx("a",{href:"https://www.youtube.com/@TheCodingTrain",target:"_blank",children:"The Coding Train"}),". You'll see his name on a lot of the Processing docs, and he has put an insane amount of effort into making hundreds of videos to teach you the fundamentals of Processing and even programming in general. In particular, I watched almost the entirety of his"," ",R.jsx("a",{href:"https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",target:"_blank",children:"Coding Challenges"})," ","playlist, and I still refer back to a handful of them when trying to brainstorm new creations."," "]}),R.jsxs("p",{children:["The other creator I must thank is"," ",R.jsx("a",{href:"https://www.youtube.com/@thedotisblack",target:"_blank",children:"thedotisblack"}),". On his channel, you can dive right into some incredibly cool animations and see how he makes them. I've picked up a few neat tricks from what he's shared and I'm sure I will be inspired by him again. Sometimes when I am stumped, I'll just browse through his videos to remind myself of the kinds of things I hope to create and hop right back in!"]}),R.jsx("p",{children:"Since I am still pretty early in my journey, there are bound to be other resources and creators I find along the way. If you come across any art or artist you'd like to share with me, feel free to send me a message or email!"}),R.jsx("p",{children:"Now... let's get to it!"})]})},{id:2,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"ii. Getting Started"}),R.jsxs("p",{children:[" ","When creating animations with Processing, there are two core functions that need to be invoked - ",R.jsx("i",{children:"setup()"}),"and",R.jsx("i",{children:"draw()"}),". In the ",R.jsx("i",{children:"setup()"})," function, we can do things like set the canvas dimensions, assign values to global variables, instantiate objects for later manipulation, and any other steps that need to happen on or before the first frame. Then, in ",R.jsx("i",{children:"draw()"}),", we can apply transformations, scaling, variable recalculation, and lots more to bring the canvas to life. Each unit of time in our case here is a single frame, or one whole execution of the ",R.jsx("i",{children:"draw()"})," ","function."]}),R.jsx(Ys,{code:n7,language:"java"}),R.jsxs("p",{children:["In this example, we're setting our canvas to 600px by 600px and giving it a black background. Although the default color mode is RGB and usually requires 3 values, we can shorthand black and white with 0 and 255 respectively. When creating the ellipse, you'll notice I used variables called ",R.jsx("i",{children:"width"})," and ",R.jsx("i",{children:"height"})," without ever creating or assigning them. That's because Processing holds on to a number of system variables as well - ",R.jsx("i",{children:"width"})," and",R.jsx("i",{children:"height"})," being the dimensions of the canvas itself. By setting the center of the ellipse to half the width and height of the canvas, we ensure it will be centered in our view even if we were to set the dimensions to something other than (600, 600)."]}),R.jsx("img",{src:Wr["post1_1.png"],className:"blog-entry-image",title:"White Circle Black Background"}),R.jsxs("p",{children:["Now, we initialize some variables globally, since we would like to change them later on within the ",R.jsx("i",{children:"draw()"}),"scope. The variables ",R.jsx("i",{children:"x"})," and ",R.jsx("i",{children:"y"})," are set to half the width and height so that we can simplify our formulas, while ",R.jsx("i",{children:"speed"})," is set to an arbitrary value of 5. We can play with this one to adjust how quickly the circle will slide."," "]}),R.jsx(Ys,{code:i7,language:"java"}),R.jsxs("p",{children:["This time around, we create our ellipse within ",R.jsx("i",{children:"draw()"})," because we want to be able to change where we place it and draw its new location each frame. We also add a check for when ",R.jsx("i",{children:"x"})," goes beyond the width of the canvas, setting it back to 0 which would send it back to the left side. Everything seems about right, so then how does it look?"," "]}),R.jsx("img",{src:Wr["post1_2.gif"],className:"blog-entry-image",title:"White Circle Trail Gif"}),R.jsx("p",{children:"Wait a second... ah, that's right. Currently, when we draw new frames, they are being overlaid on each other and creating this trailing effect. It looks cool, but wasn't quite what we wanted. Luckily, this is an easy fix."}),R.jsx(Ys,{code:a7,language:"java"}),R.jsx("img",{src:Wr["post1_3.gif"],className:"blog-entry-image",title:"White Circle Motion Gif"}),R.jsx("p",{children:"Excellent!"}),R.jsxs("p",{children:["As we'll see in later entries, both methods can be utilised depending on the context and type of effect we are going for. Next time, we'll look at the ",R.jsx("i",{children:"map()"})," function for rescaling values as well as the"," ",R.jsx("i",{children:"random()"}),"function for some of its clever uses. Thanks for reading and see you in the next one!"]})]})},{id:3,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"iii. Using Classes"}),R.jsx("p",{children:"Now that we have a basic grasp of the two core functions and getting a shape on screen, why not try to make something truly generative? One of the first examples I learned was to create a raining effect, so let's go through that together. Let's first try and get a basic shape to fall from the top of the screen to the bottom, and then extend that logic."}),R.jsx(Ys,{code:s7,language:"java"}),R.jsx("img",{src:Wr["post2_1.gif"],className:"blog-entry-image",title:"Single Raindrop Gif"}),R.jsxs("p",{children:["This gives us a line segment drawn in the center of the screen with weight 4, and it falls at a rate of 5 pixels per frame. If we want to extend this to mimic falling rain, then we can use this basic behavior in the form of a Drop class. To do this in Processing, we just create a new tab and name it Drop. Instead of creating global variables in our main file, we can instead have these be inherent properties of a Drop. At time of creation, we can assign a Drop a new starting height, fall speed, stroke weight, or really anything we want."," "]}),R.jsx(Ys,{code:r7,language:"java"}),R.jsxs("p",{children:["Two functions are doing a lot of the heavy lifting in here -"," ",R.jsx("i",{children:"random()"})," and ",R.jsx("i",{children:"map()"}),". The ",R.jsx("i",{children:"random()"}),"function gives us a number in the given range of two arguments, or a number from 0 to the given single argument. It is being used in this class for multiple purposes, such as giving the Drop a random starting position, both horizontally and vertically. These values are such that a new Drop may start well offscreen before passing through the visible canvas. The value of ",R.jsx("i",{children:"z"})," here lets us do some neat tricks to create a sense of depth despite rendering in 2D, with the use of the"," ",R.jsx("i",{children:"map()"})," function. To use this function, we tell it a value, its original range, and then the new range to which to scale it. This means we can take the value of ",R.jsx("i",{children:"z"})," and use it to inform multiple features of the Drop, like its stroke weight and fall speed, allowing us to give each Drop a separated, staggered animation for falling."]}),R.jsxs("p",{children:["Now that we've defined the class and its methods, we can go back to our main script to initialize, draw, and update a large number of Drops. Since most of our behavior and logic is stored in the Drop class, we should have pretty simple ",R.jsx("i",{children:"setup()"})," and ",R.jsx("i",{children:"draw()"})," ","functions."]}),R.jsx(Ys,{code:o7,language:"java"}),R.jsx("img",{src:Wr["post2_2.gif"],className:"blog-entry-image",title:"Rain Simulation Gif"}),R.jsx("p",{children:"If you were to run this in Processing, it would appear to rain endlessly. Unfortunately, having to export to gif means I have to use a limited number of frames. In fact, this may even motivate a shift over to p5.js at some point, the Javascript library built to support a lot of the same functionality as Processing. However, before moving on, there are still more fundamentals to Processing to discuss!"}),R.jsxs("p",{children:["Now that we've built and utilized a Class, we can certainly imagine how dynamic some of our creations can be. Just like ",R.jsx("i",{children:"random()"})," ","and ",R.jsx("i",{children:"map()"}),", there are lots of functions available to us that are simple in concept, yet lead to awesome results. Next time, we'll take a look at involving a morphing color palette. Additionally, we'll even try to solve the problem of having limited frames for gif uploads - is there a way we can ensure a smooth loop in a limited frame count?"]}),R.jsx("p",{children:"Thanks for reading and see you next time!"})]})},{id:4,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"iv. Controlled Looping"}),R.jsx("p",{children:"Technically, we've already achived a smooth loop in one of our first examples - the white circle moving right then reseting to the left. Let's take a quick look at it again to see how it was achieved."}),R.jsx("img",{src:Wr["post1_3.gif"],className:"blog-entry-image",title:"White Circle Motion Gif"}),R.jsxs("p",{children:["Remember when I told you that Processing provides us with a number of system variables? It's time I introduce the",R.jsx("i",{children:"frameCount"})," variable, a counter that is incremented by Processing for us on every render cycle of the",R.jsx("i",{children:"draw()"})," function. In the case of the moving circle, I knew I would achieve a loop at 120 frames, based on the width of the canvas and the travel speed (x displacement). By having Processing export a .png image every frame, I can hard stop the program after 120 images, and then use some other method of stitching them together into a gif (I use"," ",R.jsx("a",{href:"https://ezgif.com/maker",target:"_blank",children:"ezgif.com"}),")."]}),R.jsxs("p",{children:["The uses of ",R.jsx("i",{children:"frameCount"})," don't stop there - it can even be leveraged for some great artistic generations using colors. You may have once seen colors expressed in a color wheel, showing how various hues can blend into each other seamlessly and eventually loop back to the start. If we can somehow make use of this seamless transitioning, then we should be able to have our colors loop as well."]}),R.jsx(Ys,{code:l7,language:"java"}),R.jsx("img",{src:Wr["post3_1.gif"],className:"blog-entry-image",title:"Color Circles A 60 Frames"}),R.jsxs("p",{children:['Couple of things to note - the default color mode in Processing is RGB, where the color is based on values of red, green, and blue. By using color mode HSB, we instead need to provide a hue, saturation, and brightness. In this mode, going from 0 to 255 lets us traverse the "color wheel", meaning it can neatly loop. The other clever trick being used is the modulo operator in combination with the ',R.jsx("i",{children:"map()"})," ","function. With this, we are telling Processing that we want to divide the current ",R.jsx("i",{children:"frameCount"})," by 60, and use this remainder to inform what color to use. This means, every 60 frames, we should traverse the color wheel one time. To export, we would just un-comment the lines at the bottom and our images would save in an /output folder of our sketch."]}),R.jsxs("p",{children:["All in all, the output is pretty mesmerizing! Since our loop has the radius of each concentric circle decreasing by 20, what would happen if we create a new set of circles offset from these and have the colors of those propogate outwards instead of inwards? Something like this:"," "]}),R.jsx(Ys,{code:c7,language:"java"}),R.jsx("img",{src:Wr["post3_2.gif"],className:"blog-entry-image",title:"Color Circles B 60 Frames"}),R.jsx("p",{children:"Now that is cool! And all just in 60 frames!"}),R.jsx("p",{children:"I am still currently going through some videos of my own, so no concrete plans yet on the subject of the next entry. At the moment, I am playing around with map generation, noise algorithms, and cellular automata, but with such a vast number of ideas and topics to play with, it's hard to pick just a few! But as always, thank you for reading and I'll see you in the next one."})]})},{id:5,body:()=>R.jsxs(R.Fragment,{children:[R.jsx("h3",{children:"v. Dipping Into 3D"}),R.jsxs("p",{children:["I've been playing around with 3D more recently, and now that I've made something cool enough to share, I thought it would be nice to show you how it works in code and I will do my best to walk you through how to make something like this on your own! One change you might notice immediately in the code below is the addition of a new argument in the"," ",R.jsx("i",{children:"size()"}),"function - this is how we tell Processing to use a 3D renderer, in this case P3D."," "]}),R.jsx(Ys,{code:u7,language:"java"}),R.jsxs("p",{children:["Here is what this sketch will look like if we comment out the"," ",R.jsx("i",{children:"rotateX()"}),' function, meaning our sketch is still functionally 2D like the others. This is basically our "top view".']}),R.jsx("img",{src:Wr["post4_1.gif"],className:"blog-entry-image",title:"Sine 3D Circles Top View"}),R.jsxs("p",{children:["First, you can probably notice a similar pattern to a previous post where I use the global variable",R.jsx("i",{children:"frameCount"})," to inform my sketch on what to color something. By also using the loop variable ",R.jsx("i",{children:"i"}),", it can also be offset by the position of the shape itself. Next, instead of calling"," ",R.jsx("i",{children:"ellipse()"})," like I have before, I am instead using"," ",R.jsx("i",{children:"beginShape()"})," and ",R.jsx("i",{children:"endShape()"}),", a pair of functions that can be used to define a custom shape with calls to ",R.jsx("i",{children:"vertex()"})," ","between them. In this example, I am using the loop variable ",R.jsx("i",{children:"j"})," ","to increment around the radius and place a vertex at a number of equally spaced points. The ",R.jsx("i",{children:"CLOSE"})," argument simply tells Processing to close off the shape by connecting the final vertex with the first one. A smaller increment means more vertices, meaning our shape is closer to resembling a circle. I encourage you to try this with larger increments, or even dynamic increments to see what sort of shapes and patterns you might get!"]}),R.jsxs("p",{children:["Now let's have our big reveal. By applying ",R.jsx("i",{children:"rotateX()"})," (and remember, we have to supply our angle in radians), we tell our renderer to perform the necessary transformations for the illusion of depth. Now our Z axis comes fully into view."," "]}),R.jsx("img",{src:Wr["post4_2.gif"],className:"blog-entry-image",title:"Sine 3D Circles"}),R.jsxs("p",{children:["Another satisfying and smooth loop! Thanks to the oscillatory nature of the sine function, we are able to capture the entirety of one phase, export our frames, and stitch it together into a nice gif!"," "]})]})}],d7=[{id:0,body:()=>R.jsx("article",{className:"detail-pane",children:R.jsxs("section",{className:"detail-pane-body",children:[R.jsxs("div",{className:"about-photo-wrapper",children:[R.jsx("img",{src:sU,className:"about-photo base",alt:""}),R.jsx("img",{src:rU,className:"about-photo hover",alt:""})]}),R.jsxs("ul",{children:[R.jsx("li",{children:"Software Engineer, Game Developer, Data Scientist"}),R.jsx("li",{children:"I am 34 years old and live in Boston "}),R.jsx("li",{children:"English (Fluent), Marathi (Conversational), Hindi (Basic)"}),R.jsx("li",{children:"MS in Computer Science from Boston University"}),R.jsx("li",{children:"BS in Mathematics from UMass Amherst"}),R.jsx("li",{children:"Self-taught guitar, bass guitar, piano for ~20 years"}),R.jsx("li",{children:"Definitely a cat person but love dogs too"}),R.jsx("li",{children:"In my free time I'm probably playing/writing music, gaming, or waiting for my next D&D session"})]})]})})}],h7=[{id:0,body:()=>R.jsx(bU,{})}],p7=[{id:0,body:()=>R.jsx(jS,{})},{id:1,body:()=>R.jsx(jS,{})}],tw={about:{id:"about",label:"About Me",description:"My background, skills, and hobbies",entries:d7,hideNav:!0},guestbook:{id:"guestbook",label:"Guestbook",description:"Contact me!",entries:h7,hideNav:!0},ue5color:{id:"ue5color",label:"UE5 Color Puzzle",description:"Creating a puzzle game with UE5 Blueprints",entries:bz,hideNav:!1},ue5hex:{id:"ue5hex",label:"UE5 Hex Grid",description:"Creating a procedural hex grid in UE5 with C++",entries:B9,hideNav:!1},learnprocessing:{id:"learnprocessing",label:"Learn Processing",description:"Making Art with Code",entries:f7,hideNav:!1},roadtrip2020:{id:"roadtrip2020",label:"Roadtrip 2020",description:"A journal of my cross-country adventure",entries:hz,hideNav:!1},twelvetone:{id:"twelvetone",label:"12-Tone Atonal Matrix",description:"The Algorithm of Atonal Music",entries:p7,hideNav:!1}},m7=Object.values(tw),g7=({planet:a,openDetail:e})=>{const t=n=>{e&&e(`blog:${n}`)};return R.jsxs("div",{className:"blog-info",children:[R.jsx("h2",{children:a.label}),R.jsx("p",{children:"Dev logs, writeups, and thoughts."}),R.jsx("ul",{className:"info-item-list",children:m7.map(n=>R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:n.label,description:n.description,onActivate:()=>t(n.id)})},n.id))})]})},y7="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2019.0.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20304%20182'%20style='enable-background:new%200%200%20304%20182;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23252F3E;}%20.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23FF9900;}%20%3c/style%3e%3cg%3e%3cpath%20class='st0'%20d='M86.4,66.4c0,3.7,0.4,6.7,1.1,8.9c0.8,2.2,1.8,4.6,3.2,7.2c0.5,0.8,0.7,1.6,0.7,2.3c0,1-0.6,2-1.9,3l-6.3,4.2%20c-0.9,0.6-1.8,0.9-2.6,0.9c-1,0-2-0.5-3-1.4C76.2,90,75,88.4,74,86.8c-1-1.7-2-3.6-3.1-5.9c-7.8,9.2-17.6,13.8-29.4,13.8%20c-8.4,0-15.1-2.4-20-7.2c-4.9-4.8-7.4-11.2-7.4-19.2c0-8.5,3-15.4,9.1-20.6c6.1-5.2,14.2-7.8,24.5-7.8c3.4,0,6.9,0.3,10.6,0.8%20c3.7,0.5,7.5,1.3,11.5,2.2v-7.3c0-7.6-1.6-12.9-4.7-16c-3.2-3.1-8.6-4.6-16.3-4.6c-3.5,0-7.1,0.4-10.8,1.3c-3.7,0.9-7.3,2-10.8,3.4%20c-1.6,0.7-2.8,1.1-3.5,1.3c-0.7,0.2-1.2,0.3-1.6,0.3c-1.4,0-2.1-1-2.1-3.1v-4.9c0-1.6,0.2-2.8,0.7-3.5c0.5-0.7,1.4-1.4,2.8-2.1%20c3.5-1.8,7.7-3.3,12.6-4.5c4.9-1.3,10.1-1.9,15.6-1.9c11.9,0,20.6,2.7,26.2,8.1c5.5,5.4,8.3,13.6,8.3,24.6V66.4z%20M45.8,81.6%20c3.3,0,6.7-0.6,10.3-1.8c3.6-1.2,6.8-3.4,9.5-6.4c1.6-1.9,2.8-4,3.4-6.4c0.6-2.4,1-5.3,1-8.7v-4.2c-2.9-0.7-6-1.3-9.2-1.7%20c-3.2-0.4-6.3-0.6-9.4-0.6c-6.7,0-11.6,1.3-14.9,4c-3.3,2.7-4.9,6.5-4.9,11.5c0,4.7,1.2,8.2,3.7,10.6%20C37.7,80.4,41.2,81.6,45.8,81.6z%20M126.1,92.4c-1.8,0-3-0.3-3.8-1c-0.8-0.6-1.5-2-2.1-3.9L96.7,10.2c-0.6-2-0.9-3.3-0.9-4%20c0-1.6,0.8-2.5,2.4-2.5h9.8c1.9,0,3.2,0.3,3.9,1c0.8,0.6,1.4,2,2,3.9l16.8,66.2l15.6-66.2c0.5-2,1.1-3.3,1.9-3.9c0.8-0.6,2.2-1,4-1%20h8c1.9,0,3.2,0.3,4,1c0.8,0.6,1.5,2,1.9,3.9l15.8,67l17.3-67c0.6-2,1.3-3.3,2-3.9c0.8-0.6,2.1-1,3.9-1h9.3c1.6,0,2.5,0.8,2.5,2.5%20c0,0.5-0.1,1-0.2,1.6c-0.1,0.6-0.3,1.4-0.7,2.5l-24.1,77.3c-0.6,2-1.3,3.3-2.1,3.9c-0.8,0.6-2.1,1-3.8,1h-8.6c-1.9,0-3.2-0.3-4-1%20c-0.8-0.7-1.5-2-1.9-4L156,23l-15.4,64.4c-0.5,2-1.1,3.3-1.9,4c-0.8,0.7-2.2,1-4,1H126.1z%20M254.6,95.1c-5.2,0-10.4-0.6-15.4-1.8%20c-5-1.2-8.9-2.5-11.5-4c-1.6-0.9-2.7-1.9-3.1-2.8c-0.4-0.9-0.6-1.9-0.6-2.8v-5.1c0-2.1,0.8-3.1,2.3-3.1c0.6,0,1.2,0.1,1.8,0.3%20c0.6,0.2,1.5,0.6,2.5,1c3.4,1.5,7.1,2.7,11,3.5c4,0.8,7.9,1.2,11.9,1.2c6.3,0,11.2-1.1,14.6-3.3c3.4-2.2,5.2-5.4,5.2-9.5%20c0-2.8-0.9-5.1-2.7-7c-1.8-1.9-5.2-3.6-10.1-5.2L246,52c-7.3-2.3-12.7-5.7-16-10.2c-3.3-4.4-5-9.3-5-14.5c0-4.2,0.9-7.9,2.7-11.1%20c1.8-3.2,4.2-6,7.2-8.2c3-2.3,6.4-4,10.4-5.2c4-1.2,8.2-1.7,12.6-1.7c2.2,0,4.5,0.1,6.7,0.4c2.3,0.3,4.4,0.7,6.5,1.1%20c2,0.5,3.9,1,5.7,1.6c1.8,0.6,3.2,1.2,4.2,1.8c1.4,0.8,2.4,1.6,3,2.5c0.6,0.8,0.9,1.9,0.9,3.3v4.7c0,2.1-0.8,3.2-2.3,3.2%20c-0.8,0-2.1-0.4-3.8-1.2c-5.7-2.6-12.1-3.9-19.2-3.9c-5.7,0-10.2,0.9-13.3,2.8c-3.1,1.9-4.7,4.8-4.7,8.9c0,2.8,1,5.2,3,7.1%20c2,1.9,5.7,3.8,11,5.5l14.2,4.5c7.2,2.3,12.4,5.5,15.5,9.6c3.1,4.1,4.6,8.8,4.6,14c0,4.3-0.9,8.2-2.6,11.6%20c-1.8,3.4-4.2,6.4-7.3,8.8c-3.1,2.5-6.8,4.3-11.1,5.6C264.4,94.4,259.7,95.1,254.6,95.1z'/%3e%3cg%3e%3cpath%20class='st1'%20d='M273.5,143.7c-32.9,24.3-80.7,37.2-121.8,37.2c-57.6,0-109.5-21.3-148.7-56.7c-3.1-2.8-0.3-6.6,3.4-4.4%20c42.4,24.6,94.7,39.5,148.8,39.5c36.5,0,76.6-7.6,113.5-23.2C274.2,133.6,278.9,139.7,273.5,143.7z'/%3e%3cpath%20class='st1'%20d='M287.2,128.1c-4.2-5.4-27.8-2.6-38.5-1.3c-3.2,0.4-3.7-2.4-0.8-4.5c18.8-13.2,49.7-9.4,53.3-5%20c3.6,4.5-1,35.4-18.6,50.2c-2.7,2.3-5.3,1.1-4.1-1.9C282.5,155.7,291.4,133.4,287.2,128.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",x7=Object.freeze(Object.defineProperty({__proto__:null,default:y7},Symbol.toStringTag,{value:"Module"})),v7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20image-rendering='optimizeQuality'%20fill-rule='evenodd'%20clip-rule='evenodd'%20viewBox='0%200%20512%20512'%3e%3crect%20fill='%2310A37F'%20width='512'%20height='512'%20rx='104.187'%20ry='105.042'/%3e%3cpath%20fill='%23fff'%20fill-rule='nonzero'%20d='M378.68%20230.011a71.432%2071.432%200%20003.654-22.541%2071.383%2071.383%200%2000-9.783-36.064c-12.871-22.404-36.747-36.236-62.587-36.236a72.31%2072.31%200%2000-15.145%201.604%2071.362%2071.362%200%2000-53.37-23.991h-.453l-.17.001c-31.297%200-59.052%2020.195-68.673%2049.967a71.372%2071.372%200%2000-47.709%2034.618%2072.224%2072.224%200%2000-9.755%2036.226%2072.204%2072.204%200%200018.628%2048.395%2071.395%2071.395%200%2000-3.655%2022.541%2071.388%2071.388%200%20009.783%2036.064%2072.187%2072.187%200%200077.728%2034.631%2071.375%2071.375%200%200053.374%2023.992H271l.184-.001c31.314%200%2059.06-20.196%2068.681-49.995a71.384%2071.384%200%200047.71-34.619%2072.107%2072.107%200%20009.736-36.194%2072.201%2072.201%200%2000-18.628-48.394l-.003-.004zM271.018%20380.492h-.074a53.576%2053.576%200%2001-34.287-12.423%2044.928%2044.928%200%20001.694-.96l57.032-32.943a9.278%209.278%200%20004.688-8.06v-80.459l24.106%2013.919a.859.859%200%2001.469.661v66.586c-.033%2029.604-24.022%2053.619-53.628%2053.679zm-115.329-49.257a53.563%2053.563%200%2001-7.196-26.798c0-3.069.268-6.146.79-9.17.424.254%201.164.706%201.695%201.011l57.032%2032.943a9.289%209.289%200%20009.37-.002l69.63-40.205v27.839l.001.048a.864.864%200%2001-.345.691l-57.654%2033.288a53.791%2053.791%200%2001-26.817%207.17%2053.746%2053.746%200%2001-46.506-26.818v.003zm-15.004-124.506a53.5%2053.5%200%200127.941-23.534c0%20.491-.028%201.361-.028%201.965v65.887l-.001.054a9.27%209.27%200%20004.681%208.053l69.63%2040.199-24.105%2013.919a.864.864%200%2001-.813.074l-57.66-33.316a53.746%2053.746%200%2001-26.805-46.5%2053.787%2053.787%200%20017.163-26.798l-.003-.003zm198.055%2046.089l-69.63-40.204%2024.106-13.914a.863.863%200%2001.813-.074l57.659%2033.288a53.71%2053.71%200%200126.835%2046.491c0%2022.489-14.033%2042.612-35.133%2050.379v-67.857c.003-.025.003-.051.003-.076a9.265%209.265%200%2000-4.653-8.033zm23.993-36.111a81.919%2081.919%200%2000-1.694-1.01l-57.032-32.944a9.31%209.31%200%2000-4.684-1.266%209.31%209.31%200%2000-4.684%201.266l-69.631%2040.205v-27.839l-.001-.048c0-.272.129-.528.346-.691l57.654-33.26a53.696%2053.696%200%200126.816-7.177c29.644%200%2053.684%2024.04%2053.684%2053.684a53.91%2053.91%200%2001-.774%209.077v.003zm-150.831%2049.618l-24.111-13.919a.859.859%200%2001-.469-.661v-66.587c.013-29.628%2024.053-53.648%2053.684-53.648a53.719%2053.719%200%200134.349%2012.426c-.434.237-1.191.655-1.694.96l-57.032%2032.943a9.272%209.272%200%2000-4.687%208.057v.053l-.04%2080.376zm13.095-28.233l31.012-17.912%2031.012%2017.9v35.812l-31.012%2017.901-31.012-17.901v-35.8z'/%3e%3c/svg%3e",b7=Object.freeze(Object.defineProperty({__proto__:null,default:v7},Symbol.toStringTag,{value:"Module"})),_7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cpath%20fill='%239B4F96'%20d='M115.4%2030.7L67.1%202.9c-.8-.5-1.9-.7-3.1-.7-1.2%200-2.3.3-3.1.7l-48%2027.9c-1.7%201-2.9%203.5-2.9%205.4v55.7c0%201.1.2%202.4%201%203.5l106.8-62c-.6-1.2-1.5-2.1-2.4-2.7z'/%3e%3cpath%20fill='%2368217A'%20d='M10.7%2095.3c.5.8%201.2%201.5%201.9%201.9l48.2%2027.9c.8.5%201.9.7%203.1.7%201.2%200%202.3-.3%203.1-.7l48-27.9c1.7-1%202.9-3.5%202.9-5.4V36.1c0-.9-.1-1.9-.6-2.8l-106.6%2062z'/%3e%3cpath%20fill='%23fff'%20d='M85.3%2076.1C81.1%2083.5%2073.1%2088.5%2064%2088.5c-13.5%200-24.5-11-24.5-24.5s11-24.5%2024.5-24.5c9.1%200%2017.1%205%2021.3%2012.5l13-7.5c-6.8-11.9-19.6-20-34.3-20-21.8%200-39.5%2017.7-39.5%2039.5s17.7%2039.5%2039.5%2039.5c14.6%200%2027.4-8%2034.2-19.8l-12.9-7.6zM97%2066.2l.9-4.3h-4.2v-4.7h5.1L100%2051h4.9l-1.2%206.1h3.8l1.2-6.1h4.8l-1.2%206.1h2.4v4.7h-3.3l-.9%204.3h4.2v4.7h-5.1l-1.2%206h-4.9l1.2-6h-3.8l-1.2%206h-4.8l1.2-6h-2.4v-4.7H97zm4.8%200h3.8l.9-4.3h-3.8l-.9%204.3z'/%3e%3c/svg%3e",S7=Object.freeze(Object.defineProperty({__proto__:null,default:_7},Symbol.toStringTag,{value:"Module"})),A7="data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m17.749%2016c0-8.375-6.791-15.167-15.165-15.167h-2.584v6.667h2.584c4.697%200%208.499%203.807%208.499%208.5s-3.801%208.5-8.499%208.5h-2.584v6.667h2.584c8.375%200%2015.165-6.792%2015.165-15.167zm14.251-5.917c0-5.109-4.14-9.249-9.251-9.249h-10.667c2.625%201.645%204.777%203.943%206.245%206.667h4.421c1.428%200%202.584%201.156%202.584%202.583%200%201.428-1.156%202.584-2.584%202.584h-2.583c.417%202.203.417%204.464%200%206.667h2.583c1.423%200%202.584%201.156%202.584%202.584%200%201.432-1.156%202.588-2.584%202.588h-4.421c-1.468%202.724-3.62%205.021-6.245%206.667h10.667c2.163%200%204.256-.76%205.917-2.141%203.921-3.271%204.464-9.099%201.193-13.025%201.385-1.667%202.14-3.76%202.14-5.923z'/%3e%3c/svg%3e",M7=Object.freeze(Object.defineProperty({__proto__:null,default:A7},Symbol.toStringTag,{value:"Module"})),E7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cpath%20fill='%236f7580'%20d='M126.67%2098.44c-4.56%201.16-7.38.05-9.91-3.75-5.68-8.51-11.95-16.63-18-24.9-.78-1.07-1.59-2.12-2.6-3.45C89%2076%2081.85%2085.2%2075.14%2094.77c-2.4%203.42-4.92%204.91-9.4%203.7l26.92-36.13L67.6%2029.71c4.31-.84%207.29-.41%209.93%203.45%205.83%208.52%2012.26%2016.63%2018.67%2025.21%206.45-8.55%2012.8-16.67%2018.8-25.11%202.41-3.42%205-4.72%209.33-3.46-3.28%204.35-6.49%208.63-9.72%2012.88-4.36%205.73-8.64%2011.53-13.16%2017.14-1.61%202-1.35%203.3.09%205.19C109.9%2076%20118.16%2087.1%20126.67%2098.44zM1.33%2061.74c.72-3.61%201.2-7.29%202.2-10.83%206-21.43%2030.6-30.34%2047.5-17.06C60.93%2041.64%2063.39%2052.62%2062.9%2065H7.1c-.84%2022.21%2015.15%2035.62%2035.53%2028.78%207.15-2.4%2011.36-8%2013.47-15%201.07-3.51%202.84-4.06%206.14-3.06-1.69%208.76-5.52%2016.08-13.52%2020.66-12%206.86-29.13%204.64-38.14-4.89C5.26%2085.89%203%2078.92%202%2071.39c-.15-1.2-.46-2.38-.7-3.57q.03-3.04.03-6.08zm5.87-1.49h50.43c-.33-16.06-10.33-27.47-24-27.57-15-.12-25.78%2011.02-26.43%2027.57z'/%3e%3c/svg%3e",w7=Object.freeze(Object.defineProperty({__proto__:null,default:E7},Symbol.toStringTag,{value:"Module"})),T7="data:image/svg+xml,%3csvg%20id='Foreground'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20174.52%2045.8'%3e%3cdefs%3e%3cstyle%3e.cls-1,.cls-2{fill:%23fff;}.cls-1{fill-rule:evenodd;}%3c/style%3e%3c/defs%3e%3ctitle%3eFMOD%20Logo%20White%20-%20Black%20Background%3c/title%3e%3cpath%20class='cls-1'%20d='M375,438.88a5,5,0,1,0,5-4.91A4.93,4.93,0,0,0,375,438.88Zm.9,0a4.07,4.07,0,1,1,4.08,4.24A4.06,4.06,0,0,1,375.87,438.88Zm2.05,2.78h.9v-2.48h1l1.57,2.48h1l-1.65-2.55a1.48,1.48,0,0,0,1.52-1.57c0-1.11-.65-1.65-2-1.65h-2.23Zm.9-5H380c.61,0,1.27.12,1.27.88s-.73,1-1.52,1h-.94Z'%20transform='translate(-210.38%20-398.04)'/%3e%3ccircle%20class='cls-2'%20cx='25.64'%20cy='20.21'%20r='5.12'/%3e%3cpath%20class='cls-2'%20d='M364.41,431a7,7,0,0,0,.49-.9,4.88,4.88,0,0,1,9.21,2.24,4.76,4.76,0,0,1-.4,1.91l-.14.29a16.5,16.5,0,0,1-14.8,9.28,16.19,16.19,0,0,1,0-32.38h.71a16.37,16.37,0,0,1,7.38,2.12V398h9.62v21.9a5.4,5.4,0,0,1-5.18,5.25,11.57,11.57,0,0,1-7.78-2.72,6.56,6.56,0,0,0-4-1.39h-.71a6.57,6.57,0,1,0,5.64,9.94Z'%20transform='translate(-210.38%20-398.04)'/%3e%3cpath%20class='cls-2'%20d='M307.64,427.65a16.19,16.19,0,1,1,16.19,16.19A16.19,16.19,0,0,1,307.64,427.65Zm22.76,0a6.57,6.57,0,1,0-6.57,6.57A6.57,6.57,0,0,0,330.4,427.65Z'%20transform='translate(-210.38%20-398.04)'/%3e%3cpath%20class='cls-2'%20d='M288.07,421.06a1.82,1.82,0,0,0-1.73,1.26l-3.87,13.35a11.38,11.38,0,0,1-21.84,0l-3.87-13.35a1.83,1.83,0,0,0-3.47,0l-3.87,13.35a11.44,11.44,0,0,1-11,8.17h-2.68v-9.6h2.72a1.8,1.8,0,0,0,1.71-1.26l3.87-13.35a11.42,11.42,0,0,1,21.89,0L269.83,433a1.79,1.79,0,0,0,3.43,0l3.87-13.35a11.42,11.42,0,0,1,21.89,0L302.89,433a1.8,1.8,0,0,0,1.71,1.26h2.72v9.6h-2.68a11.43,11.43,0,0,1-11-8.17l-3.87-13.35A1.83,1.83,0,0,0,288.07,421.06Z'%20transform='translate(-210.38%20-398.04)'/%3e%3cpath%20class='cls-2'%20d='M234.77,407.67a6.57,6.57,0,0,0-6.57,6.57v29.61h-9.62V423.38h-8.2v-9.59h8.21A16.19,16.19,0,0,1,234.77,398h9.61v9.62Z'%20transform='translate(-210.38%20-398.04)'/%3e%3c/svg%3e",C7=Object.freeze(Object.defineProperty({__proto__:null,default:T7},Symbol.toStringTag,{value:"Module"})),R7="data:image/svg+xml,%3csvg%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20preserveAspectRatio='xMidYMid%20meet'%20focusable='false'%20style='pointer-events:%20none;%20display:%20block;%20width:%20100%25;%20height:%20100%25;'%20width='977'%20height='602'%20%3e%3cg%3e%3cpath%20d='M4.54,9.46,2.19,7.1a6.93,6.93,0,0,0,0,9.79l2.36-2.36A3.59,3.59,0,0,1,4.54,9.46Z'%20style=''%20fill='%23E8710A'%3e%3c/path%3e%3cpath%20d='M2.19,7.1,4.54,9.46a3.59,3.59,0,0,1,5.08,0l1.71-2.93h0l-.1-.08h0A6.93,6.93,0,0,0,2.19,7.1Z'%20style=''%20fill='%23F9AB00'%3e%3c/path%3e%3cpath%20d='M11.34,17.46h0L9.62,14.54a3.59,3.59,0,0,1-5.08,0L2.19,16.9a6.93,6.93,0,0,0,9,.65l.11-.09'%20style=''%20fill='%23F9AB00'%3e%3c/path%3e%3cpath%20d='M12,7.1a6.93,6.93,0,0,0,0,9.79l2.36-2.36a3.59,3.59,0,1,1,5.08-5.08L21.81,7.1A6.93,6.93,0,0,0,12,7.1Z'%20style=''%20fill='%23F9AB00'%3e%3c/path%3e%3cpath%20d='M21.81,7.1,19.46,9.46a3.59,3.59,0,0,1-5.08,5.08L12,16.9A6.93,6.93,0,0,0,21.81,7.1Z'%20style=''%20fill='%23E8710A'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",D7=Object.freeze(Object.defineProperty({__proto__:null,default:R7},Symbol.toStringTag,{value:"Module"})),N7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cpath%20fill='%23F0DB4F'%20d='M2%201v125h125V1H2zm66.119%20106.513c-1.845%203.749-5.367%206.212-9.448%207.401-6.271%201.44-12.269.619-16.731-2.059-2.986-1.832-5.318-4.652-6.901-7.901l9.52-5.83c.083.035.333.487.667%201.071%201.214%202.034%202.261%203.474%204.319%204.485%202.022.69%206.461%201.131%208.175-2.427%201.047-1.81.714-7.628.714-14.065C58.433%2078.073%2058.48%2068%2058.48%2058h11.709c0%2011%20.06%2021.418%200%2032.152.025%206.58.596%2012.446-2.07%2017.361zm48.574-3.308c-4.07%2013.922-26.762%2014.374-35.83%205.176-1.916-2.165-3.117-3.296-4.26-5.795%204.819-2.772%204.819-2.772%209.508-5.485%202.547%203.915%204.902%206.068%209.139%206.949%205.748.702%2011.531-1.273%2010.234-7.378-1.333-4.986-11.77-6.199-18.873-11.531-7.211-4.843-8.901-16.611-2.975-23.335%201.975-2.487%205.343-4.343%208.877-5.235l3.688-.477c7.081-.143%2011.507%201.727%2014.756%205.355.904.916%201.642%201.904%203.022%204.045-3.772%202.404-3.76%202.381-9.163%205.879-1.154-2.486-3.069-4.046-5.093-4.724-3.142-.952-7.104.083-7.926%203.403-.285%201.023-.226%201.975.227%203.665%201.273%202.903%205.545%204.165%209.377%205.926%2011.031%204.474%2014.756%209.271%2015.672%2014.981.882%204.916-.213%208.105-.38%208.581z'/%3e%3c/svg%3e",O7=Object.freeze(Object.defineProperty({__proto__:null,default:N7},Symbol.toStringTag,{value:"Module"})),U7="/assets/jupyter-Ype1XYD1.svg",L7=Object.freeze(Object.defineProperty({__proto__:null,default:U7},Symbol.toStringTag,{value:"Module"})),z7="/assets/mysql-D3bLP8_A.svg",P7=Object.freeze(Object.defineProperty({__proto__:null,default:z7},Symbol.toStringTag,{value:"Module"})),B7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cpath%20fill='%2383CD29'%20d='M112.678%2030.334L68.535%204.729c-2.781-1.584-6.424-1.584-9.227%200L14.82%2030.334C11.951%2031.985%2010%2035.088%2010%2038.407v51.142c0%203.319%201.992%206.423%204.862%208.083l11.729%206.688c5.627%202.772%207.186%202.772%209.746%202.772%208.334%200%2012.662-5.039%2012.662-13.828v-50.49C49%2042.061%2049.445%2041%2048.744%2041h-5.622C42.41%2041%2041%2042.061%2041%2042.773v50.49c0%203.896-3.616%207.773-10.202%204.48L18.676%2090.73c-.422-.23-.676-.693-.676-1.181V38.407c0-.482.463-.966.891-1.213l44.378-25.561a1.508%201.508%200%20011.415%200l43.963%2025.555c.421.253.354.722.354%201.219v51.142c0%20.488.092.963-.323%201.198l-44.133%2025.576c-.378.227-.87.227-1.285%200l-11.317-6.749c-.341-.198-.752-.269-1.08-.086-3.145%201.783-3.729%202.02-6.679%203.043-.727.253-1.799.692.408%201.929l14.798%208.754a9.29%209.29%200%20004.647%201.246%209.303%209.303%200%20004.666-1.246l43.976-25.582c2.871-1.672%204.322-4.764%204.322-8.083V38.407c-.001-3.319-1.452-6.414-4.323-8.073zM77.727%2081.445c-11.727%200-14.309-3.235-15.17-9.066-.102-.628-.634-1.379-1.274-1.379h-5.73c-.709%200-1.28.86-1.28%201.566%200%207.466%204.06%2016.512%2023.454%2016.512%2014.038%200%2022.088-5.455%2022.088-15.109%200-9.572-6.467-12.084-20.082-13.886-13.762-1.819-15.16-2.738-15.16-5.962%200-2.658%201.184-6.203%2011.374-6.203%209.104%200%2012.46%201.954%2013.841%208.091.119.577.646.991%201.241.991h5.754c.354%200%20.691-.143.939-.396.241-.272.367-.613.336-.979-.893-10.569-7.913-15.494-22.112-15.494-12.632%200-20.166%205.334-20.166%2014.275%200%209.698%207.497%2012.378%2019.622%2013.577%2014.505%201.422%2015.633%203.542%2015.633%206.395%200%204.956-3.978%207.067-13.308%207.067z'/%3e%3c/svg%3e",I7=Object.freeze(Object.defineProperty({__proto__:null,default:B7},Symbol.toStringTag,{value:"Module"})),F7="/assets/p5js-wmXNkn9y.svg",j7=Object.freeze(Object.defineProperty({__proto__:null,default:F7},Symbol.toStringTag,{value:"Module"})),H7="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2026.1.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20128%20128'%20style='enable-background:new%200%200%20128%20128;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:url(%23SVGID_1_);}%20.st1{fill:url(%23SVGID_00000081626747370093821720000015267250794296146357_);}%20.st2{opacity:0.444;fill:url(%23SVGID_00000079446610143081808770000000797593720859904649_);enable-background:new%20;}%20%3c/style%3e%3clinearGradient%20id='SVGID_1_'%20gradientUnits='userSpaceOnUse'%20x1='-10.1478'%20y1='1394.6362'%20x2='109.446'%20y2='1291.7415'%20gradientTransform='matrix(0.563%200%200%20-0.568%205.745%20798.077)'%3e%3cstop%20offset='0'%20style='stop-color:%235A9FD4'/%3e%3cstop%20offset='1'%20style='stop-color:%23306998'/%3e%3c/linearGradient%3e%3cpath%20class='st0'%20d='M63.2,2.4c-5,0-9.8,0.5-14,1.2c-12.5,2.2-14.7,6.8-14.7,15.3V30h29.4v3.8H23.5c-8.6,0-16,5.1-18.4,14.9%20c-2.7,11.3-2.8,18.2,0,30c2.1,8.7,7.1,14.9,15.6,14.9h10.1V80.1c0-9.7,8.4-18.3,18.4-18.3h29.4c8.2,0,14.7-6.7,14.7-14.9v-28%20c0-8-6.7-14-14.7-15.3C73.5,2.7,68.3,2.4,63.2,2.4z%20M47.3,11.4c3.1,0,5.5,2.5,5.5,5.6s-2.5,5.6-5.5,5.6c-3.1,0-5.5-2.5-5.5-5.6%20S44.4,11.4,47.3,11.4z'/%3e%3clinearGradient%20id='SVGID_00000096048730923680182150000005300044793301122730_'%20gradientUnits='userSpaceOnUse'%20x1='155.651'%20y1='1229.4956'%20x2='112.9456'%20y2='1289.9148'%20gradientTransform='matrix(0.563%200%200%20-0.568%205.745%20798.077)'%3e%3cstop%20offset='0'%20style='stop-color:%23FFD43B'/%3e%3cstop%20offset='1'%20style='stop-color:%23FFE873'/%3e%3c/linearGradient%3e%3cpath%20style='fill:url(%23SVGID_00000096048730923680182150000005300044793301122730_);'%20d='M96.9,33.8v13.1c0,10.1-8.6,18.7-18.4,18.7%20H49.3c-8.1,0-14.7,6.9-14.7,14.9v28c0,8,6.9,12.6,14.7,14.9c9.3,2.7,18.2,3.3,29.4,0c7.4-2.1,14.7-6.5,14.7-14.9V97.2H63.9v-3.8H108%20c8.6,0,11.8-6,14.7-14.9c3.1-9.2,3-18.1,0-29.9c-2.1-8.5-6.2-14.9-14.7-14.9H96.9L96.9,33.8z%20M80.5,104.7c3.1,0,5.5,2.5,5.5,5.6%20s-2.5,5.6-5.5,5.6c-3.1,0-5.5-2.5-5.5-5.6C74.9,107.2,77.4,104.7,80.5,104.7z'/%3e%3cradialGradient%20id='SVGID_00000059286236628120045410000011757480241301109387_'%20cx='2247.5142'%20cy='520.2819'%20r='25.7579'%20gradientTransform='matrix(0%20-0.24%20-1.055%200%20612.979%20656.776)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20style='stop-color:%23B8B8B8;stop-opacity:0.498'/%3e%3cstop%20offset='1'%20style='stop-color:%237F7F7F;stop-opacity:0'/%3e%3c/radialGradient%3e%3cpath%20style='opacity:0.444;fill:url(%23SVGID_00000059286236628120045410000011757480241301109387_);enable-background:new%20;'%20d='%20M96.1,117.6c0,3.4-14.3,6.2-31.9,6.2s-31.9-2.8-31.9-6.2c0-3.4,14.3-6.2,31.9-6.2S96.1,114.2,96.1,117.6z'/%3e%3c/svg%3e",k7=Object.freeze(Object.defineProperty({__proto__:null,default:H7},Symbol.toStringTag,{value:"Module"})),V7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='724'%20height='561'%3e%3cdefs%3e%3clinearGradient%20id='g'%20x1='0'%20x2='1'%20y1='0'%20y2='1'%20gradientUnits='objectBoundingBox'%20spreadMethod='pad'%3e%3cstop%20offset='0'%20stop-color='%23cbced0'%20stop-opacity='1'/%3e%3cstop%20offset='1'%20stop-color='%2384838b'%20stop-opacity='1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='0'%20x2='1'%20y1='0'%20y2='1'%20gradientUnits='objectBoundingBox'%20spreadMethod='pad'%3e%3cstop%20offset='0'%20stop-color='%23276dc3'%20stop-opacity='1'/%3e%3cstop%20offset='1'%20stop-color='%23165caa'%20stop-opacity='1'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M361.453,485.937%20C162.329,485.937%200.906,377.828%200.906,244.469%20C0.906,111.109%20162.329,3.000%20361.453,3.000%20C560.578,3.000%20722.000,111.109%20722.000,244.469%20C722.000,377.828%20560.578,485.937%20361.453,485.937%20ZM416.641,97.406%20C265.289,97.406%20142.594,171.314%20142.594,262.484%20C142.594,353.654%20265.289,427.562%20416.641,427.562%20C567.992,427.562%20679.687,377.033%20679.687,262.484%20C679.687,147.971%20567.992,97.406%20416.641,97.406%20Z'%20fill='url(%23g)'%20fill-rule='evenodd'/%3e%3cpath%20d='M550.000,377.000%20C550.000,377.000%20571.822,383.585%20584.500,390.000%20C588.899,392.226%20596.510,396.668%20602.000,402.500%20C607.378,408.212%20610.000,414.000%20610.000,414.000%20L696.000,559.000%20L557.000,559.062%20L492.000,437.000%20C492.000,437.000%20478.690,414.131%20470.500,407.500%20C463.668,401.969%20460.755,400.000%20454.000,400.000%20C449.298,400.000%20420.974,400.000%20420.974,400.000%20L421.000,558.974%20L298.000,559.026%20L298.000,152.938%20L545.000,152.938%20C545.000,152.938%20657.500,154.967%20657.500,262.000%20C657.500,369.033%20550.000,377.000%20550.000,377.000%20ZM496.500,241.024%20L422.037,240.976%20L422.000,310.026%20L496.500,310.002%20C496.500,310.002%20531.000,309.895%20531.000,274.877%20C531.000,239.155%20496.500,241.024%20496.500,241.024%20Z'%20fill='url(%23b'%20fill-rule='evenodd'/%3e%3c/svg%3e",G7=Object.freeze(Object.defineProperty({__proto__:null,default:V7},Symbol.toStringTag,{value:"Module"})),X7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cg%20fill='%2361DAFB'%3e%3ccircle%20cx='64'%20cy='64'%20r='11.4'/%3e%3cpath%20d='M107.3%2045.2c-2.2-.8-4.5-1.6-6.9-2.3.6-2.4%201.1-4.8%201.5-7.1%202.1-13.2-.2-22.5-6.6-26.1-1.9-1.1-4-1.6-6.4-1.6-7%200-15.9%205.2-24.9%2013.9-9-8.7-17.9-13.9-24.9-13.9-2.4%200-4.5.5-6.4%201.6-6.4%203.7-8.7%2013-6.6%2026.1.4%202.3.9%204.7%201.5%207.1-2.4.7-4.7%201.4-6.9%202.3C8.2%2050%201.4%2056.6%201.4%2064s6.9%2014%2019.3%2018.8c2.2.8%204.5%201.6%206.9%202.3-.6%202.4-1.1%204.8-1.5%207.1-2.1%2013.2.2%2022.5%206.6%2026.1%201.9%201.1%204%201.6%206.4%201.6%207.1%200%2016-5.2%2024.9-13.9%209%208.7%2017.9%2013.9%2024.9%2013.9%202.4%200%204.5-.5%206.4-1.6%206.4-3.7%208.7-13%206.6-26.1-.4-2.3-.9-4.7-1.5-7.1%202.4-.7%204.7-1.4%206.9-2.3%2012.5-4.8%2019.3-11.4%2019.3-18.8s-6.8-14-19.3-18.8zM92.5%2014.7c4.1%202.4%205.5%209.8%203.8%2020.3-.3%202.1-.8%204.3-1.4%206.6-5.2-1.2-10.7-2-16.5-2.5-3.4-4.8-6.9-9.1-10.4-13%207.4-7.3%2014.9-12.3%2021-12.3%201.3%200%202.5.3%203.5.9zM81.3%2074c-1.8%203.2-3.9%206.4-6.1%209.6-3.7.3-7.4.4-11.2.4-3.9%200-7.6-.1-11.2-.4-2.2-3.2-4.2-6.4-6-9.6-1.9-3.3-3.7-6.7-5.3-10%201.6-3.3%203.4-6.7%205.3-10%201.8-3.2%203.9-6.4%206.1-9.6%203.7-.3%207.4-.4%2011.2-.4%203.9%200%207.6.1%2011.2.4%202.2%203.2%204.2%206.4%206%209.6%201.9%203.3%203.7%206.7%205.3%2010-1.7%203.3-3.4%206.6-5.3%2010zm8.3-3.3c1.5%203.5%202.7%206.9%203.8%2010.3-3.4.8-7%201.4-10.8%201.9%201.2-1.9%202.5-3.9%203.6-6%201.2-2.1%202.3-4.2%203.4-6.2zM64%2097.8c-2.4-2.6-4.7-5.4-6.9-8.3%202.3.1%204.6.2%206.9.2%202.3%200%204.6-.1%206.9-.2-2.2%202.9-4.5%205.7-6.9%208.3zm-18.6-15c-3.8-.5-7.4-1.1-10.8-1.9%201.1-3.3%202.3-6.8%203.8-10.3%201.1%202%202.2%204.1%203.4%206.1%201.2%202.2%202.4%204.1%203.6%206.1zm-7-25.5c-1.5-3.5-2.7-6.9-3.8-10.3%203.4-.8%207-1.4%2010.8-1.9-1.2%201.9-2.5%203.9-3.6%206-1.2%202.1-2.3%204.2-3.4%206.2zM64%2030.2c2.4%202.6%204.7%205.4%206.9%208.3-2.3-.1-4.6-.2-6.9-.2-2.3%200-4.6.1-6.9.2%202.2-2.9%204.5-5.7%206.9-8.3zm22.2%2021l-3.6-6c3.8.5%207.4%201.1%2010.8%201.9-1.1%203.3-2.3%206.8-3.8%2010.3-1.1-2.1-2.2-4.2-3.4-6.2zM31.7%2035c-1.7-10.5-.3-17.9%203.8-20.3%201-.6%202.2-.9%203.5-.9%206%200%2013.5%204.9%2021%2012.3-3.5%203.8-7%208.2-10.4%2013-5.8.5-11.3%201.4-16.5%202.5-.6-2.3-1-4.5-1.4-6.6zM7%2064c0-4.7%205.7-9.7%2015.7-13.4%202-.8%204.2-1.5%206.4-2.1%201.6%205%203.6%2010.3%206%2015.6-2.4%205.3-4.5%2010.5-6%2015.5C15.3%2075.6%207%2069.6%207%2064zm28.5%2049.3c-4.1-2.4-5.5-9.8-3.8-20.3.3-2.1.8-4.3%201.4-6.6%205.2%201.2%2010.7%202%2016.5%202.5%203.4%204.8%206.9%209.1%2010.4%2013-7.4%207.3-14.9%2012.3-21%2012.3-1.3%200-2.5-.3-3.5-.9zM96.3%2093c1.7%2010.5.3%2017.9-3.8%2020.3-1%20.6-2.2.9-3.5.9-6%200-13.5-4.9-21-12.3%203.5-3.8%207-8.2%2010.4-13%205.8-.5%2011.3-1.4%2016.5-2.5.6%202.3%201%204.5%201.4%206.6zm9-15.6c-2%20.8-4.2%201.5-6.4%202.1-1.6-5-3.6-10.3-6-15.6%202.4-5.3%204.5-10.5%206-15.5%2013.8%204%2022.1%2010%2022.1%2015.6%200%204.7-5.8%209.7-15.7%2013.4z'/%3e%3c/g%3e%3c/svg%3e",q7=Object.freeze(Object.defineProperty({__proto__:null,default:X7},Symbol.toStringTag,{value:"Module"})),Y7="/assets/rstudio-D2BZY8NS.svg",W7=Object.freeze(Object.defineProperty({__proto__:null,default:Y7},Symbol.toStringTag,{value:"Module"})),Z7="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2025.0.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20id='Layer_1'%20x='0px'%20y='0px'%20viewBox='0%200%20640%20640'%20style='enable-background:new%200%200%20640%20640;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23FFFFFF;}%20.st1{fill:%23FFFFFF;stroke:%23000000;stroke-width:7;stroke-miterlimit:10;}%20.st2{fill:none;stroke:%23000000;stroke-width:7;stroke-miterlimit:10;}%20%3c/style%3e%3cpolyline%20class='st0'%20points='171.7,621.7%2020,18.4%20620,186.9%20'/%3e%3cg%3e%3cline%20class='st1'%20x1='245.8'%20y1='362.4'%20x2='283.7'%20y2='513.3'/%3e%3cline%20class='st1'%20x1='395.5'%20y1='404.8'%20x2='245.8'%20y2='362.4'/%3e%3cline%20class='st1'%20x1='283.7'%20y1='513.3'%20x2='395.5'%20y2='404.8'/%3e%3cpath%20class='st1'%20d='M134,470.9'/%3e%3cline%20class='st1'%20x1='283.7'%20y1='513.3'%20x2='134'%20y2='470.9'/%3e%3cpath%20class='st1'%20d='M134,470.9'/%3e%3cpolyline%20class='st2'%20points='134,470.9%20171.9,621.9%20283.7,513.3%20'/%3e%3cline%20class='st1'%20x1='134'%20y1='470.9'%20x2='245.8'%20y2='362.4'/%3e%3cline%20class='st1'%20x1='245.8'%20y1='362.4'%20x2='357.7'%20y2='253.8'/%3e%3cline%20class='st1'%20x1='357.7'%20y1='253.8'%20x2='469.5'%20y2='145.3'/%3e%3cline%20class='st1'%20x1='319.8'%20y1='102.9'%20x2='357.7'%20y2='253.8'/%3e%3cline%20class='st1'%20x1='357.7'%20y1='253.8'%20x2='207.9'%20y2='211.5'/%3e%3cline%20class='st1'%20x1='207.9'%20y1='211.5'%20x2='245.8'%20y2='362.4'/%3e%3cline%20class='st1'%20x1='245.8'%20y1='362.4'%20x2='96.1'%20y2='320'/%3e%3cline%20class='st1'%20x1='96.1'%20y1='320'%20x2='134'%20y2='470.9'/%3e%3cline%20class='st1'%20x1='58.2'%20y1='169.1'%20x2='96.1'%20y2='320'/%3e%3cline%20class='st1'%20x1='207.9'%20y1='211.5'%20x2='58.2'%20y2='169.1'/%3e%3cline%20class='st1'%20x1='96.1'%20y1='320'%20x2='207.9'%20y2='211.5'/%3e%3cline%20class='st1'%20x1='207.9'%20y1='211.4'%20x2='319.8'%20y2='102.9'/%3e%3cline%20class='st1'%20x1='319.8'%20y1='102.9'%20x2='170'%20y2='60.5'/%3e%3cline%20class='st1'%20x1='170'%20y1='60.5'%20x2='207.9'%20y2='211.4'/%3e%3cpolyline%20class='st2'%20points='58.2,169.1%2020.3,18.1%20170,60.5%20'/%3e%3cline%20class='st1'%20x1='58.2'%20y1='169.1'%20x2='170'%20y2='60.5'/%3e%3cpolyline%20class='st2'%20points='507.4,296.2%20619.2,187.7%20469.5,145.3%20'/%3e%3cline%20class='st1'%20x1='469.5'%20y1='145.3'%20x2='507.4'%20y2='296.2'/%3e%3cline%20class='st1'%20x1='507.4'%20y1='296.2'%20x2='357.7'%20y2='253.8'/%3e%3cline%20class='st1'%20x1='357.7'%20y1='253.8'%20x2='395.5'%20y2='404.8'/%3e%3cline%20class='st1'%20x1='395.5'%20y1='404.8'%20x2='507.4'%20y2='296.2'/%3e%3cline%20class='st1'%20x1='469.5'%20y1='145.3'%20x2='319.8'%20y2='102.9'/%3e%3c/g%3e%3c/svg%3e",K7=Object.freeze(Object.defineProperty({__proto__:null,default:Z7},Symbol.toStringTag,{value:"Module"})),Q7="/assets/ue-BqsLJ1aS.png",J7=Object.freeze(Object.defineProperty({__proto__:null,default:Q7},Symbol.toStringTag,{value:"Module"})),$7="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%3e%3cpath%20d='m64.414%20122.93%2047.606-27.49-18.247-10.553-18.656%2010.777a1.06%201.06%200%200%201-1.035-.008%201.054%201.054%200%200%201-.523-.898V69.164c0-.754.39-1.437%201.043-1.812L96.77%2054.55a1.03%201.03%200%200%201%201.035.008c.324.18.527.52.53.89v21.543l18.259%2010.547V32.56l-52.18%2030.12Zm0%200'/%3e%3cpath%20fill='%234d4d4d'%20d='m53.738%2095.676-18.664-10.79-18.261%2010.552%2047.601%2027.492V62.68L12.25%2032.559v54.976l18.254-10.543V55.45c.008-.37.207-.71.527-.89a1.04%201.04%200%200%201%201.04-.008l22.179%2012.8a2.095%202.095%200%200%201%201.043%201.813v25.598c-.004.37-.2.71-.52.902-.316.188-.71.191-1.035.012'/%3e%3cpath%20fill='gray'%20d='M68.988%205.07v21.086l18.657%2010.77c.32.187.511.531.511.906%200%20.371-.195.711-.511.898L65.469%2051.54a2.12%202.12%200%200%201-2.09%200L41.21%2038.73a1.033%201.033%200%200%201-.516-.898%201.038%201.038%200%200%201%20.516-.906l18.652-10.77V5.07L12.25%2032.56l52.164%2030.12%2052.176-30.12Zm0%200'/%3e%3c/svg%3e",eP=Object.freeze(Object.defineProperty({__proto__:null,default:$7},Symbol.toStringTag,{value:"Module"})),tP="data:image/svg+xml,%3csvg%20width='410'%20height='404'%20viewBox='0%200%20410%20404'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M399.641%2059.5246L215.643%20388.545C211.844%20395.338%20202.084%20395.378%20198.228%20388.618L10.5817%2059.5563C6.38087%2052.1896%2012.6802%2043.2665%2021.0281%2044.7586L205.223%2077.6824C206.398%2077.8924%20207.601%2077.8904%20208.776%2077.6763L389.119%2044.8058C397.439%2043.2894%20403.768%2052.1434%20399.641%2059.5246Z'%20fill='url(%23paint0_linear)'/%3e%3cpath%20d='M292.965%201.5744L156.801%2028.2552C154.563%2028.6937%20152.906%2030.5903%20152.771%2032.8664L144.395%20174.33C144.198%20177.662%20147.258%20180.248%20150.51%20179.498L188.42%20170.749C191.967%20169.931%20195.172%20173.055%20194.443%20176.622L183.18%20231.775C182.422%20235.487%20185.907%20238.661%20189.532%20237.56L212.947%20230.446C216.577%20229.344%20220.065%20232.527%20219.297%20236.242L201.398%20322.875C200.278%20328.294%20207.486%20331.249%20210.492%20326.603L212.5%20323.5L323.454%20102.072C325.312%2098.3645%20322.108%2094.137%20318.036%2094.9228L279.014%20102.454C275.347%20103.161%20272.227%2099.746%20273.262%2096.1583L298.731%207.86689C299.767%204.27314%20296.636%200.855181%20292.965%201.5744Z'%20fill='url(%23paint1_linear)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear'%20x1='6.00017'%20y1='32.9999'%20x2='235'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2341D1FF'/%3e%3cstop%20offset='1'%20stop-color='%23BD34FE'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear'%20x1='194.651'%20y1='8.81818'%20x2='236.076'%20y2='292.989'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFEA83'/%3e%3cstop%20offset='0.0833333'%20stop-color='%23FFDD35'/%3e%3cstop%20offset='1'%20stop-color='%23FFA800'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",nP=Object.freeze(Object.defineProperty({__proto__:null,default:tP},Symbol.toStringTag,{value:"Module"})),iP="/assets/PuzzleHighlight-D4mPfPxa.png",aP=Object.freeze(Object.defineProperty({__proto__:null,default:iP},Symbol.toStringTag,{value:"Module"})),sP="/assets/bighead-_9vMFswt.gif",rP=Object.freeze(Object.defineProperty({__proto__:null,default:sP},Symbol.toStringTag,{value:"Module"})),oP="/assets/endllmless-B_qw0jTM.gif",lP=Object.freeze(Object.defineProperty({__proto__:null,default:oP},Symbol.toStringTag,{value:"Module"})),cP="/assets/murdeer-NmqgclOc.png",uP=Object.freeze(Object.defineProperty({__proto__:null,default:cP},Symbol.toStringTag,{value:"Module"})),fP="/assets/murdeer222-CG3_9X-4.png",dP=Object.freeze(Object.defineProperty({__proto__:null,default:fP},Symbol.toStringTag,{value:"Module"})),hP="/assets/murdeercrazygun-C-3h99Um.gif",pP=Object.freeze(Object.defineProperty({__proto__:null,default:hP},Symbol.toStringTag,{value:"Module"})),mP="/assets/murdeergameplay-CVXnIHtJ.gif",gP=Object.freeze(Object.defineProperty({__proto__:null,default:mP},Symbol.toStringTag,{value:"Module"})),yP="/assets/noodlerekt2-Bkphn_VA.gif",xP=Object.freeze(Object.defineProperty({__proto__:null,default:yP},Symbol.toStringTag,{value:"Module"})),vP="/assets/powergunrekt-50WUgAvc.gif",bP=Object.freeze(Object.defineProperty({__proto__:null,default:vP},Symbol.toStringTag,{value:"Module"})),_P="/assets/three20-CQ3wSTKz.gif",SP=Object.freeze(Object.defineProperty({__proto__:null,default:_P},Symbol.toStringTag,{value:"Module"})),AP="/assets/GlassdoorReviews-4gN0czWB.pdf",MP=Object.freeze(Object.defineProperty({__proto__:null,default:AP},Symbol.toStringTag,{value:"Module"})),EP="/assets/NCVSFinalReport-C9HxjFNJ.pdf",wP=Object.freeze(Object.defineProperty({__proto__:null,default:EP},Symbol.toStringTag,{value:"Module"})),TP="/assets/SteamGameRatings-m13-sOPk.pdf",CP=Object.freeze(Object.defineProperty({__proto__:null,default:TP},Symbol.toStringTag,{value:"Module"})),KS=Object.assign({"../../../assets/icons/aws.svg":x7,"../../../assets/icons/chatgpt.svg":b7,"../../../assets/icons/csharp.svg":S7,"../../../assets/icons/d3js.svg":M7,"../../../assets/icons/express.svg":w7,"../../../assets/icons/fmod.svg":C7,"../../../assets/icons/googlecolab.svg":D7,"../../../assets/icons/javascript.svg":O7,"../../../assets/icons/jupyter.svg":L7,"../../../assets/icons/mysql.svg":P7,"../../../assets/icons/nodejs.svg":I7,"../../../assets/icons/p5js.svg":j7,"../../../assets/icons/python.svg":k7,"../../../assets/icons/r.svg":G7,"../../../assets/icons/reactjs.svg":q7,"../../../assets/icons/rstudio.svg":W7,"../../../assets/icons/threejs.svg":K7,"../../../assets/icons/ue.png":J7,"../../../assets/icons/unity.svg":eP,"../../../assets/icons/vitejs.svg":nP}),nw={};for(const a in KS){const e=KS[a].default,n=a.split("/").pop().replace(/\.[^.]+$/i,"");nw[n]=e}const QS=Object.assign({"../../../assets/projects/PuzzleHighlight.png":aP,"../../../assets/projects/bighead.gif":rP,"../../../assets/projects/endllmless.gif":lP,"../../../assets/projects/murdeer.png":uP,"../../../assets/projects/murdeer222.png":dP,"../../../assets/projects/murdeercrazygun.gif":pP,"../../../assets/projects/murdeergameplay.gif":gP,"../../../assets/projects/noodlerekt2.gif":xP,"../../../assets/projects/powergunrekt.gif":bP,"../../../assets/projects/three20.gif":SP}),Ib={};for(const a in QS){const e=QS[a].default,n=a.split("/").pop().replace(/\.[^.]+$/i,"");Ib[n]=e}const JS=Object.assign({"../../../assets/projectdocs/GlassdoorReviews.pdf":MP,"../../../assets/projectdocs/NCVSFinalReport.pdf":wP,"../../../assets/projectdocs/SteamGameRatings.pdf":CP}),iw={};for(const a in JS){const e=JS[a].default,t=a.split("/").pop();iw[t]=e}const RP={portfolio3d:{title:"3D Portfolio Universe",subtitle:"This website!",summary:"Universe simulation and personal portfolio",description:"A fully client-side 3D portfolio built with React Three Fiber and Vite. Features orbital camera transitions, options for quality vs. performance, and a UI layer synchronized with the 3D scene showcasing blog entries, project summaries, and important documents.",hyperlinks:[{id:"github-repo",text:"GitHub Repo",href:"https://github.com/vanadgir/vanadgir.github.io"}],technologies:[{id:"three",label:"three.js",iconKey:"threejs"},{id:"react",label:"React",iconKey:"reactjs"},{id:"javascript",label:"JavaScript",iconKey:"javascript"},{id:"vite",label:"Vite",iconKey:"vitejs"}]},murdeerGame:{title:"MURDEER",subtitle:"Unity FPS Roguelite",summary:"You play as a deer with a gun",description:`Originally developed for Big Mode Gam Jam 2025 for the theme "POWER", MURDEER has gone into full development with a small team of 4. As Lead Developer, I am responsible for writing up many of the game's features, such as the Player Controller, the weapons & attachment system, the dynamic intensity for background music, and much more.`,imageKey:["murdeer","powergunrekt","bighead","noodlerekt2"],hyperlinks:[{id:"steam-page",text:"Steam",href:"https://store.steampowered.com/app/3719400/MURDEER/"},{id:"studio-page",text:"Swift Stag Studios",href:"https://swiftstagstudios.org/"},{id:"itch-io",text:"itch.io",href:"https://accipitrade.itch.io/murdeer"}],technologies:[{id:"unity",label:"Unity",iconKey:"unity"},{id:"csharp",label:"C#",iconKey:"csharp"},{id:"fmod",label:"FMOD",iconKey:"fmod"}]},unrealPuzzle:{title:"Unreal Engine Puzzle Prototype",subtitle:"Color-based UE5 Puzzle",summary:"Combine 3 color channels to match a target color",description:"Made with Blueprints and free assets taken from Epic Games rotating store. Created custom shaders for the liquid effect and used central GameManager hooked up with events to determine puzzle completion progress and win condition. Submitted as my capstone project for ELVTR Become a Technical Artist course.",imageKey:["PuzzleHighlight"],hyperlinks:[{id:"youtube-link",text:"YouTube Walkthrough",href:"https://www.youtube.com/watch?v=bzhkDNROZVk"}],technologies:[{id:"unreal",label:"Unreal Engine 5",iconKey:"ue"}]},diceRoller:{title:"three20",subtitle:"3D Physics-based dice roller",summary:"Tabletop assistant for simulating real dice rolls",imageKey:["three20"],description:"Made with tabletop gamers in mind, three20 allows visitors to get close to the feeling of rolling real dice. Primary responsibilities included initial geometry setup, roll detection algorithm, and in-app audio player. Takes advantage of asynchronous asset loading and linear algebra for tighter performance.",hyperlinks:[{id:"live-page",text:"three20",href:"https://dice.br-ndt.dev/"},{id:"github-repo",text:"GitHub Repo",href:"https://github.com/vanadgir/three20"}],technologies:[{id:"three",label:"three.js",iconKey:"threejs"},{id:"react",label:"React",iconKey:"reactjs"},{id:"javascript",label:"JavaScript",iconKey:"javascript"},{id:"vite",label:"Vite",iconKey:"vitejs"}]},endlessCraft:{title:"EndLLMless",subtitle:"Endless crafting with ChatGPT",summary:"Use your imagination to create infinite combinations",imageKey:["endllmless"],description:"In this Infinite Craft-inspired game, you select two words as input, which sends a request to OpenAI / ChatGPT to create a combined concept and chooses a related emoji. Can store your creations, allowing you to continue creating at a later time.",hyperlinks:[{id:"live-page",text:"EndLLMless",href:"https://endless.bitvox.me/"},{id:"github-repo",text:"GitHub Repo",href:"https://github.com/br-ndt/endllmless"}],technologies:[{id:"chatGPT",label:"ChatGPT",iconKey:"chatgpt"},{id:"express",label:"Express.js",iconKey:"express"},{id:"javascript",label:"JavaScript",iconKey:"javascript"},{id:"react",label:"React",iconKey:"reactjs"}]},drawble:{title:"drawble",subtitle:"Chat & Drawing webapp",summary:"Doodle and chat in private rooms built on WebSockets",description:"Built on SERN stack, this project uses WebSockets to provide chat rooms and canvases to connected users. Uses GoogleOAuth for authorization and MySQL backend for room availability.",hyperlinks:[{id:"live-page",text:"drawble",href:"https://www.varun.pro/drawble/"},{id:"github-repo",text:"GitHub Repo",href:"https://github.com/vanadgir/drawble"}],technologies:[{id:"mySQL",label:"MySQL",iconKey:"mysql"},{id:"express",label:"Express.js",iconKey:"express"},{id:"javascript",label:"JavaScript",iconKey:"javascript"},{id:"react",label:"React",iconKey:"reactjs"}]},fill4:{title:"fill4",subtitle:"Voronoi Coloring",summary:"Coloring puzzle inspired by the four color theorem",description:"With D3 SVG used to create a game board out of a Voronoi diagram, users attempt to color the cells following adjacency rules with the given set of colors. Can lower and increase difficulty by changing number of starting cells and available colors. Multiple color palettes are provided for various types of colorblindedness.",hyperlinks:[{id:"live-page",text:"fill4",href:"https://www.varun.pro/fill4/"},{id:"github-repo",text:"GitHub Repo",href:"https://github.com/vanadgir/fill4"}],technologies:[{id:"react",label:"React",iconKey:"reactjs"},{id:"d3js",label:"d3js",iconKey:"d3js"}]},ncvsDataMining:{title:"NCVS Data Mining",subtitle:"Study of the National Crime Victimization Survey",summary:"Identifying the factors that lead to bullying",description:"Using R and a wide variety of models, we try to build the best predictive model. In our experiment, we found a binary classifier to be the strongest predictor.",previewDoc:"NCVSFinalReport.pdf",technologies:[{id:"rstudio",label:"RStudio",iconKey:"rstudio"}]},glassdoorReview:{title:"Glassdoor Reviews NLP",subtitle:"Analysis of Glassdoor Review sentiments",summary:"Exploring how experiences and perceptions differ for roles and companies",description:"By analyzing Glassdoor reviews, I seek to uncover how experiences and perceptions differ between various positions at the same company, as well as same job titles in different companies. Using the KeyBERT model in Python, I extract keywords using both Maxsum and MMR (Maximal Marginal Relevance) methods.",previewDoc:"GlassdoorReviews.pdf",hyperlinks:[{id:"colab-notebook",text:"Colab Notebook",href:"https://colab.research.google.com/drive/1zhIZ7Ub-UvwE2Pqp_Iis-qOYcutKd7L-?usp=sharing"}],technologies:[{id:"colab",label:"Google Colab",iconKey:"googlecolab"},{id:"python",label:"python",iconKey:"python"}]},steamRatings:{title:"Steam Game Ratings",subtitle:"Study of Steam Marketplace ratings",summary:"Comparing the popularity of single- and multi-player games",description:"Using R, I perform a hypothesis test on the difference in proportion of highly rated single-player games and highly-rated multi-player games on Steam. A rather quick analysis, I was able to determine there is a significant difference in popularity, with single-player games being much more highly rated.",previewDoc:"SteamGameRatings.pdf",technologies:[{id:"rstudio",label:"RStudio",iconKey:"rstudio"}]},dndler:{title:"DNDLER",subtitle:"TTRPG Character Randomizer",summary:"Create randomized player characters for Dungeons & Dragons",description:"Created and launched with a small team of 3 developers, the dndler is a TTRPG assistant that creates a full D&D 5e compatible character using the free SRD content. Can upload and download generated characters in JSON format.",hyperlinks:[{id:"live-page",text:"dndler",href:"https://dndler.app/"},{id:"github-repo",text:"GitHub Repo",href:"https://github.com/vanadgir/dndler"}],technologies:[{id:"express",label:"Express.js",iconKey:"express"},{id:"javascript",label:"JavaScript",iconKey:"javascript"},{id:"react",label:"React",iconKey:"reactjs"}]},mitADSPCapstone:{title:"Music Recommendation System",subtitle:"Collaborative Filtering, Matrix Factorization",summary:"Create music recommendation system using Million Songs Dataset",description:"Capstone project for MIT Applied Data Science Program. Created a recommendation system that used ensemble methods to find related songs and artists for potential users.",hyperlinks:[{id:"capstone",text:"Capstone Report",href:"https://www.varun.pro/MITADSP/"}],technologies:[{id:"jupyter",label:"Jupyter Notebook",iconKey:"jupyter"},{id:"python",label:"python",iconKey:"python"}]},msdCapstone:{title:"Million Songs Analysis",subtitle:"Clustering, Word Frequency",summary:"Deep dive into the Million Songs Dataset",description:"Capstone project for Springboard. Created a classification model that could find similarities of artists using common words found in songs titles, album names, and genres.",hyperlinks:[{id:"capstone",text:"Capstone Report",href:"https://www.varun.pro/MSDMusicAnalysis/"}],technologies:[{id:"jupyter",label:"Jupyter Notebook",iconKey:"jupyter"},{id:"python",label:"python",iconKey:"python"}]},leagueCapstone:{title:"League of Legends eSports Analysis",subtitle:"Player Performance, Game Result Prediction",summary:"Identifying trends in competitive League of Legends",description:"Capstone project for Springboard. Created a prediction model that would attempt to find favourable matchups for players and teams. ",hyperlinks:[{id:"capstone",text:"Capstone Report",href:"https://www.varun.pro/LoLEsportsAnalysis/"}],technologies:[{id:"jupyter",label:"Jupyter Notebook",iconKey:"jupyter"},{id:"python",label:"python",iconKey:"python"}]},collegeScorecard:{title:"College Scorecard",subtitle:"Data Wrangling, Clustering",summary:"Deep dive into US colleges and universities",description:"The College Scorecard is a service meant to help prospective students make their college decision. Whether by comparing size, popular majors, or comparing costs to the national average, the site's goal is to help the user find a good fit. Using this dataset, I try and find additional ways to help students in their decision.",hyperlinks:[{id:"data-story",text:"Data Story",href:"https://www.varun.pro/Springboard-Intro-to-Data-Science/DataStory/collegescorecard.html"},{id:"capstone",text:"Capstone Report",href:"https://www.varun.pro/Springboard-Intro-to-Data-Science/Capstone/finalreport.html"},{id:"youtube-link",text:"Presentation Recording",href:"https://www.youtube.com/watch?v=5ZlSw4PxmMQ"}],technologies:[{id:"rstudio",label:"RStudio",iconKey:"rstudio"}]}},aw=Object.fromEntries(Object.entries(RP).map(([a,e])=>{let t=null;return e.imageKey&&(Array.isArray(e.imageKey)?t=e.imageKey.map(n=>Ib[n]).filter(Boolean):t=Ib[e.imageKey]??null),[a,{...e,imageUrl:t,technologies:(e.technologies??[]).map(n=>({...n,iconUrl:nw[n.iconKey]??null})),previewDocUrl:e.previewDoc?iw[e.previewDoc]??null:null}]})),DP=Object.entries(aw).map(([a,e])=>({id:a,...e})),NP=({planet:a,openDetail:e})=>{const t=n=>{e?.(`project:${n}`)};return R.jsxs("div",{className:"blog-info",children:[R.jsx("h2",{children:a.label}),R.jsx("p",{children:"Games, Web Apps, Data Science"}),R.jsx("ul",{className:"info-item-list",children:DP.map(n=>R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:n.title,description:n.subtitle||n.summary,onActivate:()=>t(n.id)})},n.id))})]})},OP=({planet:a,openDetail:e})=>{const t=()=>{e?.("docs:resume")},n=()=>{e?.("docs:elvtr")},s=()=>{e?.("docs:datasci")};return R.jsxs("div",{className:"blog-info",children:[R.jsx("h2",{children:a.label}),R.jsx("p",{children:"View or Download"}),R.jsxs("ul",{className:"info-item-list",children:[R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:"Resume",description:"Skills & Work History",onActivate:t})}),R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:"ELVTR Tech Art",description:"Certificate & Letter of Recommendation",onActivate:n})}),R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:"Data Science",description:"Courses & Certificates",onActivate:s})})]})]})},sw={youtube:{id:"youtube",label:"YouTube",profileUrl:"https://www.youtube.com/@BarnaldoYT",profileLabel:"YouTube Channel",embeds:[{id:"retrogothica-yt",title:"Retrogothica EP",iframeSrc:"https://www.youtube.com/embed?list=OLAK5uy_mg-i9beiAOkXMPr1Ikt4EitQh30icqr_Y"},{id:"midijam-yt",title:"midis2jam2 playlist",iframeSrc:"https://www.youtube.com/embed?list=PL2DqDbGGnooJ_fXODHT9UuvxJZyjmjuMO"}]},soundcloud:{id:"soundcloud",label:"SoundCloud",profileUrl:"https://soundcloud.com/barntunes",profileLabel:"SoundCloud Artist Page",embeds:[{id:"barn-recommended",title:"Barn's Recommended",iframeSrc:"https://w.soundcloud.com/player/?url=https://soundcloud.com/barntunes/sets/barns-recommended"},{id:"untitled-ep-sc",title:"Untitled EP",iframeSrc:"https://w.soundcloud.com/player/?url=https://soundcloud.com/barntunes/sets/untitled-ep"},{id:"retrogothica-sc",title:"Retrogothica EP",iframeSrc:"https://w.soundcloud.com/player/?url=https://soundcloud.com/barntunes/sets/retrogothica-ep"}]},spotify:{id:"spotify",label:"Spotify",profileUrl:"https://open.spotify.com/artist/6WKfqZPfMCk0DhCDzJT92M?si=NUvGgXCfTmynx5_PmostfA",profileLabel:"Spotify Artist Page",embeds:[{id:"resurrections-spotify",title:"Resurrections",iframeSrc:"https://open.spotify.com/embed/album/2DDctpIZwXRTE6rr0jx5d2"},{id:"retrogothica-ep-spotify",title:"Retrogothica EP",iframeSrc:"https://open.spotify.com/embed/album/1SOnl0iA2kZJb86d3VnlX0"}]},bandcamp:{id:"bandcamp",label:"Bandcamp",profileUrl:"https://barnaldo.bandcamp.com/",profileLabel:"Bandcamp Profile",embeds:[{id:"untitled-ep-bc",title:"Untitled EP",iframeSrc:"https://bandcamp.com/EmbeddedPlayer/album=3663491662/size=large/bgcol=333333/linkcol=ffffff/tracklist=true/transparent=true/"},{id:"retrogothica-ep-bc",title:"Retrogothica EP",iframeSrc:"https://bandcamp.com/EmbeddedPlayer/album=3684439214/size=large/bgcol=333333/linkcol=ffffff/tracklist=true/transparent=true/"}]}},UP=Object.values(sw),LP=({planet:a,openDetail:e})=>{const t=n=>{e?.(`music:${n}`)};return R.jsxs("div",{className:"blog-info",children:[R.jsx("h2",{children:a.label}),R.jsx("p",{children:"Releases & WIP"}),R.jsx("ul",{className:"info-item-list",children:UP.map(n=>R.jsx("li",{className:"info-item-list-item",children:R.jsx(oh,{title:n.label,description:n.subtitle,onActivate:()=>t(n.id)})},n.id))})]})},Bc=()=>{const a=Math.floor(Math.random()*256),e=Math.floor(Math.random()*256),t=Math.floor(Math.random()*256);return`rgb(${a}, ${e}, ${t})`},by=()=>Math.random()*.15+.1,_y=()=>Math.random()*5+1.5,zP=()=>Math.random()*Math.PI*2,PP=(a,e)=>a+Math.random()*(e-a),Sy=(a,e)=>{const t=PP(a,e),n=zP(),s=Math.cos(n)*t,o=Math.sin(n)*t;return[s,0,o]},R0=[{id:"blog",label:"Blog",path:"/blog",position:Sy(28,32),color:Bc(),secondaryColor:Bc(),speed:by(),size:_y(),InfoComponent:g7},{id:"projects",label:"Projects",path:"/projects",position:Sy(48,54),color:Bc(),secondaryColor:Bc(),speed:by(),size:_y(),InfoComponent:NP},{id:"music",label:"Music",path:"/music",position:Sy(64,72),color:Bc(),secondaryColor:Bc(),speed:by(),size:_y(),InfoComponent:LP},{id:"docs",label:"Docs",path:"/docs",position:Sy(86,94),color:Bc(),secondaryColor:Bc(),speed:by(),size:_y(),InfoComponent:OP}],rw={cameraPos:[0,25,90],target:[0,0,0]};function vr(){return vr=Object.assign?Object.assign.bind():function(a){for(var e=1;eMath.PI/2}function jP(a,e,t,n){const s=om.setFromMatrixPosition(a.matrixWorld),o=s.clone();o.project(e),$S.set(o.x,o.y),t.setFromCamera($S,e);const f=t.intersectObjects(n,!0);if(f.length){const d=f[0].distance;return s.distanceTo(t.ray.origin)Math.abs(a)<1e-10?0:a;function ow(a,e,t=""){let n="matrix3d(";for(let s=0;s!==16;s++)n+=Fb(e[s]*a.elements[s])+(s!==15?",":")");return t+n}const VP=(a=>e=>ow(e,a))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),GP=(a=>(e,t)=>ow(e,a(t),"translate(-50%,-50%)"))(a=>[1/a,1/a,1/a,1,-1/a,-1/a,-1/a,-1,1/a,1/a,1/a,1,1,1,1,1]);function XP(a){return a&&typeof a=="object"&&"current"in a}const qP=Q.forwardRef(({children:a,eps:e=.001,style:t,className:n,prepend:s,center:o,fullscreen:f,portal:d,distanceFactor:p,sprite:m=!1,transform:y=!1,occlude:x,onOcclude:v,castShadow:S,receiveShadow:M,material:T,geometry:w,zIndexRange:A=[16777271,0],calculatePosition:D=IP,as:N="div",wrapperClass:U,pointerEvents:I="auto",...z},j)=>{const{gl:q,camera:B,scene:P,size:W,raycaster:se,events:ae,viewport:ce}=Ts(),[ue]=Q.useState(()=>document.createElement(N)),V=Q.useRef(null),$=Q.useRef(null),J=Q.useRef(0),he=Q.useRef([0,0]),ve=Q.useRef(null),Y=Q.useRef(null),oe=d?.current||ae.connected||q.domElement.parentNode,Te=Q.useRef(null),Ne=Q.useRef(!1),Qe=Q.useMemo(()=>x&&x!=="blending"||Array.isArray(x)&&x.length&&XP(x[0]),[x]);Q.useLayoutEffect(()=>{const at=q.domElement;x&&x==="blending"?(at.style.zIndex=`${Math.floor(A[0]/2)}`,at.style.position="absolute",at.style.pointerEvents="none"):(at.style.zIndex=null,at.style.position=null,at.style.pointerEvents=null)},[x]),Q.useLayoutEffect(()=>{if($.current){const at=V.current=gA.createRoot(ue);if(P.updateMatrixWorld(),y)ue.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const lt=D($.current,B,W);ue.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${lt[0]}px,${lt[1]}px,0);transform-origin:0 0;`}return oe&&(s?oe.prepend(ue):oe.appendChild(ue)),()=>{oe&&oe.removeChild(ue),at.unmount()}}},[oe,y]),Q.useLayoutEffect(()=>{U&&(ue.className=U)},[U]);const le=Q.useMemo(()=>y?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:o?"translate3d(-50%,-50%,0)":"none",...f&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...t},[t,o,f,W,y]),xe=Q.useMemo(()=>({position:"absolute",pointerEvents:I}),[I]);Q.useLayoutEffect(()=>{if(Ne.current=!1,y){var at;(at=V.current)==null||at.render(Q.createElement("div",{ref:ve,style:le},Q.createElement("div",{ref:Y,style:xe},Q.createElement("div",{ref:j,className:n,style:t,children:a}))))}else{var lt;(lt=V.current)==null||lt.render(Q.createElement("div",{ref:j,style:le,className:n,children:a}))}});const Ge=Q.useRef(!0);Th(at=>{if($.current){B.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);const lt=y?he.current:D($.current,B,W);if(y||Math.abs(J.current-B.zoom)>e||Math.abs(he.current[0]-lt[0])>e||Math.abs(he.current[1]-lt[1])>e){const Rt=FP($.current,B);let yt=!1;Qe&&(Array.isArray(x)?yt=x.map(Xe=>Xe.current):x!=="blending"&&(yt=[P]));const Ue=Ge.current;if(yt){const Xe=jP($.current,B,se,yt);Ge.current=Xe&&!Rt}else Ge.current=!Rt;Ue!==Ge.current&&(v?v(!Ge.current):ue.style.display=Ge.current?"block":"none");const Z=Math.floor(A[0]/2),ke=x?Qe?[A[0],Z]:[Z-1,0]:A;if(ue.style.zIndex=`${kP($.current,B,ke)}`,y){const[Xe,tt]=[W.width/2,W.height/2],qe=B.projectionMatrix.elements[5]*tt,{isOrthographicCamera:ot,top:nt,left:ht,bottom:K,right:F}=B,ye=VP(B.matrixWorldInverse),Oe=ot?`scale(${qe})translate(${Fb(-(F+ht)/2)}px,${Fb((nt+K)/2)}px)`:`translateZ(${qe}px)`;let Pe=$.current.matrixWorld;m&&(Pe=B.matrixWorldInverse.clone().transpose().copyPosition(Pe).scale($.current.scale),Pe.elements[3]=Pe.elements[7]=Pe.elements[11]=0,Pe.elements[15]=1),ue.style.width=W.width+"px",ue.style.height=W.height+"px",ue.style.perspective=ot?"":`${qe}px`,ve.current&&Y.current&&(ve.current.style.transform=`${Oe}${ye}translate(${Xe}px,${tt}px)`,Y.current.style.transform=GP(Pe,1/((p||10)/400)))}else{const Xe=p===void 0?1:HP($.current,B)*p;ue.style.transform=`translate3d(${lt[0]}px,${lt[1]}px,0) scale(${Xe})`}he.current=lt,J.current=B.zoom}}if(!Qe&&Te.current&&!Ne.current)if(y){if(ve.current){const lt=ve.current.children[0];if(lt!=null&<.clientWidth&<!=null&<.clientHeight){const{isOrthographicCamera:Rt}=B;if(Rt||w)z.scale&&(Array.isArray(z.scale)?z.scale instanceof X?Te.current.scale.copy(z.scale.clone().divideScalar(1)):Te.current.scale.set(1/z.scale[0],1/z.scale[1],1/z.scale[2]):Te.current.scale.setScalar(1/z.scale));else{const yt=(p||10)/400,Ue=lt.clientWidth*yt,Z=lt.clientHeight*yt;Te.current.scale.set(Ue,Z,1)}Ne.current=!0}}}else{const lt=ue.children[0];if(lt!=null&<.clientWidth&<!=null&<.clientHeight){const Rt=1/ce.factor,yt=lt.clientWidth*Rt,Ue=lt.clientHeight*Rt;Te.current.scale.set(yt,Ue,1),Ne.current=!0}Te.current.lookAt(at.camera.position)}});const et=Q.useMemo(()=>({vertexShader:y?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[y]);return Q.createElement("group",vr({},z,{ref:$}),x&&!Qe&&Q.createElement("mesh",{castShadow:S,receiveShadow:M,ref:Te},w||Q.createElement("planeGeometry",null),T||Q.createElement("shaderMaterial",{side:Qr,vertexShader:et.vertexShader,fragmentShader:et.fragmentShader})))}),lw=parseInt(_h.replace(/\D+/g,"")),cw=lw>=125?"uv1":"uv2";function YP(a,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,s=[new X,new X,new X],o=new X,f=new X,d=new X,p=new X;function m(T){const w=~~(T.x*n),A=~~(T.y*n),D=~~(T.z*n);return`${w},${A},${D}`}const y=a.index?a.toNonIndexed():a,x=y.attributes.position,v={};for(let T=0,w=x.count/3;Tt&&p.add(W)}p.normalize(),M.setXYZ(A+I,p.x,p.y,p.z)}}return y.setAttribute("normal",M),y}var WP=Object.defineProperty,ZP=(a,e,t)=>e in a?WP(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,KP=(a,e,t)=>(ZP(a,e+"",t),t);class QP{constructor(){KP(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let o=0,f=s.length;oe in a?JP(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,Ft=(a,e,t)=>($P(a,typeof e!="symbol"?e+"":e,t),t);const Ay=new Sf,eA=new Bl,eB=Math.cos(70*(Math.PI/180)),tA=(a,e)=>(a%e+e)%e;let tB=class extends QP{constructor(e,t){super(),Ft(this,"object"),Ft(this,"domElement"),Ft(this,"enabled",!0),Ft(this,"target",new X),Ft(this,"minDistance",0),Ft(this,"maxDistance",1/0),Ft(this,"minZoom",0),Ft(this,"maxZoom",1/0),Ft(this,"minPolarAngle",0),Ft(this,"maxPolarAngle",Math.PI),Ft(this,"minAzimuthAngle",-1/0),Ft(this,"maxAzimuthAngle",1/0),Ft(this,"enableDamping",!1),Ft(this,"dampingFactor",.05),Ft(this,"enableZoom",!0),Ft(this,"zoomSpeed",1),Ft(this,"enableRotate",!0),Ft(this,"rotateSpeed",1),Ft(this,"enablePan",!0),Ft(this,"panSpeed",1),Ft(this,"screenSpacePanning",!0),Ft(this,"keyPanSpeed",7),Ft(this,"zoomToCursor",!1),Ft(this,"autoRotate",!1),Ft(this,"autoRotateSpeed",2),Ft(this,"reverseOrbit",!1),Ft(this,"reverseHorizontalOrbit",!1),Ft(this,"reverseVerticalOrbit",!1),Ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ft(this,"mouseButtons",{LEFT:af.ROTATE,MIDDLE:af.DOLLY,RIGHT:af.PAN}),Ft(this,"touches",{ONE:sf.ROTATE,TWO:sf.DOLLY_PAN}),Ft(this,"target0"),Ft(this,"position0"),Ft(this,"zoom0"),Ft(this,"_domElementKeyEvents",null),Ft(this,"getPolarAngle"),Ft(this,"getAzimuthalAngle"),Ft(this,"setPolarAngle"),Ft(this,"setAzimuthalAngle"),Ft(this,"getDistance"),Ft(this,"getZoomScale"),Ft(this,"listenToKeyEvents"),Ft(this,"stopListenToKeyEvents"),Ft(this,"saveState"),Ft(this,"reset"),Ft(this,"update"),Ft(this,"connect"),Ft(this,"dispose"),Ft(this,"dollyIn"),Ft(this,"dollyOut"),Ft(this,"getScale"),Ft(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>y.phi,this.getAzimuthalAngle=()=>y.theta,this.setPolarAngle=te=>{let Ae=tA(te,2*Math.PI),Ze=y.phi;Ze<0&&(Ze+=2*Math.PI),Ae<0&&(Ae+=2*Math.PI);let ee=Math.abs(Ae-Ze);2*Math.PI-ee{let Ae=tA(te,2*Math.PI),Ze=y.theta;Ze<0&&(Ze+=2*Math.PI),Ae<0&&(Ae+=2*Math.PI);let ee=Math.abs(Ae-Ze);2*Math.PI-een.object.position.distanceTo(n.target),this.listenToKeyEvents=te=>{te.addEventListener("keydown",Re),this._domElementKeyEvents=te},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Re),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(s),n.update(),p=d.NONE},this.update=(()=>{const te=new X,Ae=new X(0,1,0),Ze=new ka().setFromUnitVectors(e.up,Ae),ee=Ze.clone().invert(),Ke=new X,Je=new ka,it=2*Math.PI;return function(){const Ie=n.object.position;Ze.setFromUnitVectors(e.up,Ae),ee.copy(Ze).invert(),te.copy(Ie).sub(n.target),te.applyQuaternion(Ze),y.setFromVector3(te),n.autoRotate&&p===d.NONE&&ce(se()),n.enableDamping?(y.theta+=x.theta*n.dampingFactor,y.phi+=x.phi*n.dampingFactor):(y.theta+=x.theta,y.phi+=x.phi);let ft=n.minAzimuthAngle,Tt=n.maxAzimuthAngle;isFinite(ft)&&isFinite(Tt)&&(ft<-Math.PI?ft+=it:ft>Math.PI&&(ft-=it),Tt<-Math.PI?Tt+=it:Tt>Math.PI&&(Tt-=it),ft<=Tt?y.theta=Math.max(ft,Math.min(Tt,y.theta)):y.theta=y.theta>(ft+Tt)/2?Math.max(ft,y.theta):Math.min(Tt,y.theta)),y.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,y.phi)),y.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(S,n.dampingFactor):n.target.add(S),n.zoomToCursor&&B||n.object.isOrthographicCamera?y.radius=Te(y.radius):y.radius=Te(y.radius*v),te.setFromSpherical(y),te.applyQuaternion(ee),Ie.copy(n.target).add(te),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(x.theta*=1-n.dampingFactor,x.phi*=1-n.dampingFactor,S.multiplyScalar(1-n.dampingFactor)):(x.set(0,0,0),S.set(0,0,0));let ln=!1;if(n.zoomToCursor&&B){let Qt=null;if(n.object instanceof xi&&n.object.isPerspectiveCamera){const $n=te.length();Qt=Te($n*v);const Ei=$n-Qt;n.object.position.addScaledVector(j,Ei),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const $n=new X(q.x,q.y,0);$n.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/v)),n.object.updateProjectionMatrix(),ln=!0;const Ei=new X(q.x,q.y,0);Ei.unproject(n.object),n.object.position.sub(Ei).add($n),n.object.updateMatrixWorld(),Qt=te.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Qt!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Qt).add(n.object.position):(Ay.origin.copy(n.object.position),Ay.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Ay.direction))m||8*(1-Je.dot(n.object.quaternion))>m?(n.dispatchEvent(s),Ke.copy(n.object.position),Je.copy(n.object.quaternion),ln=!1,!0):!1}})(),this.connect=te=>{n.domElement=te,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",wt),n.domElement.addEventListener("pointerdown",ht),n.domElement.addEventListener("pointercancel",F),n.domElement.addEventListener("wheel",Pe)},this.dispose=()=>{var te,Ae,Ze,ee,Ke,Je;n.domElement&&(n.domElement.style.touchAction="auto"),(te=n.domElement)==null||te.removeEventListener("contextmenu",wt),(Ae=n.domElement)==null||Ae.removeEventListener("pointerdown",ht),(Ze=n.domElement)==null||Ze.removeEventListener("pointercancel",F),(ee=n.domElement)==null||ee.removeEventListener("wheel",Pe),(Ke=n.domElement)==null||Ke.ownerDocument.removeEventListener("pointermove",K),(Je=n.domElement)==null||Je.ownerDocument.removeEventListener("pointerup",F),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener("keydown",Re)};const n=this,s={type:"change"},o={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let p=d.NONE;const m=1e-6,y=new Ax,x=new Ax;let v=1;const S=new X,M=new ze,T=new ze,w=new ze,A=new ze,D=new ze,N=new ze,U=new ze,I=new ze,z=new ze,j=new X,q=new ze;let B=!1;const P=[],W={};function se(){return 2*Math.PI/60/60*n.autoRotateSpeed}function ae(){return Math.pow(.95,n.zoomSpeed)}function ce(te){n.reverseOrbit||n.reverseHorizontalOrbit?x.theta+=te:x.theta-=te}function ue(te){n.reverseOrbit||n.reverseVerticalOrbit?x.phi+=te:x.phi-=te}const V=(()=>{const te=new X;return function(Ze,ee){te.setFromMatrixColumn(ee,0),te.multiplyScalar(-Ze),S.add(te)}})(),$=(()=>{const te=new X;return function(Ze,ee){n.screenSpacePanning===!0?te.setFromMatrixColumn(ee,1):(te.setFromMatrixColumn(ee,0),te.crossVectors(n.object.up,te)),te.multiplyScalar(Ze),S.add(te)}})(),J=(()=>{const te=new X;return function(Ze,ee){const Ke=n.domElement;if(Ke&&n.object instanceof xi&&n.object.isPerspectiveCamera){const Je=n.object.position;te.copy(Je).sub(n.target);let it=te.length();it*=Math.tan(n.object.fov/2*Math.PI/180),V(2*Ze*it/Ke.clientHeight,n.object.matrix),$(2*ee*it/Ke.clientHeight,n.object.matrix)}else Ke&&n.object instanceof qo&&n.object.isOrthographicCamera?(V(Ze*(n.object.right-n.object.left)/n.object.zoom/Ke.clientWidth,n.object.matrix),$(ee*(n.object.top-n.object.bottom)/n.object.zoom/Ke.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function he(te){n.object instanceof xi&&n.object.isPerspectiveCamera||n.object instanceof qo&&n.object.isOrthographicCamera?v=te:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ve(te){he(v/te)}function Y(te){he(v*te)}function oe(te){if(!n.zoomToCursor||!n.domElement)return;B=!0;const Ae=n.domElement.getBoundingClientRect(),Ze=te.clientX-Ae.left,ee=te.clientY-Ae.top,Ke=Ae.width,Je=Ae.height;q.x=Ze/Ke*2-1,q.y=-(ee/Je)*2+1,j.set(q.x,q.y,1).unproject(n.object).sub(n.object.position).normalize()}function Te(te){return Math.max(n.minDistance,Math.min(n.maxDistance,te))}function Ne(te){M.set(te.clientX,te.clientY)}function Qe(te){oe(te),U.set(te.clientX,te.clientY)}function le(te){A.set(te.clientX,te.clientY)}function xe(te){T.set(te.clientX,te.clientY),w.subVectors(T,M).multiplyScalar(n.rotateSpeed);const Ae=n.domElement;Ae&&(ce(2*Math.PI*w.x/Ae.clientHeight),ue(2*Math.PI*w.y/Ae.clientHeight)),M.copy(T),n.update()}function Ge(te){I.set(te.clientX,te.clientY),z.subVectors(I,U),z.y>0?ve(ae()):z.y<0&&Y(ae()),U.copy(I),n.update()}function et(te){D.set(te.clientX,te.clientY),N.subVectors(D,A).multiplyScalar(n.panSpeed),J(N.x,N.y),A.copy(D),n.update()}function at(te){oe(te),te.deltaY<0?Y(ae()):te.deltaY>0&&ve(ae()),n.update()}function lt(te){let Ae=!1;switch(te.code){case n.keys.UP:J(0,n.keyPanSpeed),Ae=!0;break;case n.keys.BOTTOM:J(0,-n.keyPanSpeed),Ae=!0;break;case n.keys.LEFT:J(n.keyPanSpeed,0),Ae=!0;break;case n.keys.RIGHT:J(-n.keyPanSpeed,0),Ae=!0;break}Ae&&(te.preventDefault(),n.update())}function Rt(){if(P.length==1)M.set(P[0].pageX,P[0].pageY);else{const te=.5*(P[0].pageX+P[1].pageX),Ae=.5*(P[0].pageY+P[1].pageY);M.set(te,Ae)}}function yt(){if(P.length==1)A.set(P[0].pageX,P[0].pageY);else{const te=.5*(P[0].pageX+P[1].pageX),Ae=.5*(P[0].pageY+P[1].pageY);A.set(te,Ae)}}function Ue(){const te=P[0].pageX-P[1].pageX,Ae=P[0].pageY-P[1].pageY,Ze=Math.sqrt(te*te+Ae*Ae);U.set(0,Ze)}function Z(){n.enableZoom&&Ue(),n.enablePan&&yt()}function ke(){n.enableZoom&&Ue(),n.enableRotate&&Rt()}function Xe(te){if(P.length==1)T.set(te.pageX,te.pageY);else{const Ze=St(te),ee=.5*(te.pageX+Ze.x),Ke=.5*(te.pageY+Ze.y);T.set(ee,Ke)}w.subVectors(T,M).multiplyScalar(n.rotateSpeed);const Ae=n.domElement;Ae&&(ce(2*Math.PI*w.x/Ae.clientHeight),ue(2*Math.PI*w.y/Ae.clientHeight)),M.copy(T)}function tt(te){if(P.length==1)D.set(te.pageX,te.pageY);else{const Ae=St(te),Ze=.5*(te.pageX+Ae.x),ee=.5*(te.pageY+Ae.y);D.set(Ze,ee)}N.subVectors(D,A).multiplyScalar(n.panSpeed),J(N.x,N.y),A.copy(D)}function qe(te){const Ae=St(te),Ze=te.pageX-Ae.x,ee=te.pageY-Ae.y,Ke=Math.sqrt(Ze*Ze+ee*ee);I.set(0,Ke),z.set(0,Math.pow(I.y/U.y,n.zoomSpeed)),ve(z.y),U.copy(I)}function ot(te){n.enableZoom&&qe(te),n.enablePan&&tt(te)}function nt(te){n.enableZoom&&qe(te),n.enableRotate&&Xe(te)}function ht(te){var Ae,Ze;n.enabled!==!1&&(P.length===0&&((Ae=n.domElement)==null||Ae.ownerDocument.addEventListener("pointermove",K),(Ze=n.domElement)==null||Ze.ownerDocument.addEventListener("pointerup",F)),_t(te),te.pointerType==="touch"?Mt(te):ye(te))}function K(te){n.enabled!==!1&&(te.pointerType==="touch"?ct(te):Oe(te))}function F(te){var Ae,Ze,ee;je(te),P.length===0&&((Ae=n.domElement)==null||Ae.releasePointerCapture(te.pointerId),(Ze=n.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",K),(ee=n.domElement)==null||ee.ownerDocument.removeEventListener("pointerup",F)),n.dispatchEvent(f),p=d.NONE}function ye(te){let Ae;switch(te.button){case 0:Ae=n.mouseButtons.LEFT;break;case 1:Ae=n.mouseButtons.MIDDLE;break;case 2:Ae=n.mouseButtons.RIGHT;break;default:Ae=-1}switch(Ae){case af.DOLLY:if(n.enableZoom===!1)return;Qe(te),p=d.DOLLY;break;case af.ROTATE:if(te.ctrlKey||te.metaKey||te.shiftKey){if(n.enablePan===!1)return;le(te),p=d.PAN}else{if(n.enableRotate===!1)return;Ne(te),p=d.ROTATE}break;case af.PAN:if(te.ctrlKey||te.metaKey||te.shiftKey){if(n.enableRotate===!1)return;Ne(te),p=d.ROTATE}else{if(n.enablePan===!1)return;le(te),p=d.PAN}break;default:p=d.NONE}p!==d.NONE&&n.dispatchEvent(o)}function Oe(te){if(n.enabled!==!1)switch(p){case d.ROTATE:if(n.enableRotate===!1)return;xe(te);break;case d.DOLLY:if(n.enableZoom===!1)return;Ge(te);break;case d.PAN:if(n.enablePan===!1)return;et(te);break}}function Pe(te){n.enabled===!1||n.enableZoom===!1||p!==d.NONE&&p!==d.ROTATE||(te.preventDefault(),n.dispatchEvent(o),at(te),n.dispatchEvent(f))}function Re(te){n.enabled===!1||n.enablePan===!1||lt(te)}function Mt(te){switch(Ye(te),P.length){case 1:switch(n.touches.ONE){case sf.ROTATE:if(n.enableRotate===!1)return;Rt(),p=d.TOUCH_ROTATE;break;case sf.PAN:if(n.enablePan===!1)return;yt(),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(n.touches.TWO){case sf.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Z(),p=d.TOUCH_DOLLY_PAN;break;case sf.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}p!==d.NONE&&n.dispatchEvent(o)}function ct(te){switch(Ye(te),p){case d.TOUCH_ROTATE:if(n.enableRotate===!1)return;Xe(te),n.update();break;case d.TOUCH_PAN:if(n.enablePan===!1)return;tt(te),n.update();break;case d.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ot(te),n.update();break;case d.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;nt(te),n.update();break;default:p=d.NONE}}function wt(te){n.enabled!==!1&&te.preventDefault()}function _t(te){P.push(te)}function je(te){delete W[te.pointerId];for(let Ae=0;Ae{Y(te),n.update()},this.dollyOut=(te=ae())=>{ve(te),n.update()},this.getScale=()=>v,this.setScale=te=>{he(te),n.update()},this.getZoomScale=()=>ae(),t!==void 0&&this.connect(t),this.update()}};const nA=new Zi,My=new X;class P1 extends A1{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new At(e,3)),this.setAttribute("uv",new At(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new Sx(t,6,1);return this.setAttribute("instanceStart",new Zs(n,3,0)),this.setAttribute("instanceEnd",new Zs(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const s=new Sx(n,t*2,1);return this.setAttribute("instanceColorStart",new Zs(s,t,0)),this.setAttribute("instanceColorEnd",new Zs(s,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new p1(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zi);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),nA.setFromBufferAttribute(t),this.boundingBox.union(nA))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ki),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let s=0;for(let o=0,f=e.count;o + #include + #include + #include + + uniform float linewidth; + uniform vec2 resolution; + + attribute vec3 instanceStart; + attribute vec3 instanceEnd; + + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + varying vec4 vLineColor; + attribute vec4 instanceColorStart; + attribute vec4 instanceColorEnd; + #else + varying vec3 vLineColor; + attribute vec3 instanceColorStart; + attribute vec3 instanceColorEnd; + #endif + #endif + + #ifdef WORLD_UNITS + + varying vec4 worldPos; + varying vec3 worldStart; + varying vec3 worldEnd; + + #ifdef USE_DASH + + varying vec2 vUv; + + #endif + + #else + + varying vec2 vUv; + + #endif + + #ifdef USE_DASH + + uniform float dashScale; + attribute float instanceDistanceStart; + attribute float instanceDistanceEnd; + varying float vLineDistance; + + #endif + + void trimSegment( const in vec4 start, inout vec4 end ) { + + // trim end segment so it terminates between the camera plane and the near plane + + // conservative estimate of the near plane + float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column + float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column + float nearEstimate = - 0.5 * b / a; + + float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); + + end.xyz = mix( start.xyz, end.xyz, alpha ); + + } + + void main() { + + #ifdef USE_COLOR + + vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; + + #endif + + #ifdef USE_DASH + + vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; + vUv = uv; + + #endif + + float aspect = resolution.x / resolution.y; + + // camera space + vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); + vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); + + #ifdef WORLD_UNITS + + worldStart = start.xyz; + worldEnd = end.xyz; + + #else + + vUv = uv; + + #endif + + // special case for perspective projection, and segments that terminate either in, or behind, the camera plane + // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space + // but we need to perform ndc-space calculations in the shader, so we must address this issue directly + // perhaps there is a more elegant solution -- WestLangley + + bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column + + if ( perspective ) { + + if ( start.z < 0.0 && end.z >= 0.0 ) { + + trimSegment( start, end ); + + } else if ( end.z < 0.0 && start.z >= 0.0 ) { + + trimSegment( end, start ); + + } + + } + + // clip space + vec4 clipStart = projectionMatrix * start; + vec4 clipEnd = projectionMatrix * end; + + // ndc space + vec3 ndcStart = clipStart.xyz / clipStart.w; + vec3 ndcEnd = clipEnd.xyz / clipEnd.w; + + // direction + vec2 dir = ndcEnd.xy - ndcStart.xy; + + // account for clip-space aspect ratio + dir.x *= aspect; + dir = normalize( dir ); + + #ifdef WORLD_UNITS + + // get the offset direction as perpendicular to the view vector + vec3 worldDir = normalize( end.xyz - start.xyz ); + vec3 offset; + if ( position.y < 0.5 ) { + + offset = normalize( cross( start.xyz, worldDir ) ); + + } else { + + offset = normalize( cross( end.xyz, worldDir ) ); + + } + + // sign flip + if ( position.x < 0.0 ) offset *= - 1.0; + + float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); + + // don't extend the line if we're rendering dashes because we + // won't be rendering the endcaps + #ifndef USE_DASH + + // extend the line bounds to encompass endcaps + start.xyz += - worldDir * linewidth * 0.5; + end.xyz += worldDir * linewidth * 0.5; + + // shift the position of the quad so it hugs the forward edge of the line + offset.xy -= dir * forwardOffset; + offset.z += 0.5; + + #endif + + // endcaps + if ( position.y > 1.0 || position.y < 0.0 ) { + + offset.xy += dir * 2.0 * forwardOffset; + + } + + // adjust for linewidth + offset *= linewidth * 0.5; + + // set the world position + worldPos = ( position.y < 0.5 ) ? start : end; + worldPos.xyz += offset; + + // project the worldpos + vec4 clip = projectionMatrix * worldPos; + + // shift the depth of the projected points so the line + // segments overlap neatly + vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; + clip.z = clipPose.z * clip.w; + + #else + + vec2 offset = vec2( dir.y, - dir.x ); + // undo aspect ratio adjustment + dir.x /= aspect; + offset.x /= aspect; + + // sign flip + if ( position.x < 0.0 ) offset *= - 1.0; + + // endcaps + if ( position.y < 0.0 ) { + + offset += - dir; + + } else if ( position.y > 1.0 ) { + + offset += dir; + + } + + // adjust for linewidth + offset *= linewidth; + + // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... + offset /= resolution.y; + + // select end + vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; + + // back to clip space + offset *= clip.w; + + clip.xy += offset; + + #endif + + gl_Position = clip; + + vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation + + #include + #include + #include + + } + `,fragmentShader:` + uniform vec3 diffuse; + uniform float opacity; + uniform float linewidth; + + #ifdef USE_DASH + + uniform float dashOffset; + uniform float dashSize; + uniform float gapSize; + + #endif + + varying float vLineDistance; + + #ifdef WORLD_UNITS + + varying vec4 worldPos; + varying vec3 worldStart; + varying vec3 worldEnd; + + #ifdef USE_DASH + + varying vec2 vUv; + + #endif + + #else + + varying vec2 vUv; + + #endif + + #include + #include + #include + #include + + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + varying vec4 vLineColor; + #else + varying vec3 vLineColor; + #endif + #endif + + vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { + + float mua; + float mub; + + vec3 p13 = p1 - p3; + vec3 p43 = p4 - p3; + + vec3 p21 = p2 - p1; + + float d1343 = dot( p13, p43 ); + float d4321 = dot( p43, p21 ); + float d1321 = dot( p13, p21 ); + float d4343 = dot( p43, p43 ); + float d2121 = dot( p21, p21 ); + + float denom = d2121 * d4343 - d4321 * d4321; + + float numer = d1343 * d4321 - d1321 * d4343; + + mua = numer / denom; + mua = clamp( mua, 0.0, 1.0 ); + mub = ( d1343 + d4321 * ( mua ) ) / d4343; + mub = clamp( mub, 0.0, 1.0 ); + + return vec2( mua, mub ); + + } + + void main() { + + #include + + #ifdef USE_DASH + + if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps + + if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX + + #endif + + float alpha = opacity; + + #ifdef WORLD_UNITS + + // Find the closest points on the view ray and the line segment + vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; + vec3 lineDir = worldEnd - worldStart; + vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); + + vec3 p1 = worldStart + lineDir * params.x; + vec3 p2 = rayEnd * params.y; + vec3 delta = p1 - p2; + float len = length( delta ); + float norm = len / linewidth; + + #ifndef USE_DASH + + #ifdef USE_ALPHA_TO_COVERAGE + + float dnorm = fwidth( norm ); + alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); + + #else + + if ( norm > 0.5 ) { + + discard; + + } + + #endif + + #endif + + #else + + #ifdef USE_ALPHA_TO_COVERAGE + + // artifacts appear on some hardware if a derivative is taken within a conditional + float a = vUv.x; + float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; + float len2 = a * a + b * b; + float dlen = fwidth( len2 ); + + if ( abs( vUv.y ) > 1.0 ) { + + alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); + + } + + #else + + if ( abs( vUv.y ) > 1.0 ) { + + float a = vUv.x; + float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; + float len2 = a * a + b * b; + + if ( len2 > 1.0 ) discard; + + } + + #endif + + #endif + + vec4 diffuseColor = vec4( diffuse, alpha ); + #ifdef USE_COLOR + #ifdef USE_LINE_COLOR_ALPHA + diffuseColor *= vLineColor; + #else + diffuseColor.rgb *= vLineColor; + #endif + #endif + + #include + + gl_FragColor = diffuseColor; + + #include + #include <${lw>=154?"colorspace_fragment":"encodings_fragment"}> + #include + #include + + } + `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const ub=new un,iA=new X,aA=new X,xa=new un,va=new un,Io=new un,fb=new X,db=new Gt,ba=new lE,sA=new X,Ey=new Zi,wy=new Ki,Fo=new un;let Ho,gf;function rA(a,e,t){return Fo.set(0,0,-e,1).applyMatrix4(a.projectionMatrix),Fo.multiplyScalar(1/Fo.w),Fo.x=gf/t.width,Fo.y=gf/t.height,Fo.applyMatrix4(a.projectionMatrixInverse),Fo.multiplyScalar(1/Fo.w),Math.abs(Math.max(Fo.x,Fo.y))}function nB(a,e){const t=a.matrixWorld,n=a.geometry,s=n.attributes.instanceStart,o=n.attributes.instanceEnd,f=Math.min(n.instanceCount,s.count);for(let d=0,p=f;dx&&va.z>x)continue;if(xa.z>x){const N=xa.z-va.z,U=(xa.z-x)/N;xa.lerp(va,U)}else if(va.z>x){const N=va.z-xa.z,U=(va.z-x)/N;va.lerp(xa,U)}xa.applyMatrix4(n),va.applyMatrix4(n),xa.multiplyScalar(1/xa.w),va.multiplyScalar(1/va.w),xa.x*=o.x/2,xa.y*=o.y/2,va.x*=o.x/2,va.y*=o.y/2,ba.start.copy(xa),ba.start.z=0,ba.end.copy(va),ba.end.z=0;const T=ba.closestPointToPointParameter(fb,!0);ba.at(T,sA);const w=Q0.lerp(xa.z,va.z,T),A=w>=-1&&w<=1,D=fb.distanceTo(sA)A.size),S=Q.useMemo(()=>f?new fw:new aB,[f]),[M]=Q.useState(()=>new B1),T=(n==null||(y=n[0])==null?void 0:y.length)===4?4:3,w=Q.useMemo(()=>{const A=f?new P1:new uw,D=e.map(N=>{const U=Array.isArray(N);return N instanceof X||N instanceof un?[N.x,N.y,N.z]:N instanceof ze?[N.x,N.y,0]:U&&N.length===3?[N[0],N[1],N[2]]:U&&N.length===2?[N[0],N[1],0]:N});if(A.setPositions(D.flat()),n){t=16777215;const N=n.map(U=>U instanceof gt?U.toArray():U);A.setColors(N.flat(),T)}return A},[e,f,n,T]);return Q.useLayoutEffect(()=>{S.computeLineDistances()},[e,S]),Q.useLayoutEffect(()=>{d?M.defines.USE_DASH="":delete M.defines.USE_DASH,M.needsUpdate=!0},[d,M]),Q.useEffect(()=>()=>{w.dispose(),M.dispose()},[w]),Q.createElement("primitive",vr({object:S,ref:m},p),Q.createElement("primitive",{object:w,attach:"geometry"}),Q.createElement("primitive",vr({object:M,attach:"material",color:t,vertexColors:!!n,resolution:[v.width,v.height],linewidth:(x=s??o)!==null&&x!==void 0?x:1,dashed:d,transparent:T===4},p)))});function hw(a,e,t,n){var s;return s=class extends hs{constructor(o){super({vertexShader:e,fragmentShader:t,...o});for(const f in a)this.uniforms[f]=new uv(a[f]),Object.defineProperty(this,f,{get(){return this.uniforms[f].value},set(d){this.uniforms[f].value=d}});this.uniforms=j0.clone(this.uniforms)}},s.key=Q0.generateUUID(),s}const hb=a=>a===Object(a)&&!Array.isArray(a)&&typeof a!="function";function I1(a,e){const t=Ts(o=>o.gl),n=Zc(wf,hb(a)?Object.values(a):a);return Q.useLayoutEffect(()=>{e?.(n)},[e]),Q.useEffect(()=>{if("initTexture"in t){let o=[];Array.isArray(n)?o=n:n instanceof ui?o=[n]:hb(n)&&(o=Object.values(n)),o.forEach(f=>{f instanceof ui&&t.initTexture(f)})}},[t,n]),Q.useMemo(()=>{if(hb(a)){const o={};let f=0;for(const d in a)o[d]=n[f++];return o}else return n},[a,n])}I1.preload=a=>Zc.preload(wf,a);I1.clear=a=>Zc.clear(wf,a);const sB=()=>parseInt(_h.replace(/\D+/g,"")),gv=sB(),oA=hw({screenspace:!1,color:new gt("black"),opacity:1,thickness:.05,size:new ze},`#include + #include + #include + #include + uniform float thickness; + uniform bool screenspace; + uniform vec2 size; + void main() { + #if defined (USE_SKINNING) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + vec4 tNormal = vec4(normal, 0.0); + vec4 tPosition = vec4(transformed, 1.0); + #ifdef USE_INSTANCING + tNormal = instanceMatrix * tNormal; + tPosition = instanceMatrix * tPosition; + #endif + if (screenspace) { + vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; + gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); + } else { + vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; + vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; + vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; + clipPosition.xy += offset; + gl_Position = clipPosition; + } + }`,`uniform vec3 color; + uniform float opacity; + #include + void main(){ + #include + gl_FragColor = vec4(color, opacity); + #include + #include <${gv>=154?"colorspace_fragment":"encodings_fragment"}> + }`);function pw({color:a="black",opacity:e=1,transparent:t=!1,screenspace:n=!1,toneMapped:s=!0,polygonOffset:o=!1,polygonOffsetFactor:f=0,renderOrder:d=0,thickness:p=.05,angle:m=Math.PI,clippingPlanes:y,...x}){const v=Q.useRef(null),[S]=Q.useState(()=>new oA({side:Ma})),{gl:M}=Ts(),T=M.getDrawingBufferSize(new ze);Q.useMemo(()=>N1({OutlinesMaterial:oA}),[]);const w=Q.useRef(0),A=Q.useRef(null);return Q.useLayoutEffect(()=>{const D=v.current;if(!D)return;const N=D.parent;if(N&&N.geometry&&(w.current!==m||A.current!==N.geometry)){var U;w.current=m,A.current=N.geometry;let I=(U=D.children)==null?void 0:U[0];I&&(m&&I.geometry.dispose(),D.remove(I)),N.skeleton?(I=new i1,I.material=S,I.bind(N.skeleton,N.bindMatrix),D.add(I)):N.isInstancedMesh?(I=new s1(N.geometry,S,N.count),I.instanceMatrix=N.instanceMatrix,D.add(I)):(I=new Li,I.material=S,D.add(I)),I.geometry=m?YP(N.geometry,m):N.geometry,I.morphTargetInfluences=N.morphTargetInfluences,I.morphTargetDictionary=N.morphTargetDictionary}}),Q.useLayoutEffect(()=>{const D=v.current;if(!D)return;const N=D.children[0];if(N){N.renderOrder=d;const U=D.parent;jo(N,{morphTargetInfluences:U.morphTargetInfluences,morphTargetDictionary:U.morphTargetDictionary}),jo(N.material,{transparent:t,thickness:p,color:a,opacity:e,size:T,screenspace:n,toneMapped:s,polygonOffset:o,polygonOffsetFactor:f,clippingPlanes:y,clipping:y&&y.length>0})}}),Q.useEffect(()=>()=>{const D=v.current;if(!D)return;const N=D.children[0];N&&(m&&N.geometry.dispose(),D.remove(N))},[]),Q.createElement("group",vr({ref:v},x))}const rB=Q.forwardRef(({makeDefault:a,camera:e,regress:t,domElement:n,enableDamping:s=!0,keyEvents:o=!1,onChange:f,onStart:d,onEnd:p,...m},y)=>{const x=Ts(z=>z.invalidate),v=Ts(z=>z.camera),S=Ts(z=>z.gl),M=Ts(z=>z.events),T=Ts(z=>z.setEvents),w=Ts(z=>z.set),A=Ts(z=>z.get),D=Ts(z=>z.performance),N=e||v,U=n||M.connected||S.domElement,I=Q.useMemo(()=>new tB(N),[N]);return Th(()=>{I.enabled&&I.update()},-1),Q.useEffect(()=>(o&&I.connect(o===!0?U:o),I.connect(U),()=>void I.dispose()),[o,U,t,I,x]),Q.useEffect(()=>{const z=B=>{x(),t&&D.regress(),f&&f(B)},j=B=>{d&&d(B)},q=B=>{p&&p(B)};return I.addEventListener("change",z),I.addEventListener("start",j),I.addEventListener("end",q),()=>{I.removeEventListener("start",j),I.removeEventListener("end",q),I.removeEventListener("change",z)}},[f,d,p,I,x,T]),Q.useEffect(()=>{if(a){const z=A().controls;return w({controls:I}),()=>w({controls:z})}},[a,I]),Q.createElement("primitive",vr({ref:y,object:I,enableDamping:s},m))}),pb=gv>=154?"opaque_fragment":"output_fragment";class oB extends Wx{constructor(e){super(e),this.onBeforeCompile=(t,n)=>{const{isWebGL2:s}=n.capabilities;t.fragmentShader=t.fragmentShader.replace(`#include <${pb}>`,` + ${s?`#include <${pb}>`:`#extension GL_OES_standard_derivatives : enable +#include <${pb}>`} + vec2 cxy = 2.0 * gl_PointCoord - 1.0; + float r = dot(cxy, cxy); + float delta = fwidth(r); + float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r); + gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a ); + #include + #include <${gv>=154?"colorspace_fragment":"encodings_fragment"}> + `)}}}const lB=Q.forwardRef((a,e)=>{const[t]=Q.useState(()=>new oB(null));return Q.createElement("primitive",vr({},a,{object:t,ref:e,attach:"material"}))});class cB extends hs{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:` + uniform float time; + attribute float size; + varying vec3 vColor; + void main() { + vColor = color; + vec4 mvPosition = modelViewMatrix * vec4(position, 0.5); + gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(time + 100.0)); + gl_Position = projectionMatrix * mvPosition; + }`,fragmentShader:` + uniform sampler2D pointTexture; + uniform float fade; + varying vec3 vColor; + void main() { + float opacity = 1.0; + if (fade == 1.0) { + float d = distance(gl_PointCoord, vec2(0.5, 0.5)); + opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25))); + } + gl_FragColor = vec4(vColor, opacity); + + #include + #include <${gv>=154?"colorspace_fragment":"encodings_fragment"}> + }`})}}const uB=a=>new X().setFromSpherical(new Ax(a,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),fB=Q.forwardRef(({radius:a=100,depth:e=50,count:t=5e3,saturation:n=0,factor:s=4,fade:o=!1,speed:f=1},d)=>{const p=Q.useRef(null),[m,y,x]=Q.useMemo(()=>{const S=[],M=[],T=Array.from({length:t},()=>(.5+.5*Math.random())*s),w=new gt;let A=a+e;const D=e/t;for(let N=0;Np.current&&(p.current.uniforms.time.value=S.clock.elapsedTime*f));const[v]=Q.useState(()=>new cB);return Q.createElement("points",{ref:d},Q.createElement("bufferGeometry",null,Q.createElement("bufferAttribute",{attach:"attributes-position",args:[m,3]}),Q.createElement("bufferAttribute",{attach:"attributes-color",args:[y,3]}),Q.createElement("bufferAttribute",{attach:"attributes-size",args:[x,1]})),Q.createElement("primitive",{ref:p,object:v,attach:"material",blending:Uy,"uniforms-fade-value":o,depthWrite:!1,transparent:!0,vertexColors:!0}))});let nf,m0;const dB=Q.createContext(null),lA=new Gt,cA=new X,hB=Q.forwardRef(({children:a,range:e,limit:t=1e3,...n},s)=>{const o=Q.useRef(null);Q.useImperativeHandle(s,()=>o.current,[]);const[f,d]=Q.useState([]),[[p,m,y]]=Q.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);Q.useEffect(()=>{o.current.geometry.attributes.position.needsUpdate=!0}),Th(()=>{for(o.current.updateMatrix(),o.current.updateMatrixWorld(),lA.copy(o.current.matrixWorld).invert(),o.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,f.length),nf=0;nf({getParent:()=>o,subscribe:v=>(d(S=>[...S,v]),()=>d(S=>S.filter(M=>M.current!==v.current)))}),[]);return Q.createElement("points",vr({userData:{instances:f},matrixAutoUpdate:!1,ref:o,raycast:()=>null},n),Q.createElement("bufferGeometry",null,Q.createElement("bufferAttribute",{attach:"attributes-position",args:[p,3],usage:hf}),Q.createElement("bufferAttribute",{attach:"attributes-color",args:[m,3],usage:hf}),Q.createElement("bufferAttribute",{attach:"attributes-size",args:[y,1],usage:hf})),Q.createElement(dB.Provider,{value:x},a))}),pB=Q.forwardRef(({children:a,positions:e,colors:t,sizes:n,stride:s=3,...o},f)=>{const d=Q.useRef(null);return Q.useImperativeHandle(f,()=>d.current,[]),Th(()=>{const p=d.current.geometry.attributes;p.position.needsUpdate=!0,t&&(p.color.needsUpdate=!0),n&&(p.size.needsUpdate=!0)}),Q.createElement("points",vr({ref:d},o),Q.createElement("bufferGeometry",null,Q.createElement("bufferAttribute",{attach:"attributes-position",args:[e,s],usage:hf}),t&&Q.createElement("bufferAttribute",{attach:"attributes-color",args:[t,s],count:t.length/s,usage:hf}),n&&Q.createElement("bufferAttribute",{attach:"attributes-size",args:[n,1],count:n.length/s,usage:hf})),a)}),mB=Q.forwardRef((a,e)=>a.positions instanceof Float32Array?Q.createElement(pB,vr({},a,{ref:e})):Q.createElement(hB,vr({},a,{ref:e})));function gB(a,e){if(a instanceof RegExp)return{keys:!1,pattern:a};var t,n,s,o,f=[],d="",p=a.split("/");for(p[0]||p.shift();s=p.shift();)t=s[0],t==="*"?(f.push(t),d+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(n=s.indexOf("?",1),o=s.indexOf(".",1),f.push(s.substring(1,~n?n:~o?o:s.length)),d+=~n&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(d+=(~n?"?":"")+"\\"+s.substring(o))):d+="/"+s;return{keys:f,pattern:new RegExp("^"+d+(e?"(?=$|/)":"/?$"),"i")}}var yB=yE();const xB=xT.useInsertionEffect,vB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bB=vB?Q.useLayoutEffect:Q.useEffect,_B=xB||bB,mw=a=>{const e=Q.useRef([a,(...t)=>e[0](...t)]).current;return _B(()=>{e[0]=a}),e[1]},SB="popstate",F1="pushState",j1="replaceState",AB="hashchange",uA=[SB,F1,j1,AB],MB=a=>{for(const e of uA)addEventListener(e,a);return()=>{for(const e of uA)removeEventListener(e,a)}},gw=(a,e)=>yB.useSyncExternalStore(MB,a,e),EB=()=>location.search,wB=({ssrSearch:a=""}={})=>gw(EB,()=>a),fA=()=>location.pathname,TB=({ssrPath:a}={})=>gw(fA,a?()=>a:fA),CB=(a,{replace:e=!1,state:t=null}={})=>history[e?j1:F1](t,"",a),RB=(a={})=>[TB(a),CB],dA=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[dA]>"u"){for(const a of[F1,j1]){const e=history[a];history[a]=function(){const t=e.apply(this,arguments),n=new Event(a);return n.arguments=arguments,dispatchEvent(n),t}}Object.defineProperty(window,dA,{value:!0})}const DB=(a,e)=>e.toLowerCase().indexOf(a.toLowerCase())?"~"+e:e.slice(a.length)||"/",yw=(a="")=>a==="/"?"":a,NB=(a,e)=>a[0]==="~"?a.slice(1):yw(e)+a,OB=(a="",e)=>DB(hA(yw(a)),hA(e)),hA=a=>{try{return decodeURI(a)}catch{return a}},UB={hook:RB,searchHook:wB,parser:gB,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:a=>a},LB=Q.createContext(UB),xw=()=>Q.useContext(LB),zB={};Q.createContext(zB);const vw=a=>{const[e,t]=a.hook(a);return[OB(a.base,e),mw((n,s)=>t(NB(n,a.base),s))]},lm=()=>vw(xw());Q.forwardRef((a,e)=>{const t=xw(),[n,s]=vw(t),{to:o="",href:f=o,onClick:d,asChild:p,children:m,className:y,replace:x,state:v,...S}=a,M=mw(w=>{w.ctrlKey||w.metaKey||w.altKey||w.shiftKey||w.button!==0||(d?.(w),w.defaultPrevented||(w.preventDefault(),s(f,a)))}),T=t.hrefs(f[0]==="~"?f.slice(1):t.base+f,t);return p&&Q.isValidElement(m)?Q.cloneElement(m,{onClick:M,href:T}):Q.createElement("a",{...S,onClick:M,href:T,className:y?.call?y(n===f):y,children:m,ref:e})});const Ch=a=>{const{throttlePhysics:e,domHeavyActive:t}=eo(),n=Q.useRef(0);Th((s,o)=>{if(!t||e==="off"){a(s,o);return}n.current+=1;let f=1;e==="light"?f=3:e==="aggressive"&&(f=6),n.current%f===0&&a(s,o*f)})},Ty=new X(0,15,35),PB=.35,BB=.4,IB=.05;function FB({homeFocus:a,getFollowPos:e,selectedPlanetId:t,isHome:n,recenterToken:s,onTransitionStart:o,onTransitionEnd:f}){const{camera:d}=Ts(),p=Q.useRef(null),m=Q.useRef(new X(...a.target)),y=Q.useRef({active:!1,t:0,fromPos:new X,fromTarget:new X,toPos:new X,toTarget:new X}),x=Q.useRef(new X),v=Q.useRef(new X),S=Q.useRef(0);return Q.useEffect(()=>{d.position.set(...a.cameraPos),m.current.set(...a.target),d.lookAt(m.current),p.current&&(p.current.enabled=!0,p.current.target.copy(m.current),p.current.update())},[d,a]),Q.useEffect(()=>{const M=y.current;M.active=!0,M.t=0,M.fromPos.copy(d.position),M.fromTarget.copy(m.current),!n&&t&&(S.current=0),(n||!t)&&(M.toPos.set(...a.cameraPos),M.toTarget.set(...a.target)),p.current&&(p.current.enabled=!1),o?.({isHome:n,selectedPlanetId:t??null})},[n,t,d,a,s]),Ch((M,T)=>{const w=y.current,A=e?e():null;if(w.active){w.t+=T/PB;const D=Math.min(1,w.t),N=x.current,U=v.current;!n&&A&&t?(N.fromArray(A),U.copy(N).add(Ty)):(N.copy(w.toTarget),U.copy(w.toPos)),d.position.lerpVectors(w.fromPos,U,D),m.current.lerpVectors(w.fromTarget,N,D),d.lookAt(m.current),(d.position.distanceTo(U)=1)&&(w.active=!1,d.position.copy(U),m.current.copy(N),d.lookAt(m.current),f?.({isHome:n,selectedPlanetId:t??null}),n&&p.current&&(p.current.enabled=!0,p.current.target.copy(m.current),p.current.update()));return}if(!n&&A){const D=m.current.fromArray(A),N=Math.hypot(Ty.x,Ty.z),U=Ty.y;S.current+=IB*T;const I=v.current.set(D.x+Math.sin(S.current)*N,D.y+U,D.z+Math.cos(S.current)*N);d.position.copy(I),d.lookAt(D);return}n&&p.current&&(p.current.update(),m.current.copy(p.current.target))}),n?R.jsx(rB,{ref:p,enableDamping:!0,dampingFactor:.08,enablePan:!0,minDistance:40,maxDistance:200}):null}const bw="/assets/normalrough-C5t319KU.png",_w="/assets/normalrough2-CQ66hHvp.jpg",Sw="/assets/normalrough3-CZuQZvxn.jpg",jB=({parentSize:a=1,color:e="#aaaaaa"})=>{const t=Q.useRef(),n=Q.useRef(),s=Q.useRef(),o=Q.useRef(new X),f=Q.useRef(Math.random()*Math.PI*2),{paused:d,showOrbits:p,shadowsEnabled:m}=eo(),y=Zc(wf,[bw,_w,Sw]),[x,v]=Q.useMemo(()=>{if(!y||y.length===0)return[null,null];if(y.length===1)return[y[0],y[0]];const w=Math.floor(Math.random()*y.length);let A=Math.floor(Math.random()*y.length);return A===w&&(A=(A+1)%y.length),[y[w],y[A]]},[y]),[S]=Q.useState(()=>{const w=a*1.6,A=a*.6,D=w+Math.random()*A,N=(Math.random()-.5)*Math.PI,U=(Math.random()-.5)*Math.PI,I=.6+Math.random()*.8,z=Q0.clamp(a*(.18+Math.random()*.12),.15,.6),j=.6+Math.random()*.3,q=Math.random()>=.5?-1:1,B=(.05+Math.random()*.15)*q;return{radius:D,tiltX:N,tiltZ:U,orbitSpeed:I,moonSize:z,roughnessValue:j,selfRotationSpeed:B}}),M=Q.useMemo(()=>new ds(S.tiltX,0,S.tiltZ),[S.tiltX,S.tiltZ]),T=Q.useMemo(()=>{const w=[];for(let D=0;D<=48;D++){const N=D/48*Math.PI*2,U=S.radius*Math.cos(N),I=S.radius*Math.sin(N),z=new X(U,0,I);z.applyEuler(M),w.push(z)}return w},[S.radius,M]);return Ch((w,A)=>{if(d||!t.current)return;f.current+=S.orbitSpeed*A;const D=S.radius*Math.cos(f.current),N=S.radius*Math.sin(f.current),U=o.current.set(D,0,N);U.applyEuler(M),t.current.position.copy(U),n.current&&(n.current.rotation.y+=S.selfRotationSpeed*A)}),R.jsxs("group",{children:[p&&R.jsx(dw,{points:T,color:e,lineWidth:.75,transparent:!0,opacity:.4}),R.jsx("group",{ref:t,children:R.jsxs("mesh",{ref:n,raycast:null,castShadow:m,receiveShadow:m,children:[R.jsx("sphereGeometry",{ref:s,args:[S.moonSize,16,16]}),R.jsx("meshStandardMaterial",{color:e,emissive:"#000000",emissiveIntensity:0,roughness:S.roughnessValue,metalness:.1,normalMap:x||void 0,bumpMap:v||void 0,bumpScale:.25})]})})]})},HB=({planet:a,onSelect:e,selected:t,onUpdate:n})=>{const{position:s,color:o,secondaryColor:f,label:d,path:p,speed:m,size:y}=a,[x,v]=Q.useState(!1),[S,M]=Q.useState(!1),T=Q.useRef(Math.random()*Math.PI*2),w=Q.useRef(),A=Q.useRef(),D=Q.useRef(),N=Q.useRef(new X),{paused:U,showOrbits:I,shadowsEnabled:z,quality:j,showMoons:q}=eo(),B=Q.useMemo(()=>{switch(j){case"high":return 48;case"medium":return 24;case"low":default:return 16}},[j]),P=Q.useMemo(()=>q?y>=6?2:y>=3.5?1:0:0,[y,q]),W=()=>{const le=Math.floor(Math.random()*256),xe=Math.floor(Math.random()*256),Ge=Math.floor(Math.random()*256);return`rgb(${le}, ${xe}, ${Ge})`},se=Q.useMemo(()=>Array.from({length:P},()=>({color:W(),secondaryColor:W()})),[P]),ae=Zc(wf,[bw,_w,Sw]),[ce,ue]=Q.useMemo(()=>{if(!ae||ae.length===0)return[null,null];if(ae.length===1)return[ae[0],ae[0]];const le=Math.floor(Math.random()*ae.length);let xe=Math.floor(Math.random()*ae.length);return xe===le&&(xe=(xe+1)%ae.length),[ae[le],ae[xe]]},[ae]),V=Q.useMemo(()=>.6+Math.random()*.3,[]),$=Q.useMemo(()=>new gt(o),[o]),J=Q.useMemo(()=>new gt(f||o),[f,o,B]);Q.useEffect(()=>{const le=D.current;if(!le)return;const xe=le.getAttribute("position"),Ge=xe.count,et=new Float32Array(Ge*3),at=$,lt=J;for(let Rt=0;Rt{const le=Math.sqrt(s[0]**2+s[2]**2)||1,xe=.6+Math.random()*.8,Ge=le,et=le*xe,at=(Math.random()-.5)*.35,lt=(Math.random()-.5)*.35;return{a:Ge,b:et,tiltX:at,tiltZ:lt}}),ve=Q.useMemo(()=>new ds(he.tiltX,0,he.tiltZ),[he]);Q.useEffect(()=>{v(!0)},[]),Q.useEffect(()=>(document.body.style.cursor=S?"pointer":"auto",()=>{document.body.style.cursor="auto"}),[S]);const Y=le=>{le.stopPropagation(),p&&e(p)},oe=le=>{le.stopPropagation(),M(!0)},Te=le=>{le.stopPropagation(),M(!1)},Ne=Q.useMemo(()=>Math.random()*.5+.1,[]);Q.useEffect(()=>{A.current&&(A.current.rotation.y=Math.random()*Math.PI*2)},[]),Ch((le,xe)=>{if(U||!w.current)return;T.current+=m*xe;const Ge=he.a*Math.cos(T.current),et=he.b*Math.sin(T.current),at=N.current.set(Ge,0,et);at.applyEuler(ve),w.current.position.copy(at),n?.(a.id,[at.x,at.y,at.z]),A.current&&(A.current.rotation.y+=Ne*xe)});const Qe=Q.useMemo(()=>{const le=[];for(let Ge=0;Ge<=64;Ge++){const et=Ge/64*Math.PI*2,at=he.a*Math.cos(et),lt=he.b*Math.sin(et),Rt=new X(at,0,lt);Rt.applyEuler(ve),le.push(Rt)}return le},[he,ve]);return R.jsxs(R.Fragment,{children:[I&&R.jsx(dw,{points:Qe,color:o,lineWidth:1,transparent:!0,opacity:.5}),R.jsxs("group",{ref:w,visible:x,children:[R.jsxs("mesh",{castShadow:z,receiveShadow:z,ref:A,onClick:Y,onPointerOver:oe,onPointerOut:Te,children:[R.jsx("sphereGeometry",{ref:D,args:[y,B,B]}),R.jsx("meshStandardMaterial",{vertexColors:!0,emissive:"#000000",emissiveIntensity:.6,roughness:V,metalness:.1,normalMap:ce||void 0,bumpMap:ue||void 0,bumpScale:.25}),S&&R.jsx(pw,{thickness:1.5,color:"white"})]}),S&&!t&&R.jsx(qP,{transform:!1,position:[0,y*1.5,0],center:!0,style:{fontFamily:'"alagard", system-ui, sans-serif',fontSize:"20px",letterSpacing:"0.08em",color:"white",textShadow:"0 0 6px rgba(0,0,0,0.9)",whiteSpace:"nowrap",pointerEvents:"none"},children:d}),se.map((le,xe)=>R.jsx(jB,{parentSize:y,color:le.color,secondaryColor:le.secondaryColor},xe))]})]})},kB="/assets/sun-D78s3ky5.png",VB=()=>{const a=Q.useRef(),e=Zc(wf,kB),{paused:t,shadowsEnabled:n}=eo(),[s,o]=Q.useState(!1),[f,d]=lm(),{requestHomeRecenter:p}=Rx();Q.useEffect(()=>{e.wrapS=Aa,e.wrapT=Aa,e.anisotropy=2,e.center.set(.5,.5)},[e]),Q.useEffect(()=>(document.body.style.cursor=s?"pointer":"auto",()=>{document.body.style.cursor="auto"}),[s]);const m=.25;Ch((T,w)=>{t||a.current&&(a.current.rotation.y-=m*w)});const y=n?1024:1,x=n?180:0,v=T=>{T.stopPropagation(),f==="/"?p():d("/")},S=T=>{T.stopPropagation(),o(!0)},M=T=>{T.stopPropagation(),o(!1)};return R.jsxs("group",{position:[0,0,0],children:[R.jsxs("mesh",{ref:a,onClick:v,onPointerOver:S,onPointerOut:M,children:[R.jsx("sphereGeometry",{args:[8,32,32]}),R.jsx("meshStandardMaterial",{map:e,color:"#ffffff",emissive:"#ffe9b3",emissiveMap:e,emissiveIntensity:1.5,roughness:1,metalness:.6}),s&&R.jsx(pw,{thickness:1.5,color:"white"})]}),R.jsx("pointLight",{position:[0,0,0],intensity:3600,distance:x,decay:2,color:"#ffe9c4",castShadow:n,"shadow-mapSize-width":y,"shadow-mapSize-height":y}),R.jsx("ambientLight",{position:[0,0,0],intensity:.05})]})},GB=({count:a=1500,radius:e=100})=>{const t=Q.useRef(),{paused:n}=eo(),{basePositions:s,positions:o,colors:f,phases:d}=Q.useMemo(()=>{const p=new Float32Array(a*3),m=new Float32Array(a*3),y=new Float32Array(a*3),x=new Float32Array(a),v=new gt;for(let S=0;S{if(n)return;const m=p.getElapsedTime(),y=t.current;if(!y)return;const v=y.geometry.attributes.position,S=v.array;for(let T=0;Ta.default),KB=({index:a=0})=>{const{camera:e}=Ts(),t=Q.useRef(),n=Q.useRef(),{paused:s,quality:o}=eo(),[f,d]=Q.useState(.34),p=I1(ZB),m=p&&p.length?p[a%p.length]:null;Q.useEffect(()=>{if(!m)return;m.colorSpace=_a,m.wrapS=m.wrapT=Aa;const x=3;m.repeat.set(x,x)},[m]),Ch((x,v)=>{if(t.current){if(n.current){const S=x.clock.elapsedTime,M=.35,T=.7,w=(Math.sin(S*.3)+1)*.5,A=M+(T-M)*w;n.current.uTime=S,n.current.uThreshold=A,d(A)}s||(t.current.position.copy(e.position),t.current.rotation.y+=v*.002,t.current.rotation.x+=v*.004,t.current.rotation.z+=v*.003)}});const y=Q.useMemo(()=>{switch(o){case"high":case"medium":default:return!0;case"low":return!1}},[o]);return R.jsx(R.Fragment,{children:y&&R.jsxs("mesh",{ref:t,renderOrder:-1,children:[R.jsx("sphereGeometry",{args:[500,64,64]}),m&&R.jsx("skyMaskMaterial",{ref:n,uTexture:m,uOpacity:.9,uThreshold:f,uWaveAmp:1.5,uWaveFreq:8,side:Ma,depthWrite:!1,transparent:!0,toneMapped:!1})]})})},QB=()=>{const[a,e]=lm(),t=a==="/",{setCameraLockedOnPlanet:n,setActivePlanetId:s,homeRecenterToken:o}=Rx(),{quality:f}=eo(),{trackPlanetSelect:d}=bf(),p=Q.useRef(Object.fromEntries(R0.map(w=>[w.id,null]))),m=(w,A)=>{p.current[w]=A},y=Q.useMemo(()=>a==="/"?null:R0.find(w=>w.path===a)??null,[a]),x=t||y!=null;Q.useEffect(()=>{y?(s(y.id),d(y.id)):s(null)},[y,s,d]);const v={low:3e3,medium:5e3,high:9e3},S={low:1500,medium:2500,high:4e3},M=v[f]??v.low,T=S[f]??S.low;return R.jsxs(R.Fragment,{children:[R.jsx(KB,{}),R.jsx(fB,{radius:150,depth:80,count:M,factor:4,saturation:0}),R.jsx(GB,{count:T}),R.jsx(VB,{}),R0.map(w=>R.jsx(HB,{planet:w,selected:y?.id===w.id,onSelect:A=>e(A),onUpdate:m},w.id)),x&&R.jsx(FB,{homeFocus:rw,getFollowPos:()=>y?p.current[y.id]:null,selectedPlanetId:y?.id??null,isHome:t,recenterToken:o,onTransitionStart:()=>{n(!1)},onTransitionEnd:({isHome:w})=>{n(!w)}})]})},JB=()=>{const{shadowsEnabled:a}=eo();return R.jsx("div",{className:"r3f-root",children:R.jsxs(aU,{style:{width:"100vw",height:"100vh",background:"#000"},gl:{alpha:!1},dpr:[.8,1.5],camera:{position:rw.cameraPos,fov:50,near:.1,far:1e3},shadows:a,children:[R.jsx("color",{attach:"background",args:["black"]}),R.jsx(Q.Suspense,{fallback:null,children:R.jsx(QB,{})})]})})},$B=({blogId:a})=>{const e=tw[a],{trackEvent:t}=bf();if(!e)return R.jsx("article",{className:"detail-pane",children:R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:"Blog"}),R.jsx("p",{className:"detail-pane-subtitle",children:"Blog not found."})]})});const{label:n,description:s,entries:o=[],hideNav:f}=e,[d,p]=Q.useState(0),m=o.length-1,y=Q.useRef(null),x=w=>{w<0||w>m||p(w)},v=()=>{x(0)},S=()=>{x(d-1)},M=()=>{x(d+1)};Q.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[d]);const T=o[d];return Q.useEffect(()=>{T&&t("blog_entry_view",{blog_id:a,entry_index:d,entry_id:T.id})},[a,d,T,t]),R.jsxs("article",{className:"detail-pane detail-pane--blog",children:[R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:n}),s&&R.jsx("p",{className:"detail-pane-subtitle",children:s})]}),R.jsx("section",{className:"detail-pane-body",ref:y,children:T?R.jsx("div",{className:"blog-entry-body",children:T.body({goTo:x})}):R.jsx("p",{children:"No entries yet."})}),!f&&o.length>1&&R.jsxs("footer",{className:"detail-pane-footer blog-nav",children:[R.jsx("button",{onClick:S,disabled:d===0,children:"< Prev"}),R.jsx("button",{onClick:v,disabled:d===0,children:"Home"}),R.jsx("button",{onClick:M,disabled:d===m,children:"Next >"})]})]})},eI="/assets/ELVTR%20Certificate%20Varun-Cy_j69Hf.pdf",tI=Object.freeze(Object.defineProperty({__proto__:null,default:eI},Symbol.toStringTag,{value:"Module"})),nI="/assets/ELVTR%20Letter%20of%20Recommendation%20Varun-BhnfjI7U.pdf",iI=Object.freeze(Object.defineProperty({__proto__:null,default:nI},Symbol.toStringTag,{value:"Module"})),aI="/assets/Varun%20Nadgir%20Resume-Bv6dpI9X.pdf",sI=Object.freeze(Object.defineProperty({__proto__:null,default:aI},Symbol.toStringTag,{value:"Module"})),rI="/assets/VarunDataScienceCareerTrackCertificate-qnkRtQP7.pdf",oI=Object.freeze(Object.defineProperty({__proto__:null,default:rI},Symbol.toStringTag,{value:"Module"})),lI="/assets/VarunNadgir-MIT-ADSP-CVlKunOP.pdf",cI=Object.freeze(Object.defineProperty({__proto__:null,default:lI},Symbol.toStringTag,{value:"Module"})),uI="/assets/intermediatePythonDataScience-D-zM81WC.pdf",fI=Object.freeze(Object.defineProperty({__proto__:null,default:uI},Symbol.toStringTag,{value:"Module"})),dI="/assets/intermediateRdatacamp-D96zKFek.pdf",hI=Object.freeze(Object.defineProperty({__proto__:null,default:dI},Symbol.toStringTag,{value:"Module"})),pA=Object.assign({"../documents/ELVTR Certificate Varun.pdf":tI,"../documents/ELVTR Letter of Recommendation Varun.pdf":iI,"../documents/Varun Nadgir Resume.pdf":sI,"../documents/VarunDataScienceCareerTrackCertificate.pdf":oI,"../documents/VarunNadgir-MIT-ADSP.pdf":cI,"../documents/intermediatePythonDataScience.pdf":fI,"../documents/intermediateRdatacamp.pdf":hI}),Aw={};for(const a in pA){const e=pA[a].default,t=a.split("/").pop();Aw[t]=e}const pI={resume:{title:"Resume",subtitle:"Skills & Work History",docs:[{id:"resume-main",label:"Resume",filename:"Varun Nadgir Resume.pdf"}]},elvtr:{title:"ELVTR Tech Art",subtitle:"Certificate & Letter of Recommendation",docs:[{id:"elvtr-cert",label:"Certificate",filename:"ELVTR Certificate Varun.pdf"},{id:"elvtr-lor",label:"Letter of Recommendation",filename:"ELVTR Letter of Recommendation Varun.pdf"}]},datasci:{title:"Data Science",subtitle:"Courses & Certificates",docs:[{id:"mit-adsp",label:"MIT ADSP",filename:"VarunNadgir-MIT-ADSP.pdf"},{id:"springboard-career",label:"Springboard Data Science Career Track",filename:"VarunDataScienceCareerTrackCertificate.pdf"},{id:"intermediate-r",label:"Datacamp: R",filename:"intermediateRdatacamp.pdf"},{id:"intermediate-python",label:"Datacamp: Python",filename:"intermediatePythonDataScience.pdf"}]}},mI=Object.fromEntries(Object.entries(pI).map(([a,e])=>[a,{...e,docs:e.docs.map(t=>{const n=Aw[t.filename];return n?{...t,url:n}:null}).filter(Boolean)}])),gI=({topicId:a})=>{const e=mI[a],{trackEvent:t}=bf();if(!e||!e.docs||e.docs.length===0)return R.jsx("article",{className:"detail-pane",children:R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:"Documents"}),R.jsx("p",{className:"detail-pane-subtitle",children:"No documents found."})]})});const{title:n,subtitle:s,docs:o}=e,[f,d]=Q.useState(o[0].id);Q.useEffect(()=>{o.length>0&&d(o[0].id)},[a,o]);const p=o.find(m=>m.id===f)??o[0];return Q.useEffect(()=>{p&&t("doc_select",{topic_id:a,doc_id:p.id})},[a,p,t]),R.jsxs("article",{className:"detail-pane detail-pane--docs",children:[R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:n}),s&&R.jsx("p",{className:"detail-pane-subtitle",children:s})]}),R.jsxs("section",{className:"detail-pane-body detail-pane-body--docs",children:[R.jsx("div",{className:"docs-controls-row",children:R.jsx("aside",{className:"docs-list",children:o.map(m=>R.jsxs("div",{className:"docs-item"+(m.id===f?" docs-item--active":""),children:[R.jsx("button",{type:"button",className:"docs-item-title",onClick:()=>d(m.id),children:m.label}),R.jsxs("div",{className:"docs-item-actions",children:[R.jsx("button",{type:"button",className:"docs-action-button",onClick:()=>{t("doc_view",{topic_id:a,doc_id:m.id,url:m.url}),window.open(m.url,"_blank","noopener,noreferrer")},children:"View"}),R.jsx("a",{href:m.url,download:!0,target:"_blank",rel:"noreferrer",className:"docs-action-button",onClick:()=>t("doc_download",{topic_id:a,doc_id:m.id,url:m.url}),children:"Download"})]})]},m.id))})}),R.jsx("div",{className:"docs-viewer",children:R.jsx("iframe",{src:p.url,title:p.label,className:"docs-viewer-frame"})})]})]})},yI=({projectId:a})=>{const e=aw[a],{trackEvent:t,trackExternalLink:n}=bf();if(!e)return R.jsx("article",{className:"detail-pane",children:R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:"Project"}),R.jsx("p",{className:"detail-pane-subtitle",children:"No project found."})]})});const{title:s,summary:o,subtitle:f,description:d,technologies:p,imageUrl:m,hyperlinks:y,previewDocUrl:x}=e;return Q.useEffect(()=>{t("project_view",{project_id:a,title:s})},[a,s,t]),R.jsxs("article",{className:"detail-pane detail-pane--project",children:[R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:s}),f&&R.jsx("p",{className:"detail-pane-subtitle",children:f}),o&&R.jsx("p",{className:"detail-pane-subtitle",children:o})]}),R.jsxs("section",{className:"detail-pane-body",children:[m&&R.jsx("div",{className:"detail-pane-project-image-wrapper",children:Array.isArray(m)?m.map((v,S)=>R.jsx("img",{src:v,alt:`${s} preview ${S+1}`,className:"detail-pane-project-image"},`${s}-image-${S}`)):R.jsx("img",{src:m,alt:`${s} preview`,className:"detail-pane-project-image"})}),d&&R.jsx("p",{className:"detail-pane-description",children:d}),x&&R.jsx("div",{className:"detail-pane-doc-preview",children:R.jsx("iframe",{src:x,title:`${s} document preview`,className:"detail-pane-doc-iframe"})}),y&&y.length>0&&R.jsx("div",{className:"detail-pane-links",children:R.jsx("div",{className:"detail-pane-links-buttons",children:y.map(v=>R.jsx("button",{className:"detail-pane-link-button",onClick:()=>{t("project_link_click",{project_id:a,link_id:v.id,href:v.href}),n("project",v.href),window.open(v.href,"_blank","noopener,noreferrer")},children:v.text},v.id))})}),p&&p.length>0&&R.jsx("div",{className:"detail-pane-tech-section",children:R.jsx("div",{className:"detail-pane-tech-strip",children:p.map(v=>v.iconUrl?R.jsx("div",{className:"detail-pane-tech-icon-wrapper",title:v.label,children:R.jsx("img",{src:v.iconUrl,alt:v.label,className:"detail-pane-tech-icon"})},v.id):null)})})]})]})},xI=({platformId:a})=>{const{trackExternalLink:e,trackEvent:t}=bf(),n=sw[a];if(!n)return R.jsx("article",{className:"detail-pane",children:R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:"Music"}),R.jsx("p",{className:"detail-pane-subtitle",children:"No platform data found."})]})});const{label:s,subtitle:o,description:f,profileUrl:d,profileLabel:p,embeds:m=[]}=n;return Q.useEffect(()=>{t("music_platform_view",{platform_id:a,label:s})},[a,s,t]),R.jsxs("article",{className:"detail-pane detail-pane--music",children:[R.jsxs("header",{className:"detail-pane-header",children:[R.jsx("h2",{children:s}),o&&R.jsx("p",{className:"detail-pane-subtitle",children:o}),f&&R.jsx("p",{className:"detail-pane-subtitle",children:f})]}),R.jsxs("section",{className:"detail-pane-body",children:[d&&R.jsx("div",{className:"music-profile-link-wrapper",children:R.jsx("a",{href:d,target:"_blank",rel:"noreferrer",className:"music-profile-link",onClick:()=>e(a,d),children:p||`Open my ${s} page`})}),m.length===0&&R.jsxs("p",{children:["Embeds for this platform will go here. Configure them in"," ",R.jsx("code",{children:"musicMedia.jsx"}),"."]}),m.map(y=>R.jsxs("div",{className:"music-embed-card",children:[R.jsx("h3",{className:"music-embed-title",children:y.title}),y.note&&R.jsx("p",{className:"music-embed-note",children:y.note}),R.jsx("div",{className:"music-embed-frame-wrapper",children:R.jsx("iframe",{src:y.iframeSrc,title:y.title,className:"music-embed-frame",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",frameBorder:"0",style:y.height?{height:y.height,aspectRatio:"auto"}:void 0})})]},y.id))]})]})},vI=a=>{if(a.startsWith("docs:")){const e=a.split(":")[1];return R.jsx(gI,{topicId:e},e)}if(a.startsWith("project:")){const e=a.split(":")[1];return R.jsx(yI,{projectId:e},e)}if(a.startsWith("music:")){const e=a.split(":")[1];return R.jsx(xI,{platformId:e},e)}if(a.startsWith("blog:")){const e=a.split(":")[1];return R.jsx($B,{blogId:e},e)}return null},bI=({planet:a})=>{if(!a)return null;const{trackOverlayClose:e,trackOverlayOpen:t}=bf(),[n,s]=Q.useState(null),[,o]=lm(),f=Q.useCallback(y=>{s(x=>{const v=x===y?null:y;return v?t?.("detail",y):e?.("detail",y),v})},[t,e]),d=Q.useCallback(()=>{n&&e?.("detail",n),s(null)},[n,e]),p=y=>{y.stopPropagation(),o("/")},m=a.InfoComponent??_I;return R.jsxs("div",{className:"planet-overlay-root",children:[n&&R.jsxs("div",{className:"planet-overlay-box planet-overlay-box--left",children:[R.jsx("button",{type:"button",style:{fontFamily:'"alagard", system-ui, sans-serif',color:"red"},className:"overlay-close-button",onClick:d,"aria-label":"Close detail panel",children:"X"}),vI(n)]}),R.jsxs("div",{className:"planet-overlay-box planet-overlay-box--right",children:[R.jsx(m,{planet:a,openDetail:f,closeDetail:d,hasDetail:!!n}),R.jsx("button",{type:"button",style:{fontFamily:'"alagard", system-ui, sans-serif',color:"red"},className:"overlay-close-button",onClick:p,"aria-label":"Close detail panel",children:"X"})]})]})},_I=({planet:a})=>R.jsxs("div",{children:[R.jsx("h2",{children:a.label}),R.jsx("p",{children:"Content coming soon."})]}),SI="data:image/svg+xml,%3csvg%20width='1024'%20height='1024'%20viewBox='0%200%201024%201024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%200C3.58%200%200%203.58%200%208C0%2011.54%202.29%2014.53%205.47%2015.59C5.87%2015.66%206.02%2015.42%206.02%2015.21C6.02%2015.02%206.01%2014.39%206.01%2013.72C4%2014.09%203.48%2013.23%203.32%2012.78C3.23%2012.55%202.84%2011.84%202.5%2011.65C2.22%2011.5%201.82%2011.13%202.49%2011.12C3.12%2011.11%203.57%2011.7%203.72%2011.94C4.44%2013.15%205.59%2012.81%206.05%2012.6C6.12%2012.08%206.33%2011.73%206.56%2011.53C4.78%2011.33%202.92%2010.64%202.92%207.58C2.92%206.71%203.23%205.99%203.74%205.43C3.66%205.23%203.38%204.41%203.82%203.31C3.82%203.31%204.49%203.1%206.02%204.13C6.66%203.95%207.34%203.86%208.02%203.86C8.7%203.86%209.38%203.95%2010.02%204.13C11.55%203.09%2012.22%203.31%2012.22%203.31C12.66%204.41%2012.38%205.23%2012.3%205.43C12.81%205.99%2013.12%206.7%2013.12%207.58C13.12%2010.65%2011.25%2011.33%209.47%2011.53C9.76%2011.78%2010.01%2012.26%2010.01%2013.01C10.01%2014.08%2010%2014.94%2010%2015.21C10%2015.42%2010.15%2015.67%2010.55%2015.59C13.71%2014.53%2016%2011.53%2016%208C16%203.58%2012.42%200%208%200Z'%20transform='scale(64)'%20fill='%231B1F23'/%3e%3c/svg%3e",AI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M19%200h-14c-2.761%200-5%202.239-5%205v14c0%202.761%202.239%205%205%205h14c2.762%200%205-2.239%205-5v-14c0-2.761-2.238-5-5-5zm-11%2019h-3v-11h3v11zm-1.5-12.268c-.966%200-1.75-.79-1.75-1.764s.784-1.764%201.75-1.764%201.75.79%201.75%201.764-.783%201.764-1.75%201.764zm13.5%2012.268h-3v-5.604c0-3.368-4-3.113-4%200v5.604h-3v-11h3v1.765c1.396-2.586%207-2.777%207%202.476v6.759z'/%3e%3c/svg%3e",MI=()=>{const[a,e]=lm(),t=a==="/",{requestHomeRecenter:n}=Rx();return R.jsxs("nav",{className:"dom-nav","aria-label":"Planet navigation",children:[R.jsx("button",{type:"button",onClick:()=>{t?n():e("/")},"aria-pressed":t,children:"Home"}),R0.map(s=>R.jsx("button",{type:"button",onClick:()=>e(s.path),"aria-pressed":a===s.path,children:s.label},s.id)),R.jsx("a",{href:"https://github.com/vanadgir",target:"_blank",rel:"noreferrer",className:"dom-nav-icon external-icon","aria-label":"GitHub",title:"GitHub",children:R.jsx("img",{src:SI,alt:""})}),R.jsx("a",{href:"https://www.linkedin.com/in/varun-nadgir/",target:"_blank",rel:"noreferrer",className:"dom-nav-icon external-icon","aria-label":"LinkedIn",title:"LinkedIn",children:R.jsx("img",{src:AI,alt:""})})]})},EI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20xml:space='preserve'%3e%3cg%20style='stroke:%20none;%20stroke-width:%200;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20none;%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='translate(1.4065934065934016%201.4065934065934016)%20scale(2.81%202.81)'%3e%3cpath%20d='M%2088.568%2054.357%20L%2088.568%2054.357%20c%20-8.337%20-3.453%20-8.337%20-15.262%200%20-18.715%20l%200%200%20c%201.183%20-0.49%201.745%20-1.847%201.255%20-3.03%20l%20-4.369%20-10.547%20c%20-0.49%20-1.183%20-1.847%20-1.745%20-3.03%20-1.255%20l%200%200%20c%20-8.337%203.453%20-16.687%20-4.897%20-13.233%20-13.233%20l%200%200%20c%200.49%20-1.183%20-0.072%20-2.54%20-1.255%20-3.03%20l%20-10.548%20-4.37%20c%20-1.183%20-0.49%20-2.54%200.072%20-3.03%201.255%20c%20-3.453%208.337%20-15.262%208.337%20-18.715%200%20c%20-0.49%20-1.183%20-1.847%20-1.745%20-3.03%20-1.255%20L%2022.065%204.547%20c%20-1.183%200.49%20-1.745%201.847%20-1.255%203.03%20c%203.453%208.337%20-4.897%2016.687%20-13.234%2013.234%20c%20-1.183%20-0.49%20-2.54%200.072%20-3.03%201.255%20L%200.177%2032.613%20c%20-0.49%201.183%200.072%202.54%201.255%203.03%20l%200%200%20c%208.337%203.453%208.337%2015.262%200%2018.715%20l%200%200%20c%20-1.183%200.49%20-1.745%201.847%20-1.255%203.03%20l%204.369%2010.547%20c%200.49%201.183%201.847%201.745%203.03%201.255%20l%200%200%20c%208.337%20-3.453%2016.687%204.897%2013.233%2013.234%20l%200%200%20c%20-0.49%201.183%200.072%202.54%201.255%203.03%20l%2010.547%204.369%20c%201.183%200.49%202.54%20-0.072%203.03%20-1.255%20l%200%200%20c%203.453%20-8.337%2015.262%20-8.337%2018.715%200%20l%200%200%20c%200.49%201.183%201.847%201.745%203.03%201.255%20l%2010.547%20-4.369%20c%201.183%20-0.49%201.745%20-1.847%201.255%20-3.03%20l%200%200%20c%20-3.453%20-8.337%204.897%20-16.687%2013.234%20-13.233%20c%201.183%200.49%202.54%20-0.072%203.03%20-1.255%20l%204.369%20-10.547%20C%2090.313%2056.204%2089.751%2054.848%2088.568%2054.357%20z%20M%2045%2064.052%20c%20-10.522%200%20-19.052%20-8.53%20-19.052%20-19.052%20S%2034.478%2025.949%2045%2025.949%20S%2064.052%2034.479%2064.052%2045%20S%2055.522%2064.052%2045%2064.052%20z'%20style='stroke:%20none;%20stroke-width:%201;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20rgb(168,168,168);%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='%20matrix(1%200%200%201%200%200)%20'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e",wI=()=>{const{paused:a,togglePaused:e,showOrbits:t,toggleShowOrbits:n,settingsOpen:s,toggleSettingsOpen:o,shadowsEnabled:f,toggleShadowsEnabled:d,debugEnabled:p,toggleDebugEnabled:m,quality:y,toggleQuality:x,showMoons:v,toggleShowMoons:S,throttlePhysics:M,toggleThrottlePhysics:T}=eo(),w=y==="low"?"L":y==="medium"?"M":"H";return R.jsxs("div",{className:"dom-footer","aria-label":"Simulation controls",children:[R.jsx("button",{type:"button",className:"dom-nav-icon settings-gear-button",onClick:o,"aria-label":"Simulation settings","aria-pressed":s,children:R.jsx("img",{src:EI,alt:""})}),R.jsxs("div",{className:`settings-tray ${s?"settings-tray--open":""}`,children:[R.jsx("button",{type:"button",onClick:e,"aria-pressed":!a,title:"Pauses/Resumes the simulation",children:a?"Resume":"Pause"}),R.jsx("button",{type:"button",onClick:m,"aria-pressed":p,title:"Toggle simulation details",children:p?"Hide Debug":"Show Debug"}),R.jsx("button",{type:"button",onClick:n,"aria-pressed":t,title:"Toggle orbits of moving bodies",children:t?"Hide orbits":"Show orbits"}),R.jsx("button",{type:"button",onClick:d,"aria-pressed":f,title:"Toggle shadows. Turn off for better performance",children:f?"Disable Shadows":"Enable Shadows"}),R.jsxs("button",{type:"button",onClick:x,"aria-label":"Cycle visual quality",title:"Determines ambient star count and vertex count of planet geometries",children:["Quality: ",w]}),R.jsx("button",{type:"button",onClick:S,"aria-pressed":v,title:"Toggles moons. Turn off for better performance",children:v?"Hide Moons":"Show Moons"}),R.jsxs("button",{type:"button",onClick:T,"aria-pressed":M!=="off",title:"Throttles 3D frame updates while heavy DOM elements are active",children:["Throttle Physics:"," ",M==="off"?"Off":M==="light"?"Light":"Aggressive"]}),R.jsx("button",{type:"button",onClick:()=>window.location.reload(),title:"Refresh page and scene",children:"Refresh"})]})]})},TI=()=>{const{debugEnabled:a}=eo(),[e,t]=Q.useState(0),n=Q.useRef(performance.now()),s=Q.useRef(0);return Q.useEffect(()=>{if(!a)return;let o;const f=d=>{s.current+=1,d-n.current>=1e3&&(t(s.current),s.current=0,n.current=d),o=requestAnimationFrame(f)};return o=requestAnimationFrame(f),()=>cancelAnimationFrame(o)},[a]),a?R.jsxs("div",{className:"debug-panel",children:[e," fps"]}):null},CI=()=>{const[a]=lm(),{cameraLockedOnPlanet:e,activePlanetId:t}=Rx(),{setDomHeavyActive:n}=eo(),{trackNavigation:s,trackPageView:o}=bf(),f=a==="/",d=f?null:R0.find(m=>m.id===t)??null,p=!f&&d&&e;return Q.useEffect(()=>{n(!!p)},[p,n]),Q.useEffect(()=>{const m=typeof window<"u"?window.location.pathname+window.location.search:a;s(m),o(m)},[a,s,o]),R.jsxs("div",{className:"dom-root",children:[R.jsx(MI,{}),f&&R.jsxs("div",{className:"dom-body",children:[R.jsx("h1",{children:"Welcome, Visitor"}),"I'm Varun. I'd like to make an apple pie from scratch, so I invented a universe. ",R.jsx("br",{}),"Hope you enjoy your stay. Visit the planets to learn more about me!"]}),!f&&d&&e&&R.jsx(bI,{planet:d}),R.jsx(wI,{}),R.jsx(TI,{})]})},RI=()=>R.jsxs("div",{className:"app-root",children:[R.jsx(JB,{}),R.jsx(CI,{})]});gA.createRoot(document.getElementById("root")).render(R.jsx(Q.StrictMode,{children:R.jsx(TT,{measurementId:"G-SBP8C5TMB1",children:R.jsx(wT,{children:R.jsx(ET,{children:R.jsx(RI,{})})})})}));export{jb as g}; diff --git a/docs/intermediatePythonDataScience.pdf b/docs/assets/intermediatePythonDataScience-D-zM81WC.pdf similarity index 100% rename from docs/intermediatePythonDataScience.pdf rename to docs/assets/intermediatePythonDataScience-D-zM81WC.pdf diff --git a/docs/intermediateRdatacamp.pdf b/docs/assets/intermediateRdatacamp-D96zKFek.pdf similarity index 100% rename from docs/intermediateRdatacamp.pdf rename to docs/assets/intermediateRdatacamp-D96zKFek.pdf diff --git a/images/jupyter-icon.svg b/docs/assets/jupyter-Ype1XYD1.svg similarity index 100% rename from images/jupyter-icon.svg rename to docs/assets/jupyter-Ype1XYD1.svg diff --git a/docs/assets/murdeer-NmqgclOc.png b/docs/assets/murdeer-NmqgclOc.png new file mode 100644 index 0000000..67581be Binary files /dev/null and b/docs/assets/murdeer-NmqgclOc.png differ diff --git a/images/murdeer.png b/docs/assets/murdeer222-CG3_9X-4.png similarity index 100% rename from images/murdeer.png rename to docs/assets/murdeer222-CG3_9X-4.png diff --git a/docs/assets/murdeercrazygun-C-3h99Um.gif b/docs/assets/murdeercrazygun-C-3h99Um.gif new file mode 100644 index 0000000..0a117ed Binary files /dev/null and b/docs/assets/murdeercrazygun-C-3h99Um.gif differ diff --git a/docs/assets/murdeergameplay-CVXnIHtJ.gif b/docs/assets/murdeergameplay-CVXnIHtJ.gif new file mode 100644 index 0000000..c8f62ba Binary files /dev/null and b/docs/assets/murdeergameplay-CVXnIHtJ.gif differ diff --git a/images/mysql-icon.svg b/docs/assets/mysql-D3bLP8_A.svg similarity index 100% rename from images/mysql-icon.svg rename to docs/assets/mysql-D3bLP8_A.svg diff --git a/docs/assets/noodlerekt2-Bkphn_VA.gif b/docs/assets/noodlerekt2-Bkphn_VA.gif new file mode 100644 index 0000000..3e389a0 Binary files /dev/null and b/docs/assets/noodlerekt2-Bkphn_VA.gif differ diff --git a/docs/assets/normalrough-C5t319KU.png b/docs/assets/normalrough-C5t319KU.png new file mode 100644 index 0000000..f7ac84d Binary files /dev/null and b/docs/assets/normalrough-C5t319KU.png differ diff --git a/docs/assets/normalrough2-CQ66hHvp.jpg b/docs/assets/normalrough2-CQ66hHvp.jpg new file mode 100644 index 0000000..b451c06 Binary files /dev/null and b/docs/assets/normalrough2-CQ66hHvp.jpg differ diff --git a/docs/assets/normalrough3-CZuQZvxn.jpg b/docs/assets/normalrough3-CZuQZvxn.jpg new file mode 100644 index 0000000..04e21a0 Binary files /dev/null and b/docs/assets/normalrough3-CZuQZvxn.jpg differ diff --git a/images/p5js-icon.svg b/docs/assets/p5js-wmXNkn9y.svg similarity index 100% rename from images/p5js-icon.svg rename to docs/assets/p5js-wmXNkn9y.svg diff --git a/blog/ue5hexgrid/images/post1_1.gif b/docs/assets/post1_1-1v4xs0Uf.gif similarity index 100% rename from blog/ue5hexgrid/images/post1_1.gif rename to docs/assets/post1_1-1v4xs0Uf.gif diff --git a/blog/ue5hexgrid/images/post1_2.gif b/docs/assets/post1_2-C-e6baKN.gif similarity index 100% rename from blog/ue5hexgrid/images/post1_2.gif rename to docs/assets/post1_2-C-e6baKN.gif diff --git a/blog/learnprocessing/images/post1_2.gif b/docs/assets/post1_2-kWKlVks6.gif similarity index 100% rename from blog/learnprocessing/images/post1_2.gif rename to docs/assets/post1_2-kWKlVks6.gif diff --git a/blog/learnprocessing/images/post1_3.gif b/docs/assets/post1_3-CoM2yJ51.gif similarity index 100% rename from blog/learnprocessing/images/post1_3.gif rename to docs/assets/post1_3-CoM2yJ51.gif diff --git a/blog/learnprocessing/images/post2_1.gif b/docs/assets/post2_1-CsoDaNpx.gif similarity index 100% rename from blog/learnprocessing/images/post2_1.gif rename to docs/assets/post2_1-CsoDaNpx.gif diff --git a/blog/learnprocessing/images/post2_2.gif b/docs/assets/post2_2-DpsCAzZ-.gif similarity index 100% rename from blog/learnprocessing/images/post2_2.gif rename to docs/assets/post2_2-DpsCAzZ-.gif diff --git a/blog/learnprocessing/images/post3_1.gif b/docs/assets/post3_1-CaHNN6jh.gif similarity index 100% rename from blog/learnprocessing/images/post3_1.gif rename to docs/assets/post3_1-CaHNN6jh.gif diff --git a/blog/learnprocessing/images/post3_2.gif b/docs/assets/post3_2-0Zz24XNs.gif similarity index 100% rename from blog/learnprocessing/images/post3_2.gif rename to docs/assets/post3_2-0Zz24XNs.gif diff --git a/blog/learnprocessing/images/post4_1.gif b/docs/assets/post4_1-B1MZSVX9.gif similarity index 100% rename from blog/learnprocessing/images/post4_1.gif rename to docs/assets/post4_1-B1MZSVX9.gif diff --git a/blog/learnprocessing/images/post4_2.gif b/docs/assets/post4_2-DOy_BHSk.gif similarity index 100% rename from blog/learnprocessing/images/post4_2.gif rename to docs/assets/post4_2-DOy_BHSk.gif diff --git a/docs/assets/powergunrekt-50WUgAvc.gif b/docs/assets/powergunrekt-50WUgAvc.gif new file mode 100644 index 0000000..dfd885a Binary files /dev/null and b/docs/assets/powergunrekt-50WUgAvc.gif differ diff --git a/docs/assets/prism-java-Civ-VhAW.js b/docs/assets/prism-java-Civ-VhAW.js new file mode 100644 index 0000000..8a5e7a5 --- /dev/null +++ b/docs/assets/prism-java-Civ-VhAW.js @@ -0,0 +1 @@ +import{g as u}from"./index-BU365GF-.js";function p(t,a){for(var r=0;re[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var o={},i;function d(){return i||(i=1,(function(t){var a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,e={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[e,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:e.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:e.inside}],keyword:a,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":e,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:e.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:e.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),o}var c=d();const l=u(c),w=p({__proto__:null,default:l},[c]);export{w as p}; diff --git a/images/rstudio-icon.svg b/docs/assets/rstudio-D2BZY8NS.svg similarity index 100% rename from images/rstudio-icon.svg rename to docs/assets/rstudio-D2BZY8NS.svg diff --git a/docs/assets/sun-D78s3ky5.png b/docs/assets/sun-D78s3ky5.png new file mode 100644 index 0000000..f9163a5 Binary files /dev/null and b/docs/assets/sun-D78s3ky5.png differ diff --git a/docs/assets/three20-CQ3wSTKz.gif b/docs/assets/three20-CQ3wSTKz.gif new file mode 100644 index 0000000..7cb559b Binary files /dev/null and b/docs/assets/three20-CQ3wSTKz.gif differ diff --git a/docs/assets/ue-BqsLJ1aS.png b/docs/assets/ue-BqsLJ1aS.png new file mode 100644 index 0000000..3322012 Binary files /dev/null and b/docs/assets/ue-BqsLJ1aS.png differ diff --git a/docs/assets/varunpfp-C0wT5bHB.jpg b/docs/assets/varunpfp-C0wT5bHB.jpg new file mode 100644 index 0000000..58e5de4 Binary files /dev/null and b/docs/assets/varunpfp-C0wT5bHB.jpg differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..84e566f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + Varun Nadgir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/docs/og-preview.jpg b/docs/og-preview.jpg new file mode 100644 index 0000000..4bd2546 Binary files /dev/null and b/docs/og-preview.jpg differ diff --git a/docs/rocket.svg b/docs/rocket.svg new file mode 100644 index 0000000..c510da5 --- /dev/null +++ b/docs/rocket.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/docs/vite.svg b/docs/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/docs/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..4fa125d --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,29 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{js,jsx}'], + extends: [ + js.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + rules: { + 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], + }, + }, +]) diff --git a/favicons/car.ico b/favicons/car.ico deleted file mode 100644 index 1053fb6..0000000 Binary files a/favicons/car.ico and /dev/null differ diff --git a/favicons/docfav.ico b/favicons/docfav.ico deleted file mode 100644 index 0735548..0000000 Binary files a/favicons/docfav.ico and /dev/null differ diff --git a/favicons/emailfav.ico b/favicons/emailfav.ico deleted file mode 100644 index e611f3e..0000000 Binary files a/favicons/emailfav.ico and /dev/null differ diff --git a/favicons/gamefav.ico b/favicons/gamefav.ico deleted file mode 100644 index 6929498..0000000 Binary files a/favicons/gamefav.ico and /dev/null differ diff --git a/favicons/musicfav.ico b/favicons/musicfav.ico deleted file mode 100644 index df0074a..0000000 Binary files a/favicons/musicfav.ico and /dev/null differ diff --git a/favicons/varunfav.ico b/favicons/varunfav.ico deleted file mode 100644 index 24bc224..0000000 Binary files a/favicons/varunfav.ico and /dev/null differ diff --git a/fonts/OpenSans-Bold-webfont.eot b/fonts/OpenSans-Bold-webfont.eot deleted file mode 100644 index e1c7674..0000000 Binary files a/fonts/OpenSans-Bold-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Bold-webfont.svg b/fonts/OpenSans-Bold-webfont.svg deleted file mode 100644 index 364b368..0000000 --- a/fonts/OpenSans-Bold-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-Bold-webfont.ttf b/fonts/OpenSans-Bold-webfont.ttf deleted file mode 100644 index 2d94f06..0000000 Binary files a/fonts/OpenSans-Bold-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Bold-webfont.woff b/fonts/OpenSans-Bold-webfont.woff deleted file mode 100644 index cd86852..0000000 Binary files a/fonts/OpenSans-Bold-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.eot b/fonts/OpenSans-BoldItalic-webfont.eot deleted file mode 100644 index f44ac9a..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.svg b/fonts/OpenSans-BoldItalic-webfont.svg deleted file mode 100644 index 8392240..0000000 --- a/fonts/OpenSans-BoldItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-BoldItalic-webfont.ttf b/fonts/OpenSans-BoldItalic-webfont.ttf deleted file mode 100644 index f74e0e3..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-BoldItalic-webfont.woff b/fonts/OpenSans-BoldItalic-webfont.woff deleted file mode 100644 index f3248c1..0000000 Binary files a/fonts/OpenSans-BoldItalic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.eot b/fonts/OpenSans-Italic-webfont.eot deleted file mode 100644 index 277c189..0000000 Binary files a/fonts/OpenSans-Italic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.svg b/fonts/OpenSans-Italic-webfont.svg deleted file mode 100644 index 29c7497..0000000 --- a/fonts/OpenSans-Italic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-Italic-webfont.ttf b/fonts/OpenSans-Italic-webfont.ttf deleted file mode 100644 index 63f187e..0000000 Binary files a/fonts/OpenSans-Italic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Italic-webfont.woff b/fonts/OpenSans-Italic-webfont.woff deleted file mode 100644 index 469a29b..0000000 Binary files a/fonts/OpenSans-Italic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.eot b/fonts/OpenSans-Light-webfont.eot deleted file mode 100644 index 837daab..0000000 Binary files a/fonts/OpenSans-Light-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.svg b/fonts/OpenSans-Light-webfont.svg deleted file mode 100644 index bdb6726..0000000 --- a/fonts/OpenSans-Light-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-Light-webfont.ttf b/fonts/OpenSans-Light-webfont.ttf deleted file mode 100644 index b50ef9d..0000000 Binary files a/fonts/OpenSans-Light-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Light-webfont.woff b/fonts/OpenSans-Light-webfont.woff deleted file mode 100644 index 99514d1..0000000 Binary files a/fonts/OpenSans-Light-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.eot b/fonts/OpenSans-LightItalic-webfont.eot deleted file mode 100644 index f0ebf2c..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.svg b/fonts/OpenSans-LightItalic-webfont.svg deleted file mode 100644 index 60765da..0000000 --- a/fonts/OpenSans-LightItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-LightItalic-webfont.ttf b/fonts/OpenSans-LightItalic-webfont.ttf deleted file mode 100644 index 5898c8c..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-LightItalic-webfont.woff b/fonts/OpenSans-LightItalic-webfont.woff deleted file mode 100644 index 9c978dc..0000000 Binary files a/fonts/OpenSans-LightItalic-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.eot b/fonts/OpenSans-Regular-webfont.eot deleted file mode 100644 index dd6fd2c..0000000 Binary files a/fonts/OpenSans-Regular-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.svg b/fonts/OpenSans-Regular-webfont.svg deleted file mode 100644 index 01038bb..0000000 --- a/fonts/OpenSans-Regular-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-Regular-webfont.ttf b/fonts/OpenSans-Regular-webfont.ttf deleted file mode 100644 index 05951e7..0000000 Binary files a/fonts/OpenSans-Regular-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Regular-webfont.woff b/fonts/OpenSans-Regular-webfont.woff deleted file mode 100644 index 274664b..0000000 Binary files a/fonts/OpenSans-Regular-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.eot b/fonts/OpenSans-Semibold-webfont.eot deleted file mode 100644 index 289aade..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.svg b/fonts/OpenSans-Semibold-webfont.svg deleted file mode 100644 index cc2ca42..0000000 --- a/fonts/OpenSans-Semibold-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 2011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-Semibold-webfont.ttf b/fonts/OpenSans-Semibold-webfont.ttf deleted file mode 100644 index 6f15073..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-Semibold-webfont.woff b/fonts/OpenSans-Semibold-webfont.woff deleted file mode 100644 index 4e47cb1..0000000 Binary files a/fonts/OpenSans-Semibold-webfont.woff and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.eot b/fonts/OpenSans-SemiboldItalic-webfont.eot deleted file mode 100644 index 50a8a6f..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.eot and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.svg b/fonts/OpenSans-SemiboldItalic-webfont.svg deleted file mode 100644 index 65b50e2..0000000 --- a/fonts/OpenSans-SemiboldItalic-webfont.svg +++ /dev/null @@ -1,146 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Digitized data copyright 20102011 Google Corporation -Foundry : Ascender Corporation -Foundry URL : httpwwwascendercorpcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/OpenSans-SemiboldItalic-webfont.ttf b/fonts/OpenSans-SemiboldItalic-webfont.ttf deleted file mode 100644 index 55ba312..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.ttf and /dev/null differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.woff b/fonts/OpenSans-SemiboldItalic-webfont.woff deleted file mode 100644 index 0adc6df..0000000 Binary files a/fonts/OpenSans-SemiboldItalic-webfont.woff and /dev/null differ diff --git a/header.html b/header.html deleted file mode 100644 index 8d69ef6..0000000 --- a/header.html +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/images/bullet.png b/images/bullet.png deleted file mode 100644 index 0614eb6..0000000 Binary files a/images/bullet.png and /dev/null differ diff --git a/images/fmod-icon.svg b/images/fmod-icon.svg deleted file mode 100644 index 06796c4..0000000 --- a/images/fmod-icon.svg +++ /dev/null @@ -1 +0,0 @@ -FMOD Logo Black - White Background \ No newline at end of file diff --git a/images/ggplot2-icon.png b/images/ggplot2-icon.png deleted file mode 100644 index ae3ec82..0000000 Binary files a/images/ggplot2-icon.png and /dev/null differ diff --git a/images/hexgriddemo.gif b/images/hexgriddemo.gif deleted file mode 100644 index 54ba3e9..0000000 Binary files a/images/hexgriddemo.gif and /dev/null differ diff --git a/images/hr.gif b/images/hr.gif deleted file mode 100644 index bdb4168..0000000 Binary files a/images/hr.gif and /dev/null differ diff --git a/images/nav-bg.gif b/images/nav-bg.gif deleted file mode 100644 index 4743965..0000000 Binary files a/images/nav-bg.gif and /dev/null differ diff --git a/images/ue-icon.svg b/images/ue-icon.svg deleted file mode 100644 index e4fdfe6..0000000 --- a/images/ue-icon.svg +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/index.html b/index.html index 19a5324..f9e61d3 100644 --- a/index.html +++ b/index.html @@ -1,145 +1,76 @@ - - + + - - - - + + + + + + + + Varun Nadgir - - - - - - + + + - - - - - - - - - -
- -
-
- -
-

Software Engineer | Technical Artist | Data Scientist

-
-
- -
- -

Welcome!

- -

- Thanks for visiting my corner of the internet! My name is Varun and I am - a programmer and musician from Massachusetts. For my work history and contact information, please see my resume. -

- - -

Most Recent:

-
- -

- In addition to programming, I also enjoy writing music. I have been - commissioned for a few tracks in the past and am open to new projects, - whether for your video game or short film. The majority of my music is - on - SoundCloud, but you can also find my EP on Bandcamp and - Spotify. Reach out to me on SoundCloud or my email and we can discuss further! -

- - - - -
- + +
+ - - - - - \ No newline at end of file diff --git a/js/Vehicle.js b/js/Vehicle.js deleted file mode 100644 index 0f846d6..0000000 --- a/js/Vehicle.js +++ /dev/null @@ -1,64 +0,0 @@ -function Vehicle(x, y) { - this.pos = createVector(random(width), random(height)); - this.target = createVector(x, y); - this.vel = p5.Vector.random2D(); - this.acc = createVector(); - this.r = 8; - this.maxspeed = 10; - this.maxforce = 1; -} - -Vehicle.prototype.behaviors = function () { - let arrive = this.arrive(this.target); - let mouse = createVector(mouseX, mouseY); - let flee = this.flee(mouse); - - arrive.mult(1); - flee.mult(1.5); - - this.applyForce(arrive); - this.applyForce(flee); -}; - -Vehicle.prototype.applyForce = function (f) { - this.acc.add(f); -}; - -Vehicle.prototype.update = function () { - this.pos.add(this.vel); - this.vel.add(this.acc); - this.acc.mult(0); -}; - -Vehicle.prototype.show = function () { - stroke(255); - strokeWeight(4); - point(this.pos.x, this.pos.y); -}; - -Vehicle.prototype.arrive = function (target) { - let desired = p5.Vector.sub(target, this.pos); - let d = desired.mag(); - let speed = this.maxspeed; - if (d < 100) { - speed = map(d, 0, 100, 0, this.maxspeed); - } - desired.setMag(speed); - let steer = p5.Vector.sub(desired, this.vel); - steer.limit(this.maxforce); - return steer; -}; - -Vehicle.prototype.flee = function (target) { - let desired = p5.Vector.sub(target, this.pos); - let d = desired.mag(); - if (d < 75) { - desired.setMag(this.maxspeed); - desired.mult(-1); - let steer = p5.Vector.sub(desired, this.vel); - steer.limit(this.maxforce); - return steer; - } else { - return createVector(0, 0); - } -} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9bb1c3f --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "vanadgir.github.io", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "postbuild": "cp docs/index.html docs/404.html", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@emailjs/browser": "^4.4.1", + "@react-three/drei": "^10.7.7", + "@react-three/fiber": "^9.4.0", + "@react-three/postprocessing": "^3.0.4", + "p5": "^2.1.1", + "postprocessing": "^6.38.0", + "prism-react-renderer": "^2.4.1", + "prismjs": "^1.30.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "three": "^0.181.1", + "vite-plugin-glsl": "^1.5.4", + "wouter": "^3.7.1" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "@vitejs/plugin-react": "^5.1.0", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "vite": "^7.2.2" + } +} diff --git a/params.json b/params.json deleted file mode 100644 index d06faa6..0000000 --- a/params.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vanadgir.github.io", - "tagline": "my-personal-website", - "body": "### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here [using GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/), select a template crafted by a designer, and publish. After your page is generated, you can check out the new `gh-pages` branch locally. If you’re using GitHub Desktop, simply sync your repository and you’ll see the new branch.\r\n\r\n### Designer Templates\r\nWe’ve crafted some handsome templates for you to use. Go ahead and click 'Continue to layouts' to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved.\r\n\r\n### Creating pages manually\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `` element will link to the contributor’s GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out our [documentation](https://help.github.com/pages) or [contact support](https://github.com/contact) and we’ll help you sort it out.\r\n", - "note": "Don't delete this file! It's used internally to help with page regeneration." -} \ No newline at end of file diff --git a/projects/glassdoorreviews/index.html b/projects/glassdoorreviews/index.html deleted file mode 100644 index ebc629f..0000000 --- a/projects/glassdoorreviews/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - Glassdoor Reviews - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/index.html b/projects/index.html deleted file mode 100644 index aea2bfa..0000000 --- a/projects/index.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - Portfolio - - - - - - - - - - - - - - - -
-
-
-

My Portfolio

-
-
- -
-

-
- itch.io
- -

-
- - -
-
-
- - -
-

UE5 Puzzle Prototype (2024)
- YouTube Presentation
-

-
- -
-
-
- - -
-

3D Physics Dice Roller (2024)
- three20
- Github Repo -

-
- - -
-
-
- - -
-

p5.js Sketch Gallery (2024)
- Home
-

-
- -
-
-
- - -
-

Endless Crafting with ChatGPT (2024)
- EndLLMless
- Github Repo -

-
- - - - -
-
-
- - -
-

Collaborative Drawing SERN Application (2023)
- drawble
- Github Repo -

-
- - - - -
-
-
- - -
-

Voronoi Shapes Coloring React Application (2023)
- Fill4
- Github Repo -

-
- - -
-
-
- - -
-

National Crime Victimization Survey Data Mining (2023)
- NCVS Data Mining -

-
- -
-
-
- - -
-

Natural Language Processing of Glassdoor Reviews (2023)
- Glassdoor Reviews NLP -

-
- - -
-
-
- - -
-

Analysis of Single-Player and Multi-Player Game Popularity (2022)
- Steam Game Ratings -

-
- -
-
-
- - -
-

TTRPG Character Randomizer & Improv Assistance (2022):
- DNDLER
- Github Repo -

-
- - - -
-
-
- - -
-

Music Recommendation System (2021):
- (Collaborative Filtering, Matrix Factorization)
- Capstone Project -

-
- - -
-
-
- - -
-

Million Songs Dataset Analysis (2018):
- (Clustering, Word Frequency)
- Capstone Project -

-
- - -
-
-
- - -
-

League of Legends Esports Analysis (2018):
- (Player Analysis, Game Result Prediction)
- Capstone Project -

-
- - -
-
-
- - -
-

College Scorecard (2017):
- (Data Wrangling, Data Visualization, Clustering)
- Data Story
- Capstone Project
- Live Presentation Recording -

-
- -
-
-
- - -
-

Personal Website (2016):
- (HTML/CSS/JS, jQuery, Github Pages)
- Github Repo -

-
-
- -
-
- - - - \ No newline at end of file diff --git a/projects/ncvs/index.html b/projects/ncvs/index.html deleted file mode 100644 index a0c2d0b..0000000 --- a/projects/ncvs/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - NCVS - - - - - - - - - - - - - - - -
-
-
-

NCVS Data Mining

-
-
-
-

In this research project, we try to identify the factors which lead to bullying using the National Crime Victimization Survey data. Using R and a wide variety of models, we try to build the best predictive model (in this case, a binary classifier). Below is an embed of the final report, knitted from RMarkdown into PDF, but you can also view it in a separate tab here. You can also view the original study's codebook, which describes the data collection method and has an in-depth data dictionary of all the questions and responses.

-
-
- - - - \ No newline at end of file diff --git a/projects/steamratings/index.html b/projects/steamratings/index.html deleted file mode 100644 index 84ff7d0..0000000 --- a/projects/steamratings/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - Steam Game Ratings - - - - - - - - - - - - - - - -
-
-
-

Steam Game Ratings

-
-
-
-

Using R, I perform a hypothesis test on the difference in proportion of highly rated single-player games and highly-rated multi-player games on Steam. A rather quick analysis, I was able to determine there is a significant difference in popularity, with single-player games being much more highly rated. Below is an embed of the presentation, but if you would like to view the full Powerpoint, it is hosted here on OneDrive.

-
-
- - - - \ No newline at end of file diff --git a/public/CNAME b/public/CNAME new file mode 100644 index 0000000..e1ab4e4 --- /dev/null +++ b/public/CNAME @@ -0,0 +1 @@ +www.varun.pro diff --git a/public/og-preview.jpg b/public/og-preview.jpg new file mode 100644 index 0000000..4bd2546 Binary files /dev/null and b/public/og-preview.jpg differ diff --git a/public/rocket.svg b/public/rocket.svg new file mode 100644 index 0000000..c510da5 --- /dev/null +++ b/public/rocket.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recent-article.html b/recent-article.html deleted file mode 100644 index ccf5f4a..0000000 --- a/recent-article.html +++ /dev/null @@ -1,14 +0,0 @@ - -
- - - - -

January 2025

-

UE5 Puzzle Prototype

- Read Blog - Watch On YouTube -
-
\ No newline at end of file diff --git a/sketches/Fishtank/Fish.js b/sketches/Fishtank/Fish.js deleted file mode 100644 index e30ec9c..0000000 --- a/sketches/Fishtank/Fish.js +++ /dev/null @@ -1,117 +0,0 @@ -// Fish class definition -class Fish { - constructor(x, y) { - this.acceleration = createVector(0, 0); - this.velocity = createVector(0, random(-1,1)); - this.position = createVector(x, y); - this.r = 8; - this.maxspeed = 5; - this.maxforce = 0.8; - this.color = random(255); - this.wanderTheta = 0; - } - - // update location - update() { - // update vel with acc - this.velocity.add(this.acceleration); - // limit max speed - this.velocity.limit(this.maxspeed); - this.position.add(this.velocity); - // reset accel to 0 every cycle - this.acceleration.mult(0); - - // keep within fishtank - this.position.x = constrain(this.position.x, 0, width); - this.position.y = constrain(this.position.y, 0, height); - } - - // updating accel based on applied force - applyForce(force) { - // F = A when M = 1 - this.acceleration.add(force); - } - - // wander when no food - wander() { - this.velocity.mult(0.3); - let wanderPoint = this.velocity.copy(); - wanderPoint.setMag(100); - wanderPoint.add(this.position); - // circle(wanderPoint.x, wanderPoint.y, 16); - - let wanderRadius = 10; - // noFill(); - // circle(wanderPoint.x, wanderPoint.y, wanderRadius*2); - // line(this.position.x, this.position.y, wanderPoint.x, wanderPoint.y); - - let theta = this.wanderTheta + this.velocity.heading(); - - let x = wanderRadius * cos(theta); - let y = wanderRadius * sin(theta); - wanderPoint.add(x,y); - // circle(wanderPoint.x, wanderPoint.y, 8); - // stroke(0); - // line(this.position.x, this.position.y, wanderPoint.x, wanderPoint.y); - - let steer = wanderPoint.sub(this.position); - steer.setMag(this.maxforce); - this.applyForce(steer); - - let displaceRange = 0.9; - this.wanderTheta += random(-displaceRange, displaceRange) - } - - // eat behavior - eat(list) { - let searchRange = Infinity; - let closest = -1; - for (let i = 0; i < list.length; i++) { - let d = this.position.dist(list[i].position); - if (d < searchRange) { - searchRange = d; - closest = i; - } - } - - // if close to food, remove - if (closest != -1 && searchRange < 8) { - list.splice(closest, 1); - } else if (closest != -1) { - this.seek(list[closest].position); - } - } - - // steer towards target - seek(target) { - // vector from location to target - let desired = p5.Vector.sub(target, this.position); - - // scale to max speed - desired.setMag(this.maxspeed); - - // steer = desired - velocity - let steer = p5.Vector.sub(desired, this.velocity); - steer.limit(this.maxforce); - - this.applyForce(steer); - } - - // render fish - display() { - // draw facing target - let theta = this.velocity.heading() + PI / 2; - fill(this.color, 255, 255); - stroke(0); - strokeWeight(1); - push(); - translate(this.position.x, this.position.y); - rotate(theta); - beginShape(); - vertex(0, -this.r * 2); - vertex(-this.r, this.r * 2); - vertex(this.r, this.r * 2); - endShape(CLOSE); - pop(); - } -} diff --git a/sketches/Fishtank/Food.js b/sketches/Fishtank/Food.js deleted file mode 100644 index 6066d6f..0000000 --- a/sketches/Fishtank/Food.js +++ /dev/null @@ -1,18 +0,0 @@ -class Food { - constructor(x, y) { - this.position = createVector(x, y); - this.velocity = createVector(0, random(0.6, 1.3)); - } - - fall() { - this.position.add(this.velocity); - this.position.y = constrain(this.position.y, 0, height); - } - - display(){ - colorMode(RGB); - fill(100, 58, 19); - ellipse(this.position.x, this.position.y, 8, 8); - colorMode(HSB); - } -} diff --git a/sketches/Fishtank/index.html b/sketches/Fishtank/index.html deleted file mode 100644 index 685ccd5..0000000 --- a/sketches/Fishtank/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - Fishtank - - - - - - - - - - - - - - - - - - -
- -
-
-

Fishtank

-

Gallery Home

-
-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/sketches/Mandala/index.html b/sketches/Mandala/index.html deleted file mode 100644 index 5eca958..0000000 --- a/sketches/Mandala/index.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - Mandala - - - - - - - - - - - - - - - - - - -
- -
-
-

Mandala

-

Gallery Home

-
-
-
-
-
- - - - - \ No newline at end of file diff --git a/sketches/MapGen/Cell.js b/sketches/MapGen/Cell.js deleted file mode 100644 index 9d3ebae..0000000 --- a/sketches/MapGen/Cell.js +++ /dev/null @@ -1,17 +0,0 @@ -class Cell { - constructor(value) { - // is collapsed? - this.collapsed = false; - - // initial options - if (value instanceof Array) { - this.options = value; - } else { - // or all options to start - this.options = []; - for (let i = 0; i < value; i++) { - this.options[i] = i; - } - } - } -} diff --git a/sketches/MapGen/Tile.js b/sketches/MapGen/Tile.js deleted file mode 100644 index 0d5a9ef..0000000 --- a/sketches/MapGen/Tile.js +++ /dev/null @@ -1,68 +0,0 @@ -// reverse string function -function reverseString(s) { - let arr = s.split(""); - arr = arr.reverse(); - return arr.join(""); -} - -// function to compare edge -function compareEdge(a, b) { - return a == reverseString(b); -} - -class Tile { - constructor(img, edges) { - // Image - this.img = img; - // Edges - this.edges = edges; - // Valid neighbors - this.up = []; - this.right = []; - this.down = []; - this.left = []; - } - - // find valid neighbors - analyze(tiles) { - for (let i = 0; i < tiles.length; i++) { - let tile = tiles[i]; - // UP - if (compareEdge(tile.edges[2], this.edges[0])) { - this.up.push(i); - } - // RIGHT - if (compareEdge(tile.edges[3], this.edges[1])) { - this.right.push(i); - } - // DOWN - if (compareEdge(tile.edges[0], this.edges[2])) { - this.down.push(i); - } - // LEFT - if (compareEdge(tile.edges[1], this.edges[3])) { - this.left.push(i); - } - } - } - - // rotate tile - rotate(num) { - // draw - const w = this.img.width; - const h = this.img.height; - const newImg = createGraphics(w, h); - newImg.imageMode(CENTER); - newImg.translate(w / 2, h / 2); - newImg.rotate(HALF_PI * num); - newImg.image(this.img, 0, 0); - - // calculate edges - const newEdges = []; - const len = this.edges.length; - for (let i = 0; i < len; i++) { - newEdges[i] = this.edges[(i - num + len) % len]; - } - return new Tile(newImg, newEdges); - } -} diff --git a/sketches/MapGen/index.html b/sketches/MapGen/index.html deleted file mode 100644 index ef18a05..0000000 --- a/sketches/MapGen/index.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - MapGen - - - - - - - - - - - - - - - - - - -
- -
-
-

MapGen

-

Gallery Home

-
-
-
-
- - -
Loading Tiles...
- - - - - \ No newline at end of file diff --git a/sketches/MapGen/tiles/0.png b/sketches/MapGen/tiles/0.png deleted file mode 100644 index 35bcc0b..0000000 Binary files a/sketches/MapGen/tiles/0.png and /dev/null differ diff --git a/sketches/MapGen/tiles/1.png b/sketches/MapGen/tiles/1.png deleted file mode 100644 index 6281949..0000000 Binary files a/sketches/MapGen/tiles/1.png and /dev/null differ diff --git a/sketches/MapGen/tiles/10.png b/sketches/MapGen/tiles/10.png deleted file mode 100644 index 3f04f83..0000000 Binary files a/sketches/MapGen/tiles/10.png and /dev/null differ diff --git a/sketches/MapGen/tiles/11.png b/sketches/MapGen/tiles/11.png deleted file mode 100644 index a54cfbd..0000000 Binary files a/sketches/MapGen/tiles/11.png and /dev/null differ diff --git a/sketches/MapGen/tiles/12.png b/sketches/MapGen/tiles/12.png deleted file mode 100644 index 7a82924..0000000 Binary files a/sketches/MapGen/tiles/12.png and /dev/null differ diff --git a/sketches/MapGen/tiles/13.png b/sketches/MapGen/tiles/13.png deleted file mode 100644 index 0608639..0000000 Binary files a/sketches/MapGen/tiles/13.png and /dev/null differ diff --git a/sketches/MapGen/tiles/2.png b/sketches/MapGen/tiles/2.png deleted file mode 100644 index 4d8091b..0000000 Binary files a/sketches/MapGen/tiles/2.png and /dev/null differ diff --git a/sketches/MapGen/tiles/3.png b/sketches/MapGen/tiles/3.png deleted file mode 100644 index e86c7c9..0000000 Binary files a/sketches/MapGen/tiles/3.png and /dev/null differ diff --git a/sketches/MapGen/tiles/4.png b/sketches/MapGen/tiles/4.png deleted file mode 100644 index c849fa1..0000000 Binary files a/sketches/MapGen/tiles/4.png and /dev/null differ diff --git a/sketches/MapGen/tiles/5.png b/sketches/MapGen/tiles/5.png deleted file mode 100644 index a169fc1..0000000 Binary files a/sketches/MapGen/tiles/5.png and /dev/null differ diff --git a/sketches/MapGen/tiles/6.png b/sketches/MapGen/tiles/6.png deleted file mode 100644 index 0037890..0000000 Binary files a/sketches/MapGen/tiles/6.png and /dev/null differ diff --git a/sketches/MapGen/tiles/7.png b/sketches/MapGen/tiles/7.png deleted file mode 100644 index d51f2ad..0000000 Binary files a/sketches/MapGen/tiles/7.png and /dev/null differ diff --git a/sketches/MapGen/tiles/8.png b/sketches/MapGen/tiles/8.png deleted file mode 100644 index d90cefb..0000000 Binary files a/sketches/MapGen/tiles/8.png and /dev/null differ diff --git a/sketches/MapGen/tiles/9.png b/sketches/MapGen/tiles/9.png deleted file mode 100644 index 7df5258..0000000 Binary files a/sketches/MapGen/tiles/9.png and /dev/null differ diff --git a/sketches/QuickSort/index.html b/sketches/QuickSort/index.html deleted file mode 100644 index 56cb6d2..0000000 --- a/sketches/QuickSort/index.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - QuickSort - - - - - - - - - - - - - - - - - - -
- -
-
-

QuickSort

-

Gallery Home

-
-
-
-
- - - - - \ No newline at end of file diff --git a/sketches/Sandpile/Cell.js b/sketches/Sandpile/Cell.js deleted file mode 100644 index 9192ec8..0000000 --- a/sketches/Sandpile/Cell.js +++ /dev/null @@ -1,79 +0,0 @@ -class Cell { - // set center of cell - constructor(x, y) { - this.x = x; - this.y = y; - this.sandLevel = 0; - this.col = color(0); - this.inXBounds = false; - this.inYBounds = false; - } - - // render method - render(){ - // change color depending on level - switch(this.sandLevel){ - case 0: - this.col = color(0); // black - break; - case 1: - this.col = color(0, 105, 148); // blue - break; - case 2: - this.col = color(194, 178, 98); // beige - break; - case 3: - this.col = color(139, 69, 19); // brown - break; - case 4: - this.col = color(34, 139, 34); // green - break; - case 5: - this.col = color(112, 128, 144); // gray - break; - } - - // overflowing cells fill white - if (this.sandLevel > CELL_MAXIMUM){ - this.col = color(255); // white - } - - // hovered cells fill white - if (this.isHovered() & activeClick) { - this.col = color(255); // white - } - - // fill and draw rect - fill(this.col); - rect(this.x, this.y, cellWidth, cellWidth); - } - - // get method - getSandLevel(){ - return this.sandLevel; - } - - // set method - setSandLevel(level){ - this.sandLevel = level; - } - - // increment method - incrementSand(){ - this.sandLevel += 1; - } - - // mouse hover check - isHovered(){ - this.inXBounds = ((mouseX > this.x - cellWidth/2) && (mouseX <= this.x + cellWidth/2)); - this.inYBounds = ((mouseY > this.y - cellWidth/2) && (mouseY <= this.y + cellWidth/2)); - return this.inXBounds & this.inYBounds; - } - - // click event - clicked(){ - if (this.isHovered()) { - this.sandLevel += DROP_WHEN_CLICKED; - } - } -} diff --git a/sketches/Sandpile/Grid.js b/sketches/Sandpile/Grid.js deleted file mode 100644 index 8acaa49..0000000 --- a/sketches/Sandpile/Grid.js +++ /dev/null @@ -1,83 +0,0 @@ -class Grid { - // set dimensions of grid - constructor(rows, columns) { - this.rows = rows; - this.columns = columns; - - this.cells = []; - for (let i = 0; i < this.rows; i++) { - this.cells[i] = []; - for (let j = 0; j < this.columns; j++) { - this.cells[i][j] = new Cell(i * cellWidth, j * cellWidth); - } - } - } - - // show cells - render() { - for (let i = 0; i < this.rows; i++) { - for (let j = 0; j < this.columns; j++) { - this.cells[i][j].render(); - } - } - } - - // calculate new sand levels - topple() { - let newSandLevels = []; - - // first pass - for (let i = 0; i < this.rows; i++) { - newSandLevels[i] = []; - for (let j = 0; j < this.columns; j++) { - newSandLevels[i][j] = this.cells[i][j].getSandLevel(); - } - } - - // second pass - for (let i = 0; i < this.rows; i++) { - for (let j = 0; j < this.columns; j++) { - let num = this.cells[i][j].getSandLevel(); - if (num > CELL_MAXIMUM) { - newSandLevels[i][j] -= 4; - if (i + 1 < this.rows) newSandLevels[i + 1][j]++; - if (i - 1 >= 0) newSandLevels[i - 1][j]++; - if (j + 1 < this.columns) newSandLevels[i][j + 1]++; - if (j - 1 >= 0) newSandLevels[i][j - 1]++; - } - } - } - - // update cells - for (let i = 0; i < this.rows; i++) { - for (let j = 0; j < this.columns; j++) { - this.cells[i][j].setSandLevel(newSandLevels[i][j]); - } - } - } - - // drop sand at location - dropSand(x, y, amt) { - this.cells[x][y].setSandLevel(amt); - } - - // click event - clicked() { - for (let i = 0; i < this.rows; i++) { - for (let j = 0; j < this.columns; j++) { - this.cells[i][j].clicked(); - } - } - } - - // grid reset method - resetGrid() { - for (let i = 0; i < this.rows; i++) { - for (let j = 0; j < this.columns; j++) { - this.cells[i][j].setSandLevel(0); - } - } - - this.dropSand(Math.floor(rows / 2), Math.floor(columns / 2), INITIAL_SAND); - } -} diff --git a/sketches/Sandpile/index.html b/sketches/Sandpile/index.html deleted file mode 100644 index a6379f2..0000000 --- a/sketches/Sandpile/index.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - Sandpiles - - - - - - - - - - - - - - - - - - -
- -
-
-

Sandpiles

-

Gallery Home

-
-
-
-
- - -

Options

- - - - - - - - - - \ No newline at end of file diff --git a/sketches/TurretDefense/Bullet.js b/sketches/TurretDefense/Bullet.js deleted file mode 100644 index 9aca237..0000000 --- a/sketches/TurretDefense/Bullet.js +++ /dev/null @@ -1,36 +0,0 @@ -class Bullet { - constructor(center, speed) { - this.center = center; - this.speed = speed; - this.offScreen = false; - this.size = 5; - } - - collidesWith(target) { - const distance = dist( - this.center.x, - this.center.y, - target.center.x, - target.center.y - ); - - return distance < this.size + target.size; - } - - update() { - this.center.sub(this.speed); - - const xinside = this.center.x >= 0 && this.center.x <= width; - const yinside = this.center.y >= 0 && this.center.y <= height; - - if (!xinside ||!yinside) { - this.offScreen = true; - } - } - - show(){ - noStroke(); - fill(200, 0, 0); - ellipse(this.center.x, this.center.y, this.size*2, this.size*2); - } -} diff --git a/sketches/TurretDefense/Seeker.js b/sketches/TurretDefense/Seeker.js deleted file mode 100644 index 6c0dd56..0000000 --- a/sketches/TurretDefense/Seeker.js +++ /dev/null @@ -1,101 +0,0 @@ -class Seeker { - constructor(center) { - this.center = center; - this.previousBullet = millis(); - this.velocity = createVector(random(1.5, 2), random(1.5, 2)); - this.size = 20; - this.visionRadius = 200; - this.SHOT_INTERVAL = 30; - this.MIN_VISION = 50; - this.MAX_VISION = 400; - this.closest; - } - - scan(targets) { - let shortest = Infinity; - let newClosest = null; - - for (let t of targets) { - if (t.isInside & t.onScreen()) { - let distance = dist( - this.center.x, - this.center.y, - t.center.x, - t.center.y - ); - if (distance < shortest) { - newClosest = t; - shortest = distance; - } - } - } - - this.closest = newClosest; - } - - moveSeeker(mousePos) { - let direction = mousePos.copy().sub(this.center); - let distance = direction.mag(); - if (distance > 5) { - direction.normalize(); - let speed = this.velocity.mag(); - let targetVelocity = direction.mult(speed); - this.velocity = p5.Vector.lerp(this.velocity, targetVelocity, 1); - } - } - - fireBullet(target) { - if (!this.closest) return; - - const currentTime = millis(); - - if (currentTime - this.previousBullet > this.SHOT_INTERVAL) { - const a = this.center.copy().sub(this.closest.center); - const b = a.add(target.speed.copy()); - - const aimOffset = random(1); - - bullets.push( - new Bullet( - this.center.copy(), - a.add(b).normalize().mult(2.5).add(createVector(0, aimOffset)) - ) - ); - this.previousBullet = currentTime; - } - } - - update() { - this.center.add(this.velocity); - - this.fireBullet(this.closest); - - if (this.center.x <= this.size || this.center.x >= width - this.size) { - this.velocity.x *= -1; - } - - if (this.center.y <= this.size || this.center.y >= height - this.size) { - this.velocity.y *= -1; - } - } - - show() { - for (let b of bullets) { - b.update(); - b.show(); - } - - fill(255); - noStroke(); - ellipse(this.center.x, this.center.y, this.size * 2, this.size * 2); - - noFill(); - stroke(255); - ellipse( - this.center.x, - this.center.y, - this.visionRadius * 2, - this.visionRadius * 2 - ); - } -} diff --git a/sketches/TurretDefense/Target.js b/sketches/TurretDefense/Target.js deleted file mode 100644 index 00bedd1..0000000 --- a/sketches/TurretDefense/Target.js +++ /dev/null @@ -1,54 +0,0 @@ -function getRandomSpeed(){ - const speed = random(-1.5, -0.5); - return createVector(0, speed); -} - -class Target { - constructor(id, center) { - this.id = id; - this.center = center; - this.speed = getRandomSpeed(); - this.size = 8; - this.health = 150; - this.fill; - this.isInside = false; - } - - onScreen(){ - const xinside = (this.center.x >= 0 && this.center.x <= width); - const yinside = (this.center.y >= 0 && this.center.y <= height); - - return xinside && yinside; - } - - update(){ - this.center.add(this.speed); - - if(this.isInside) { - this.fill = color(0, 200, 0); - } else { - this.fill = color(0, 0, 200); - } - - if(this.center.y < 0) { - this.center.y = random(height, height*2); - this.speed = getRandomSpeed(); - SCORE += 1; - } - } - - insideRadius(s) { - if (dist(s.center.x, s.center.y, this.center.x, this.center.y) < s.visionRadius) { - this.isInside = true; - } else { - this.isInside = false; - } - } - - show(){ - fill(this.fill); - stroke(this.fill); - ellipse(this.center.x, this.center.y, this.size*2, this.size*2); - } - -} diff --git a/sketches/TurretDefense/index.html b/sketches/TurretDefense/index.html deleted file mode 100644 index 32ac49a..0000000 --- a/sketches/TurretDefense/index.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - Turret Defense Demo - - - - - - - - - - - - - - - - - - -
- -
-
-

Turret Defense Demo

-

Gallery Home

-
-
-
-
- - - - - -
- - - - - - - - \ No newline at end of file diff --git a/sketches/index.html b/sketches/index.html deleted file mode 100644 index 72bab41..0000000 --- a/sketches/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - Sketch Gallery - - - - - - - - - - - - - - - - -
- -
-
-

p5.js Sketch Gallery

-
-
- -

Turret Defense Demo

-

Radial Detection in Dynamic Particle System

-
- - -

Sandpiles

-

Emergent Patterns of Cellular Automata -
(contains strobe effects) -

-
- - -

Mandala

-

Procedural Generation of Mandala Using Recursion

-
- - -

Fishtank

-

Explore Particle Physics and Steering Behaviors with Interactive Fishtank

-
- - -

MapGen

-

2D Map Generator using Wave Function Collapse

-
- - -

QuickSort

-

Colorful visualization of QuickSort

-
- -
-
-
- - - - \ No newline at end of file diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000..6c712c0 --- /dev/null +++ b/src/App.css @@ -0,0 +1,1110 @@ +/* ========================================== */ +/* FONTS & ROOT VARIABLES */ +/* ========================================== */ + +@font-face { + font-family: "alagard"; + src: url("./assets/fonts/alagard.ttf") format("truetype"); + font-weight: normal; + font-style: normal; +} + +:root { + --nav-item-height: 32px; +} + +/* ========================================== */ +/* GLOBAL LAYOUT / TYPOGRAPHY */ +/* ========================================== */ + +html, +body, +#root { + font-family: "alagard", Cambria, "Times New Roman", serif; + font-size: 18px; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; +} + +.app-root { + position: relative; + width: 100vw; + height: 100vh; + overflow: hidden; + background: #000; + user-select: none; +} + +.r3f-root { + position: absolute; + inset: 0; + z-index: 0; +} + +.r3f-root canvas, +.r3f-canvas { + width: 100%; + height: 100%; + display: block; +} + +/* ========================================== */ +/* GLOBAL SCROLLBARS */ +/* ========================================== */ + +/* WebKit */ +::-webkit-scrollbar { + width: 10px; +} + +::-webkit-scrollbar-track { + background: rgba(255, 255, 255, 0.08); + backdrop-filter: blur(3px); + border-radius: 10px; +} + +::-webkit-scrollbar-thumb { + background: linear-gradient(180deg, #7aa7ff, #3e5bd6); + border-radius: 10px; + border: 2px solid rgba(0, 0, 0, 0.2); +} + +::-webkit-scrollbar-thumb:hover { + background: linear-gradient(180deg, #98b7ff, #4c6ce0); +} + +/* Firefox */ +* { + scrollbar-width: thin; + scrollbar-color: #4c6ce0 rgba(255, 255, 255, 0.08); +} + +/* ========================================== */ +/* SINGLE DOM ROOT CONTAINER & BODY CONTENT */ +/* ========================================== */ + +.dom-root { + position: absolute; + inset: 0; + color: white; + pointer-events: none; +} + +.dom-body { + user-select: none; + pointer-events: none; + position: absolute; + margin-top: 5vh; + margin-left: 1vw; +} + +.debug-panel { + position: fixed; + right: 0.5rem; + bottom: 0.5rem; + color: white; + font-size: 0.75rem; + font-family: "alagard", Cambria, "Times New Roman", serif; + background: none; + border: none; + padding: 0; + pointer-events: none; + z-index: 1000; +} + +/* ========================================== */ +/* NAVIGATION BAR & FOOTER */ +/* ========================================== */ + +.dom-nav { + position: absolute; + top: 10px; + left: 10px; + right: 10px; + + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; + + max-width: calc(100% - 20px); + pointer-events: auto; + z-index: 10; +} + +.dom-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + display: flex; + align-items: center; + padding: 8px; + box-sizing: border-box; + z-index: 20; /* above canvas */ +} + +/* gear on the left, tray to the right */ +.settings-gear-button { + pointer-events: auto; + margin-right: 8px; +} + +/* Shared button-like controls (nav, footer, trays, pane footers) */ +.dom-nav button, +.dom-nav a, +.dom-footer button, +.settings-tray button, +.detail-pane-footer button { + font-family: "alagard", Cambria, "Times New Roman", serif; + min-height: var(--nav-item-height); + padding: 0 10px; + border-radius: 4px; + box-sizing: border-box; + cursor: pointer; + + border: 1px solid rgba(255, 255, 255, 0.6); + background: rgba(0, 0, 0, 0.6); + color: white; + + text-decoration: none; + + display: inline-flex; + align-items: center; + justify-content: center; +} + +.dom-nav button, +.dom-nav a, +.dom-footer button, +.detail-pane-footer button { + font-size: 16px; +} + +.detail-pane-project-image-wrapper { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.75rem; + margin: 0 0 1rem; +} + +.detail-pane-project-image { + max-width: 100%; + max-height: 260px; + object-fit: contain; + display: block; +} + +.detail-pane-doc-preview { + margin: 1rem 0; + display: flex; + justify-content: center; +} + +.detail-pane-doc-iframe { + width: 100%; + max-width: 100%; + height: 640px; + border: none; + border-radius: 6px; +} + +.detail-pane-links { + margin-top: 1rem; + margin-bottom: 1.5rem; + text-align: center; +} + +.detail-pane-links-heading { + font-size: 1rem; + margin-bottom: 0.6rem; +} + +.detail-pane-links-buttons { + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 0.75rem; +} + +.detail-pane-link-button { + padding: 0.4rem 1rem; + font-family: "alagard", Cambria, "Times New Roman", serif; + font-size: 0.9rem; + color: white; + background: #1a1a1a; + border: 1px solid #444; + border-radius: 6px; + cursor: pointer; + transition: background 0.2s ease, border-color 0.2s ease; +} + +.detail-pane-link-button:hover { + background: #ff9900; + border-color: #ff9900; + color: black; +} + +.detail-pane-tech-row { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + margin-top: 1rem; +} + +.detail-pane-tech-chip { + display: flex; + align-items: center; + gap: 0.35rem; +} + +.detail-pane-tech-strip { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 2rem; + padding: 0.5rem 0; +} + +.detail-pane-tech-icon-wrapper { + display: flex; + align-items: center; + justify-content: center; +} + +.detail-pane-tech-icon { + height: 48px; + width: auto; + object-fit: contain; + display: block; +} + +.detail-pane-tech-label { + font-size: 0.85rem; +} + +/* Settings tray buttons – make interactions feel snappier */ +.settings-tray button { + font-size: 14px; + transition: transform 0.12s ease, filter 0.12s ease; +} + +.settings-tray button:active { + transform: scale(0.96); + filter: brightness(1.2); +} + +/* Pressed state for nav & settings tray buttons */ +.dom-nav button[aria-pressed="true"], +.settings-tray button[aria-pressed="true"] { + border-color: white; + background: rgba(255, 255, 255, 0.15); +} + +/* Icon buttons (square, no padding) */ +.dom-nav-icon { + width: var(--nav-item-height); + height: var(--nav-item-height); + + padding: 0 !important; + border-radius: 4px; + flex: 0 0 var(--nav-item-height); + + display: inline-flex; + align-items: center; + justify-content: center; +} + +.dom-nav-icon img { + width: 100%; + height: 100%; + object-fit: contain; + display: block; + padding: 0; + margin: 0; +} + +/* External icons */ +.dom-nav a.external-icon { + background: rgba(146, 146, 146, 0.866); +} + +/* ========================================== */ +/* MUSIC EMBED CARDS */ +/* ========================================== */ + +.detail-pane--music .detail-pane-body { + font-size: 18px; +} + +.music-embed-card { + margin-bottom: 1.25rem; + padding-bottom: 1rem; + border-bottom: 1px solid rgba(148, 163, 184, 0.4); +} + +.music-embed-title { + margin: 0 0 0.25rem 0; + font-size: 1.05rem; +} + +.music-embed-note { + margin: 0 0 0.5rem 0; + font-size: 0.9rem; + opacity: 0.85; +} + +.music-embed-frame-wrapper { + width: 100%; + border-radius: 10px; + overflow: hidden; +} + +/* 16:9 responsive iframe */ +.music-embed-frame { + width: 100%; + aspect-ratio: 16 / 9; + border: none; + display: block; +} + +.music-profile-link-wrapper { + margin-bottom: 1rem; +} + +.music-profile-link { + display: inline-flex; + align-items: center; + gap: 0.4rem; + padding: 0.4rem 0.75rem; + border-radius: 999px; + font-size: 0.9rem; + font-weight: 500; + text-decoration: none; + background: rgba(148, 163, 184, 0.16); + border: 1px solid rgba(148, 163, 184, 0.45); + color: #e5e7eb; + backdrop-filter: blur(10px); +} + +.music-profile-link:hover { + background: rgba(148, 163, 184, 0.3); +} + +/* ========================================== */ +/* SETTINGS TRAY */ +/* ========================================== */ + +.settings-tray { + display: flex; + flex-direction: row; + gap: 6px; + + padding: 8px 10px; + border-radius: 12px; + background: rgba(5, 10, 30, 0.95); + border: 1px solid rgba(148, 163, 184, 0.7); + box-shadow: 0 0 24px rgba(15, 23, 42, 0.9); + color: #e5e7eb; + + transform: translateX(-8px); + opacity: 0; + pointer-events: none; + transition: transform 0.25s ease-out, opacity 0.25s ease-out; +} + +.settings-tray--open { + transform: translateX(0); + opacity: 1; + pointer-events: auto; +} + +/* ========================================== */ +/* OVERLAY ROOT / BASE PANEL STYLES */ +/* ========================================== */ + +/* Root flex container: controls layout for both panes */ +.planet-overlay-root { + position: fixed; + inset: 0; + z-index: 10; + font-size: 20px; + pointer-events: none; + + /* leave room for nav + footer */ + padding: 72px 24px 80px; + box-sizing: border-box; + + display: flex; + flex-direction: row; /* left/right */ + align-items: flex-start; + justify-content: space-between; /* push children to edges */ +} + +/* Base overlay panel card styling */ +.planet-overlay-box { + box-sizing: border-box; + padding: 0.75rem 1.5rem 1.5rem; + + border-radius: 18px; + background: rgba(5, 10, 30, 0.86); + border: 1px solid rgba(148, 163, 184, 0.7); + box-shadow: 0 0 30px rgba(15, 23, 42, 0.95); + color: #e5e7eb; + + backdrop-filter: blur(10px); + pointer-events: auto; + font-family: "alagard", Cambria, "Times New Roman", serif; + + /* flex child anchored to its side; do NOT grow into center */ + position: relative; + flex: 0 0 auto; + min-width: 0; + min-height: 0; + max-width: clamp(380px, 36vw, 720px); + max-height: 100%; + display: flex; + flex-direction: column; +} + +/* Normalize headings inside overlay panes */ +.planet-overlay-box h2 { + margin: 0 0 0.25rem 0; +} + +/* Left detail panel – sits on left because it's first child */ +.planet-overlay-box--left { + margin-right: 0; +} + +/* Right primary panel – force it to the right edge even + if it's the only panel rendered */ +.planet-overlay-box--right { + margin-left: auto; +} + +/* Close button for the left detail panel */ +.overlay-close-button { + position: absolute; + top: 10px; + right: 12px; + border: none; + background: transparent; + color: #e5e7eb; + font-size: 24px; + line-height: 1; + cursor: pointer; + padding: 0; +} + +.overlay-close-button:hover { + opacity: 0.8; +} + +/* ========================================== */ +/* RIGHT-PANE INFO LIST */ +/* ========================================== */ + +.blog-info { + display: flex; + flex-direction: column; + min-height: 0; +} + +.blog-info p { + margin-top: 4px; + margin-bottom: 4px; +} + +.blog-info ul { + margin-top: 1%; +} + +.info-item-list { + flex: 1 1 auto; + min-height: 0; + overflow-y: auto; + padding: 0; + margin: 0.75rem 0 0; + + display: flex; + flex-direction: column; + gap: 6px; +} + +.info-item-list-item { + margin: 0; +} + +.info-item-button { + width: 100%; + text-align: left; + display: flex; + flex-direction: column; + gap: 2px; + + border-radius: 8px; + border: 1px solid rgba(148, 163, 184, 0.7); + background: rgba(15, 23, 42, 0.85); + padding: 8px 10px; + cursor: pointer; + + color: #e5e7eb; + font-family: "alagard", Cambria, "Times New Roman", serif; +} + +.info-item-button:hover { + background: rgba(30, 64, 175, 0.6); +} + +.info-item-title { + font-size: 20px; +} + +.info-item-description { + font-size: 16px; + opacity: 0.8; +} + +.info-item-tech-row { + display: flex; + flex-wrap: wrap; + gap: 0.25rem; + margin-top: 0.35rem; +} + +.info-item-tech-icon { + height: 20px; /* smaller but still standardized */ + width: auto; + object-fit: contain; +} + +/* ========================================== */ +/* LEFT-PANE DETAIL CONTENT */ +/* ========================================== */ + +.detail-pane { + max-width: 100%; + font-family: "alagard", Cambria, "Times New Roman", serif; + display: flex; + flex-direction: column; + flex: 1 1 auto; + min-height: 0; +} + +.detail-pane-header { + flex: 0 0 auto; + margin-bottom: 0.75rem; +} + +.detail-pane-header h2 { + margin: 0 0 0.25rem 0; +} + +.detail-pane-subtitle { + margin: 0; + font-size: 18px; + opacity: 0.8; +} + +.detail-pane-body { + flex: 1 1 auto; + min-height: 0; + overflow-y: auto; + font-size: 22px; + line-height: 1.5; +} + +.detail-pane-body h3 { + margin: 0.5rem 0 0.25rem; + font-size: 22px; +} + +.detail-pane-body p { + margin: 0.4rem 0; +} + +.detail-pane-body strong, +.detail-pane-body b { + font-weight: bold; +} + +.detail-pane-body ul, +.detail-pane-body ol { + list-style: disc outside; + margin: 0.4rem 0 0.4rem 1.4rem; + padding-left: 0; +} + +/* Make sure list items actually render as list items */ +.detail-pane-body ul li, +.detail-pane-body ol li { + display: list-item; +} + +/* Smooth scrolling on mobile for inner panes */ +.detail-pane-body, +.info-item-list { + -webkit-overflow-scrolling: touch; +} + +/* Overall docs layout: vertical stack */ +.detail-pane-body--docs { + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +/* Row that holds the list of buttons (can expand later if needed) */ +.docs-controls-row { + display: flex; + align-items: flex-start; +} + +/* Left column: flexbox of buttons, wide enough for labels */ +.docs-list { + display: flex; + flex-direction: column; + gap: 0.6rem; + width: 100%; /* use full width since preview is below */ +} + +/* Each entry block */ +.docs-item { + display: flex; + flex-direction: column; +} + +/* Active highlight */ +.docs-item--active .docs-item-title { + background: rgba(120, 140, 255, 0.55); +} + +/* Name button */ +.docs-item-title { + width: 100%; + text-align: center; + padding: 0.35rem 0.6rem; + + border-radius: 0; + border: 1px solid rgba(255, 255, 255, 0.3); + background: rgba(0, 0, 0, 0.5); + + font-family: "alagard", Cambria, "Times New Roman", serif; + font-size: clamp(0.7rem, 1.6vw, 0.95rem); + color: #ffffff; + + cursor: pointer; + box-shadow: none; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.docs-item-title:hover { + background: rgba(80, 110, 255, 0.75); +} + +/* View + Download row */ +.docs-item-actions { + margin-top: 0.25rem; + display: flex; + gap: 0.35rem; + justify-content: center; +} + +/* View + Download buttons */ +.docs-action-button { + padding: 0.2rem 0.5rem; + + border-radius: 0; + border: 1px solid rgba(255, 255, 255, 0.3); + background: rgba(0, 0, 0, 0.5); + + font-family: "alagard", Cambria, "Times New Roman", serif; + font-size: 0.75rem; + color: #ffffff; + + cursor: pointer; + box-shadow: none; + text-decoration: none; /* for */ + display: inline-flex; + align-items: center; + justify-content: center; +} + +.docs-action-button:hover { + background: rgba(255, 255, 255, 0.12); +} + +.docs-viewer { + height: 45vh; + max-height: 60vh; + overflow: hidden; + border-radius: 6px; +} + +.docs-viewer-frame { + width: 100%; + height: 100%; + border: none; +} + +/* Generic blog images used by all entries */ +.blog-image, +.blog-entry-image { + display: block; + width: 85%; + justify-self: center; + margin: 0.75rem auto 1rem; + border-radius: 10px; + border: 1px solid rgba(148, 163, 184, 0.7); +} + +/* Footer pager controls */ +.detail-pane-footer { + flex: 0 0 auto; + margin-top: 0.75rem; + padding-top: 0.5rem; + border-top: 1px solid rgba(148, 163, 184, 0.6); + display: flex; + justify-content: flex-start; + gap: 8px; +} + +.detail-pane-footer button:disabled { + opacity: 0.4; + cursor: default; +} + +/* Index page "Day N" / post title links */ +.page-link { + border: none; + background: transparent; + padding: 0; + margin: 0; + + font: inherit; + color: #e5e7eb; + text-decoration: underline; + cursor: pointer; +} + +.page-link:hover { + color: #fd7e00; +} + +.page-link:focus-visible { + outline: 2px solid rgba(248, 250, 252, 0.9); + outline-offset: 2px; +} + +.about-photo-wrapper { + position: relative; + display: block; + width: 85%; + justify-self: center; + margin: 0.75rem 0 1rem; + border-radius: 10px; + border: 1px solid rgba(148, 163, 184, 0.7); + + margin-left: auto; + margin-right: auto; + + aspect-ratio: 1 / 1; + overflow: hidden; +} + +.about-photo { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + + transition: opacity 0.4s ease; +} + +.about-photo.base { + opacity: 1; +} + +.about-photo.hover { + opacity: 0; +} + +.about-photo-wrapper:hover .hover { + opacity: 1; +} + +.about-photo-wrapper:hover .base { + opacity: 0; +} + +/* ========================================== */ +/* GUESTBOOK */ +/* ========================================== */ + +.guestbook-body { + font-family: "alagard", Cambria, "Times New Roman", serif; + display: flex; + flex-direction: column; + gap: 1rem; +} + +.guestbook-form { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.guestbook-label { + display: flex; + flex-direction: column; + font-weight: bold; + gap: 0.25rem; +} + +.guestbook-input, +.guestbook-textarea, +.guestbook-captcha-input { + padding: 8px; + border-radius: 6px; + border: 1px solid #555; + background: #111; + color: white; +} + +.guestbook-submit-button { + font-family: "alagard", Cambria, "Times New Roman", serif; + padding: 10px 14px; + text-align: center; + border-radius: 6px; + background: #444; + color: white; + font-weight: bold; + cursor: pointer; + text-decoration: none; +} + +.guestbook-submit-button.disabled { + opacity: 0.4; + cursor: not-allowed; +} + +.guestbook-captcha-row { + display: flex; + align-items: center; + gap: 8px; +} + +.guestbook-warning { + color: #f55; + font-size: 0.9rem; +} + +.code-block { + position: relative; + margin: 1.5rem 0; + border-radius: 8px; + background: #050814; + border: 1px solid rgba(255, 255, 255, 0.08); + overflow: hidden; + font-size: 0.9rem; +} + +.code-block-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.4rem 0.75rem; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); + background: radial-gradient(circle at top left, #20253b, #050814); +} + +.code-block-lang { + font-size: 0.75rem; + text-transform: uppercase; + letter-spacing: 0.08em; + opacity: 0.7; +} + +.code-block-copy { + font-family: "alagard", Cambria, "Times New Roman", serif; + font-size: 0.75rem; + padding: 0.15rem 0.6rem; + border-radius: 999px; + border: 1px solid rgba(255, 255, 255, 0.24); + background: transparent; + color: inherit; + cursor: pointer; +} + +.code-block-copy:hover { + background: rgba(255, 255, 255, 0.06); +} + +.code-block-pre { + margin: 0; + padding: 0.75rem 0.9rem; + overflow-x: auto; +} + +/* Make long lines usable on phone */ +.code-block-pre::-webkit-scrollbar { + height: 6px; +} + +.code-block-pre::-webkit-scrollbar-thumb { + border-radius: 999px; +} + +/* Let code wrap if you prefer that to horizontal scroll */ +.code-block-code { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + "Liberation Mono", "Courier New", monospace; + white-space: pre; + line-height: 1.5; +} + +/* Optional: slightly smaller font on narrow screens */ +@media (max-width: 600px) { + .code-block { + margin: 1rem 0; + font-size: 0.8rem; + } + + .code-block-pre { + padding: 0.6rem 0.7rem; + } +} + +/* ========================================== */ +/* MOBILE */ +/* ========================================== */ + +@media (max-width: 600px) { + /* Nav: wrap so it always fits */ + .dom-nav { + display: flex; + flex-wrap: wrap; + gap: 4px; + justify-content: center; + max-width: 100%; + white-space: normal; + overflow: visible; + } + + .dom-nav button, + .dom-nav a { + flex: 1 1 auto; + min-width: 0; + padding: 0 6px; + font-size: 14px; + } + + .dom-nav-icon { + flex: 0 0 var(--nav-item-height); + } + + /* OVERLAY: fixed top and fixed bottom, adaptive heights */ + .planet-overlay-root { + /* no extra padding so panels can sit at true top/bottom */ + padding: 0; + } + + .planet-overlay-box { + left: 8px; + right: 8px; + max-width: none; + width: auto; + } + + /* Fallback height for browsers without dvh support */ + .planet-overlay-box--left, + .planet-overlay-box--right { + height: 45vh; + max-height: 45vh; + } + + /* TOP PANE (left) – fixed under nav, height derived from viewport */ + .planet-overlay-box--left { + position: fixed; + top: 56px; /* just under the nav */ + border-radius: 12px; + overflow: hidden; + + /* adaptive: split space with bottom pane so they never overlap */ + height: calc((100dvh - 56px) * 0.65); + max-height: calc((100dvh - 56px) * 0.65); + } + + /* BOTTOM PANE (right) – fixed at far bottom, same adaptive height. + When it's alone, it still uses this height (does NOT fill screen). */ + .planet-overlay-box--right { + position: fixed; + left: 8px; + right: 8px; + bottom: 0; /* full far bottom */ + border-radius: 12px; + overflow: hidden; + + height: calc((100dvh - 56px) * 0.35); + max-height: calc((100dvh - 56px) * 0.35); + } + + /* Footer stays fixed; may be covered by bottom pane (as you allowed) */ + .dom-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + padding: 8px; + box-sizing: border-box; + } + + /* Settings tray as a drop-up above the gear/footer */ + .settings-tray { + position: absolute; + left: 8px; /* align with gear button */ + bottom: calc(var(--nav-item-height) + 16px); /* sit above footer */ + flex-direction: column; + align-items: stretch; + max-width: calc(100% - 16px); + + transform: translateY(8px); + opacity: 0; + pointer-events: none; + } + + .settings-tray--open { + transform: translateY(0); + opacity: 1; + pointer-events: auto; + } + + .settings-tray button { + width: 100%; + text-align: left; + } + + /* Home copy: top, horizontally centered, wide */ + .dom-body { + position: absolute; + top: 56px; /* under nav */ + left: 50%; + transform: translateX(-50%); + width: 90vw; + max-width: 480px; + margin: 0; + text-align: center; + padding: 0 8px; + pointer-events: none; + user-select: none; + } +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..ab8abc0 --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,14 @@ +import R3F from "./R3F"; +import DOM from "./DOM"; +import "./App.css"; + +const App = () => { + return ( +
+ + +
+ ); +}; + +export default App; diff --git a/src/DOM/components/DebugPanel.jsx b/src/DOM/components/DebugPanel.jsx new file mode 100644 index 0000000..b5b5085 --- /dev/null +++ b/src/DOM/components/DebugPanel.jsx @@ -0,0 +1,41 @@ +import { useEffect, useRef, useState } from "react"; +import { useSettings } from "../../contexts/SettingsContext"; + +const DebugPanel = () => { + const { debugEnabled } = useSettings(); + const [fps, setFps] = useState(0); + const lastTime = useRef(performance.now()); + const frames = useRef(0); + + useEffect(() => { + if (!debugEnabled) return; + + let rafId; + + const measure = (now) => { + frames.current += 1; + + if (now - lastTime.current >= 1000) { + setFps(frames.current); + frames.current = 0; + lastTime.current = now; + } + + rafId = requestAnimationFrame(measure); + }; + + rafId = requestAnimationFrame(measure); + + return () => cancelAnimationFrame(rafId); + }, [debugEnabled]); + + if (!debugEnabled) return null; + + return ( +
+ {fps} fps +
+ ); +}; + +export default DebugPanel; diff --git a/src/DOM/components/InfoOverlay.jsx b/src/DOM/components/InfoOverlay.jsx new file mode 100644 index 0000000..37cffe6 --- /dev/null +++ b/src/DOM/components/InfoOverlay.jsx @@ -0,0 +1,124 @@ +import { useState, useCallback } from "react"; + +import BlogOverlay from "../content/BlogOverlay"; +import DocumentsOverlay from "../content/DocumentsOverlay"; +import ProjectsOverlay from "../content/ProjectsOverlay"; +import MusicOverlay from "../content/MusicOverlay"; + +import { useLocation } from "wouter"; + +import { useGTag } from "../../contexts/GTagContext"; + +const renderDetail = (detailId) => { + if (detailId.startsWith("docs:")) { + const topicId = detailId.split(":")[1]; + return ; + } + + if (detailId.startsWith("project:")) { + const projectId = detailId.split(":")[1]; + return ; + } + + if (detailId.startsWith("music:")) { + const platformId = detailId.split(":")[1]; + return ; + } + + if (detailId.startsWith("blog:")) { + const blogId = detailId.split(":")[1]; + return ; + } + + return null; +}; + +const InfoOverlay = ({ planet }) => { + if (!planet) return null; + const { trackOverlayClose, trackOverlayOpen } = useGTag(); + const [detailId, setDetailId] = useState(null); + const [, navigate] = useLocation(); + + const openDetail = useCallback( + (id) => { + setDetailId((current) => { + const next = current === id ? null : id; + if (next) { + // opened + trackOverlayOpen?.("detail", id); + } else { + // closed via toggle + trackOverlayClose?.("detail", id); + } + return next; + }); + }, + [trackOverlayOpen, trackOverlayClose] + ); + + const closeDetail = useCallback(() => { + if (detailId) { + trackOverlayClose?.("detail", detailId); + } + setDetailId(null); + }, [detailId, trackOverlayClose]); + + const handleClick = (e) => { + e.stopPropagation(); + navigate("/"); + }; + + const InfoComponent = planet.InfoComponent ?? DefaultInfo; + + return ( +
+ {detailId && ( +
+ + {renderDetail(detailId)} +
+ )} + +
+ + +
+
+ ); +}; + +const DefaultInfo = ({ planet }) => ( +
+

{planet.label}

+

Content coming soon.

+
+); + +export default InfoOverlay; diff --git a/src/DOM/components/NavBar.jsx b/src/DOM/components/NavBar.jsx new file mode 100644 index 0000000..053a281 --- /dev/null +++ b/src/DOM/components/NavBar.jsx @@ -0,0 +1,66 @@ +import { useLocation } from "wouter"; +import { PLANETS } from "../../config/planets"; +import GithubIcon from "../../assets/images/github.svg"; +import LinkedInIcon from "../../assets/images/linkedin.svg"; + +import { usePlanetUI } from "../../contexts/PlanetUIContext"; + +const NavBar = () => { + const [location, navigate] = useLocation(); + const isHome = location === "/"; + const { requestHomeRecenter } = usePlanetUI(); + + return ( +
+ ); +}; + +export default NavBar; diff --git a/src/DOM/components/OverlayContentLink.jsx b/src/DOM/components/OverlayContentLink.jsx new file mode 100644 index 0000000..96ef7c8 --- /dev/null +++ b/src/DOM/components/OverlayContentLink.jsx @@ -0,0 +1,16 @@ +const OverlayContentLink = ({ title, description, onActivate }) => { + return ( + + ); +}; + +export default OverlayContentLink; diff --git a/src/DOM/components/SettingsBar.jsx b/src/DOM/components/SettingsBar.jsx new file mode 100644 index 0000000..27b18ba --- /dev/null +++ b/src/DOM/components/SettingsBar.jsx @@ -0,0 +1,132 @@ +import SettingsIcon from "../../assets/images/settings.svg"; +import { useSettings } from "../../contexts/SettingsContext"; + +const SettingsBar = () => { + const { + paused, + togglePaused, + showOrbits, + toggleShowOrbits, + settingsOpen, + toggleSettingsOpen, + shadowsEnabled, + toggleShadowsEnabled, + debugEnabled, + toggleDebugEnabled, + quality, + toggleQuality, + showMoons, + toggleShowMoons, + throttlePhysics, + toggleThrottlePhysics, + } = useSettings(); + + const qualityLabel = + quality === "low" ? "L" : quality === "medium" ? "M" : "H"; + + return ( +
+ {/* Gear: always visible */} + + + {/* Tray: slides out to the right of the gear */} +
+ {/* Pause/Resume */} + + + {/* Debug Toggle */} + + + {/* Show Orbit Toggle */} + + + {/* Shadows Toggle */} + + + {/* Quality Cycle */} + + + {/* Moons Toggle */} + + + {/* Prioritize DOM Cycle */} + + + {/* Refresh Page */} + +
+
+ ); +}; + +export default SettingsBar; diff --git a/src/DOM/components/info/BlogInfo.jsx b/src/DOM/components/info/BlogInfo.jsx new file mode 100644 index 0000000..e6a952f --- /dev/null +++ b/src/DOM/components/info/BlogInfo.jsx @@ -0,0 +1,30 @@ +import OverlayContentLink from "../OverlayContentLink"; +import { blogList } from "../../content/entries/blogMedia"; + +const BlogInfo = ({ planet, openDetail }) => { + const handleOpenBlog = (blogId) => { + if (!openDetail) return; + openDetail(`blog:${blogId}`); + }; + + return ( +
+

{planet.label}

+

Dev logs, writeups, and thoughts.

+ +
    + {blogList.map((blog) => ( +
  • + handleOpenBlog(blog.id)} + /> +
  • + ))} +
+
+ ); +}; + +export default BlogInfo; diff --git a/src/DOM/components/info/DocsInfo.jsx b/src/DOM/components/info/DocsInfo.jsx new file mode 100644 index 0000000..42f1f20 --- /dev/null +++ b/src/DOM/components/info/DocsInfo.jsx @@ -0,0 +1,48 @@ +import OverlayContentLink from "../OverlayContentLink"; + +const DocsInfo = ({ planet, openDetail }) => { + const openResume = () => { + openDetail?.("docs:resume"); + }; + + const openElvtr = () => { + openDetail?.("docs:elvtr"); + }; + + const openDataSci = () => { + openDetail?.("docs:datasci"); + }; + + return ( +
+

{planet.label}

+

View or Download

+ +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+ ); +}; + +export default DocsInfo; diff --git a/src/DOM/components/info/MusicInfo.jsx b/src/DOM/components/info/MusicInfo.jsx new file mode 100644 index 0000000..03d328d --- /dev/null +++ b/src/DOM/components/info/MusicInfo.jsx @@ -0,0 +1,29 @@ +import OverlayContentLink from "../OverlayContentLink"; +import { musicPlatformList } from "../../content/entries/musicMedia"; + +const MusicInfo = ({ planet, openDetail }) => { + const handleOpenPlatform = (platformId) => { + openDetail?.(`music:${platformId}`); + }; + + return ( +
+

{planet.label}

+

Releases & WIP

+ +
    + {musicPlatformList.map((platform) => ( +
  • + handleOpenPlatform(platform.id)} + /> +
  • + ))} +
+
+ ); +}; + +export default MusicInfo; diff --git a/src/DOM/components/info/ProjectsInfo.jsx b/src/DOM/components/info/ProjectsInfo.jsx new file mode 100644 index 0000000..bd79c08 --- /dev/null +++ b/src/DOM/components/info/ProjectsInfo.jsx @@ -0,0 +1,29 @@ +import OverlayContentLink from "../OverlayContentLink"; +import { projectList } from "../../content/entries/projectMedia"; + +const ProjectsInfo = ({ planet, openDetail }) => { + const handleOpenProject = (projectId) => { + openDetail?.(`project:${projectId}`); + }; + + return ( +
+

{planet.label}

+

Games, Web Apps, Data Science

+ +
    + {projectList.map((project) => ( +
  • + handleOpenProject(project.id)} + /> +
  • + ))} +
+
+ ); +}; + +export default ProjectsInfo; diff --git a/src/DOM/content/BlogOverlay.jsx b/src/DOM/content/BlogOverlay.jsx new file mode 100644 index 0000000..7bad1b3 --- /dev/null +++ b/src/DOM/content/BlogOverlay.jsx @@ -0,0 +1,94 @@ +// src/content/BlogOverlay.jsx +import { useState, useRef, useEffect } from "react"; +import { blogsById } from "../content/entries/blogMedia"; +import { useGTag } from "../../contexts/GTagContext"; + +const BlogOverlay = ({ blogId }) => { + const blog = blogsById[blogId]; + const { trackEvent } = useGTag(); + + // Safety: missing blogId + if (!blog) { + return ( +
+
+

Blog

+

Blog not found.

+
+
+ ); + } + + const { label, description, entries = [], hideNav } = blog; + + const [page, setPage] = useState(0); + const maxPage = entries.length - 1; + const bodyRef = useRef(null); + + const goTo = (index) => { + if (index < 0 || index > maxPage) return; + setPage(index); + }; + + const goHome = () => { + goTo(0); + }; + + const goPrev = () => { + goTo(page - 1); + }; + + const goNext = () => { + goTo(page + 1); + }; + + useEffect(() => { + if (bodyRef.current) { + bodyRef.current.scrollTop = 0; + } + }, [page]); + + const entry = entries[page]; + + useEffect(() => { + if (!entry) return; + trackEvent("blog_entry_view", { + blog_id: blogId, + entry_index: page, + entry_id: entry.id, + }); + }, [blogId, page, entry, trackEvent]); + + return ( +
+
+

{label}

+ {description &&

{description}

} +
+ +
+ {entry ? ( +
{entry.body({ goTo })}
+ ) : ( +

No entries yet.

+ )} +
+ + {!hideNav && entries.length > 1 && ( +
+ + + +
+ )} +
+ ); +}; + +export default BlogOverlay; diff --git a/src/DOM/content/DocumentsOverlay.jsx b/src/DOM/content/DocumentsOverlay.jsx new file mode 100644 index 0000000..1bff385 --- /dev/null +++ b/src/DOM/content/DocumentsOverlay.jsx @@ -0,0 +1,118 @@ +import { useState, useEffect } from "react"; +import { documentsByTopic } from "../content/entries/documentMedia"; +import { useGTag } from "../../contexts/GTagContext"; + +const DocumentsOverlay = ({ topicId }) => { + const topic = documentsByTopic[topicId]; + const { trackEvent } = useGTag(); + + if (!topic || !topic.docs || topic.docs.length === 0) { + return ( +
+
+

Documents

+

No documents found.

+
+
+ ); + } + + const { title, subtitle, docs } = topic; + + const [selectedId, setSelectedId] = useState(docs[0].id); + + useEffect(() => { + if (docs.length > 0) { + setSelectedId(docs[0].id); + } + }, [topicId, docs]); + + const selectedDoc = docs.find((d) => d.id === selectedId) ?? docs[0]; + + useEffect(() => { + if (!selectedDoc) return; + trackEvent("doc_select", { + topic_id: topicId, + doc_id: selectedDoc.id, + }); + }, [topicId, selectedDoc, trackEvent]); + + return ( +
+
+

{title}

+ {subtitle &&

{subtitle}

} +
+ +
+ {/* Top: all the buttons */} +
+ +
+ + {/* Bottom: full-width preview */} +
+